Add spam-list updater and local Ollama screening

This commit is contained in:
smileBeda committed 2026-10-30 21:26:36 +00:00
1 parent 3902076440
commit 7b9ccf7cc7
2 files changed
+33 -5

No files matched your search

+5 -5
View File
@@ -1,14 +1,14 @@
# TukuToi
Astro website served by nginx, with PHP-FPM contact and review forms delivered through Postmark.
Astro website with PHP-FPM forms, Postmark email delivery, and spam screening through downloaded lists and local Ollama.
## Deployment layout
- **Compose:** `/srv/docker/tukutoi/docker-compose.yml`
- **Static configuration/source:** deployment configuration under `/srv/docker/tukutoi`; private application source, Dockerfile, and nginx/PHP configuration from `ssh://git@git.yoonect.com:2222/TukuToi/TukuToi-LLC-Website.git`, branch `main`, build targets `web` and `php`
- **Non-secret environment:** application defaults are declared in source; no project-local environment file
- **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:** none
- **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`
- **Bulk HDD data:** none
- **Other mounts:** none
@@ -16,6 +16,6 @@ Secrets are never committed to this repository. The central secret environment i
## Dependencies and recovery
- **Networks/dependencies:** default project bridge between web and PHP; web joins external `npm_proxy` at `192.168.99.18`, HTTP port 80, without host-published ports. PHP requires Postmark access and four configured mail templates. 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`; optional ECB exchange-rate retrieval falls back to committed data.
- **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`.
- **Back up:** deployment repository, private application repository, protected `forms.env`, and Postmark template configuration
- **Re-creatable:** both images and containers, generated static website, and transient APCu state; rebuild both targets from `main` with Bake permissions `--allow=network.host --allow=ssh`, retaining release image IDs/source revisions for rollback
- **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. Rebuild web/PHP targets from `main` with Bake permissions `--allow=network.host --allow=ssh`, retaining release image IDs/source revisions for rollback
+28
View File
@@ -19,6 +19,8 @@ services:
ipv4_address: 192.168.99.18
php:
image: tukutoi-php:latest
pull_policy: never
build:
context: ssh://git@git.yoonect.com:2222/TukuToi/TukuToi-LLC-Website.git#main
target: php
@@ -29,6 +31,32 @@ services:
- default
env_file:
- /srv/docker/secrets/tukutoi/forms.env
environment:
OLLAMA_URL: http://192.168.1.4:11434
OLLAMA_MODEL: qwen3.5:4b
OLLAMA_TIMEOUT: "20"
volumes:
- type: bind
source: /srv/appdata/tukutoi/spam-lists
target: /var/lib/tukutoi
read_only: true
bind:
create_host_path: false
restart: unless-stopped
networks:
- default
lists:
image: tukutoi-php:latest
pull_policy: never
user: www-data
command: ["php", "/var/www/api/bin/spam-lists.php", "--loop"]
volumes:
- type: bind
source: /srv/appdata/tukutoi/spam-lists
target: /var/lib/tukutoi
bind:
create_host_path: false
restart: unless-stopped
networks:
- default