Skip to content

Commit 9e06057

Browse files
feat: Update Node.js version from 22 to 25
* feat: Update Node.js version from 22 to 25 * feat: enable insecure * ci: change ref to global workflows * chore(deps-dev): bump rollup from 4.57.1 to 4.59.0 * chore(deps): bump the npm group with 9 updates (#26)
1 parent b013b24 commit 9e06057

9 files changed

Lines changed: 1211 additions & 622 deletions

File tree

.github/workflows/node-lint-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
node-version: [22, 23]
16+
node-version: [23, 24, 25]
1717
steps:
1818
- name: Checkout
1919
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -35,7 +35,7 @@ jobs:
3535
runs-on: ubuntu-latest
3636
strategy:
3737
matrix:
38-
node-version: [22, 23]
38+
node-version: [23, 24, 25]
3939
steps:
4040
- name: Checkout
4141
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -57,7 +57,7 @@ jobs:
5757
runs-on: ubuntu-latest
5858
strategy:
5959
matrix:
60-
node-version: [22, 23]
60+
node-version: [23, 24, 25]
6161
steps:
6262
- name: Checkout
6363
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -83,7 +83,7 @@ jobs:
8383
needs: build
8484
strategy:
8585
matrix:
86-
node-version: [22, 23]
86+
node-version: [23, 24, 25]
8787
steps:
8888
- name: Checkout
8989
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

.github/workflows/node-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Setup Node.js
2525
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
2626
with:
27-
node-version: 22
27+
node-version: 25
2828
cache: npm
2929

3030
- name: Install dependencies

Makefile

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
.PHONY: install dev build lint seed import test clean clean-db clean-all clean-deps docker-build docker-run docker-stop docker-logs docker-clean docker-shell docker-db-backup docker-db-restore compose-up compose-down compose-logs compose-restart compose-clean help
1+
.PHONY: install dev dev-https dev-insecure build lint seed import test clean clean-db clean-all clean-deps docker-build docker-run docker-run-insecure docker-stop docker-logs docker-clean docker-shell docker-db-backup docker-db-restore compose-up compose-up-insecure compose-down compose-logs compose-restart compose-clean help
22

33
help:
44
@echo "Development Commands"
55
@echo "===================="
66
@echo "make install - Install npm dependencies"
7-
@echo "make dev - Start development server"
7+
@echo "make dev - Start development server (HTTP)"
8+
@echo "make dev-https - Start dev server with auto HTTPS (self-signed cert via Next.js)"
9+
@echo "make dev-insecure - Start dev server with TLS verification disabled (INSECURE_TLS=1)"
810
@echo "make build - Full production build (seed + import + build)"
911
@echo "make lint - Run ESLint"
1012
@echo "make seed - Create/reset database tables"
@@ -22,6 +24,7 @@ help:
2224
@echo "===================="
2325
@echo "make docker-build - Build Docker image"
2426
@echo "make docker-run - Run container (Docker CLI)"
27+
@echo "make docker-run-insecure - Run container with TLS verification disabled (INSECURE_TLS=1)"
2528
@echo "make docker-stop - Stop container"
2629
@echo "make docker-logs - View container logs"
2730
@echo "make docker-clean - Remove container and image"
@@ -32,6 +35,7 @@ help:
3235
@echo "Docker Compose Commands"
3336
@echo "======================"
3437
@echo "make compose-up - Start services with Docker Compose"
38+
@echo "make compose-up-insecure - Start services with TLS verification disabled (INSECURE_TLS=1)"
3539
@echo "make compose-down - Stop services"
3640
@echo "make compose-logs - View Docker Compose logs"
3741
@echo "make compose-restart - Restart services"
@@ -44,6 +48,12 @@ install:
4448
dev:
4549
npm run dev
4650

51+
dev-https:
52+
npm run dev:https
53+
54+
dev-insecure:
55+
INSECURE_TLS=1 npm run dev
56+
4757
build:
4858
mkdir -p data
4959
npm run db:seed
@@ -110,12 +120,25 @@ docker-run: docker-build
110120
@echo "Running container..."
111121
docker run -d \
112122
-p 3000:3000 \
123+
-e SESSION_SECRET=supersecretkeysupersecretkey3232 \
113124
-v learning-platform-data:/app/data \
114125
--name learning-platform \
115126
--restart unless-stopped \
116127
learning-platform:latest
117128
@echo "Container started: http://localhost:3000"
118129

130+
docker-run-insecure: docker-build
131+
@echo "Running container with TLS verification disabled..."
132+
docker run -d \
133+
-p 3000:3000 \
134+
-e SESSION_SECRET=supersecretkeysupersecretkey3232 \
135+
-e INSECURE_TLS=1 \
136+
-v learning-platform-data:/app/data \
137+
--name learning-platform \
138+
--restart unless-stopped \
139+
learning-platform:latest
140+
@echo "Container started (insecure TLS): http://localhost:3000"
141+
119142
docker-stop:
120143
@echo "Stopping container..."
121144
docker stop learning-platform || true
@@ -157,6 +180,11 @@ compose-up:
157180
docker-compose up -d
158181
@echo "Services started: http://localhost:3000"
159182

183+
compose-up-insecure:
184+
@echo "Starting services with TLS verification disabled..."
185+
INSECURE_TLS=1 docker-compose up -d
186+
@echo "Services started (insecure TLS): http://localhost:3000"
187+
160188
compose-down:
161189
@echo "Stopping services..."
162190
docker-compose down

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ services:
1010
NODE_ENV: production
1111
PORT: ${PORT:-3000}
1212
HOST: ${HOST:-0.0.0.0}
13+
INSECURE_TLS: ${INSECURE_TLS:-0}
1314
volumes:
1415
# Persist SQLite database
1516
- learning-platform-data:/app/data

eslint.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const nextConfig = require("eslint-config-next/core-web-vitals");
2+
3+
module.exports = [
4+
...nextConfig,
5+
{
6+
files: ["**/*.ts", "**/*.tsx"],
7+
rules: {
8+
"@typescript-eslint/no-explicit-any": "warn",
9+
// Disabled: intentional Next.js SSR-safe pattern (localStorage access in mount effects)
10+
"react-hooks/set-state-in-effect": "off",
11+
},
12+
},
13+
];

next.config.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,46 @@ import { readFileSync } from "fs";
33

44
const pkg = JSON.parse(readFileSync("./package.json", "utf-8"));
55

6+
// Allow disabling TLS certificate verification for environments with
7+
// self-signed certs or corporate proxies (set INSECURE_TLS=1).
8+
// Works in both development and production containers (e.g. docker-run-insecure).
9+
if (process.env.INSECURE_TLS === "1") {
10+
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
11+
console.warn(
12+
`WARNING: TLS certificate verification is disabled (INSECURE_TLS=1) — NODE_ENV=${process.env.NODE_ENV}`
13+
);
14+
}
15+
16+
const isDev = process.env.NODE_ENV !== "production";
17+
const isInsecure = process.env.INSECURE_TLS === "1";
18+
619
const nextConfig: NextConfig = {
720
serverExternalPackages: ["better-sqlite3"],
821
output: "standalone",
922
env: {
1023
NEXT_PUBLIC_APP_VERSION: pkg.version,
1124
},
25+
// Apply permissive headers in development OR when INSECURE_TLS=1 is set
26+
// (e.g. docker-run-insecure). Prevents the browser from caching HSTS for
27+
// localhost and unblocks Next.js inline bootstrap scripts over plain HTTP.
28+
async headers() {
29+
if (!isDev && !isInsecure) return [];
30+
return [
31+
{
32+
source: "/(.*)",
33+
headers: [
34+
// Expire HSTS immediately so the browser stops upgrading HTTP→HTTPS.
35+
{ key: "Strict-Transport-Security", value: "max-age=0" },
36+
// Allow unsafe-inline so Next.js inline scripts are not blocked.
37+
{
38+
key: "Content-Security-Policy",
39+
value:
40+
"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; font-src 'self' data:; connect-src 'self' ws: wss:;",
41+
},
42+
],
43+
},
44+
];
45+
},
1246
};
1347

1448
export default nextConfig;

0 commit comments

Comments
 (0)