docs: align deployment/setup docs with current code

- nginx/docs/PRODUCTION_DEPLOYMENT.md: drop stale htpasswd/Basic-auth model,
  manual server-side deploy step, /var/www/posterg paths and hardcoded IP; describe
  the PHP-layer AdminAuth, automated 📋 Deploying nginx configuration…
xamxam.conf

sent 145 bytes  received 125 bytes  540.00 bytes/sec
total size is 10,012  speedup is 37.08
deploy-server.sh

sent 143 bytes  received 113 bytes  512.00 bytes/sec
total size is 8,519  speedup is 33.28, and what deploy-server.sh
  actually does.
- nginx/docs/QUICK_REFERENCE.md: replace htpasswd user management with AdminAuth
  guidance; fix php8.2->php8.4, log paths, admin rate limit (300r/m), socket path.
- nginx/README.md, nginx/SETUP.md: note 📋 Deploying nginx configuration…
xamxam.conf

sent 145 bytes  received 125 bytes  540.00 bytes/sec
total size is 10,012  speedup is 37.08
deploy-server.sh

sent 143 bytes  received 113 bytes  170.67 bytes/sec
total size is 8,519  speedup is 33.28 automates
  deploy-server.sh (no manual ssh/sudo step).
- docs/deployment.md: correct deploy-code scope (code-only, no --chown), fix the
  /var/log/xamxam provisioning step (deploy-server.sh via deploy-nginx, not
  deploy-code), document the setup-server.sh prerequisite and fresh-box caveat.
- README.md: replace the incomplete manual first-time setup snippet with the
  real setup-server.sh + provision-server flow and a fresh-box caveat.
This commit is contained in:
Pontoporeia
2026-09-18 16:26:49 +02:00
parent 64fd92b913
commit 0e009c49d4
6 changed files with 220 additions and 393 deletions
+21 -7
View File
@@ -40,21 +40,35 @@ accidental overwrites of production data.
### First-time server setup
First bootstrap the role/user/dirs with `scripts/setup-server.sh`, then the one-shot
remote provisioning recipe, which deploys code, nginx, and cron jobs:
```bash
ssh xamxam
sudo mkdir -p /var/www/xamxam
sudo chown www-data:xamxam /var/www/xamxam
sudo chmod 775 /var/www/xamxam
exit
# 1. role/user/dir bootstrap (creates xamxam group, /var/www/xamxam, perms):
# equivalent to: ssh -t xamxam "sudo DEPLOY_USER=\$USER bash /tmp/setup-server.sh"
rsync scripts/setup-server.sh xamxam:/tmp/setup-server.sh
ssh -t xamxam "sudo DEPLOY_USER=\$USER bash /tmp/setup-server.sh"
# 2. full provisioning (env/APP_KEY + deploy + nginx + backup + cleanup cron + logrotate):
just provision-server
```
Then deploy once and apply nginx config:
> **Fresh box caveat:** `provision-server` assumes `setup-server.sh` already ran.
> On a truly empty `/var/www/xamxam`, run `setup-server.sh` (or re-apply
> `deploy-server.sh` via `just deploy-nginx`) first, otherwise the deploy's
> rsync hits `Permission denied` on `storage/`.
`just deploy` / `just deploy-nginx` apply code + nginx config:
```bash
just deploy
just deploy-nginx
just deploy-nginx # included in `just deploy` and `just provision-server`
```
See [docs/deployment.md](docs/deployment.md) for the full workflow and the
podman test environment in [test-env/README.md](test-env/README.md) to validate
any of this against a fresh throwaway box.
## Security notes
- Admin panel protected by PHP session (`AdminAuth`) — password-only, no username