Commit Graph
82 Commits
Author SHA1 Message Date
Donkie f38720314b Bump version to 0.26.1 2026-08-06 18:44:00 +00:00
Donkie f369253c67 Bump version to 0.26.0 2026-07-31 08:19:20 +00:00
Donkie 388e87ec96 Merge branch 'master' into security/backend-audit-todo
# Conflicts:
#	pyproject.toml
2026-07-31 09:15:22 +02:00
Donkie 67022e7c6d Regenerate the README screenshot from catalog-imported filaments
The old one was seeded with stress_seed.py, which builds a filament name
from one random pool and its color hex from another, so the picture
contradicted itself: "PETG Copper Bronze" had a blue swatch and "PVA
Sparkle Silver" a tan one. That is the first thing a visitor sees.

scripts/demo_seed.py imports every filament from SpoolmanDB instead,
issuing the same request the client's Add-spools flow does, so names,
colors, densities and temperatures come from one source and agree with
each other. Twenty filaments across eight real vendors are pinned by
external id, chosen for material spread and a varied swatch column; if
one leaves the catalog the script fails with the list rather than
quietly drifting.

The spools on top of them are still made up, because that half really is
per-user data -- partial weights, locations, lot numbers, prices,
first/last-used dates, a few archived and a few still sealed -- plus the
handful of extra fields a real user defines, so the inspector shows
content where it used to show its empty state.

Two details are shaped by how the list renders rather than by realism:
spools consume a whole number of grams, since a decimal wraps onto a
second line in the narrow weight column, and comments stay under ~20
characters, since the list shows a comment in place of "used N ago" and
truncated the longer ones mid-word.
2026-07-30 22:03:19 +02:00
Donkie 59672ecb30 Merge master into feature/v2-client
Brings the branch up to 0.25.0 and picks up cosign image signing, the
armv7/arm64 smoke tests, the armv7 greenlet/libstdc++ fix, the
PUID/PGID and Kubernetes SPOOLMAN_PORT entrypoint guards, and the
externaldb unwritable-path fix.

The only conflict was publish-images' needs list, where both sides had
added a job: test-frontend-v2 here, test-multiarch-smoke on master.
Resolved as the union, so nothing publishes until every test job has
passed. The rest of the graph is unchanged, and the new smoke tests
inherit client_v2 coverage for free -- build-arm64 and build-armv7
already download the client_v2 artifact, so booting those images to
/health now also proves the default client is present in them.

Claude-Session: https://claude.ai/code/session_01UB5KocsTBm9GL5x3Uuup5F
2026-07-30 21:02:14 +02:00
Donkie 6ca753bca0 Move the stress-seed script into scripts/
It has been sitting untracked in client_v2/ -- the wrong place twice
over: it is a backend tool that talks to the API over HTTP and knows
nothing about the client, and client_v2 is excluded from ruff, so
nothing was checking it.

scripts/ already holds the repo's operational scripts, and a poe task
puts it next to the other things you run against a dev instance. The
docstring gains the warning the flags deserve: --purge deletes every
vendor, filament and spool on the target, not only the generated ones.

Ruff now sees it, so scripts/ gets per-file ignores for the rules a
generator legitimately breaks -- stdout is its user interface, its data
is deliberately random and full of literal weights and diameters, and
the generators are long by nature. Type annotations and everything else
stay enforced.

Also fix --skip-fields: it skipped creating the extra-field definitions
but still generated values for them, so every POST failed with "Unknown
extra field" and the run produced nothing.

Claude-Session: https://claude.ai/code/session_01UB5KocsTBm9GL5x3Uuup5F
2026-07-30 20:59:41 +02:00
Donkie 17f8b9fee1 client_v2: add Playwright frontend integration tests
Mirrors tests_frontend, but drives the Svelte client instead of the legacy
React one: same production image, same PostgreSQL-backed compose stack, same
"only the first navigation uses a URL" discipline.

- smoke.spec.ts clicks through every top-bar tab, asserting each route's title
  and the app shell, with no browser console errors; a second test proves the
  library reached the API rather than falling into its offline state.
- crud.spec.ts walks the first-use happy path. client_v2 folds the legacy
  client's three create forms into one "Add spools" modal, so a manufacturer,
  a filament and a spool are created by a single submit, then verified back in
  the library list and on the locations page.

Two client_v2-specific helpers earn their keep: the top bar renders its nav
twice (desktop + mobile, one hidden by CSS) so nav locators need narrowing to
the visible one, and NumberInput's accessible name picks up its stepper and
help buttons, so numeric fields are found via their form item instead of
getByLabel.

