v0.1.1: monochrome UI, spaced settings tabs, keychain-safe publishing
The accent is ink rather than blue: primary buttons, the floating Add button, the empty-state shield, the active settings tab, the switch, the countdown ring and the initials tile. Light mode uses a deep near-black with a whisper of cool hue, dark mode a near-white — the Daito / Beautiful UI treatment. Status colours and the platform dots keep their hue because they carry meaning. The input focus glow stays, now a neutral 4px halo with a mid-grey edge. The per-issuer hue helper in the web UI is gone; the rendered chat tile still uses its issuer colour, where it helps tell accounts apart. Settings tabs get an 8px gap: each pill carries a 1px hairline ring outside its box, so 4px read as the pills touching. build-and-publish-unraid.sh writes registry auth into its private Docker config instead of `docker login`/`docker logout`. With an empty config the CLI falls back to docker-credential-osxkeychain, which shares its keychain item with git's helper: login fails with -25299 and logout deletes the credential git uses. PUBLISHING.md documents the trap and the release flow for this version. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
1 parent
ad3720edbf
commit
3c83cd9928
7 files changed
+146
-86
No files matched your search
+63
-31
@@ -1,73 +1,105 @@
|
||||
# Publishing to Gitea
|
||||
|
||||
Everything here needs a Gitea **personal access token**, which is why it isn't
|
||||
automated: the token should only ever exist in your own shell.
|
||||
Releases are cut by hand. Each one needs a Gitea **personal access token**
|
||||
with the `write:repository` and `write:package` scopes, which is why none of
|
||||
this is automated: the token should only ever exist in your own shell or
|
||||
keychain.
|
||||
|
||||
Create one at **Gitea → Settings → Applications → Generate New Token** with
|
||||
scopes:
|
||||
|
||||
- `write:repository` — to create the repo and push
|
||||
- `write:package` — to push the container image
|
||||
|
||||
Export it once per shell session:
|
||||
On a Mac that has pushed before, git already holds the token in the login
|
||||
keychain and nothing needs exporting. Elsewhere, create one at **Gitea →
|
||||
Settings → Applications → Generate New Token** and export it once per shell
|
||||
session:
|
||||
|
||||
```bash
|
||||
export GITEA_TOKEN='<paste-your-token>'
|
||||
```
|
||||
|
||||
## 1. Create the repository
|
||||
## 1. Cut the version
|
||||
|
||||
Bump `version` in the workspace `Cargo.toml`, update the `IMAGE_TAG` and
|
||||
`GIT_REF` defaults in `scripts/build-and-publish-unraid.sh`, add a line to the
|
||||
README changelog, and commit. Then tag:
|
||||
|
||||
```bash
|
||||
curl -s -X POST "https://gitea.milesward.dev/api/v1/user/repos" -H "Authorization: token $GITEA_TOKEN" -H "Content-Type: application/json" -d '{"name":"OpenMFA","description":"Self-hosted TOTP authenticator with live delivery to Discord, Slack or Telegram. Container-native Rust.","private":false,"auto_init":false}'
|
||||
git tag -a v0.1.1 -m "OpenMFA v0.1.1"
|
||||
```
|
||||
|
||||
The repo is public so Unraid can pull the image anonymously without registry
|
||||
credentials; the Gitea instance itself is not exposed beyond the LAN.
|
||||
Tags are `vMAJOR.MINOR[.PATCH]` — `v0.1`, `v0.1.1`, … — and the image carries
|
||||
the same number without the `v` (`0.1`, `0.1.1`) plus a moving `latest`.
|
||||
|
||||
## 2. Push the code and the tag
|
||||
|
||||
```bash
|
||||
cd "/Users/casperadmin/OpenMFA" && git -c "http.extraHeader=Authorization: token $GITEA_TOKEN" push -u origin main --follow-tags
|
||||
git push origin main --follow-tags
|
||||
```
|
||||
|
||||
That pushes `main` and the `v0.1` tag together.
|
||||
With a token in the environment rather than the keychain, prefix the command
|
||||
with `git -c "http.extraHeader=Authorization: token $GITEA_TOKEN"`.
|
||||
|
||||
## 3. Push the container image
|
||||
## 3. Build the image
|
||||
|
||||
The image is already built and tagged locally as
|
||||
`gitea.milesward.dev/mward4/openmfa:0.1` and `:latest`.
|
||||
The Dockerfile cross-compiles to `x86_64-unknown-linux-musl` from whatever
|
||||
architecture the builder runs on, so this is fast on Apple Silicon — no QEMU.
|
||||
`--provenance=false --sbom=false` matters: Unraid's Docker cannot load the
|
||||
attestation manifests BuildKit attaches by default.
|
||||
|
||||
```bash
|
||||
printf '%s' "$GITEA_TOKEN" | docker login gitea.milesward.dev --username mward4 --password-stdin && docker push gitea.milesward.dev/mward4/openmfa:0.1 && docker push gitea.milesward.dev/mward4/openmfa:latest && docker logout gitea.milesward.dev
|
||||
docker build --pull --platform linux/amd64 --provenance=false --sbom=false -f deploy/docker/Dockerfile -t gitea.milesward.dev/mward4/openmfa:0.1.1 -t gitea.milesward.dev/mward4/openmfa:latest .
|
||||
```
|
||||
|
||||
If the image isn't built (a fresh machine, say), `scripts/build-and-publish-unraid.sh`
|
||||
does the clone, build, login and push in one pass:
|
||||
## 4. Push the image
|
||||
|
||||
**Never run `docker login` or `docker logout` for `gitea.milesward.dev` on a
|
||||
Mac where git keeps the token in the keychain.** Docker's `osxkeychain`
|
||||
credential helper maps to the same keychain item as git's: `login` fails with
|
||||
"The specified item already exists in the keychain (-25299)", and `logout`
|
||||
silently deletes the credential git was using, so the next `git push` fails
|
||||
with a bare 401. Write the auth into a throwaway config instead — a config
|
||||
that already contains an `auths` entry makes the CLI skip the helper:
|
||||
|
||||
```bash
|
||||
export DOCKER_CONFIG="$(mktemp -d)" && printf '{"auths":{"gitea.milesward.dev":{"auth":"%s"}}}' "$(printf 'mward4:%s' "$GITEA_TOKEN" | base64 | tr -d '\n')" > "$DOCKER_CONFIG/config.json" && docker push gitea.milesward.dev/mward4/openmfa:0.1.1 && docker push gitea.milesward.dev/mward4/openmfa:latest; rm -rf "$DOCKER_CONFIG"; unset DOCKER_CONFIG
|
||||
```
|
||||
|
||||
On a Colima host, `export DOCKER_HOST="unix://$HOME/.colima/default/docker.sock"`
|
||||
first: an isolated `DOCKER_CONFIG` has no `currentContext`, and the CLI would
|
||||
otherwise look for `/var/run/docker.sock`.
|
||||
|
||||
On a fresh machine, `scripts/build-and-publish-unraid.sh` does the clone,
|
||||
build and push in one pass using that same private-config approach:
|
||||
|
||||
```bash
|
||||
GITEA_TOKEN="$GITEA_TOKEN" ./scripts/build-and-publish-unraid.sh
|
||||
```
|
||||
|
||||
## 4. Deploy on Unraid
|
||||
## 5. Verify the pull
|
||||
|
||||
The repo is public, so this needs no credentials — which is exactly how Unraid
|
||||
will fetch it:
|
||||
|
||||
```bash
|
||||
docker pull gitea.milesward.dev/mward4/openmfa:0.1.1
|
||||
```
|
||||
|
||||
## 6. Deploy on Unraid
|
||||
|
||||
Add a container with Repository set to:
|
||||
|
||||
```
|
||||
gitea.milesward.dev/mward4/openmfa:0.1
|
||||
gitea.milesward.dev/mward4/openmfa:0.1.1
|
||||
```
|
||||
|
||||
Since the package is in a private registry, add the Gitea credentials under
|
||||
Unraid's Docker → Registries first, or the pull will 401.
|
||||
|
||||
Map `/var/lib/openmfa` to `/mnt/user/appdata/openmfa`,
|
||||
publish port `8720`, and leave networking on bridge.
|
||||
|
||||
Or import `deploy/unraid/openmfa.xml` into
|
||||
(or `:latest`). Map `/var/lib/openmfa` to `/mnt/user/appdata/openmfa`,
|
||||
publish port `8720`, and leave networking on bridge. Or import
|
||||
`deploy/unraid/openmfa.xml` into
|
||||
`/boot/config/plugins/dockerMan/templates-user/` to get all of that prefilled.
|
||||
|
||||
To upgrade an existing container, change the tag and apply. The vault, key,
|
||||
settings and admin account all live in the appdata mount and carry over.
|
||||
|
||||
## Afterwards
|
||||
|
||||
Confirm the token isn't left lying around in your shell history:
|
||||
If a token was exported, make sure it is not left in the shell:
|
||||
|
||||
```bash
|
||||
unset GITEA_TOKEN
|
||||
|
||||
Reference in new issue
Block a user