Commit Graph
72 Commits
Author SHA1 Message Date
Artur MoreiraandPaperclip eff0aaa366 feat(frontend): add Cache-Control headers to all page routes (BIT-2261)
Set Cache-Control: s-maxage=60, stale-while-revalidate=300 on all page
routes to enable Cloudflare CDN caching per docs/architecture.md § 7.

Files updated:
- index.astro (homepage)
- article/[slug].astro (article pages)
- category/[slug].astro (category pages)
- noticias.astro (news listing)
- search.astro (search results)
- sitemap.xml.ts (sitemap)
- robots.txt.ts (robots)

This enables:
- CDN edge caching for 60 seconds (s-maxage)
- Serving stale content while revalidating for up to 300s (SWR)
- Improved TTFB for repeated requests (target: <30ms cache HIT)

Acceptance criteria:
✓ All page routes return correct Cache-Control header
✓ Cloudflare can cache responses with cf-cache-status: HIT
✓ TTFB improves to <30ms for cache HIT scenario
✓ Header values match architecture spec

Co-Authored-By: Paperclip <[email protected]>
2026-04-11 03:37:32 +00:00
Artur MoreiraandPaperclip 216c537ce7 docs: add PROJECT_STATUS.md — objectives vs delivery matrix (BIT-2078)
Maps all 12 project objectives against delivered scope, links active
Paperclip sweep (BIT-2030) and open child issues (BIT-2079, BIT-2080),
and summarises the full repo tree for governance visibility.

Co-Authored-By: Paperclip <[email protected]>
2026-04-10 21:51:05 +00:00
Artur Moreira fbf5b0c557 docs: expand README doc index with full docs/ coverage (BIT-1952)
- Add Aggregator Architecture, Operations, Writer Pipeline, Writer Tools, Editorial Brief
- Add i18n doc
- Group Documentation section into Core / Aggregator & Writer Pipeline / Internationalisation

Paperclip-Issue: BIT-1952
Paperclip-Agent: patricia-santos
2026-04-10 00:01:54 +00:00
Artur Moreira c001907137 feat(cursor): add baseline stack and boundaries rules
Introduce news-platform-stack-and-boundaries.mdc for Astro/Fastify/WordPress
layers, Gitea deploy expectations, and secrets hygiene.

Paperclip-Issue: BIT-1953
Paperclip-Run: 195b0ea6-3690-401f-8009-1d1b4738337a
2026-04-09 22:46:26 +00:00
Artur Moreira f3ae08247f Merge branch 'task/BIT-1951-runbooks-readme' (BIT-1951 runbook index) 2026-04-09 22:29:51 +00:00
Artur Moreira 68f85d7f04 docs(runbooks): add runbook index (BIT-1951)
Add docs/runbooks/README.md linking BIT-746 escalation, monitoring,
deployment, smoke script, and paperclip company runbook index. Surface
the index from README and docs/monitoring.md.

