Commit graph

13 commits

Author SHA1 Message Date
dlawler489
2768a71c63 Add per-license commercial-use rules (settings + auto-register)
- license_rules table (name -> commercial); licenses auto-register on
  import with a best-effort seed, overridable in Settings (applies the
  choice to every model with that license)
- resolveCommercial() replaces ad-hoc inferCommercial across import/refresh
- GET/PUT /api/licenses; "License types" section in Settings
- Fix CC short codes: BY / BY-SA / BY-ND now classed sellable (MakerWorld
  stores e.g. "BY-SA"); NC variants stay non-commercial

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 10:20:28 +10:00
dlawler489
5af88eb5ce Add email/password auth + SMTP password resets
All checks were successful
build-and-push / docker (push) Successful in 29s
- users + password_resets tables; bcrypt hashing; JWT session in an
  httpOnly cookie (auth_secret auto-generated in settings)
- /api gated behind auth (except /api/config and /api/auth/*)
- First-run creates the account (no open registration after that);
  login, logout, forgot/reset-password flows
- SMTP settings (host/port/secure/user/pass/from) in Settings menu;
  nodemailer sends reset links
- Auth screen (sign in / create account / forgot / reset) gates the SPA;
  Sign out button; COOKIE_SECURE=true in compose for HTTPS

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 22:33:11 +10:00
dlawler489
b06767bd08 compose: match working Traefik labels (tls=true, certresolver=le)
All checks were successful
build-and-push / docker (push) Successful in 25s
The 404 was a router that wouldn't load: cert resolver is named `le`
(not `letsencrypt`) and the explicit `tls=true` label was missing.
Mirror the working paperless service.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 20:55:01 +10:00
dlawler489
5e02caf013 compose: default Traefik network to proxy
All checks were successful
build-and-push / docker (push) Successful in 9s
That's the actual network Traefik runs on; was defaulting to a
non-existent `traefik` network, causing "network ... could not be found".
Still overridable via TRAEFIK_NETWORK.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 20:51:06 +10:00
dlawler489
5dfe809eb2 compose: Traefik label-based auto-discovery
All checks were successful
build-and-push / docker (push) Successful in 26s
Add Traefik labels so the Docker provider auto-discovers the app.
Includes traefik.docker.network (the app is on two networks) which is
the usual fix for routing not resolving. Host/entrypoint/certresolver
overridable via PRINTHIVE_HOST / TRAEFIK_ENTRYPOINT / TRAEFIK_CERTRESOLVER.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 20:47:06 +10:00
dlawler489
8ad25aff98 compose: route via shared Traefik network instead of host port
Drop the published host port (it clashed on the deploy host) and attach
the app to the external Traefik network so Traefik routes to it directly.
Stable container_name printhive-app for the file provider to target;
network name configurable via TRAEFIK_NETWORK.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 20:45:02 +10:00
dlawler489
34ced61b51 compose: make host port configurable (APP_PORT)
Host port 3000 can clash with other services on the deploy host; allow
overriding via APP_PORT (default 3000). Only needed for Traefik to reach
the app — can be dropped entirely if Traefik shares the Docker network.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 20:43:05 +10:00
dlawler489
5fb3939bcd Add first-run setup wizard for import sources
All checks were successful
build-and-push / docker (push) Successful in 11s
On a fresh install (no integration settings yet), prompt once for the
Thingiverse/MakerWorld/Printables tokens and FlareSolverr URL, with a
"skip for now" option. /api/config exposes setupComplete (true if any
setting is configured or setup was dismissed); POST /api/setup/complete
records dismissal. DB password stays a deploy-time env var by necessity.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 20:35:18 +10:00
dlawler489
5d69acd718 compose: pull image for deploy instead of building
Dockhand pulls the CI-built image, so drop `build: .` (no build context
on the deploy host) and add pull_policy: always.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 20:29:54 +10:00
dlawler489
3a6a2143ef CI: push image using a Forgejo access token
All checks were successful
build-and-push / docker (push) Successful in 15s
The auto GITHUB_TOKEN lacks package-write scope (push failed with
unauthorized: reqPackageAccess). Use a REGISTRY_TOKEN secret (Forgejo
token with write:package) and log in as the repo owner instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 17:48:57 +10:00
dlawler489
e5e1a2bfc1 Add Forgejo Actions CI to build & push the image
Some checks failed
build-and-push / docker (push) Failing after 53s
On push to main (and v* tags), builds the Docker image and pushes it to
the Forgejo container registry at git.plexultra.com/dlawler489/printhive
(:latest and :<short-sha>). Uses the auto-provided Actions token with
packages:write; plain docker CLI so it only needs the checkout action.
Compose image reference updated to the Forgejo registry.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 17:00:49 +10:00
dlawler489
aabc0dd870 Add Docker packaging (Dockerfile, compose, sidecar deps)
- Dockerfile: node:22-bookworm-slim + Python venv with trimesh for the
  3MF->GLB sidecar (PYTHON_BIN env points the converter at it)
- docker-compose.yml: app + postgres 16 with healthcheck/depends_on,
  named volumes for pgdata/uploads/thumbnails/glb, token env passthrough
- .dockerignore, tools/requirements.txt
- converter.js honours PYTHON_BIN (defaults to local venv)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 16:51:06 +10:00
dlawler489
a37db15a3f Initial commit: Printhive 3D-print file library
Self-hosted Express + Postgres app for organizing STL/3MF/OBJ/etc. with:
- Model/file library, tags, collections, print settings
- URL import: Thingiverse (API), Printables (GraphQL), MakerWorld
  (FlareSolverr + token), cubee3d/other (metadata + manual files)
- In-browser 3D viewer; 3MF rendered via Python/trimesh GLB conversion
- Auto thumbnails, license/commercial-use tracking, in-app editing
- Settings (API tokens / FlareSolverr) stored in DB with .env fallback

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 13:15:17 +10:00