diff --git a/backend/workflows/templates/workflows/developer_handbook.html b/backend/workflows/templates/workflows/developer_handbook.html
index 205a165..d991796 100644
--- a/backend/workflows/templates/workflows/developer_handbook.html
+++ b/backend/workflows/templates/workflows/developer_handbook.html
@@ -33,6 +33,7 @@
Builders
Testing
Backup
+ CI/CD
Deployment
Troubleshooting
Security
@@ -266,7 +267,95 @@ make backup-verify BACKUP_DIR=backups/backup_YYYYmmdd_HHMMSS
The staff UI uses the shared action-progress overlay for backup creation and verification so long-running actions present one standard app behavior.
- 13) Deployment and Release Checklist
+ 13) CI/CD
+
+ - Repository model: one private GitHub repository, not separate dev/prod repositories.
+ - Branch model:
develop for the test deployment, main reserved for production.
+ - Current test workflow file:
.github/workflows/deploy-test.yml.
+ - Current production workflow file:
.github/workflows/deploy-prod.yml.
+ - GitHub Actions uploads the working tree to the server over SSH. The server does not clone from GitHub.
+ - This is intentional for a private repository: it removes the need to store GitHub deploy keys on the target server.
+
+ GitHub Environments
+
+ - Create GitHub environments named
development and production.
+ - Development secrets:
+
+ TEST_DEPLOY_HOST
+ TEST_DEPLOY_USER
+ TEST_DEPLOY_PORT
+ TEST_DEPLOY_PATH
+ TEST_DEPLOY_SSH_KEY
+
+
+ - Production secrets:
+
+ PROD_DEPLOY_HOST
+ PROD_DEPLOY_USER
+ PROD_DEPLOY_PORT
+ PROD_DEPLOY_PATH
+ PROD_DEPLOY_SSH_KEY
+
+
+
+ Current test deployment values
+
+ - Host:
192.168.2.55
+ - User:
root
+ - Path:
/opt/workdock
+ - URL:
http://192.168.2.55:8088
+
+
+ The current LAN test deployment intentionally uses DJANGO_DEBUG=1 in .env.test because the security checks correctly reject insecure cookie settings when DEBUG=0 and the deployment is still plain HTTP. This is acceptable for the internal test box only. Production must run with HTTPS and DEBUG=0.
+
+
+ 14) Deployment
+ Test server stack
+
+ - Stack file:
docker-compose.prod.yml
+ - Entrypoints:
+
+ backend/entrypoint-web-prod.sh
+ backend/entrypoint-worker-prod.sh
+
+
+ - Reverse proxy/static/media:
deploy/Caddyfile
+ - Main deploy script:
scripts/deploy_stack.sh
+
+ What the deploy script does
+
+ - Validate env file presence
+ - Build
web, worker, and caddy
+ - Start
db and redis
+ - Initialize writable volume ownership for media/static/backups
+ - Run migrations
+ - Run
bootstrap_initial_users
+ - Run
collectstatic
+ - Optionally run
manage.py check
+ - Start
web, worker, and caddy
+ - Wait until
/healthz/ becomes healthy
+
+ Manual deploy
+ cd /opt/workdock
+RUN_DJANGO_CHECK=0 DEPLOY_HEALTH_URL="http://127.0.0.1:8088/healthz/" ./scripts/deploy_stack.sh .env.test docker-compose.prod.yml
+ Validation after deploy
+ curl -I http://192.168.2.55:8088/healthz/
+ssh root@192.168.2.55 "cd /opt/workdock && docker compose --env-file .env.test -f docker-compose.prod.yml ps"
+ Proxmox / LXC requirement
+ The current server is an Ubuntu CT on Proxmox running Docker inside the container. The CT required Proxmox-side configuration before Docker containers could start correctly.
+ features: nesting=1,keyctl=1
+lxc.apparmor.profile: unconfined
+lxc.mount.entry: /dev/null sys/module/apparmor/parameters/enabled none bind 0 0
+ Those lines belong in /etc/pve/lxc/<CTID>.conf on the Proxmox host, followed by pct restart <CTID>.
+ Production expectations
+
+ - Use a real hostname
+ - Use HTTPS
+ - Use
DJANGO_DEBUG=0
+ - Use secure cookies and SSL redirect
+ - Run deployment with
RUN_DJANGO_CHECK=1
+
+ Release checklist
- Run
manage.py check
- Run tests or targeted verification
@@ -275,11 +364,11 @@ make backup-verify BACKUP_DIR=backups/backup_YYYYmmdd_HHMMSS
- Generate at least one onboarding/offboarding PDF if PDF templates changed
- Verify MailHog or SMTP path if email behavior changed
- Verify Nextcloud upload if integration behavior changed
- - Update Project Wiki and Developer Handbook if architecture/workflow changed
+ - Update Project Wiki and Developer Handbook if architecture or operational workflow changed
- Take a snapshot commit before major next-phase work
- 14) Troubleshooting
+ 15) Troubleshooting
- Page looks stale: restart
web and hard-refresh browser
- Second request hangs: inspect web logs and verify health endpoint
@@ -290,7 +379,7 @@ make backup-verify BACKUP_DIR=backups/backup_YYYYmmdd_HHMMSS
- Requests dependency warning appears: verify
chardet==5.2.0 is installed in the rebuilt image and restart web/worker
- 15) Security and Maintenance Notes
+ 16) Security and Maintenance Notes
- Containers run as non-root
app user.
- Keep secrets in
.env, not in tracked files.
diff --git a/backend/workflows/templates/workflows/handbook.html b/backend/workflows/templates/workflows/handbook.html
index 52747d7..3e8f56f 100644
--- a/backend/workflows/templates/workflows/handbook.html
+++ b/backend/workflows/templates/workflows/handbook.html
@@ -41,7 +41,7 @@
- {% trans "repository and service structure" %}
- {% trans "Docker and migration workflow" %}
- {% trans "translation and builder architecture" %}
- - {% trans "deployment, security, and maintenance notes" %}
+ - {% trans "CI/CD, deployment, security, and maintenance notes" %}