Why: the usual way to hand a secret to a container is to mount it as a file and name the path in the environment. Compose, swarm and Kubernetes all do it that way, and it keeps the key out of the process environment and off any disk the container can write. What: the master key is now looked for in KEEPORG_MASTER_KEY, then KEEPORG_MASTER_KEY_FILE, then the configured master_key_file. A secret file may hold base64, with or without padding or a trailing newline, or exactly 32 raw bytes, because secret stores produce both. Only the configured path is ever created, which is what keeps a plain package install working with no setup. The two environment variables name a key something else owns, so a missing one is reported and vault creation refused. Minting a replacement there would be worse than failing: it opens none of the existing vaults, and the mistake would otherwise surface one failed merge at a time. The compose example now provisions the key as a real secret rather than an environment variable, and the Dockerfile and README show the same. Neither names a version any more, so they stop drifting as the server is bumped. Proved: unit tests for every source and precedence, all four accepted encodings, and that a missing secret writes nothing anywhere. In real containers: a podman secret carrying base64 survives a stop and start with "1 vault keys available for merging" and merges a stale push afterwards; a secret holding 32 raw bytes creates a vault; and a secret that failed to mount is named in the startup log, with vault creation answering with the three places a key may come from.
19 lines
722 B
Makefile
19 lines
722 B
Makefile
# Single source of truth for all platform versions (semver).
|
|
# Bump with: make bump PLATFORM=<server|linux|macos|windows|bsd|android> PART=<major|minor|patch>
|
|
VERSION_SERVER := 0.4.0
|
|
VERSION_LINUX := 0.2.0
|
|
VERSION_MACOS := 0.2.0
|
|
VERSION_WINDOWS := 0.2.0
|
|
VERSION_BSD := 0.2.0
|
|
VERSION_ANDROID := 0.2.0
|
|
# Monotonic Android versionCode, never decreases.
|
|
ANDROID_VERSION_CODE := 2
|
|
|
|
# Reverse-DNS application identifiers.
|
|
APPID_ANDROID := cc.tiredsysadmin.android.keeporg
|
|
APPID_MACOS := cc.tiredsysadmin.macos.keeporg
|
|
APPID_LINUX := cc.tiredsysadmin.linux.keeporg
|
|
APPID_WINDOWS := cc.tiredsysadmin.windows.keeporg
|
|
APPID_BSD := cc.tiredsysadmin.bsd.keeporg
|
|
APPID_SERVER := cc.tiredsysadmin.linux.keeporgd
|