Compare commits

...
Author SHA1 Message Date
tiago-neves e723e3ee5b chore(runtime): WordPress PHP 8.5 + Node.js 24.22.1 baseline (BIT-31729)
Tests / bridge tests (push) Successful in 39s
Tests / writer-pipeline tests (push) Successful in 42s
Tests / writer-pipeline tests (pull_request) Successful in 45s
Tests / frontend lib tests (push) Successful in 55s
Tests / bridge tests (pull_request) Successful in 35s
Tests / frontend lib tests (pull_request) Successful in 47s
Align docker-compose, engines, nvmrc, and CI with the company runtime baseline.
Official wordpress:6-php8.5-fpm ships PHP 8.5.6 today; host Node must move to 24.22.1 Active LTS.

Paperclip-Issue: BIT-31729
Paperclip-Run: 8b5ae44d-b3e7-430e-871e-d5fcb1bd9fb1
2026-10-23 18:52:30 +01:00
17 changed files with 59 additions and 43 deletions

No files matched your search

+3 -3
View File
@@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
node-version: "24.22.1"
cache: "npm"
cache-dependency-path: writer-pipeline/package-lock.json
- run: npm ci
@@ -34,7 +34,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
node-version: "24.22.1"
cache: "npm"
cache-dependency-path: bridge/package-lock.json
- run: npm ci
@@ -51,7 +51,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
node-version: "24.22.1"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- run: npm install
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]
node-version: [24.22.1]
steps:
- uses: actions/checkout@v4
+1
View File
@@ -0,0 +1 @@
24.22.1
+1
View File
@@ -0,0 +1 @@
24.22.1
+11 -8
View File
@@ -14,10 +14,13 @@
"ioredis": "^5.4.1"
},
"devDependencies": {
"@types/node": "^20.14.0",
"@types/node": "^24.19.2",
"pino-pretty": "^13.1.3",
"tsx": "^4.15.0",
"typescript": "^5.4.5"
},
"engines": {
"node": ">=24.22.1"
}
},
"node_modules/@esbuild/aix-ppc64": {
@@ -540,13 +543,13 @@
"license": "MIT"
},
"node_modules/@types/node": {
"version": "20.19.37",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.37.tgz",
"integrity": "sha512-8kzdPJ3FsNsVIurqBs7oodNnCEVbni9yUEkaHbgptDACOPW04jimGagZ51E6+lXUwJjgnBw+hyko/lkFWCldqw==",
"version": "24.19.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.19.2.tgz",
"integrity": "sha512-93d49wCWJkCyN87MxLpNN6KXPCwFw7bVUg79mGUV1OS40JGWwVCr8n61DXCSqz7CV6/VfPkb7xec7uP2M+QHWQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"undici-types": "~6.21.0"
"undici-types": ">=7.24.0 <7.24.7"
}
},
"node_modules/abstract-logging": {
@@ -1400,9 +1403,9 @@
}
},
"node_modules/undici-types": {
"version": "6.21.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
"version": "7.24.6",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz",
"integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==",
"dev": true,
"license": "MIT"
},
+4 -1
View File
@@ -4,6 +4,9 @@
"description": "WordPress REST API bridge for the news platform",
"type": "module",
"main": "dist/server.js",
"engines": {
"node": ">=24.22.1"
},
"scripts": {
"dev": "tsx watch src/server.ts",
"build": "tsc",
@@ -19,7 +22,7 @@
"ioredis": "^5.4.1"
},
"devDependencies": {
"@types/node": "^20.14.0",
"@types/node": "^24.19.2",
"pino-pretty": "^13.1.3",
"tsx": "^4.15.0",
"typescript": "^5.4.5"
+3 -2
View File
@@ -19,9 +19,10 @@ log "installing Docker..."
apt-get install -y --no-install-recommends docker.io docker-compose-plugin
systemctl enable --now docker
log "Node.js 22 (NodeSource)..."
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
log "Node.js 24 Active LTS (NodeSource)..."
curl -fsSL https://deb.nodesource.com/setup_24.x | bash -
apt-get install -y nodejs
# Target runtime: Node.js 24.22.1 (Active LTS). Verify with: node -v
log "PM2 (global)..."
npm install -g pm2
+1 -1
View File
@@ -25,7 +25,7 @@ The bridge is a lightweight Fastify HTTP server that sits between the Astro fron
| Layer | Choice |
|-------|--------|
| HTTP server | Fastify 5 |
| Language | TypeScript (Node.js 22+) |
| Language | TypeScript (Node.js 24.22.1+) |
| Cache | Redis (ioredis) |
| HTTP client | `undici` |
| Process manager | PM2 or systemd |
+3 -3
View File
@@ -73,7 +73,7 @@ Versioned script on the repo (run as **root** on a fresh Ubuntu 24.04 CT):
sudo bash /opt/news-platform/deploy/lxc/setup.sh
```
It installs nginx, Redis, Docker (+ compose plugin), Node.js 22, and PM2, and enables `docker` and `redis-server`.
It installs nginx, Redis, Docker (+ compose plugin), Node.js 24 (Active LTS), and PM2, and enables `docker` and `redis-server`.
---
@@ -184,7 +184,7 @@ A stack real está versionada em **`wordpress/docker-compose.yml`** (não duplic
| Item | Valor actual |
|------|----------------|
| Database | **MariaDB 11** (`mariadb:11`), serviço `db`, porta 3306 só na rede Compose |
| WordPress | `wordpress:6-php8.3-fpm` + `nginx:alpine` sidecar per site; `WORDPRESS_DB_HOST: db:3306` (andebol: `db-andebol`) |
| WordPress | `wordpress:6-php8.5-fpm` + `nginx:alpine` sidecar per site; `WORDPRESS_DB_HOST: db:3306` (andebol: `db-andebol`) |
| URL pública | Preferir `WORDPRESS_PUBLIC_URL=https://newsproject.bitreport.pt` no `wordpress/.env`. Se faltar, o `wp-config` infere `https://` + `Host` quando o pedido chega **via Nginx do CT** e traz qualquer *hint* de proxy (`X-Forwarded-Proto`, `X-Forwarded-For`, ou `X-Real-IP`); `X-Forwarded-Proto` deve reflectir o HTTPS do NPM — ver `deploy/nginx/newsproject.bitreport.pt.conf`. |
| Arranque | `depends_on: db` com `condition: service_healthy` |
| Volumes | `db_data` (MySQL), `wp_content` (uploads/plugins) |
@@ -218,7 +218,7 @@ pm2 startup
## Deployment Checklist
- [ ] LXC container created and running
- [ ] Base packages installed (Node 22, nginx, redis, docker)
- [ ] Base packages installed (Node 24.22.1, nginx, redis, docker)
- [ ] Git repo cloned to `/opt/news-platform/`
- [ ] `config/domains/newsproject.bitreport.pt.json` populated
- [ ] Bridge dependencies installed and built
+1 -1
View File
@@ -1 +1 @@
22
24.22.1
+9 -9
View File
@@ -12,11 +12,11 @@
"astro": "^6.0.8"
},
"devDependencies": {
"@types/node": "^20.19.39",
"@types/node": "^24.19.2",
"tsx": "^4.21.0"
},
"engines": {
"node": ">=22.12.0"
"node": ">=24.22.1"
}
},
"node_modules/@astrojs/compiler": {
@@ -1583,13 +1583,13 @@
}
},
"node_modules/@types/node": {
"version": "20.19.39",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.39.tgz",
"integrity": "sha512-orrrD74MBUyK8jOAD/r0+lfa1I2MO6I+vAkmAWzMYbCcgrN4lCrmK52gRFQq/JRxfYPfonkr4b0jcY7Olqdqbw==",
"version": "24.19.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.19.2.tgz",
"integrity": "sha512-93d49wCWJkCyN87MxLpNN6KXPCwFw7bVUg79mGUV1OS40JGWwVCr8n61DXCSqz7CV6/VfPkb7xec7uP2M+QHWQ==",
"devOptional": true,
"license": "MIT",
"dependencies": {
"undici-types": "~6.21.0"
"undici-types": ">=7.24.0 <7.24.7"
}
},
"node_modules/@types/unist": {
@@ -4491,9 +4491,9 @@
"license": "MIT"
},
"node_modules/undici-types": {
"version": "6.21.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
"version": "7.24.6",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz",
"integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==",
"devOptional": true,
"license": "MIT"
},
+2 -2
View File
@@ -4,7 +4,7 @@
"version": "0.1.0",
"description": "Astro SSR frontend for multi-domain sports news platform",
"engines": {
"node": ">=22.12.0"
"node": ">=24.22.1"
},
"scripts": {
"dev": "astro dev",
@@ -19,7 +19,7 @@
"astro": "^6.0.8"
},
"devDependencies": {
"@types/node": "^20.19.39",
"@types/node": "^24.19.2",
"tsx": "^4.21.0"
}
}
+1 -1
View File
@@ -7,7 +7,7 @@ Headless WordPress instance serving the News Platform via the REST API. The WP f
| Service | Port | Notes |
|---------|------|-------|
| `nginx` | **8080** → 80 | Public HTTP edge; proxies to PHP-FPM |
| `wordpress` | (internal) | `wordpress:6-php8.3-fpm` — PHP-FPM only |
| `wordpress` | (internal) | `wordpress:6-php8.5-fpm` — PHP-FPM only |
| `nginx-andebol` | **8081** → 80 | Andebol WordPress edge |
| `wordpress-andebol` | (internal) | Second FPM stack |
| MariaDB 11 | 3306 | Internal only — not exposed to host (`db`, `db-andebol`) |
+2 -2
View File
@@ -17,7 +17,7 @@ services:
start_period: 90s
wordpress:
image: wordpress:6-php8.3-fpm
image: wordpress:6-php8.5-fpm
restart: unless-stopped
depends_on:
db:
@@ -135,7 +135,7 @@ services:
start_period: 90s
wordpress-andebol:
image: wordpress:6-php8.3-fpm
image: wordpress:6-php8.5-fpm
restart: unless-stopped
depends_on:
db-andebol:
+1
View File
@@ -0,0 +1 @@
24.22.1
+11 -8
View File
@@ -13,9 +13,12 @@
"rss-parser": "^3.13.0"
},
"devDependencies": {
"@types/node": "^20.14.0",
"@types/node": "^24.19.2",
"tsx": "^4.15.0",
"typescript": "^5.4.5"
},
"engines": {
"node": ">=24.22.1"
}
},
"node_modules/@esbuild/aix-ppc64": {
@@ -502,13 +505,13 @@
"license": "MIT"
},
"node_modules/@types/node": {
"version": "20.19.37",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.37.tgz",
"integrity": "sha512-8kzdPJ3FsNsVIurqBs7oodNnCEVbni9yUEkaHbgptDACOPW04jimGagZ51E6+lXUwJjgnBw+hyko/lkFWCldqw==",
"version": "24.19.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.19.2.tgz",
"integrity": "sha512-93d49wCWJkCyN87MxLpNN6KXPCwFw7bVUg79mGUV1OS40JGWwVCr8n61DXCSqz7CV6/VfPkb7xec7uP2M+QHWQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"undici-types": "~6.21.0"
"undici-types": ">=7.24.0 <7.24.7"
}
},
"node_modules/abstract-logging": {
@@ -1145,9 +1148,9 @@
}
},
"node_modules/undici-types": {
"version": "6.21.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
"version": "7.24.6",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz",
"integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==",
"dev": true,
"license": "MIT"
},
+4 -1
View File
@@ -4,6 +4,9 @@
"private": true,
"type": "module",
"description": "Aggregator-first writer pipeline for andebol.net (shortlist, token metrics, WP drafts)",
"engines": {
"node": ">=24.22.1"
},
"scripts": {
"build": "tsc",
"typecheck": "tsc --noEmit",
@@ -22,7 +25,7 @@
"rss-parser": "^3.13.0"
},
"devDependencies": {
"@types/node": "^20.14.0",
"@types/node": "^24.19.2",
"tsx": "^4.15.0",
"typescript": "^5.4.5"
}