The suite publishes on host port 8001 so it can run alongside the legacy one.
CI gains a test-frontend-v2 job cloned from test-frontend, gating
publish-images alongside it.

Also fixes tests_frontend/run.py: it only built client/dist, but the Dockerfile
copies client_v2/build unconditionally, so the image could not be built from a
clean checkout.
2026-07-29 19:08:12 +02:00
Donkie 7d4728ae9b security: add shared origin-trust helper
Tasks 1-3 of the backend security audit all need to answer "is this browser
origin someone we trust". Build it once, driven entirely by the existing
SPOOLMAN_CORS_ORIGIN rather than a new env var.

- Unset means same-origin only, which is right for nearly every deployment.
  Non-browser clients (Moonraker, OctoPrint) send no Origin and are unaffected.
- A list means those origins plus our own.
- "*" and debug mode mean "I do not want origin checks" and are honoured as
  such, with a loud startup warning. An operator who writes "*" is opting out;
  reinterpreting it as something narrower would leave them no way to say so.

Also accept X-Forwarded-Host, so a reverse proxy that rewrites Host (nginx
without proxy_set_header Host $host, Apache without ProxyPreserveHost On) does
not see the guard reject its own web UI. A malicious page cannot set that
header on any of the vectors the guard exists to stop: forms cannot set request
headers, nor can the browser WebSocket API, and a fetch that adds one needs a
CORS preflight it will not get.

get_cors_origin() now normalizes its entries -- it was a bare split(","), so
"https://a, https://b" yielded " https://b", which no Origin header can match.
CORS itself benefits from the same fix. The raw value is kept in the startup
log so a typo stays visible.

