DONE: fix error on nginx, add version on env, enable impersonate on staging

This commit is contained in:
ISMAIL MASSERAN
2026-08-27 10:33:09 +08:00
parent a127b9d8ce
commit 6e1ce76c50
7 changed files with 13 additions and 25 deletions
+1
View File
@@ -1,5 +1,6 @@
APP_NAME=Laravel
APP_ENV=staging
APP_VERSION=v2.2-staging
APP_KEY=base64:O1XZDqK4H6+3GdrODgCaLr2l+OoWvgVhYr0GJ1KizW8=
APP_DEBUG=true
APP_URL=http://172.16.6.200:8091
+4 -4
View File
@@ -56,11 +56,11 @@ jobs:
set -e
IMAGE_TAG="${{ inputs.image_tag }}"
mkdir -p "${DEPLOY_DIR}/docker/nginx"
mkdir -p "${DEPLOY_DIR}/docker/nginx" "${DEPLOY_DIR}/public"
cp docker-compose.staging.yml "${DEPLOY_DIR}/docker-compose.yml"
cp docker/nginx/default.conf "${DEPLOY_DIR}/docker/nginx/default.conf"
rm -rf "${DEPLOY_DIR}/public"
cp -R public "${DEPLOY_DIR}/public"
find "${DEPLOY_DIR}/public" -mindepth 1 -delete
cp -R public/. "${DEPLOY_DIR}/public/"
if [ ! -f "${DEPLOY_DIR}/.env.staging" ]; then
if [ -f .env.staging ]; then
@@ -78,7 +78,7 @@ jobs:
export IMAGE_TAG
docker compose --env-file .env.staging -f docker-compose.yml pull app
docker compose --env-file .env.staging -f docker-compose.yml up -d --no-build --remove-orphans
docker compose --env-file .env.staging -f docker-compose.yml up -d --no-build --force-recreate --remove-orphans app web
echo "✓ Deployed IMAGE_TAG=${IMAGE_TAG}"
+2
View File
@@ -15,6 +15,8 @@ return [
'name' => env('APP_NAME', 'Laravel'),
'version' => env('APP_VERSION', ''),
/*
|--------------------------------------------------------------------------
| Application Environment
+1 -16
View File
@@ -1,23 +1,8 @@
# Staging stack — isolated from local docker-compose.yml (8081 / 3307)
# and from api_arrahn staging (8090 / 3308).
#
# Local:
# docker compose --env-file .env.staging -f docker-compose.staging.yml up -d --build
#
# CI (image already in registry):
# APP_IMAGE=git.koppkb.com/kopkb/kaunter IMAGE_TAG=<sha> \
# docker compose --env-file .env.staging -f docker-compose.staging.yml up -d --no-build
#
# Host nginx reverse-proxies the public domain to 127.0.0.1:${HTTP_PORT}.
# See docker/nginx/host-proxy.example.conf
#
# If 8091 or 3309 is already taken, set HTTP_PORT / MYSQL_PUBLISH_PORT in .env.staging.
name: kaunter_staging
services:
app:
image: ${APP_IMAGE:-kaunter}:${IMAGE_TAG:-staging}
image: ${APP_IMAGE:-git.koppkb.com/kopkb/kaunter}:${IMAGE_TAG:-staging}
build:
context: .
dockerfile: docker/php/Dockerfile
+1 -1
View File
@@ -9,7 +9,7 @@ server {
client_max_body_size 50M;
location / {
try_files $uri $uri/ @php;
try_files $uri @php;
}
location @php {
+2 -2
View File
@@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" href="{{ asset('img/icon_pkb.png') }}">
<title>arOS v2.2</title>
<title>arOS {{ config('app.version') }}</title>
<style>
@keyframes slide {
@@ -82,7 +82,7 @@
<div class="card-header pb-0 text-left">
<div style="display: flex; justify-content:space-between; align-items:center">
<h1 class="font-weight-bolder text-info text-gradient" style="word-break: break-word; white-space: nowrap;">
Kaunter arOS v2.2
Kaunter arOS {{ config('app.version') }}
</h1>
<img src="{{ asset('img/icon_pkb.png') }}" alt="logo-arrahn" style="width: 85px; margin-left: 30px;">
</div>
@@ -139,7 +139,7 @@
<a href="{{ route('kakitangan.tukarcawangan',['id'=>$staff->id]) }}" class="btn btn-info" title="Tukar Cawangan"><i class="material-icons">work</i></a>
<a href="{{ route('operasi.kakitangan.edit',['id'=>$staff->id]) }}" class="btn btn-success" title="Edit Maklumat"><i class="material-icons">settings</i></a>
@if(
app()->environment('local')
app()->environment(['local', 'staging'])
&&
in_array($auth_user->roles, ['admin'])
&& $staff->roles != 'admin'
@@ -161,7 +161,7 @@
<a href="{{ route('admin.kakitangan.edit',['id'=>$staff->id]) }}" class="btn btn-success" title="Edit Maklumat"><i class="material-icons">settings</i></a>
<a href="{{ route('admin.kakitangan.resetcredentials',['id'=>$staff->id]) }}" class="btn btn-primary" title="Reset Password"><i class="material-icons">restore</i></a>
@if(
app()->environment('local')
app()->environment(['local', 'staging'])
&&
$staff->roles != 'admin'
&& $staff->id != $auth_user->id