Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd40507856 | ||
|
|
55f54eec10 | ||
|
|
a94c0852ae | ||
|
|
6649a27218 | ||
|
|
5fcdefd5d7 | ||
|
|
4b7451f8e2 | ||
|
|
b37b5d08c1 | ||
|
|
240a5b3c0a | ||
|
|
8205fd70d0 | ||
|
|
3460fff8ff | ||
|
|
954161ba8f | ||
|
|
eed5a8fb12 | ||
|
|
f74bc1a1ff |
No files matched your search
@@ -480,4 +480,6 @@ If the update changed the schema, restore the pre-update dump too (above).
|
|||||||
|
|
||||||
### Releases
|
### Releases
|
||||||
|
|
||||||
Deployed versions are tagged `vX.Y.Z` in git, with notes in `Release-Notes/vX.Y.md`. To see what's running, compare `docker image inspect homeschool-backend --format '{{.Created}}'` to the tag date.
|
Since October 2026, releases use calendar versioning: the monthly update is tagged `vYYYY.MM` (e.g. `v2026.10`), with notes in `Release-Notes/vYYYY.MM.md`. A follow-up fix in the same month is tagged `vYYYY.MM.N` (e.g. `v2026.10.1`) and added to that month's notes. `frontend/package.json` carries the same version as `YYYY.MM.N` (npm requires three parts, so the monthly release is `2026.10.0`). Earlier releases used `vX.Y.Z` (last: `v1.1.1`).
|
||||||
|
|
||||||
|
To see what's running, compare `docker image inspect homeschool-backend --format '{{.Created}}'` to the tag date.
|
||||||
@@ -35,3 +35,12 @@ Maintenance release from the 2026-09-24 review (`reports/maintenance-2026-09-24.
|
|||||||
### Known / accepted
|
### Known / accepted
|
||||||
- npm audit: vite ≤6.4.2 and esbuild advisories affect only the **dev server**, which production never runs (it serves the static build). Fixing them fully needs Vite 6.4+/7.
|
- npm audit: vite ≤6.4.2 and esbuild advisories affect only the **dev server**, which production never runs (it serves the static build). Fixing them fully needs Vite 6.4+/7.
|
||||||
- mysql:8.4.11 has upstream findings in Oracle's image: curl, bundled Python tools, and gosu's Go stdlib.
|
- mysql:8.4.11 has upstream findings in Oracle's image: curl, bundled Python tools, and gosu's Go stdlib.
|
||||||
|
|
||||||
|
## v1.1.1 — 2026-09-25
|
||||||
|
|
||||||
|
Low-severity items from the 2026-09-24 review.
|
||||||
|
|
||||||
|
- Frontend runs as non-root: `nginxinc/nginx-unprivileged:1.30.5-alpine`, listening on **8080** in the container. Host port 8054 is unchanged, so NPM needs no change.
|
||||||
|
- Replaced unmaintained `passlib` with `bcrypt` 5.0.0 directly. Existing `$2b$` hashes still verify; passwords are truncated to 72 bytes as before. A malformed hash now fails verification instead of raising.
|
||||||
|
- `DOCS_ENABLED` is now passed to the backend container (default `false`), so the README instructions work.
|
||||||
|
- db `mem_limit` 512m → 768m (MySQL 8.4 was at ~86% of 512m).
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
# v2026.10
|
||||||
|
|
||||||
|
## v2026.10 — 2026-10-12
|
||||||
|
|
||||||
|
Monthly dependency update for October 2026. It is the first release under calendar versioning (`vYYYY.MM`); the previous release was `v1.1.1`.
|
||||||
|
|
||||||
|
### Security
|
||||||
|
- **Frontend: 0 npm audit findings**, down from 6 (4 high, 2 moderate):
|
||||||
|
- vue 3.5.12 → **3.5.43**: fixes `@vue/server-renderer` XSS (GHSA-g2v6-rqmx-r4w6). The app renders client-side only, so the real exposure was low.
|
||||||
|
- `source-map-js` event-loop DoS (GHSA-68fv-2mgg-jv7q), fixed by the lockfile refresh.
|
||||||
|
- vite 5.4.21 → **8.3.4** / esbuild: fixes the dev-server advisory (GHSA-67mh-4wv8-2f99) that was accepted in v1.1.0. Vite 5 is no longer maintained.
|
||||||
|
- Backend: `pip-audit` reports no known vulnerabilities, before or after.
|
||||||
|
|
||||||
|
### Frontend (major upgrades)
|
||||||
|
- vite 5.4.21 → **8.3.4** (Rolldown-based), @vitejs/plugin-vue 5.1.4 → **6.0.10**
|
||||||
|
- pinia 2.2.4 → **4.0.3**. Pinia 4 requires `@vue/devtools-api` alongside it, so `@vue/devtools-api` 8.2.1 is now a direct dependency.
|
||||||
|
- vue-router 4.4.5 → **5.4.0**. Upstream lists no breaking changes for plain vue-router 4 users.
|
||||||
|
- vue 3.5.12 → 3.5.43; axios 1.20.0 was already current.
|
||||||
|
- `package.json` now sets `"type": "module"`, and `vite.config.js` resolves `@` via `import.meta.url` instead of `__dirname`. This removes Vite 8's warning about the CommonJS config loader, which a future Vite major will drop.
|
||||||
|
- Version `2026.10.0`.
|
||||||
|
|
||||||
|
### Backend
|
||||||
|
- fastapi 0.141.1 → 0.143.0, pydantic 2.13.5 → 2.14.1, pydantic-settings 2.5.2 → 2.15.0
|
||||||
|
- **sqlalchemy 2.0.35 → 2.1.4**, PyMySQL 1.1.2 → 1.2.3, aiomysql 0.3.0 → 0.3.2. PyMySQL 1.2.3 broke SQLAlchemy 2.0.35's connection ping in September; it works with 2.1.4.
|
||||||
|
- uvicorn 0.30.6 → 0.54.0, httpx 0.27.2 → 0.28.1, PyJWT 2.15.0 → 2.15.1, cryptography 50.0.1 → 50.0.2, email-validator 2.2.0 → 2.3.0
|
||||||
|
- `Settings` uses `model_config = SettingsConfigDict(...)` instead of the class-based `Config`. Pydantic deprecated the old form, and V3 will remove it.
|
||||||
|
- Unchanged (already current): starlette 1.7.0, anyio 4.15.1, bcrypt 5.0.0, alembic 1.20.0, Mako 1.4.3, python-multipart 0.0.32.
|
||||||
|
|
||||||
|
### Base images
|
||||||
|
- python 3.12.14-slim → **3.12.15-slim**
|
||||||
|
- node 24.21.0-alpine, nginx-unprivileged 1.30.5-alpine and mysql 8.4.11 were already the latest. The rebuild applies pending OS package updates (5 apt, 8 apk) through the existing `apt-get upgrade` / `apk upgrade` steps.
|
||||||
|
|
||||||
|
### Testing
|
||||||
|
Tested on an isolated copy of the stack (separate project, volume and port) with the 2026-10-12 production dump restored:
|
||||||
|
- API smoke test through nginx: 125/126 checks passed. It covered:
|
||||||
|
- auth (register, login, refresh, forged/`alg=none` JWT rejection)
|
||||||
|
- CRUD on children, subjects, options, schedules, blocks, routine, break activities and rules
|
||||||
|
- the full timer lifecycle, including break events, select/skip/reset, agenda and rules overlays
|
||||||
|
- WebSocket broadcast of all 16 events
|
||||||
|
- the TV dashboard with an active block
|
||||||
|
- every list GET route
|
||||||
|
- super-admin impersonation of all 3 real users, reading their real data and TV dashboards
|
||||||
|
|
||||||
|
The one failed check, refresh, was a test artifact: the `Secure` cookie isn't sent over plain HTTP. Refresh returns 200 when the cookie is sent.
|
||||||
|
- Headless Chromium against the built UI: login form, route guards, dashboard/logs/admin rendering, reload persistence, and the TV view showing the active block and staying live after a WebSocket event. The same test was also run against the previous image to tell regressions apart from existing behavior.
|
||||||
|
|
||||||
|
### Known / existing (not changed in this release)
|
||||||
|
- An expired session redirects to `/login` **without** the `?redirect=` query, so after signing in the user lands on `/dashboard` instead of the page they asked for. The previous build behaves the same way. Fixed in v2026.10.1.
|
||||||
|
- mysql:8.4.11 upstream image findings from v1.1.0 still apply until Oracle publishes a newer 8.4.x.
|
||||||
|
|
||||||
|
## v2026.10.1 — 2026-10-12
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
- **Sign-in returns you to the page you asked for.** Opening a protected page while logged out, or having your session expire, now goes to `/login?redirect=<page>`, and you land back on that page after signing in. Before this you always landed on `/dashboard`. The axios interceptor in `useApi.js` treated the guard's own failed `/api/auth/refresh` as an expired session and hard-navigated to a bare `/login`, which overrode the router's redirect.
|
||||||
|
- **Wrong password now shows an error.** The same interceptor caught the 401 from `/api/auth/login` and reloaded the login page, so "incorrect password" never appeared. Login, register and refresh now skip the auto-refresh and report their own 401s.
|
||||||
|
- When a session expires mid-use, the interceptor now keeps the current path and query in `?redirect=`.
|
||||||
|
- `LoginView` only follows `redirect` values that are in-app paths. `//host` and `https://…` fall back to `/dashboard`.
|
||||||
|
|
||||||
|
### Testing
|
||||||
|
Headless Chromium on an isolated stack, compared with the v2026.10 build: redirect after a logged-out visit (with query string), redirect after a mid-use expiry, wrong-password error without a reload, and external redirect values ignored. v2026.10 failed all of these; v2026.10.1 passes them.
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
# v2026.11
|
||||||
|
|
||||||
|
## v2026.11 — 2026-11-16
|
||||||
|
|
||||||
|
Monthly dependency update for November 2026. It fixes one high-severity npm advisory, moves FastAPI forward 20 minor versions, and moves MySQL to 8.4.13 on the same 8.4 LTS line. No application code changes were needed.
|
||||||
|
|
||||||
|
### Security
|
||||||
|
- **Frontend: 0 npm audit findings**, down from 1 high:
|
||||||
|
- axios 1.20.0 → **1.21.1** pulls follow-redirects 1.16.3. That fixes GHSA-q3jh-wrc6-jgq8, GHSA-8r9p-f939-6h3c and GHSA-mrwp-f3q8-3g9p, where credential headers could leak on cross-origin redirects. They only affect axios's Node HTTP adapter, not the browser build, so the real exposure was low.
|
||||||
|
- Backend: `pip-audit` reports no known vulnerabilities, before or after.
|
||||||
|
- mysql 8.4.11 → 8.4.13 includes Oracle's quarterly patch releases.
|
||||||
|
|
||||||
|
### Updated
|
||||||
|
| Component | From | To | Type | Notes |
|
||||||
|
|---|---|---|---|---|
|
||||||
|
| axios | 1.20.0 | 1.21.1 | minor | Security (follow-redirects) |
|
||||||
|
| vue | 3.5.43 | 3.5.45 | patch | |
|
||||||
|
| vite / @vitejs/plugin-vue | 8.3.4 / 6.0.10 | 8.3.8 / 6.0.11 | patch | |
|
||||||
|
| pinia | 4.0.3 | 4.1.0 | minor | `@vue/devtools-api` 8.2.1 still satisfies its peer dependency |
|
||||||
|
| vue-router | 5.4.0 | 5.5.1 | minor | |
|
||||||
|
| fastapi | 0.143.0 | 0.163.1 | 0.x minor | See "Breaking changes reviewed" |
|
||||||
|
| starlette | 1.7.0 | 1.10.0 | minor | Changes to form/multidict, GZip and TestClient; none of them used here |
|
||||||
|
| pydantic / pydantic-settings | 2.14.1 / 2.15.0 | 2.14.3 / 2.16.3 | patch / minor | |
|
||||||
|
| sqlalchemy | 2.1.4 | 2.1.9 | patch | |
|
||||||
|
| anyio, alembic, PyMySQL | 4.15.1, 1.20.0, 1.2.3 | 4.16.0, 1.20.1, 1.2.4 | minor / patch | |
|
||||||
|
| email-validator, python-multipart | 2.3.0, 0.0.32 | 2.4.0, 0.0.34 | minor / patch | |
|
||||||
|
| python image | 3.12.15-slim | 3.12.16-slim | patch | |
|
||||||
|
| node build image | 24.21.0-alpine | 24.22.3-alpine | minor | |
|
||||||
|
| nginx-unprivileged | 1.30.5-alpine | 1.30.6-alpine | patch | Stays on the 1.30 stable branch |
|
||||||
|
| mysql | 8.4.11 | 8.4.13 | patch (LTS) | The data dictionary upgrades in place on first start |
|
||||||
|
|
||||||
|
Unchanged (already current): uvicorn 0.54.0, cryptography 50.0.2, PyJWT 2.15.1, bcrypt 5.0.0, httpx 0.28.1, aiomysql 0.3.2, Mako 1.4.3.
|
||||||
|
|
||||||
|
Frontend `package.json` version is `2026.11.0`.
|
||||||
|
|
||||||
|
### Breaking changes reviewed (FastAPI 0.144–0.163)
|
||||||
|
- 0.147/0.162 omitted form booleans, 0.149 empty form strings, 0.150 empty file inputs, 0.160 parameter-model `extra`: these only affect `Form`/`File`/parameter models. Not used here, since every endpoint takes JSON bodies.
|
||||||
|
- 0.148: defaults for omitted parameters are no longer validated. This only affects `Query`/`Header`/`Cookie`/`Form`, none of which are used.
|
||||||
|
- 0.151: an explicit JSON `null` is rejected for non-nullable fields, even when they have a default. Every field the frontend sends as `null` (log `session_id`/`subject_id`/`duration_minutes`, session `template_id`, block `label`/`duration_minutes`, child `birth_date`) is already typed `X | None`. The smoke test sends these nulls explicitly.
|
||||||
|
- 0.145/0.155: `openapi_prefix` and `**extra` were removed from `FastAPI()` and the param functions. Neither is used.
|
||||||
|
- 0.146: `root_path` is deprecated. Not used.
|
||||||
|
- 0.162.6 drops Python 3.10. We run 3.12.
|
||||||
|
|
||||||
|
### Code changes
|
||||||
|
- None.
|
||||||
|
|
||||||
|
### Deferred / skipped
|
||||||
|
- **Python 3.12 → 3.13/3.14**: 3.12 still receives security fixes. A runtime minor jump needs its own run, with rebuilt compiled wheels (cryptography, pydantic-core, bcrypt) and a full regression pass.
|
||||||
|
- **nginx 1.31.x**: this is the mainline branch. We stay on the 1.30 stable line.
|
||||||
|
|
||||||
|
### Verification
|
||||||
|
Tested on an isolated copy of the stack (compose project `hstest`, its own volume, port 18054, ntfy disabled) with the 2026-11-16 production dump restored. Every unit was tested this way before it was committed.
|
||||||
|
- **Container builds**: backend and frontend images build on every unit. `pip check` is clean, and `npm audit` reports 0 findings.
|
||||||
|
- **API smoke test through nginx**: the pre-update images passed 106/106, and every update unit passed 96/96. The baseline count is higher only because its database still held one leftover test user. The test covers:
|
||||||
|
- super-admin login and impersonation of all 3 real users, with every list GET and every schedule detail
|
||||||
|
- register, login, wrong-password 401, forged-token 401, change-password and logout
|
||||||
|
- create and update for children, strikes, subjects, options, templates, blocks, morning routine, break activities and rules
|
||||||
|
- the full timer lifecycle: start, pause, resume, all 4 break events, select, complete, reset and skip
|
||||||
|
- agenda, rules overlay show/hide, and WebSocket broadcast (15 events received)
|
||||||
|
- the TV dashboard with an active block
|
||||||
|
- activity logs with explicit `null` fields
|
||||||
|
- **MySQL upgrade**: the test volume was created by 8.4.11 and then started on 8.4.13. The log shows `Server upgrade from '80411' to '80413' completed` after about 1 minute. `CHECK TABLE` returned OK, and the row counts were unchanged.
|
||||||
|
- **Headless Chromium UI test**: passed 8/9 on both the new and the pre-update images. It checks:
|
||||||
|
- the login guard redirect with its query string, the wrong-password error, and returning to the requested page
|
||||||
|
- the dashboard, admin and logs pages via in-app navigation
|
||||||
|
- the TV view showing the active block and staying live after WebSocket events
|
||||||
|
|
||||||
|
The one failing check is identical on both builds and comes from the test itself: 401s from the pre-login refresh probe and the deliberate wrong password, plus WebSocket 429s from nginx's `tv_limit` (10 r/m).
|
||||||
|
- There is no unit test suite or linter in this repo.
|
||||||
|
|
||||||
|
### Deploy notes
|
||||||
|
- **Take a fresh DB backup right before deploying.** On first start mysql 8.4.13 upgrades the data dictionary in place (about 1 minute; the healthcheck's 180s `start_period` covers it). MySQL can't be downgraded in place, so going back to 8.4.11 means restoring the backup into a fresh volume.
|
||||||
|
- `docker compose pull db && docker compose up -d --build`. No env var, volume or permission changes.
|
||||||
|
|
||||||
|
### Production deploy — 2026-11-16
|
||||||
|
Deployed with `docker compose pull db && docker compose up -d --build`. A fresh backup was taken right before: `~/backups/homeschool/homeschool-20261116-2352-pre-v2026.11-deploy.sql.gz` (18,286 bytes, verified).
|
||||||
|
- All three containers are healthy. Running versions: mysql 8.4.13, Python 3.12.16, fastapi 0.163.1, starlette 1.10.0, SQLAlchemy 2.1.9, nginx 1.30.6.
|
||||||
|
- MySQL upgraded in place, `80411` → `80413`, in about 1 minute with no errors. Row counts match the pre-deploy backup (3 users, 3 children, 72 sessions, 1,158 timer events), and `CHECK TABLE` is OK on users, children, sessions, timer_events and schedule_blocks.
|
||||||
|
- Through https://homeschool.chns.tech:
|
||||||
|
- `/`, `/login` and `/api/health` return 200, and the served bundle matches the new build.
|
||||||
|
- Protected routes without a token return 401.
|
||||||
|
- A real child's TV dashboard loads, and its WebSocket connects over `wss://`.
|
||||||
|
- Real user traffic after the deploy returned 200s. The backend log shows no errors.
|
||||||
|
- Prod checks were read-only. Registering and admin login fire ntfy alerts, so the write paths were covered by the test-stack runs above.
|
||||||
|
|
||||||
|
### Rollback
|
||||||
|
- Git tag: `pre-update-2026-11-16`
|
||||||
|
- Image tags: `homeschool-backend:pre-update-2026-11-16`, `homeschool-frontend:pre-update-2026-11-16`, `mysql:8.4.11-pre-update-2026-11-16`
|
||||||
|
- Database backup: `~/backups/homeschool/homeschool-pre-update-2026-11-16.sql.gz` (18,279 bytes, taken before any changes, while 8.4.11 was running)
|
||||||
|
- Restore command (it replaces the current tables; `--databases` dumps include `CREATE DATABASE` and `DROP TABLE`):
|
||||||
|
```bash
|
||||||
|
docker compose stop backend frontend
|
||||||
|
zcat ~/backups/homeschool/homeschool-pre-update-2026-11-16.sql.gz | \
|
||||||
|
docker exec -i homeschool_db sh -c 'exec mysql -uroot -p"$MYSQL_ROOT_PASSWORD"'
|
||||||
|
docker compose start backend frontend
|
||||||
|
```
|
||||||
|
For a production restore, prefer the newer pre-deploy backup (`homeschool-20261116-2352-pre-v2026.11-deploy.sql.gz`), which is in the same format. To return to mysql 8.4.11 after the 8.4.13 upgrade, recreate the volume first: stop the stack, remove or rename `homeschool_mysql_data`, set the image back to `mysql:8.4.11`, `docker compose up -d db`, wait until it's healthy, then run the restore above.
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
FROM python:3.12.14-slim
|
FROM python:3.12.16-slim
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|||||||
+11
-4
@@ -3,21 +3,28 @@ from typing import Any
|
|||||||
|
|
||||||
import jwt
|
import jwt
|
||||||
from jwt import PyJWTError
|
from jwt import PyJWTError
|
||||||
from passlib.context import CryptContext
|
import bcrypt
|
||||||
|
|
||||||
from app.config import get_settings
|
from app.config import get_settings
|
||||||
|
|
||||||
settings = get_settings()
|
settings = get_settings()
|
||||||
|
|
||||||
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
|
|
||||||
|
def _encode(plain: str) -> bytes:
|
||||||
|
# bcrypt only uses the first 72 bytes; passlib truncated silently, so do the
|
||||||
|
# same to keep existing hashes verifiable (bcrypt>=5 raises instead).
|
||||||
|
return plain.encode("utf-8")[:72]
|
||||||
|
|
||||||
|
|
||||||
def hash_password(plain: str) -> str:
|
def hash_password(plain: str) -> str:
|
||||||
return pwd_context.hash(plain)
|
return bcrypt.hashpw(_encode(plain), bcrypt.gensalt(rounds=12)).decode("ascii")
|
||||||
|
|
||||||
|
|
||||||
def verify_password(plain: str, hashed: str) -> bool:
|
def verify_password(plain: str, hashed: str) -> bool:
|
||||||
return pwd_context.verify(plain, hashed)
|
try:
|
||||||
|
return bcrypt.checkpw(_encode(plain), hashed.encode("ascii"))
|
||||||
|
except ValueError: # malformed hash
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def create_access_token(data: dict[str, Any]) -> str:
|
def create_access_token(data: dict[str, Any]) -> str:
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
from pydantic_settings import BaseSettings
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||||
from functools import lru_cache
|
from functools import lru_cache
|
||||||
|
|
||||||
|
|
||||||
class Settings(BaseSettings):
|
class Settings(BaseSettings):
|
||||||
|
model_config = SettingsConfigDict(env_file=".env")
|
||||||
|
|
||||||
database_url: str
|
database_url: str
|
||||||
secret_key: str
|
secret_key: str
|
||||||
algorithm: str = "HS256"
|
algorithm: str = "HS256"
|
||||||
@@ -19,9 +21,6 @@ class Settings(BaseSettings):
|
|||||||
def cors_origins_list(self) -> list[str]:
|
def cors_origins_list(self) -> list[str]:
|
||||||
return [o.strip() for o in self.cors_origins.split(",")]
|
return [o.strip() for o in self.cors_origins.split(",")]
|
||||||
|
|
||||||
class Config:
|
|
||||||
env_file = ".env"
|
|
||||||
|
|
||||||
|
|
||||||
@lru_cache
|
@lru_cache
|
||||||
def get_settings() -> Settings:
|
def get_settings() -> Settings:
|
||||||
|
|||||||
+16
-17
@@ -1,18 +1,17 @@
|
|||||||
fastapi==0.141.1
|
fastapi==0.163.1
|
||||||
starlette==1.7.0
|
starlette==1.10.0
|
||||||
anyio==4.15.1
|
anyio==4.16.0
|
||||||
uvicorn[standard]==0.30.6
|
uvicorn[standard]==0.54.0
|
||||||
sqlalchemy[asyncio]==2.0.35
|
sqlalchemy[asyncio]==2.1.9
|
||||||
aiomysql==0.3.0
|
aiomysql==0.3.2
|
||||||
PyMySQL==1.1.2
|
PyMySQL==1.2.4
|
||||||
PyJWT==2.15.0
|
PyJWT==2.15.1
|
||||||
cryptography==50.0.1
|
cryptography==50.0.2
|
||||||
passlib[bcrypt]==1.7.4
|
bcrypt==5.0.0
|
||||||
bcrypt==3.2.2
|
pydantic==2.14.3
|
||||||
pydantic==2.13.5
|
pydantic-settings==2.16.3
|
||||||
pydantic-settings==2.5.2
|
alembic==1.20.1
|
||||||
alembic==1.20.0
|
|
||||||
Mako==1.4.3
|
Mako==1.4.3
|
||||||
python-multipart==0.0.32
|
python-multipart==0.0.34
|
||||||
email-validator==2.2.0
|
email-validator==2.4.0
|
||||||
httpx==0.27.2
|
httpx==0.28.1
|
||||||
+5
-4
@@ -6,7 +6,7 @@ x-logging: &default-logging
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: mysql:8.4.11
|
image: mysql:8.4.13
|
||||||
container_name: homeschool_db
|
container_name: homeschool_db
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
@@ -24,7 +24,7 @@ services:
|
|||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
start_period: 180s
|
start_period: 180s
|
||||||
mem_limit: 512m
|
mem_limit: 768m
|
||||||
cpus: 1.0
|
cpus: 1.0
|
||||||
logging: *default-logging
|
logging: *default-logging
|
||||||
|
|
||||||
@@ -43,6 +43,7 @@ services:
|
|||||||
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
|
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
|
||||||
NTFY_URL: ${NTFY_URL:-}
|
NTFY_URL: ${NTFY_URL:-}
|
||||||
NTFY_TOKEN: ${NTFY_TOKEN:-}
|
NTFY_TOKEN: ${NTFY_TOKEN:-}
|
||||||
|
DOCS_ENABLED: ${DOCS_ENABLED:-false}
|
||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
@@ -63,13 +64,13 @@ services:
|
|||||||
container_name: homeschool_frontend
|
container_name: homeschool_frontend
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "8054:80"
|
- "8054:8080"
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
networks:
|
networks:
|
||||||
- homeschool_net
|
- homeschool_net
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1/"]
|
test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:8080/"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 3
|
retries: 3
|
||||||
|
|||||||
+5
-3
@@ -1,5 +1,5 @@
|
|||||||
# Stage 1: Build Vue.js app
|
# Stage 1: Build Vue.js app
|
||||||
FROM node:24.21.0-alpine AS builder
|
FROM node:24.22.3-alpine AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@@ -10,11 +10,13 @@ COPY . .
|
|||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Stage 2: Serve with nginx
|
# Stage 2: Serve with nginx
|
||||||
FROM nginx:1.30.5-alpine
|
FROM nginxinc/nginx-unprivileged:1.30.6-alpine
|
||||||
|
|
||||||
|
USER root
|
||||||
RUN apk upgrade --no-cache
|
RUN apk upgrade --no-cache
|
||||||
|
USER nginx
|
||||||
|
|
||||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 8080
|
||||||
+1
-1
@@ -33,7 +33,7 @@ limit_req_zone $binary_remote_addr zone=auth_limit:10m rate=5r/m;
|
|||||||
limit_req_zone $binary_remote_addr zone=tv_limit:10m rate=10r/m;
|
limit_req_zone $binary_remote_addr zone=tv_limit:10m rate=10r/m;
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 8080;
|
||||||
server_tokens off;
|
server_tokens off;
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
index index.html;
|
index index.html;
|
||||||
|
|||||||
Generated
+1289
-931
File diff suppressed because it is too large.
Load diff
@@ -1,20 +1,22 @@
|
|||||||
{
|
{
|
||||||
"name": "homeschool-frontend",
|
"name": "homeschool-frontend",
|
||||||
"version": "1.1.0",
|
"version": "2026.11.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "1.20.0",
|
"@vue/devtools-api": "8.2.1",
|
||||||
"pinia": "2.2.4",
|
"axios": "1.21.1",
|
||||||
"vue": "3.5.12",
|
"pinia": "4.1.0",
|
||||||
"vue-router": "4.4.5"
|
"vue": "3.5.45",
|
||||||
|
"vue-router": "5.5.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vitejs/plugin-vue": "5.1.4",
|
"@vitejs/plugin-vue": "6.0.11",
|
||||||
"vite": "5.4.21"
|
"vite": "8.3.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -17,12 +17,14 @@ api.interceptors.request.use((config) => {
|
|||||||
// Auto-refresh on 401
|
// Auto-refresh on 401
|
||||||
let refreshing = false
|
let refreshing = false
|
||||||
let waitQueue = []
|
let waitQueue = []
|
||||||
|
// These report their own 401s (wrong password, expired refresh cookie); refreshing on them would hide the error
|
||||||
|
const NO_REFRESH = ['/api/auth/login', '/api/auth/register', '/api/auth/refresh']
|
||||||
|
|
||||||
api.interceptors.response.use(
|
api.interceptors.response.use(
|
||||||
(res) => res,
|
(res) => res,
|
||||||
async (error) => {
|
async (error) => {
|
||||||
const original = error.config
|
const original = error.config
|
||||||
if (error.response?.status === 401 && !original._retry) {
|
if (error.response?.status === 401 && !original._retry && !NO_REFRESH.includes(original.url)) {
|
||||||
if (refreshing) {
|
if (refreshing) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
waitQueue.push({ resolve, reject })
|
waitQueue.push({ resolve, reject })
|
||||||
@@ -43,7 +45,10 @@ api.interceptors.response.use(
|
|||||||
waitQueue.forEach(({ reject }) => reject())
|
waitQueue.forEach(({ reject }) => reject())
|
||||||
waitQueue = []
|
waitQueue = []
|
||||||
localStorage.removeItem('access_token')
|
localStorage.removeItem('access_token')
|
||||||
window.location.href = '/login'
|
const { pathname, search } = window.location
|
||||||
|
window.location.href = pathname === '/login'
|
||||||
|
? '/login'
|
||||||
|
: `/login?redirect=${encodeURIComponent(pathname + search)}`
|
||||||
} finally {
|
} finally {
|
||||||
refreshing = false
|
refreshing = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,8 +57,10 @@ async function submit() {
|
|||||||
} else {
|
} else {
|
||||||
await auth.register(form.value.email, form.value.password, form.value.fullName)
|
await auth.register(form.value.email, form.value.password, form.value.fullName)
|
||||||
}
|
}
|
||||||
const redirect = route.query.redirect || '/dashboard'
|
// Only follow in-app paths ("//host" would be protocol-relative)
|
||||||
router.push(redirect)
|
const redirect = route.query.redirect
|
||||||
|
const safe = typeof redirect === 'string' && redirect.startsWith('/') && !redirect.startsWith('//')
|
||||||
|
router.push(safe ? redirect : '/dashboard')
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
error.value = e.response?.data?.detail || 'Something went wrong'
|
error.value = e.response?.data?.detail || 'Something went wrong'
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
import { resolve } from 'path'
|
import { fileURLToPath, URL } from 'node:url'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [vue()],
|
plugins: [vue()],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': resolve(__dirname, 'src'),
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
|
|||||||
@@ -153,13 +153,17 @@ This section was first blocked on backups. The user then asked for the HIGH find
|
|||||||
| Container | Image | Image ID |
|
| Container | Image | Image ID |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| homeschool_db | mysql:8.4.11 | sha256:ee241324a55f… |
|
| homeschool_db | mysql:8.4.11 | sha256:ee241324a55f… |
|
||||||
| homeschool_backend | homeschool-backend | sha256:51b49afb4ec4… |
|
| homeschool_backend | homeschool-backend (v1.1.0) | sha256:1eb66dc84e67… |
|
||||||
| homeschool_frontend | homeschool-frontend | sha256:f9a737699cda… |
|
| homeschool_frontend | homeschool-frontend (v1.1.0) | sha256:50f1de90c447… |
|
||||||
|
|
||||||
### Post-deploy regression
|
### Post-deploy regression
|
||||||
|
|
||||||
After the HIGH deploy, `POST /api/sessions/{id}/timer` returned **500 on every call**: 8 failures, 0 successes, starting 06:43 UTC. FastAPI 0.141 raises on a failed lazy-load of `current_block.subject.options` during response serialization, where 0.115 silently skipped it. The first smoke test didn't cover timer actions. Fixed in v1.1.0 by eager-loading `Subject.options` in `sessions.py` and `dashboard.py`. The smoke test now covers the full timer lifecycle, the TV dashboard with an active block, schedule/subject writes, and every parameterless GET route (from the OpenAPI spec).
|
After the HIGH deploy, `POST /api/sessions/{id}/timer` returned **500 on every call**: 8 failures, 0 successes, starting 06:43 UTC. FastAPI 0.141 raises on a failed lazy-load of `current_block.subject.options` during response serialization, where 0.115 silently skipped it. The first smoke test didn't cover timer actions. Fixed in v1.1.0 by eager-loading `Subject.options` in `sessions.py` and `dashboard.py`. The smoke test now covers the full timer lifecycle, the TV dashboard with an active block, schedule/subject writes, and every parameterless GET route (from the OpenAPI spec).
|
||||||
|
|
||||||
|
### v1.1.0 deploy verification
|
||||||
|
|
||||||
|
All 3 containers are healthy with 0 restarts, and log rotation is active (10m × 3). Public `/api/health` returns 200. Production timer actions return 200 (4 of 4 right after the deploy). Tagged `v1.1.0` and pushed. The pre-review rollback images (`rollback-20260924`) were pruned by the user; `rollback-20260924b` (the HIGH-fix build) remains.
|
||||||
|
|
||||||
### Post-update scan (trivy HIGH/CRITICAL)
|
### Post-update scan (trivy HIGH/CRITICAL)
|
||||||
|
|
||||||
| Image | Before | After |
|
| Image | Before | After |
|
||||||
|
|||||||
Reference in new issue
Block a user