Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
916f4ae101 | ||
| 45d389c67f | |||
|
|
7f12332cf6 | ||
| fe30f03b9f | |||
|
|
fc472d5dad | ||
| a0a2f27eac | |||
|
|
bd7adec2f0 | ||
| 9b6386c4ae | |||
|
|
9da1ae7ca1 | ||
| bc8bed3339 | |||
|
|
3fee678bd2 | ||
| be720178c2 | |||
|
|
eec0294f3e | ||
| 59a1c7956c | |||
|
|
e86949a1d7 | ||
|
|
7ca62bfc46 |
@@ -1,65 +0,0 @@
|
|||||||
name: Build Release Artefact
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "v*"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: Setup PHP
|
|
||||||
uses: shivammathur/setup-php@v2
|
|
||||||
with:
|
|
||||||
php-version: "8.4"
|
|
||||||
extensions: mbstring, intl, pdo_pgsql, xml, curl, zip, gd
|
|
||||||
|
|
||||||
- name: Setup Node
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: "lts/*"
|
|
||||||
|
|
||||||
- name: Install backend deps (prod)
|
|
||||||
env:
|
|
||||||
APP_ENV: prod
|
|
||||||
APP_DEBUG: "0"
|
|
||||||
run: composer install --no-dev --optimize-autoloader --no-interaction --no-scripts
|
|
||||||
|
|
||||||
- name: Build frontend (static)
|
|
||||||
run: |
|
|
||||||
cd frontend
|
|
||||||
npm ci
|
|
||||||
CI=1 NUXT_TELEMETRY_DISABLED=1 NUXT_PUBLIC_API_BASE=/api NUXT_PUBLIC_APP_BASE=/ npm run generate
|
|
||||||
test -f .output/public/index.html
|
|
||||||
|
|
||||||
- name: Build artefact
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
mkdir -p release
|
|
||||||
tar -czf "release/lesstime-${GITHUB_REF_NAME}.tar.gz" \
|
|
||||||
.env \
|
|
||||||
bin \
|
|
||||||
config \
|
|
||||||
migrations \
|
|
||||||
public \
|
|
||||||
src \
|
|
||||||
vendor \
|
|
||||||
composer.json \
|
|
||||||
composer.lock \
|
|
||||||
symfony.lock \
|
|
||||||
frontend/.output
|
|
||||||
|
|
||||||
- name: Create Release
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
with:
|
|
||||||
files: release/lesstime-${{ github.ref_name }}.tar.gz
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
parameters:
|
parameters:
|
||||||
app.version: '0.3.18'
|
app.version: '0.3.26'
|
||||||
|
|||||||
@@ -109,23 +109,33 @@ export LESSTIME_IMAGE_TAG="$TAG"
|
|||||||
|
|
||||||
echo "==> Deploying lesstime:${TAG}..."
|
echo "==> Deploying lesstime:${TAG}..."
|
||||||
|
|
||||||
|
echo "==> Enabling maintenance mode..."
|
||||||
|
touch maintenance.on
|
||||||
|
|
||||||
echo "==> Pulling image..."
|
echo "==> Pulling image..."
|
||||||
docker compose pull
|
sudo docker compose pull
|
||||||
|
|
||||||
echo "==> Starting container..."
|
echo "==> Starting container..."
|
||||||
docker compose up -d
|
sudo docker compose up -d
|
||||||
|
|
||||||
echo "==> Waiting for container to be ready..."
|
echo "==> Waiting for container to be ready..."
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
|
echo "==> Extracting maintenance page..."
|
||||||
|
mkdir -p public
|
||||||
|
sudo docker compose cp app:/var/www/html/public/maintenance.html public/maintenance.html
|
||||||
|
|
||||||
echo "==> Running migrations..."
|
echo "==> Running migrations..."
|
||||||
docker compose exec -T -u www-data app php bin/console doctrine:migrations:migrate --no-interaction
|
sudo docker compose exec -T -u www-data app php bin/console doctrine:migrations:migrate --no-interaction
|
||||||
|
|
||||||
echo "==> Clearing cache..."
|
echo "==> Clearing cache..."
|
||||||
docker compose exec -T -u www-data app php bin/console cache:clear --env=prod
|
sudo docker compose exec -T -u www-data app php bin/console cache:clear --env=prod
|
||||||
docker compose exec -T -u www-data app php bin/console cache:warmup --env=prod
|
sudo docker compose exec -T -u www-data app php bin/console cache:warmup --env=prod
|
||||||
|
|
||||||
VERSION=$(docker compose exec -T app cat config/version.yaml | grep 'app.version' | awk -F"'" '{print $2}')
|
echo "==> Disabling maintenance mode..."
|
||||||
|
rm -f maintenance.on
|
||||||
|
|
||||||
|
VERSION=$(sudo docker compose exec -T app cat config/version.yaml | grep 'app.version' | awk -F"'" '{print $2}')
|
||||||
echo "==> Deployed v${VERSION}"
|
echo "==> Deployed v${VERSION}"
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -192,16 +202,33 @@ Creer `/etc/nginx/sites-available/lesstime.conf` :
|
|||||||
```nginx
|
```nginx
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
server_name project.malio-dev.fr;
|
server_name project.malio-dev.fr;
|
||||||
|
|
||||||
client_max_body_size 55m;
|
root /var/www/lesstime/public;
|
||||||
|
|
||||||
|
# Maintenance mode
|
||||||
|
if (-f /var/www/lesstime/maintenance.on) {
|
||||||
|
return 503;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 503 @maintenance;
|
||||||
|
|
||||||
|
location @maintenance {
|
||||||
|
rewrite ^(.*)$ /maintenance.html break;
|
||||||
|
}
|
||||||
|
|
||||||
|
location = /maintenance.html {
|
||||||
|
internal;
|
||||||
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://127.0.0.1:8080;
|
proxy_pass http://127.0.0.1:8081;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
client_max_body_size 55m;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -250,6 +277,8 @@ rm /tmp/lesstime.sql
|
|||||||
├── config/jwt/
|
├── config/jwt/
|
||||||
│ ├── private.pem
|
│ ├── private.pem
|
||||||
│ └── public.pem
|
│ └── public.pem
|
||||||
|
├── public/
|
||||||
|
│ └── maintenance.html # extrait automatiquement par deploy.sh
|
||||||
└── uploads/
|
└── uploads/
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
153
doc/setup-maintenance-mode.md
Normal file
153
doc/setup-maintenance-mode.md
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
# Configuration du mode maintenance (nginx hote)
|
||||||
|
|
||||||
|
Guide pour activer le support du mode maintenance pilote par Central.
|
||||||
|
Ces etapes sont a faire **une seule fois** par application sur le serveur de production.
|
||||||
|
|
||||||
|
Le principe : le nginx de l'hote (reverse proxy) verifie si un fichier `maintenance.on` existe dans le dossier de deploy. Si oui, il sert une page `maintenance.html` au lieu de proxifier vers le container Docker.
|
||||||
|
|
||||||
|
Central pilote la creation/suppression de ce fichier via ses volumes Docker.
|
||||||
|
|
||||||
|
## Ce qui a ete fait pour Lesstime
|
||||||
|
|
||||||
|
### 1. Deployer pour extraire la page maintenance
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /var/www/lesstime
|
||||||
|
sudo ./deploy.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Le `deploy.sh` extrait automatiquement `maintenance.html` du container vers `public/` :
|
||||||
|
```
|
||||||
|
mkdir -p public
|
||||||
|
sudo docker compose cp app:/var/www/html/public/maintenance.html public/maintenance.html
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Mettre a jour la conf nginx de l'hote
|
||||||
|
|
||||||
|
Remplacer le contenu de `/etc/nginx/sites-available/lesstime.conf` :
|
||||||
|
|
||||||
|
```nginx
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name project.malio-dev.fr;
|
||||||
|
|
||||||
|
root /var/www/lesstime/public;
|
||||||
|
|
||||||
|
# Maintenance mode
|
||||||
|
if (-f /var/www/lesstime/maintenance.on) {
|
||||||
|
return 503;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 503 @maintenance;
|
||||||
|
|
||||||
|
location @maintenance {
|
||||||
|
rewrite ^(.*)$ /maintenance.html break;
|
||||||
|
}
|
||||||
|
|
||||||
|
location = /maintenance.html {
|
||||||
|
internal;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://127.0.0.1:8081;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
client_max_body_size 55m;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. Recharger nginx
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo nginx -t && sudo systemctl reload nginx
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. Verifier
|
||||||
|
|
||||||
|
- Depuis Central, activer la maintenance sur Lesstime
|
||||||
|
- Ouvrir `http://project.malio-dev.fr` → doit afficher la page "Maintenance en cours"
|
||||||
|
- Desactiver la maintenance depuis Central → le site revient
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## A faire pour Inventory
|
||||||
|
|
||||||
|
Meme procedure :
|
||||||
|
|
||||||
|
### 1. Deployer pour extraire la page maintenance
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /var/www/inventory
|
||||||
|
sudo ./deploy.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
> Si le `deploy.sh` ne contient pas encore l'extraction, mettre a jour le fichier depuis le repo (`infra/prod/deploy.sh`) ou executer manuellement :
|
||||||
|
> ```bash
|
||||||
|
> mkdir -p public
|
||||||
|
> sudo docker compose cp app:/var/www/html/public/maintenance.html public/maintenance.html
|
||||||
|
> ```
|
||||||
|
|
||||||
|
### 2. Mettre a jour la conf nginx de l'hote
|
||||||
|
|
||||||
|
Remplacer le contenu de `/etc/nginx/sites-available/inventory.conf` :
|
||||||
|
|
||||||
|
```nginx
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name inventory.malio-dev.fr;
|
||||||
|
|
||||||
|
root /var/www/inventory/public;
|
||||||
|
|
||||||
|
# Maintenance mode
|
||||||
|
if (-f /var/www/inventory/maintenance.on) {
|
||||||
|
return 503;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 503 @maintenance;
|
||||||
|
|
||||||
|
location @maintenance {
|
||||||
|
rewrite ^(.*)$ /maintenance.html break;
|
||||||
|
}
|
||||||
|
|
||||||
|
location = /maintenance.html {
|
||||||
|
internal;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://127.0.0.1:8082;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. Recharger nginx
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo nginx -t && sudo systemctl reload nginx
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Fonctionnement
|
||||||
|
|
||||||
|
```
|
||||||
|
Central (container)
|
||||||
|
└── touch /var/www/maintenance/lesstime/maintenance.on
|
||||||
|
│ (volume Docker : /var/www/lesstime → /var/www/maintenance/lesstime)
|
||||||
|
▼
|
||||||
|
/var/www/lesstime/maintenance.on (hote)
|
||||||
|
│
|
||||||
|
▼
|
||||||
|
nginx hote : if (-f /var/www/lesstime/maintenance.on) → 503
|
||||||
|
│
|
||||||
|
▼
|
||||||
|
maintenance.html servie depuis /var/www/lesstime/public/
|
||||||
|
```
|
||||||
@@ -33,8 +33,8 @@
|
|||||||
<MalioButton
|
<MalioButton
|
||||||
label="Se connecter"
|
label="Se connecter"
|
||||||
button-class="w-full"
|
button-class="w-full"
|
||||||
|
type="submit"
|
||||||
:disabled="isSubmitting"
|
:disabled="isSubmitting"
|
||||||
@click="handleSubmit"
|
|
||||||
/>
|
/>
|
||||||
<p class="font-bold">v{{ version }}</p>
|
<p class="font-bold">v{{ version }}</p>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ RUN rm -f /etc/nginx/sites-enabled/default
|
|||||||
# Configs
|
# Configs
|
||||||
COPY infra/prod/supervisord.conf /etc/supervisor/conf.d/app.conf
|
COPY infra/prod/supervisord.conf /etc/supervisor/conf.d/app.conf
|
||||||
COPY infra/prod/nginx.conf /etc/nginx/sites-enabled/lesstime.conf
|
COPY infra/prod/nginx.conf /etc/nginx/sites-enabled/lesstime.conf
|
||||||
|
COPY infra/prod/maintenance.html /var/www/html/public/maintenance.html
|
||||||
|
|
||||||
# Backend from stage 1
|
# Backend from stage 1
|
||||||
COPY --from=backend-build /app /var/www/html
|
COPY --from=backend-build /app /var/www/html
|
||||||
|
|||||||
@@ -1,96 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
# Usage: ./infra/prod/deploy-release.sh v0.1.0
|
|
||||||
# Requires: curl, tar, (optional) rsync
|
|
||||||
#
|
|
||||||
# Auth token: set RELEASE_TOKEN env var or create /etc/lesstime-release-token
|
|
||||||
umask 002
|
|
||||||
|
|
||||||
TAG="${1:-}"
|
|
||||||
if [ -z "$TAG" ]; then
|
|
||||||
echo "Usage: $0 v0.1.0" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
REPO_OWNER="MALIO-DEV"
|
|
||||||
REPO_NAME="Lesstime"
|
|
||||||
GITEA_API="https://gitea.malio.fr/api/v1"
|
|
||||||
DEPLOY_DIR="/var/www/lesstime"
|
|
||||||
|
|
||||||
if [ -f /etc/lesstime-release-token ] && [ -z "${RELEASE_TOKEN:-}" ]; then
|
|
||||||
RELEASE_TOKEN="$(cat /etc/lesstime-release-token)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
tmp_dir="$(mktemp -d)"
|
|
||||||
cleanup() {
|
|
||||||
rm -rf "$tmp_dir"
|
|
||||||
}
|
|
||||||
trap cleanup EXIT
|
|
||||||
|
|
||||||
release_json="$tmp_dir/release.json"
|
|
||||||
curl_opts=(-sS)
|
|
||||||
if [ -n "${RELEASE_TOKEN:-}" ]; then
|
|
||||||
curl_opts+=(-H "Authorization: token ${RELEASE_TOKEN}")
|
|
||||||
fi
|
|
||||||
curl "${curl_opts[@]}" \
|
|
||||||
"${GITEA_API}/repos/${REPO_OWNER}/${REPO_NAME}/releases/tags/${TAG}" \
|
|
||||||
-o "$release_json"
|
|
||||||
|
|
||||||
asset_url="$(python3 - "$release_json" <<'PY'
|
|
||||||
import json, sys
|
|
||||||
data = json.load(open(sys.argv[1], 'r'))
|
|
||||||
assets = data.get("assets", [])
|
|
||||||
for a in assets:
|
|
||||||
name = a.get("name", "")
|
|
||||||
if name.startswith("lesstime-") and name.endswith(".tar.gz"):
|
|
||||||
print(a.get("browser_download_url", ""))
|
|
||||||
break
|
|
||||||
PY
|
|
||||||
)"
|
|
||||||
|
|
||||||
if [ -z "$asset_url" ]; then
|
|
||||||
echo "Release asset not found for tag ${TAG}" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
archive="$tmp_dir/artefact.tar.gz"
|
|
||||||
curl "${curl_opts[@]}" -L "$asset_url" -o "$archive"
|
|
||||||
|
|
||||||
tar -xzf "$archive" -C "$tmp_dir"
|
|
||||||
|
|
||||||
if command -v rsync >/dev/null 2>&1; then
|
|
||||||
rsync -a --delete --no-perms --no-owner --no-group \
|
|
||||||
--exclude ".env" \
|
|
||||||
--exclude ".env.local" \
|
|
||||||
--exclude "config/jwt" \
|
|
||||||
--exclude "var" \
|
|
||||||
"$tmp_dir"/ "$DEPLOY_DIR"/
|
|
||||||
else
|
|
||||||
cp -a "$tmp_dir"/. "$DEPLOY_DIR"/
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Ensure Nginx can traverse the deploy path.
|
|
||||||
chmod o+rx "$(dirname "$DEPLOY_DIR")" "$DEPLOY_DIR" 2>/dev/null || true
|
|
||||||
|
|
||||||
# Create frontend/dist symlink if needed (nginx serves from frontend/dist)
|
|
||||||
if [ -d "${DEPLOY_DIR}/frontend/.output/public" ] && [ ! -L "${DEPLOY_DIR}/frontend/dist" ]; then
|
|
||||||
ln -sfn "${DEPLOY_DIR}/frontend/.output/public" "${DEPLOY_DIR}/frontend/dist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Release ${TAG} deployed to ${DEPLOY_DIR}"
|
|
||||||
|
|
||||||
# Ensure var/log exists and is writable by PHP (www-data)
|
|
||||||
mkdir -p "${DEPLOY_DIR}/var/log"
|
|
||||||
chown www-data:www-data "${DEPLOY_DIR}/var/log"
|
|
||||||
chmod 775 "${DEPLOY_DIR}/var/log"
|
|
||||||
|
|
||||||
if [ -f "${DEPLOY_DIR}/.env.local" ]; then
|
|
||||||
echo "Clearing cache..."
|
|
||||||
php "${DEPLOY_DIR}/bin/console" cache:clear --env=prod --no-debug
|
|
||||||
|
|
||||||
echo "Running migrations (if any)..."
|
|
||||||
php "${DEPLOY_DIR}/bin/console" doctrine:migrations:migrate --no-interaction --env=prod
|
|
||||||
else
|
|
||||||
echo "Skip post-deploy: ${DEPLOY_DIR}/.env.local not found" >&2
|
|
||||||
fi
|
|
||||||
@@ -8,6 +8,9 @@ export LESSTIME_IMAGE_TAG="$TAG"
|
|||||||
|
|
||||||
echo "==> Deploying lesstime:${TAG}..."
|
echo "==> Deploying lesstime:${TAG}..."
|
||||||
|
|
||||||
|
echo "==> Enabling maintenance mode..."
|
||||||
|
touch maintenance.on
|
||||||
|
|
||||||
echo "==> Pulling image..."
|
echo "==> Pulling image..."
|
||||||
sudo docker compose pull
|
sudo docker compose pull
|
||||||
|
|
||||||
@@ -17,6 +20,10 @@ sudo docker compose up -d
|
|||||||
echo "==> Waiting for container to be ready..."
|
echo "==> Waiting for container to be ready..."
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
|
echo "==> Extracting maintenance page..."
|
||||||
|
mkdir -p public
|
||||||
|
sudo docker compose cp app:/var/www/html/public/maintenance.html public/maintenance.html
|
||||||
|
|
||||||
echo "==> Running migrations..."
|
echo "==> Running migrations..."
|
||||||
sudo docker compose exec -T -u www-data app php bin/console doctrine:migrations:migrate --no-interaction
|
sudo docker compose exec -T -u www-data app php bin/console doctrine:migrations:migrate --no-interaction
|
||||||
|
|
||||||
@@ -24,5 +31,8 @@ echo "==> Clearing cache..."
|
|||||||
sudo docker compose exec -T -u www-data app php bin/console cache:clear --env=prod
|
sudo docker compose exec -T -u www-data app php bin/console cache:clear --env=prod
|
||||||
sudo docker compose exec -T -u www-data app php bin/console cache:warmup --env=prod
|
sudo docker compose exec -T -u www-data app php bin/console cache:warmup --env=prod
|
||||||
|
|
||||||
|
echo "==> Disabling maintenance mode..."
|
||||||
|
rm -f maintenance.on
|
||||||
|
|
||||||
VERSION=$(sudo docker compose exec -T app cat config/version.yaml | grep 'app.version' | awk -F"'" '{print $2}')
|
VERSION=$(sudo docker compose exec -T app cat config/version.yaml | grep 'app.version' | awk -F"'" '{print $2}')
|
||||||
echo "==> Deployed v${VERSION}"
|
echo "==> Deployed v${VERSION}"
|
||||||
|
|||||||
49
infra/prod/maintenance.html
Normal file
49
infra/prod/maintenance.html
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Maintenance en cours</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||||
|
background-color: #f3f4f6;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
min-height: 100vh;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
background: white;
|
||||||
|
border-radius: 12px;
|
||||||
|
box-shadow: 0 4px 24px rgba(0,0,0,0.10);
|
||||||
|
padding: 48px 40px;
|
||||||
|
max-width: 480px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.icon {
|
||||||
|
font-size: 48px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
color: #1f2937;
|
||||||
|
font-size: 24px;
|
||||||
|
margin: 0 0 16px;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
color: #6b7280;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 1.6;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<div class="icon">🛠</div>
|
||||||
|
<h1>Maintenance en cours</h1>
|
||||||
|
<p>L'application est temporairement indisponible pour mise à jour. Elle sera de retour dans quelques instants.</p>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
server_name project.malio-dev.fr;
|
|
||||||
|
|
||||||
root /var/www/lesstime/frontend/.output/public;
|
|
||||||
index index.html;
|
|
||||||
|
|
||||||
client_max_body_size 55m;
|
|
||||||
|
|
||||||
location ^~ /api/ {
|
|
||||||
root /var/www/lesstime/public;
|
|
||||||
try_files $uri /index.php?$query_string;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ^~ /bundles/ {
|
|
||||||
root /var/www/lesstime/public;
|
|
||||||
try_files $uri =404;
|
|
||||||
}
|
|
||||||
|
|
||||||
location = /api/login_check {
|
|
||||||
include fastcgi_params;
|
|
||||||
fastcgi_param SCRIPT_FILENAME /var/www/lesstime/public/index.php;
|
|
||||||
fastcgi_param DOCUMENT_ROOT /var/www/lesstime/public;
|
|
||||||
fastcgi_param SCRIPT_NAME /index.php;
|
|
||||||
fastcgi_param PATH_INFO /login_check;
|
|
||||||
fastcgi_param REQUEST_URI /login_check;
|
|
||||||
fastcgi_pass unix:/run/php/php8.4-fpm.sock;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ^~ /_mcp {
|
|
||||||
root /var/www/lesstime/public;
|
|
||||||
try_files $uri /index.php?$query_string;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~ ^/index\.php(/|$) {
|
|
||||||
include fastcgi_params;
|
|
||||||
fastcgi_param SCRIPT_FILENAME /var/www/lesstime/public/index.php;
|
|
||||||
fastcgi_param DOCUMENT_ROOT /var/www/lesstime/public;
|
|
||||||
fastcgi_pass unix:/run/php/php8.4-fpm.sock;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~ \.php$ {
|
|
||||||
return 404;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -3,8 +3,25 @@ server {
|
|||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
server_name project.malio-dev.fr;
|
server_name project.malio-dev.fr;
|
||||||
|
|
||||||
|
root /var/www/lesstime/public;
|
||||||
|
|
||||||
|
# Maintenance mode
|
||||||
|
if (-f /var/www/lesstime/maintenance.on) {
|
||||||
|
return 503;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 503 @maintenance;
|
||||||
|
|
||||||
|
location @maintenance {
|
||||||
|
rewrite ^(.*)$ /maintenance.html break;
|
||||||
|
}
|
||||||
|
|
||||||
|
location = /maintenance.html {
|
||||||
|
internal;
|
||||||
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://127.0.0.1:8080;
|
proxy_pass http://127.0.0.1:8081;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|||||||
@@ -2,6 +2,23 @@ server {
|
|||||||
listen 80;
|
listen 80;
|
||||||
server_name _;
|
server_name _;
|
||||||
|
|
||||||
|
# Maintenance mode
|
||||||
|
if (-f /var/www/html/maintenance.on) {
|
||||||
|
return 503;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 503 @maintenance;
|
||||||
|
|
||||||
|
location @maintenance {
|
||||||
|
root /var/www/html/public;
|
||||||
|
rewrite ^(.*)$ /maintenance.html break;
|
||||||
|
}
|
||||||
|
|
||||||
|
location = /maintenance.html {
|
||||||
|
root /var/www/html/public;
|
||||||
|
internal;
|
||||||
|
}
|
||||||
|
|
||||||
root /var/www/html/frontend/.output/public;
|
root /var/www/html/frontend/.output/public;
|
||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user