# 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. 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: ```bash export GITEA_TOKEN='' ``` ## 1. Create the repository ```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}' ``` The repo is public so Unraid can pull the image anonymously without registry credentials; the Gitea instance itself is not exposed beyond the LAN. ## 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 ``` That pushes `main` and the `v0.1` tag together. ## 3. Push the container image The image is already built and tagged locally as `gitea.milesward.dev/mward4/openmfa:0.1` and `:latest`. ```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 ``` 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: ```bash GITEA_TOKEN="$GITEA_TOKEN" ./scripts/build-and-publish-unraid.sh ``` ## 4. Deploy on Unraid Add a container with Repository set to: ``` gitea.milesward.dev/mward4/openmfa:0.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 `/boot/config/plugins/dockerMan/templates-user/` to get all of that prefilled. ## Afterwards Confirm the token isn't left lying around in your shell history: ```bash unset GITEA_TOKEN ```