mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-09-25 01:53:03 +02:00
69 lines
1.7 KiB
Markdown
69 lines
1.7 KiB
Markdown
# XAMXAM
|
|
|
|
(Anciennement *[Posterg](https://wiki.erg.be/m/#Posterg))*
|
|
|
|
Répertoire des travaux de fin d'études de l'[ERG](https://erg.be) (École de Recherche Graphique).
|
|
|
|
## Requirements
|
|
|
|
- PHP ≥ 8.4 (with `ext-json`, `ext-openssl`, `ext-pdo`, `ext-sqlite3`)
|
|
- Composer
|
|
- Node.js / npm
|
|
- nginx (production)
|
|
|
|
## Development
|
|
|
|
```bash
|
|
# one-time
|
|
composer install
|
|
npm ci
|
|
|
|
# run the dev server (builds assets, applies migrations, opens a browser)
|
|
just dev # http://127.0.0.1:8000 (public) and /admin/
|
|
just stop # stop it
|
|
```
|
|
|
|
Live CSS/JS rebuilds happen automatically via a chokidar watcher while `just dev` runs.
|
|
See [`docs/development.md`](docs/development.md) for the full workflow.
|
|
|
|
## Deployment
|
|
|
|
Files are pushed to the server with rsync — there is no repo on the remote.
|
|
|
|
```bash
|
|
just deploy # rsync app files → xamxam:/var/www/xamxam/
|
|
just deploy-db # push local xamxam.db → remote (only if remote DB is absent)
|
|
```
|
|
|
|
`deploy-db` refuses to run if a database already exists on the server, to avoid
|
|
accidental overwrites of production data.
|
|
|
|
### First-time server setup
|
|
|
|
```bash
|
|
ssh xamxam
|
|
sudo mkdir -p /var/www/xamxam
|
|
sudo chown www-data:xamxam /var/www/xamxam
|
|
sudo chmod 775 /var/www/xamxam
|
|
exit
|
|
```
|
|
|
|
Then deploy once and apply nginx config:
|
|
|
|
```bash
|
|
just deploy
|
|
just deploy-nginx
|
|
```
|
|
|
|
## Security notes
|
|
|
|
- Admin panel protected by PHP session (`AdminAuth`) — password-only, no username
|
|
- Uploads stored outside webroot, served via controlled `/media` (`MediaController`)
|
|
- Rate limiting on public search (`app/src/RateLimit.php`)
|
|
- See `nginx/docs/SECURITY_HEADERS.md` for security headers reference
|
|
|
|
## More docs
|
|
|
|
See [`docs/README.md`](docs/README.md) for the full documentation index.
|
|
|