Readability pass across all four areas of the stack. Comments explain why rather than what, concentrated at the points where behaviour is non-obvious: concurrency, caching, auth, scraping and nginx templating. Backend: doc comments on every exported declaration across handlers, services, models and resolvers. Resolver commentary lives inside function bodies so gqlgen does not strip it on regeneration; schema files use # comments rather than description blocks so introspection output is unchanged. Extracted the duplicated auth-cookie blocks into helpers. Frontend: header comments on every component, store and view, including STATUS: notes marking which of the parallel/legacy views are still live. Documented the non-reactive animation-state pattern, the homeData hub and the WebSocket stale-socket guard. Removed a few dead imports and named the reconnect-backoff and poll-interval constants. Python: module and function docstrings covering the Travelodge scraping contract, the deadline threading, the two-executor concurrency and the NDJSON streaming protocol. Infra: header blocks on every compose file, nginx template, Dockerfile and entrypoint, covering the config selection, envsubst allow-lists, rate-limit semantics and volume persistence. Hoisted the duplicated envsubst variable list in nginx/entrypoint.sh. New: backend/README.md, python/README.md, DEPLOYMENT.md, .env.example, backend/graph/doc.go. Refreshed vue/README.md. Corrected CLAUDE.md, which stated a 24h access token where main.go sets 7 days. No behaviour change. go build/vet, vite build, py_compile and docker compose config all pass. Co-Authored-By: Claude Opus 5 <[email protected]>
44 lines
1.7 KiB
Docker
44 lines
1.7 KiB
Docker
# =============================================================================
|
|
# Quartz image — builds the Obsidian notes site.
|
|
#
|
|
# HOW THE SOURCE IS OBTAINED: Quartz is not an npm package you depend on, it is
|
|
# an application you clone and configure. So the image `git clone`s the
|
|
# upstream repo at build time, which is why `git` is installed. --depth 1
|
|
# --branch pins to an exact tag (QUARTZ_VERSION, overridable as a build ARG)
|
|
# and fetches no history — a shallow clone is much faster on a Pi and the
|
|
# history is of no use here.
|
|
#
|
|
# Because this clone happens at build time, upstream Quartz is only updated
|
|
# when the image is rebuilt with a bumped QUARTZ_VERSION. The tag pin is the
|
|
# thing stopping an upstream change from breaking the notes site on a routine
|
|
# redeploy.
|
|
#
|
|
# gettext-base supplies `envsubst` for rendering quartz.config.ts from its
|
|
# template at container start (see quartz/entrypoint.sh).
|
|
#
|
|
# quartz.config.ts.template and quartz.layout.ts are copied in AFTER the clone
|
|
# so they land on top of the upstream defaults — layout is used as-is, config
|
|
# is templated at runtime because it needs DOMAIN.
|
|
#
|
|
# node:22-slim is multi-arch, so this builds unchanged on the Pi.
|
|
# =============================================================================
|
|
FROM node:22-slim
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install --yes git gettext-base \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /quartz
|
|
|
|
ARG QUARTZ_VERSION=v4.4.0
|
|
RUN git clone --depth 1 --branch ${QUARTZ_VERSION} \
|
|
https://github.com/jackyzha0/quartz.git . \
|
|
&& npm ci
|
|
|
|
COPY quartz.config.ts.template /quartz/quartz.config.ts.template
|
|
COPY quartz.layout.ts /quartz/quartz.layout.ts
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|