Adds tests/ for backend unit tests, runnable with `poe test` and wired into the
lefthook ci group. Nothing enforces this helper yet; that is tasks 1-3.
2026-07-27 08:51:11 +02:00
Donkie 6e1065009c Bump version to 0.25.0 2026-07-22 14:10:59 +00:00
dependabot[bot] 54b67f53ef Bump setuptools from 78.1.1 to 83.0.0 (#970)
Bumps [setuptools](https://github.com/pypa/setuptools) from 78.1.1 to 83.0.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v78.1.1...v83.0.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-version: 83.0.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-22 15:56:09 +02:00
Donkie d65b50d5a2 Use paraglide for i18n in client_v2. Update base path handling 2026-07-16 18:41:01 +02:00
Donkie 103e029434 Bump version to 0.24.0 2026-07-07 09:48:12 +00:00
Donkie d9fd44eab9 Add Playwright frontend integration tests; fix broken SPA static serving
Add a browser-driven integration suite (tests_frontend/) that runs against
the real production image + PostgreSQL and drives the UI with Playwright:
a smoke test that navigates every page via the sidebar with no console
errors, and a CRUD test that creates a vendor -> filament -> spool entirely
through the UI. Wired up as `poe itest-frontend` and a new `test-frontend`
CI job (reusing the image built for the backend tests, gating releases).

Navigation goes through real UI buttons (language-independent link targets)
and the app language is forced to English so label matchers are stable
regardless of the runner's browser locale.

This immediately caught a real regression: Starlette 1.3.1 (pulled by a
recent dep bump) removed the `method` kwarg from FileResponse, so
SinglePageApplication 500'd on every static asset and the whole UI was dead.
Drop the removed kwarg — Starlette now derives HEAD handling from the scope.

Claude-Session: https://claude.ai/code/session_01BQjJiwEbu6bHbeDjPPDm3V
2026-07-07 09:12:42 +02:00
Donkie da54ead06f Bump deps to clear Dependabot alerts (path-to-regexp, pytest)
- path-to-regexp: force >=8.4.0 (8.4.2) under @ant-design/pro-layout via a
  scoped npm override, fixing the ReDoS advisories (GHSA sequential optional
  groups + multiple wildcards). Express keeps its own 0.1.x.
- pytest 8.3 -> 9.1.1 and pytest-asyncio 0.23/0.25 -> 1.4.0 in
  tests_integration/requirements.txt and the dev group; regenerated uv.lock.

Verified: client build + typecheck pass, npm audit clean, and the full
integration suite (223 tests) passes on postgres, sqlite, mariadb, and
cockroachdb under podman.

Claude-Session: https://claude.ai/code/session_01BQjJiwEbu6bHbeDjPPDm3V
2026-07-06 20:39:46 +02:00
Donkie eafbc64937 Bump version to 0.23.1 2026-02-03 16:27:38 +00:00
Donkie 7f14cbdaa9 Added rsa variant of aiomysql to add support for better mysql password methods. 2026-01-24 15:59:53 +01:00
Donkie 115e29bdaf Bump version to 0.23.0 2026-01-23 20:21:50 +00:00
Donkie 1974d4b8d2 Version bump updates 2026-01-23 21:07:45 +01:00
dependabot[bot] b393f822e8 Bump setuptools from 76.1.0 to 78.1.1
Bumps [setuptools](https://github.com/pypa/setuptools) from 76.1.0 to 78.1.1.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v76.1.0...v78.1.1)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-version: 78.1.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-18 21:30:53 +00:00
Donkie b361aee956 CI fixes 2026-01-18 16:55:31 +01:00
Donkie b942d1f8a1 Replaced pdm with uv, updated backend deps, python 3.10 minimum, simplified install script 2026-01-07 22:01:02 +01:00
Donkie 753140ecc3 Replaced su-exec with gosu, fixed pdm using wrong python version 2026-01-05 23:53:41 +01:00
Donkie 1888240044 Bump version to 0.22.1 2025-03-18 21:41:35 +01:00
Donkie a5df70a803 Bump version to 0.22.0 2025-03-16 21:34:21 +01:00
Donkie 70ea7ad414 Update python dependencies and ruff/black versions 2025-03-16 21:34:02 +01:00
Donkie 92065fd8df Update python dependencies 2025-03-16 18:23:40 +01:00
Donkie 053b20f19c Bump version to 0.21.0 2024-12-01 14:54:31 +01:00
Donkie a3f506ce85 Bumped python dependencies 2024-12-01 14:53:58 +01:00
Donkie 4f8d5abcec Bump version to 0.20.0 2024-09-08 22:42:34 +02:00
Donkie 5c5bd4627b Bump version to 0.19.3 2024-08-10 11:50:16 +02:00
Donkie 2e414af9bb Bump version to 0.19.2 2024-08-09 17:16:08 +02:00
Donkie 2fd80038e3 Bump version to 0.19.1 2024-08-09 17:07:13 +02:00
Donkie c93ca5d916 Bump version to 0.19.0 2024-08-07 15:44:24 +02:00
Donkie 535fa40ad2 Updated most python dependencies
Primarily FastAPI and Pydantic to v2. Also ruff to latest.

Updated some code to support Pydantic v2
2024-05-23 19:42:27 +02:00
Donkie 306dbe40af Bump version to 0.18.1 2024-05-22 20:16:22 +02:00
Donkie 4eee6712c1 Bump version to 0.18.0 2024-05-20 22:55:22 +02:00
Donkie 21d541a680 Added script to download files from external db 2024-05-12 10:48:33 +02:00
Donkie 4f93fdd4ea Bump version to 0.17.0 2024-05-04 20:35:35 +02:00
Dmitry Belousov 91d922d0b8 fixed version prometheus-client
added env variable SPOOLMAN_METRICS_ENABLED for enabled database collector

set metrics path as /metrics

checked Null values at vendors, init weight and price
removed some logs
2024-04-15 00:17:36 +03:00
Dmitry Belousov fc8df5346d Rollback pdm.lock to cadb707
Rollback pyproject.toml
2024-04-14 22:59:35 +03:00
Dmitry Belousov 28b2bfec50 Added prometheus client
Added scheduler for compute current spool metrics and info
2024-04-09 15:25:09 +03:00
Donkie babb95d086 Bump version to 0.16.1 2024-02-04 10:02:52 +00:00
Donkie 6d63519bee Bump version to 0.16.0 2024-02-01 17:27:26 +00:00
Donkie 3340da3067 Allow relative imports in tests 2024-01-23 18:58:57 +01:00
Donkie b57ca68250 Bump version to 0.15.0 2023-12-29 11:01:32 +00:00
Donkie 286e519eaa Bump version to 0.14.0 2023-12-02 12:05:31 +01:00
Donkie e52675e131 Bump version to 0.13.1 2023-10-24 20:23:20 +02:00
Donkie aa2e79b101 Bump version to 0.13.0 2023-10-21 11:57:01 +02:00
Donkie a6d527aaf0 Added/deleted-type websocket messages
Events are now sent for not only when an object changes but also when one is created or deleted.

For now it's not really possible to subscribe to these events however.

This breaks backwards-compatibility with the websocket messages.
2023-10-15 19:46:10 +02:00
Donkie 8ade10db11 Bump version to 0.12.2 2023-10-08 11:40:49 +02:00