9 Commits
Author SHA1 Message Date
José AlvesandPaperclip f37d4f7318 fix(devops): wp-login ops-only gate + smoke for branded auth (BIT-26754)
Tests / writer-pipeline tests (push) Successful in 40s
Tests / bridge tests (push) Successful in 39s
Tests / frontend lib tests (push) Successful in 38s
Tests / writer-pipeline tests (pull_request) Successful in 47s
Tests / bridge tests (pull_request) Successful in 48s
Tests / frontend lib tests (pull_request) Successful in 49s
- Nginx: add auth_basic gate on wp-login.php (ops htpasswd, BIT-26754)
- deploy.sh: note htpasswd step 5 in post-deploy manual steps
- smoke-andebol.sh: update /entrar+/registar checks to verify branded
  Astro 200 (no WordPress strings); add wp-login.php 401/403 gate check;
  add /api/homepage latest ≥24 density check (BIT-26752)

Co-Authored-By: Paperclip <[email protected]>
2026-07-17 09:18:47 +00:00
José AlvesandCursor be0b0c9c6f fix(deploy): ensure writer-pipeline var is writable by www-data
Tests / writer-pipeline tests (push) Failing after 11s
Tests / bridge tests (push) Successful in 29s
Tests / frontend lib tests (push) Successful in 31s
Tests / writer-pipeline tests (pull_request) Failing after 11s
Tests / bridge tests (pull_request) Failing after 13s
Tests / frontend lib tests (pull_request) Successful in 29s
Writer systemd oneshots run as www-data but deploy never chowned
writer-pipeline/var, causing EACCES on aggregated-items.json when
the store was created by root. Mirror BIT-743 bridge/config/writers
fix; rebuild writer-pipeline on webhook when that tree changes.

Paperclip-Issue: BIT-25140
Co-authored-by: Cursor <[email protected]>
2026-06-14 20:04:03 +00:00
José Alves cba153cfc1 fix(docs): update CT222 IP from 10.10.50.140 to 10.10.50.204 — BIT-24053
Tests / bridge tests (push) Successful in 29s
Tests / writer-pipeline tests (push) Successful in 30s
Tests / frontend lib tests (push) Successful in 31s
Tests / writer-pipeline tests (pull_request) Successful in 28s
Tests / bridge tests (pull_request) Successful in 28s
Tests / frontend lib tests (pull_request) Successful in 26s
CT222 news-project-test changed IP following DHCP re-lease (BIT-24050
emergency fix). IP is now static at 10.10.50.204 via systemd-networkd.
Update all doc references, deploy script post-install notes, and
wordpress/README direct-access URLs.

Paperclip-Agent: Tiago Neves (devops; id 5d084b36-f38f-42a5-a92a-520005afda4f)
Paperclip-Issue: BIT-24053
Paperclip-Run: 9c69919d-4c21-48b0-8eb7-2b9745bed65c
2026-06-01 13:12:36 +00:00
Artur Moreira f15287e589 feat(monitoring): add service health monitoring with alerts (BIT-744)
Automated health monitoring for the news-platform services on CT222,
motivated by the bridge crash-loop incident (BIT-743) where 3,608
restarts went undetected until manual discovery.

Health endpoints:
- Bridge /health enhanced with optional ?checks=true for deep
  dependency probes (WordPress, Redis) and uptime reporting
- Frontend /health.json added as Astro API route

Monitoring infrastructure:
- healthcheck.sh: periodic probe script with HTTP checks, systemd
  restart-count detection, cooldown logic, and Ntfy push alerting
- news-healthcheck.timer: runs every 3 min (detection < 5 min)
- [email protected]: OnFailure template for instant crash alerts
- All three service units updated with OnFailure= directive
- deploy.sh updated to install monitoring units and env file

Paperclip-Agent: peter-spark
Paperclip-Issue: BIT-744
Paperclip-Run: 405ab587-8b8b-4963-8867-0feb95a994e3
2026-04-02 23:37:06 +00:00
Artur Moreira cccf26f657 fix(bridge): prevent WriterConfigService from crashing on EACCES
The module-level singleton called mkdirSync('config/writers') which
fatally crashed the bridge when running as www-data without write
permission to the working directory. The bridge has been crash-looping
with restart counter >3600, taking andebol.net offline.

Constructor now catches EACCES gracefully (warn + degrade) instead of
killing the process. Deploy scripts also ensure the directory exists
with correct ownership.

Paperclip-Agent: peter-spark
Paperclip-Issue: BIT-743
Paperclip-Run: 817ec0b4-3778-44ae-8c07-efd97a2bdd86
2026-04-02 23:28:50 +00:00
Artur MoreiraandPaperclip a77c293d0e feat(wordpress): nginx + PHP-FPM stacks; retire Apache images (BIT-578)
- Use wordpress:6-php8.3-fpm with nginx:alpine sidecars; keep host ports 8080/8081
- Add shared wp_html / wp_andebol_html volumes so nginx can serve the same docroot as FPM
- Nginx: try_files permalinks, proxy headers, HTTP_AUTHORIZATION for App Passwords
- Update deploy scripts to force-recreate nginx with wordpress when public URL is fixed
- Refresh README and deployment docs

Co-Authored-By: Paperclip <[email protected]>
Made-with: Cursor
2026-03-28 01:15:51 +00:00
Artur Moreira e15e88ef6c fix(nginx): default_server for all NPM hostnames + WP port map
Use default_server and server_name _ so domains like andebol.net reach Astro
instead of the Debian nginx welcome page. Install map Host→WordPress port
(8080 default, andebol.net→8081). deploy.sh and webhook-deploy install
conf.d snippet and remove sites-enabled/default.

docs/deployment.md: document multi-domain NPM workflow.

Refs: BIT-345
2026-03-25 12:34:18 +00:00
Artur Moreira 5e14e2df47 fix(deploy): auto-set WordPress public URL and sync wp_options on LXC
Add wordpress-ensure-public-url.sh (exit 2 when .env updated) and
wordpress-sync-options-url.sh to align siteurl/home with HTTPS. Wire
into deploy.sh and webhook-deploy.sh for /opt/news-platform only so
the board does not need manual .env or SQL for BIT-470/BIT-471.

Made-with: Cursor
2026-03-24 19:02:10 +00:00
Artur MoreiraandPaperclip 0e3a1afb3b feat: deploy pipeline — systemd units, Nginx, deploy scripts (BIT-352)
deploy/systemd/:
  - news-frontend.service (Astro SSR :4321)
  - news-bridge.service (Fastify :3200)
  - news-wordpress.service (Docker Compose wrapper)
  - frontend.env.example + bridge.env.example

deploy/nginx/:
  - newsproject.bitreport.pt.conf (reverse proxy → :4321, /api/ → :3200)
  - Nginx config validated OK on CT 222

deploy/scripts/:
  - deploy.sh — full from-scratch deploy (clone, build, install, start)
  - webhook-deploy.sh — incremental deploy on git push (cron-friendly)

Tested on CT 222 (10.10.50.140):
  - nginx -t → OK
  - systemd units installed (news-frontend/bridge/wordpress)
  - news-wordpress enabled; frontend/bridge pending Astro build

Remaining manual steps:
  - DHCP reservation for 10.10.50.140
  - NPM proxy host: newsproject.bitreport.pt → http://10.10.50.140
  - Run deploy.sh after bridge.env and frontend.env are configured

Co-Authored-By: Paperclip <[email protected]>
Made-with: Cursor
2026-03-23 15:48:43 +00:00