Paperclip-Agent: David Santos (urlKey david-santos; id 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376)
Paperclip-Issue: BIT-1951
Paperclip-Run: ac17e30b-ad9a-46fd-bdb6-ffdfa0d99242
Made-with: Cursor
2026-04-09 22:29:32 +00:00
Artur Moreira c75ae37054 docs: sync local frontend/domain documentation
Publish the local docs updates for domain and frontend notes so guidance is available in Git.
2026-04-08 08:58:21 +01:00
spark 02c64f0ff9 feat(error-reporting): include routing metadata in bridge reporter
Add source metadata for deterministic news-platform routing.
2026-04-06 23:00:55 +01:00
Artur Moreira 8b9bb9fafd feat(error-reporting): include project_slug and gitea_repo in bridge reporter
Emit canonical routing metadata from news-platform bridge error events so hub/Paperclip triage can resolve the correct repository at source.
2026-04-06 21:58:25 +00:00
spark 15e517c2e8 Merge pull request 'feat(bridge): integrate errors.bitreport.pt error reporting (BIT-750)' (#3) from task/BIT-750-error-reporting into main
Reviewed-on: #3
2026-04-04 01:34:40 +01:00
Artur Moreira cd13a334c2 feat(bridge): integrate errors.bitreport.pt error reporting (BIT-750)
Report 5xx errors from the Fastify error handler to the central ingest API.
Enabled when ERROR_REPORTING_TOKEN is set in the environment.

Paperclip-Agent: peter-spark
Paperclip-Issue: BIT-750
Paperclip-Run: c2c29aef-e79f-4e69-98ed-3353d04b7a6d
2026-04-04 00:19:13 +00:00
Artur Moreira f5b9a5d058 docs(monitoring): BIT-746 public URL probe, inventory, alert runbook
Extend healthcheck.sh with optional BRIDGE_DEEP_URL and PUBLIC_PAGE_URL
(customer-facing HTTPS with redirects). Document must-not-fail checks,
intervals, and escalation in docs/monitoring.md and a dedicated runbook.

Paperclip-Issue: BIT-746
Paperclip-Run: 04281f51-59ac-4267-a269-f12269dc2320
Paperclip-Agent: Tiago Neves (urlKey tiago-neves; id 5d084b36-f38f-42a5-a92a-520005afda4f)
Made-with: Cursor
2026-04-03 00:23:28 +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 Moreira 89040e8a15 feat(writer-pipeline): expand andebol.net aggregator sources (PT + international)
Add Record and SAPO RSS, Guardian world and BBC handball; cap noisy RSS via
maxItems. Document Lusa/wire and ToS notes in AGGREGATOR_OPERATIONS.

Paperclip-Agent: José Alves (urlKey jos-alves; id 11179220-3cec-4f0f-880d-2771ff64fce8)
Paperclip-Issue: BIT-741
Paperclip-Run: ce6e2b51-1a3f-46f5-b479-2500427a0327
Made-with: Cursor
2026-04-02 20:59:20 +00:00
Artur Moreira b629f6c6aa feat(frontend): PT shell i18n, html lang pt-PT, i18n docs (BIT-739)
- Set document language to full BCP-47 from domain config (e.g. pt-PT).
- Extend ui-i18n with service errors, ad labels, ARIA landmarks, category
  meta fallback, and localized search upstream message.
- Localize ArticleHeader (dates, reading time, breadcrumb); omit duplicate
  breadcrumb when institutional chrome already provides one.

Docs: add docs/i18n.md strategy sketch; domains.md and deployment.md
(BRIDGE_INTERNAL_URL) cross-links.

Paperclip-Agent: ac1be104-8818-496a-80c5-fbc590a87855
Paperclip-Issue: 182b154e-5ad4-4965-9f30-50a66ef51ce0
Paperclip-Run: 6ce7746f-bfb6-4486-a1f5-aed26fe8e149
Made-with: Cursor
2026-04-02 20:06:48 +00:00
Artur Moreira 4d60425f7d docs(andebol): establish editorial brief and publication criteria
Introduces comprehensive editorial standards for andebol.net to ensure:
- Only Portuguese-language (PT-PT) content is published
- Real, verifiable news with proper source attribution
- No plagiarism or copy-pasted content
- Clear content categories, writing templates, and quality checklist

Addresses the urgent need for editorial governance following an English-language
article publication incident. Includes templates for match reports, transfers,
analysis, and competition updates.

Updates writer pipeline docs to reference the new editorial brief.

Paperclip-Agent: f0251a61-38e1-4a9b-8cd1-38d96a320cab
Paperclip-Issue: BIT-740
Paperclip-Run: 248bfdd9-8f8e-4ff3-8f25-1726da6a5e16
2026-04-02 20:05:02 +00:00
Artur Moreira 9a4c144f27 fix(frontend): block production SSR from using mock bridge content
When the Astro server could not reach the bridge health endpoint, the
code fell back to MockBridgeClient, which serves English placeholder
articles and a fictional author name. That was indexed and shown on
andebol.net (BIT-738).

Introduce resolveSsrBridge() so production never uses the mock; allow
BRIDGE_INTERNAL_URL to override the domain JSON endpoint for real
deploy topology; adjust pages and sitemap accordingly.

Made-with: Cursor
2026-04-02 19:57:45 +00:00
Artur Moreira 7f0deae75f feat(aggregator): searchable store, bridge AGGREGATOR_URL, writer candidates
Implement BIT-709 acceptance: GET /search and /stats on the writer-pipeline
aggregator; bridge AggregatorClient calls /search and maps items with
source_url. /writers/:id/candidates merges aggregator-first with WordPress,
exposes candidate_source and matched_sources, and passes max_age_hours into
ranking. Add docs/AGGREGATOR_OPERATIONS.md and store unit tests.

Paperclip-Issue: BIT-709
Made-with: Cursor
2026-04-02 19:42:39 +00:00
Artur Moreira fa64f29445 feat(frontend): institutional category pages match news hub layout (BIT-623)
Align andebol.net-style category and archive routes with the /noticias editorial
pattern: gradient masthead, lead article plus two-column grid, optional most-read
sidebar from bridge trending, and hub pagination styling. Non-institutional
themes keep the previous simple grid and header.

Made-with: Cursor
2026-04-02 17:35:48 +00:00
Artur Moreira 5999fc56cc feat(writer-tools): add CLI and API for content aggregation management
Implement writer tools for agents (Nelson Alves, AI News Writer) to:
- Manage topics and sources they write about
- Query aggregated content by relevance and freshness
- Get ranked writing candidates (top-N articles)

Changes:
- bridge/src/routes/writers.ts - REST API endpoints for writer operations
- bridge/src/services/writer-config.ts - Configuration management
- bridge/src/services/ranking.ts - Freshness/relevance scoring algorithm
- bridge/src/services/aggregator-client.ts - Aggregator integration (stub)
- config/writers/{agent-id}.json - Agent configuration storage
- docs/writer-tools.md - Complete usage documentation

Endpoints:
  GET /writers/:agentId - Get full configuration
  GET /writers/:agentId/topics - List topics
  POST /writers/:agentId/topics - Add topic
  DELETE /writers/:agentId/topics/:topic - Remove topic
  GET /writers/:agentId/sources - List sources
  POST /writers/:agentId/sources - Add source
  DELETE /writers/:agentId/sources/:sourceId - Remove source
  GET /writers/:agentId/candidates - Get top writing candidates
  GET /writers/:agentId/stats - Get aggregation stats
  PUT /writers/:agentId/ranking-preferences - Update weights

Features:
- Weighted ranking: freshness (60%) + relevance (40%, topic matching)
- Stale-While-Revalidate caching for performance
- Per-agent configuration (JSON files)
- Integration-ready for BIT-709 aggregator

Paperclip-Agent: f0251a61-38e1-4a9b-8cd1-38d96a320cab
Paperclip-Issue: BIT-712
Paperclip-Run: a0707773-bfef-4313-9fa3-dd7cebf278cb
2026-04-02 13:16:58 +00:00
Artur Moreira 512ab3bca6 feat(writer-pipeline): multi-source ingest (RSS, sitemap, HTML) for BIT-711
- Add ingest-sources with retries, sitemap index/urlset parsing, and HTML meta extraction
- Preserve original article URLs in store; dedupe ids via canonical URL hash
- Extend andebol.net.sources.json: FPA, IHF RSS, Handball Planet, Eurohandball sitemap (filtered)
- Optional shortlist ?topic= query; strip common tracking query params in canonicalUrl
- Add npm test (node:test) for sitemap and html-meta helpers

Paperclip-Agent: Tiago Neves (urlKey tiago-neves; id 5d084b36-f38f-42a5-a92a-520005afda4f)
Paperclip-Issue: BIT-711
Paperclip-Run: 83b79f64-d6b6-4efd-ab06-c5cc7d687169
Made-with: Cursor
2026-04-02 09:09:07 +00:00
Artur Moreira f18e1f9fed feat(writer-pipeline): aggregator-first andebol.net ingest, metrics, optional WP drafts
Add writer-pipeline package: RSS ingest to local store, shortlist, per-cycle
token estimates (aggregator read context vs full HTML), optional Fastify
aggregator API, optional WordPress draft creation via Application Passwords.
Document runbook in docs/WRITER_PIPELINE_ANDEBOL.md; extend README structure.

Refs: BIT-713
Made-with: Cursor
2026-04-02 08:40:12 +00:00
Artur Moreira 3579fdb837 docs(aggregator): BIT-710 data architecture and contract
Define complete data schema, deduplication rules, retention policy,
and 4-phase rollout plan for multi-source news content aggregator.

Unblocks BIT-711 (ingest), BIT-712 (writer tools), and BIT-713 (integration).

Paperclip-Issue: BIT-710
Paperclip-Issue: BIT-709
Paperclip-Agent: xika
Paperclip-Run: 31ec8d7f-43a6-480d-b3df-fba5de85cdab
2026-04-02 08:36:57 +00:00
Artur Moreira 6be81f11dc feat(institutional): portal parity — trending, section labels, secondary nav (BIT-688)
Add an institutional trending strip with section title and card rhythm.
Show a visible hero section label; localize related-articles titles.
Article pages gain breadcrumbs in institutional theme; category pages get
a horizontal secondary nav aligned with the news hub plus a wider layout.
Search gains an institutional masthead, accessible heading hierarchy, and
a results section title when queries return articles.

Verified: npm run build (frontend).

Paperclip-Task: b8b9096e-1fcd-478f-a92f-83a1db0ce67d
Paperclip-Run: 33ce910a-e3fe-4e2d-be3f-e8a3261c73e7
Made-with: Cursor
2026-04-01 14:19:29 +00:00
Artur MoreiraandPaperclip 0e74bd9cb0 feat(andebol): editorial masthead and magazine top stories on /noticias
Institutional theme only: full-width gradient masthead with section title,
magazine-style secondary featured row (image-led cards), underline category
tabs, and wider content column (~1400px) aligned with pro sports news hubs.

Refs: BIT-623

Co-Authored-By: Paperclip <[email protected]>
Made-with: Cursor
2026-03-30 13:48:04 +00:00
Artur MoreiraandPaperclip 8a68a7fab8 Merge branch 'task/BIT-626-visual-refresh' — sitewide visual refresh (BIT-626)
Co-Authored-By: Paperclip <[email protected]>
2026-03-30 12:40:20 +00:00
478b0c4273 feat(andebol): sitewide visual refresh — typography, header, footer, cards (BIT-626)
Switch institutional theme from serif to Inter (sans-serif) for headings
and body. Increase heading weights to 700-800 for professional punch.
Add top accent bar to header, dark navy footer, modern card radius (6px),
and tighter letter-spacing on all titles. Inspired by eurohandball.com
visual hierarchy without copying assets or branding.

Typography stack: Inter → SF Pro → system sans-serif
Article body: retains serif (Georgia) for readability

Co-Authored-By: Paperclip <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-03-30 12:35:08 +00:00
Artur MoreiraandPaperclip a70f930808 fix(frontend): surface /noticias archive and fix public URL behind proxy
Add getPublicOrigin() so canonical URLs and JSON-LD use Host + X-Forwarded-Proto
instead of localhost:4321 when nginx proxies to Node.

- Nav and mobile menu: link "Notícias" to /noticias (eurohandball-style listing).
- Homepage "ver tudo" targets /noticias instead of /category/all.
- Redirect /news to /noticias for English-style paths.

Co-Authored-By: Paperclip <[email protected]>
Made-with: Cursor
2026-03-30 12:21:46 +00:00
Artur MoreiraandPaperclip f3e56f4b14 feat(andebol): redesign /noticias as magazine-style layout (BIT-623)
Replace uniform 3-column grid with rich newspaper-inspired layout:
- Secondary featured row (top stories cards) below hero
- Lead article displayed as large card for visual hierarchy
- Two-column main+sidebar layout on desktop
- "Most Read" trending sidebar with numbered article list
- Mixed card sizes (lg lead + md grid) instead of monotonous grid
- New i18n string: news_most_read (pt-PT + en)

Co-Authored-By: Paperclip <[email protected]>
2026-03-30 02:07:16 +00:00
7869b25b2a feat(andebol): add /noticias news archive page with hero + category tabs (BIT-624)
New dedicated news listing page for andebol.net inspired by eurohandball.com/news:
- Hero banner with latest featured article (page 1, unfiltered)
- Horizontal category filter tabs (all + domain categories)
- Responsive 3-column article grid with pagination
- Full i18n support (pt-PT / en)
- Uses institutional theme tokens and existing ArticleCard component

Co-Authored-By: Paperclip <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-03-30 01:57:27 +00:00
Artur MoreiraandPaperclip 4ef03e52ea fix(homepage): dedupe feed bands and surface featured section
The bridge built hero, trending, featured, latest, and category rows from
overlapping slices of the same post list, so the same thumbnails appeared many
times. Reserve post ids top-to-bottom, over-fetch the main feed and category
queries, and de-dupe the hero when stickies overlap the feed.

Render the featured slice as its own banded section, localize the sports
trending strip, and use distinct heading ids when two grids share the page.

Co-Authored-By: Paperclip <[email protected]>
Made-with: Cursor
2026-03-29 21:00:56 +00:00
Artur MoreiraandPaperclip 921f52f259 Merge branch 'task/5865f3d2-c493-491f-b19a-c9fa4ee3b424-wp-nginx-migration' (BIT-578)
WordPress stacks: nginx + PHP-FPM on CT 222 validated.

Co-Authored-By: Paperclip <[email protected]>
2026-03-28 01:19:37 +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 50c5fafcd9 chore(deploy): extend andebol smoke for search/archive; fix Host header env (BIT-591)
- Assert GET /search, /search?q=te, /category/all return 200
- Use SMOKE_HOST instead of HOST for the vhost header (HOST=0.0.0.0 in agent envs caused 403)

Made-with: Cursor
2026-03-27 16:57:43 +00:00
Artur MoreiraandPaperclip 1e0de85486 feat(andebol): surface FPA national agenda on homepage via bridge
Enable fpa_agenda_enabled on andebol.net domain config. The bridge fetches
ws.fpa.pt getAgendaJogosFAP with SWR caching, normalises rows, and attaches
fpa_agenda to the homepage JSON. The institutional theme renders a responsive
fixtures table with FPA attribution.

Co-Authored-By: Paperclip <[email protected]>
Made-with: Cursor
2026-03-27 16:57:24 +00:00
Artur Moreira 0a845c41cc feat(frontend): institutional layout pass — search, archive, discovery (BIT-591)
Add GET /search wired to bridge articles search with pagination and empty-state
category pills. Handle /category/all as a full-archive listing. Enrich
institutional theme: serif body rhythm, hero depth, footer gradient, header
search (all breakpoints) plus auth links when auth_links is set, homepage
DiscoverSection, and footer links to search and archive. Extend UI strings (EN/PT)
and mock bridge search for offline builds.

Verified: npx [email protected].0 node_modules/astro/bin/astro.mjs build (frontend).
Made-with: Cursor
2026-03-27 16:46:51 +00:00
Artur MoreiraandPaperclip 563136ff00 fix(bridge): handle undefined term.description in strip_html
Now that _embed works correctly, WordPress returns full wp:term data where
some categories have undefined description fields. Guard strip_html against
null/undefined input.

Co-Authored-By: Paperclip <[email protected]>
2026-03-27 11:42:02 +00:00
Artur MoreiraandPaperclip 53f37b27b0 fix(bridge): WP REST _embed param was silently ignored — no featured images
The EMBED constant ('_embed=wp:featuredmedia,author,wp:term') was used as a
URLSearchParams key, which encodes the '=' as '%3D'. The .replace('%3D=','=')
hack never matched because '%3D' is followed by 'w' (from 'wp:'), not '='.

Result: WordPress never received the _embed parameter, so _embedded data
(featured images, author, terms) was always missing from API responses.
The bridge normalized this to featured_image: null for every article.

Fix: use URLSearchParams.set('_embed', EMBED_VALUE) so the key and value
are properly separated and encoded.

Co-Authored-By: Paperclip <[email protected]>
2026-03-27 11:40:23 +00:00
Artur MoreiraandPaperclip f599f54709 fix(nginx): expose /wp-content/uploads/ publicly for article featured images
WordPress article images (featured_media) are served from /wp-content/uploads/.
The existing /wp-content/ block restricts access to RFC1918 IPs, blocking public
browsers from loading article images. Add a longer ^~ prefix match for the uploads
subdirectory so it wins over the restricted block, with 7d cache headers.

Paired with setting ANDEBOL_WORDPRESS_PUBLIC_URL=https://andebol.net in .env so
WordPress returns public image URLs instead of localhost:8081.

Co-Authored-By: Paperclip <[email protected]>
2026-03-27 11:25:27 +00:00
Artur Moreira ff4c41bc2d fix(frontend): add ui-i18n module and locale-aware copy for institutional theme
The institutional header/footer already imported ui-i18n.ts but the file was
missing from the repository. Add Portuguese/English UI strings, wire
config.locale through homepage sections, category archives, article cards,
and related articles, and use Intl.RelativeTimeFormat for relative dates.

Refs: BIT-586
Made-with: Cursor
2026-03-27 10:59:04 +00:00
Artur MoreiraandPaperclip aff73455d0 feat(andebol): public WP login surface, auth nav, /entrar and /registar
- Nginx: proxy wp-login.php, wp-includes, wp-admin css/js/images, and
  wp-content/languages without RFC1918 allow (works with real_ip); keep
  rest of wp-admin, wp-content, wp-json restricted.
- Domain config: auth_links on andebol.net; optional DomainConfig field.
- Astro: Portuguese/English auth labels, header/footer links, redirects.
- Bridge: omit internal detail from 503 JSON (avoid leaking upstream msgs).
- Docs: deployment + domains schema for auth and membership.

Co-Authored-By: Paperclip <[email protected]>
Made-with: Cursor
2026-03-27 10:57:57 +00:00
738f847d36 feat: theme system + institutional theme + andebol.net domain config
Add domain-aware theme system (BIT-494, BIT-495, BIT-496, BIT-497):

- Theme architecture: move shared components into src/themes/sports/,
  create src/themes/institutional/ with handball-oriented design
- Domain config: andebol.net.json (institutional theme, pt-PT locale,
  handball categories, WP endpoint port 8081)
- theme.ts library: resolves theme components per domain config
- Updated layouts/pages to use theme-aware component loading
- Updated docs: domains.md, frontend.md with theme system docs
- Smoke test script for andebol.net
- WordPress .env.example with andebol env vars

Note: this work was completed in BIT-494/495/496/497 but was
never committed — committing now to unblock andebol.net deploy.

Co-Authored-By: Paperclip <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-03-27 08:38:41 +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 MoreiraandPaperclip 49aef86119 feat(wordpress): add wordpress-andebol service on port 8081 for andebol.net
Adds a second WordPress instance (wordpress-andebol) with its own MariaDB
(db-andebol) on port 8081 to support the andebol.net domain.

New env vars required in .env:
  ANDEBOL_MYSQL_ROOT_PASSWORD
  ANDEBOL_MYSQL_PASSWORD
  ANDEBOL_WORDPRESS_PUBLIC_URL (optional, defaults to http://localhost:8081)

Closes BIT-507 (partial — WP deploy step).

Co-Authored-By: Paperclip <[email protected]>
2026-03-25 00:17:23 +00:00
Artur Moreira 787983bd49 fix(wordpress): escape $ in WORDPRESS_CONFIG_EXTRA for Docker Compose
Compose was stripping PHP $_ variables, breaking wp-config and causing
HTTP 500. Use $$ prefix so literals reach the container (BIT-471).

Made-with: Cursor
2026-03-24 22:23:39 +00:00
Artur Moreira c835661400 feat(wordpress): optional WORDPRESS_DEBUG for LXC triage (BIT-471)
Expose WP_DEBUG, WP_DEBUG_LOG/DISPLAY, E_ALL + display_errors when
WORDPRESS_DEBUG=1 in wordpress/.env. Default off. For short-lived
diagnosis of opaque HTTP 500; disable after fix.

Made-with: Cursor
2026-03-24 22:16:16 +00:00
Artur Moreira 67f655820a fix(wordpress): broaden proxy detection for WP_HOME inference (BIT-470)
- Treat X-Forwarded-Proto or X-Real-IP as sufficient proxy hints alongside X-Forwarded-For
- Normalize WORDPRESS_PUBLIC_URL in ensure-public-url script (trailing slash, any localhost:8080 substring)
- Update deployment.md and wordpress README

Made-with: Cursor
2026-03-24 19:47:35 +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 Moreira 1141e6d840 feat(wordpress): script to fix siteurl/home in wp_options on CT
Adds scripts/fix-wp-siteurl-home.sh for BIT-471: updates siteurl and home
via mysqli from the wordpress container (same path as runtime). Default URL
https://newsproject.bitreport.pt; override with WP_PUBLIC_URL. Run after DB
is healthy (verify-db-connection.sh).

Made-with: Cursor
2026-03-24 19:00:59 +00:00