add held service
This commit is contained in:
1 parent
6fde547b53
commit
e870128105
2 files changed
+37
-4
No files matched your search
@@ -9,16 +9,27 @@ Astro website with PHP-FPM forms, Postmark email delivery, and spam screening th
|
||||
- **Non-secret environment:** Compose declares `OLLAMA_URL=http://192.168.1.4:11434`, `OLLAMA_MODEL=qwen3.5:4b`, and `OLLAMA_TIMEOUT=20`; other application defaults are declared in source
|
||||
- **Secrets:** `/srv/docker/secrets/tukutoi/forms.env`; builds authenticate through the operator's SSH agent
|
||||
- **NVMe application state:** `/srv/appdata/tukutoi/spam-lists`, mounted at `/var/lib/tukutoi` read-write by the `lists` updater and read-only by PHP; owned by the PHP image's numeric `www-data` identity, directory mode `0700`
|
||||
- **Held contact messages:** PHP writes messages to `/srv/appdata/tukutoi/held`. PHP and the `held` worker both mount it read-write at `/var/lib/tukutoi-held`. The worker emails Beda a weekly count and deletes messages after 30 days.
|
||||
- **Bulk HDD data:** none
|
||||
- **Other mounts:** none
|
||||
|
||||
Secrets are never committed to this repository. The central secret environment is supplied to the `php` service. Required settings are `FORM_SECRET`, `POSTMARK_TOKEN`, `MAIL_FROM`, and `MAIL_TO`.
|
||||
Secrets are never committed to this repository. The central secret environment is supplied to the `php` and `held` services. Required settings are `FORM_SECRET`, `POSTMARK_TOKEN`, `MAIL_FROM`, and `MAIL_TO`.
|
||||
|
||||
## Dependencies and recovery
|
||||
|
||||
- **Networks/dependencies:** default project bridge between web, PHP, and lists; web joins external `npm_proxy` at `192.168.99.18`, HTTP port 80, without host-published ports. PHP requires Postmark with four configured templates and the Mac's Ollama endpoint with model `qwen3.5:4b`; lists requires StopForumSpam downloads. Missing lists disable list checks; unavailable Ollama leaves messages model-unchecked. Builds require private Git access, base-image/npm downloads, host build networking, and SSH-agent forwarding. The Node build stage uses `--dns-result-order=ipv4first --no-network-family-autoselection`.
|
||||
- **Networks/dependencies:** default project bridge between web, PHP, lists, and held; web joins external `npm_proxy` at `192.168.99.18`, HTTP port 80, without host-published ports. PHP requires Postmark with four configured templates and the Mac's Ollama endpoint with model `qwen3.5:4b`; lists requires StopForumSpam downloads. Missing lists disable list checks; unavailable Ollama leaves messages model-unchecked. Builds require private Git access, base-image/npm downloads, host build networking, and SSH-agent forwarding. The Node build stage uses `--dns-result-order=ipv4first --no-network-family-autoselection`.
|
||||
- **Back up:** deployment repository, private application repository, protected `forms.env`, and Postmark template configuration
|
||||
- **Re-creatable:** two images and three containers, generated website, transient APCu state, and downloaded spam-list SQLite data; initialize lists before serving updated forms. The updater shares `tukutoi-php:latest`, runs as `www-data`, and refreshes daily with six-hour retry after failed updates. Retain release image IDs and source revisions for rollback
|
||||
- **Re-creatable:** two images and four containers, generated website, transient APCu state, and downloaded spam-list SQLite data; initialize lists before serving updated forms. The updater shares `tukutoi-php:latest`, runs as `www-data`, and refreshes daily with six-hour retry after failed updates. Retain release image IDs and source revisions for rollback
|
||||
|
||||
## First deployment of held-message processing
|
||||
|
||||
Create the protected host directory once before starting the four-service stack. The PHP workers and the held-message worker use the PHP image’s `www-data` identity (last verified as UID/GID 82:82).
|
||||
|
||||
```bash
|
||||
sudo install -d -m 0700 -o 82 -g 82 /srv/appdata/tukutoi/held
|
||||
```
|
||||
|
||||
Then use the update command below. Check that all four services stay up. Held messages are private form submissions. If you back them up, account for the copies when applying your retention policy.
|
||||
|
||||
## Update after an application change on main
|
||||
|
||||
@@ -31,6 +42,6 @@ cd /srv/docker/tukutoi &&
|
||||
sudo --preserve-env=SSH_AUTH_SOCK docker compose up -d --build
|
||||
```
|
||||
|
||||
Compose builds web and PHP from the private repository's current `main` and recreates services whose images changed, including `lists` when the PHP image changes. Preserving `SSH_AUTH_SOCK` lets the build use your agent under sudo. A pull in this directory only updates the deployment configuration.
|
||||
Compose builds web and PHP from the private repository's current `main` and recreates services whose images changed, including `lists` and `held` when the PHP image changes. Preserving `SSH_AUTH_SOCK` lets the build use your agent under sudo. A pull in this directory only updates the deployment configuration.
|
||||
|
||||
Check `sudo docker compose ps --all` and open the changed page. For a forms release, submit a test message and confirm the expected email arrives.
|
||||
@@ -42,6 +42,11 @@ services:
|
||||
read_only: true
|
||||
bind:
|
||||
create_host_path: false
|
||||
- type: bind
|
||||
source: /srv/appdata/tukutoi/held
|
||||
target: /var/lib/tukutoi-held
|
||||
bind:
|
||||
create_host_path: false
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- default
|
||||
@@ -61,6 +66,23 @@ services:
|
||||
networks:
|
||||
- default
|
||||
|
||||
held:
|
||||
image: tukutoi-php:latest
|
||||
pull_policy: never
|
||||
user: www-data
|
||||
command: ["php", "/var/www/api/bin/held.php", "--loop"]
|
||||
env_file:
|
||||
- /srv/docker/secrets/tukutoi/forms.env
|
||||
volumes:
|
||||
- type: bind
|
||||
source: /srv/appdata/tukutoi/held
|
||||
target: /var/lib/tukutoi-held
|
||||
bind:
|
||||
create_host_path: false
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- default
|
||||
|
||||
networks:
|
||||
npm_proxy:
|
||||
external: true
|
||||
Reference in new issue
Block a user