2.8 KiB
2.8 KiB
Working in this repository
This repository holds both the VardKey application and its StartOS package, side by side at the
repository root. The application is the Python source at the top level (app.py, database.py,
alerts.py, export.py, validation.py, static/, tests/); the package is startos/ together
with the Dockerfile, Makefile, package.json, tsconfig.json, and the rest of the StartOS
skeleton.
Repository mechanics
- The package repo is also the application repo. The packaging guide says a package repo is not
a fork of the application. That rule assumes a published upstream image or a git submodule, and
VardKey has neither — it is our own application and publishes no image — so the package builds
the application from this repository's root. Do not add an
upstream-project/submodule to "fix" this; it would point at this same repository and break the build. - There is no CI. The packaging guide assumes GitHub Actions workflows. This repository is on
Gitea, so there are no
.github/workflows/and there must not be any. Build the.s9pklocally withmake. - The image is built by
Dockerfile, referenced asdockerBuild: {}instartos/manifest/index.ts, which makes the build context the repository root. Anything theDockerfiledoes notCOPYis not in the image. - The application is pure Python standard library. There is no
requirements.txtand no package-installation step in the image.
Things that look right and are not
- Do not add a
USERline to theDockerfile. Themainvolume is mounted at/dataand must be writable without achown; dropping privileges in the image makes the SQLite database unwritable. static/must beCOPYed into the image.app.pyanswers/healthfrom code, but every page and asset is read fromROOT/static. Leave it out and the health check goes green while the whole UI answers404.- The internal port must be the same in three places.
startos/utils.tsholdsuiPort;startos/main.tspasses it asPORTto the daemon and uses it in the readiness URL, andstartos/interfaces.tsbinds it. Changing one alone leaves the readiness check permanently red. - Do not add a second container, Postgres, Redis, an external backend, or external storage for
application data. This is a standing prohibition, not a work item — see
TODO.mdsections 1 and 13.
Tests
python3 -m unittest discover -s tests
The suite is the application's regression net and does not exercise the package. It must stay green, on Linux and on the Windows copy alike.
Build
make x86 # or: make arm
Building needs a StartOS packaging workspace — see the packaging guide's Environment Setup.
make install needs host.default in the workspace .startos/config.yaml and one
start-cli auth login.