Files
Echoion/.gitea/RELEASING.md
T
faumaray 697db046d3
Modular container CI / release-build (push) Has been cancelled
Release: harden multiline secret handling
2026-07-30 03:58:21 +03:00

14 KiB

Echoion releases on Gitea

Echoion release builds run only through scripts/release.sh, whose default mode builds, tests, validates, and packages inside containers/release.Dockerfile. The runner host only checks out sources and controls Docker; the workflow never starts echoiond.

One-time Gitea setup

The workflows target the standard ubuntu-24.04 label advertised by a default Gitea runner. No custom runner label is required. Use one trusted Linux AMD64 runner with capacity set to one so release and feed writes remain serialized on Gitea versions that do not implement workflow concurrency. The job image needs Bash, Git with SSH-signature support, OpenSSH client tools, Python 3.10 or newer, OpenSSL with Ed25519 support, coreutils, the Docker CLI, and access to a Docker daemon. The release builder itself remains containerized.

Every workflow starts by running docker version and docker info. These commands verify both the Docker client in the ubuntu-24.04 job image and access to the daemon before checkout, secrets, or a long release build are used. A runner installed as a container must have the host socket mounted:

services:
  runner:
    volumes:
      - ./data:/data
      - /var/run/docker.sock:/var/run/docker.sock

Leave container.docker_host at its generated default ("") so act_runner passes the detected Docker endpoint to job containers. Do not set it to -, which explicitly prevents that endpoint from being mounted. Restart the runner after changing its configuration. scripts/lib/docker-daemon-path.sh detects when commands run inside the job container and translates checked-out paths through that container's Docker mount table. The release wrapper and control-plane tests both use it because bind mount paths passed to the socket are resolved by the runner host daemon, not inside the Actions job container.

The shared scripts/lib/component-ssh.sh helper pins the current git.faumaray.ru RSA host key. Its verified fingerprint is SHA256:fugBYnqAnqmTLsGpafVgQF9gPQzJqps7uHvs48blg2A. If the Gitea SSH host key is intentionally rotated, verify the new fingerprint through an independent administrator channel and update the shared helper. Component Git commands use BatchMode=yes and strict host checking, so missing credentials or a changed host key fail instead of waiting for interactive runner input. Never work around a rotation by disabling strict host-key checking.

The Docker-capable runner executes only protected main pushes, manual runs, scheduled nightlies, and signed release tags. The container CI workflow does not run for pull requests because contributor-controlled scripts must not receive a privileged Docker socket or release checkout credentials. If pre-merge CI is required, register a separate ephemeral echoion-pr runner without release secrets or host-level Docker access and give it a dedicated workflow. A global runner such as the default installation shown in Gitea must only serve repositories you trust: a workflow with Docker-daemon access can control the runner host.

Enable Actions and configure these secrets:

Secret Scope Purpose
RELEASE_CHECKOUT_SSH_KEY Void organization Single-line base64 of the release-bot OpenSSH private key used to read every private component/dependency repository and to fast-forward the protected Echoion release-feed branch.
RELEASE_BOT_TOKEN Void organization PAT owned by a dedicated bot. It needs repository write scope for component releases and package write scope for the public organization registry. It does not need release-feed write access.
RELEASE_TAG_ALLOWED_SIGNERS Void organization Complete OpenSSH allowed_signers lines for maintainers allowed to publish v* tags.
RELEASE_FEED_ED25519_PRIVATE_KEY Void organization Single-line base64 of the Ed25519 PEM private key that signs component feeds.
RELEASE_FEED_GIT_SIGNING_KEY Void organization Single-line base64 of the OpenSSH private key that signs release-feed commits.
RELEASE_FEED_ED25519_PUBLIC_KEY Echoion repository PEM public key matching the component-feed signing key. It verifies independently published components without exposing signing authority to the product workflow.

Encode multiline private keys with base64 -w0 before storing them. This is a security requirement: the release scripts reject raw multiline private keys so runner environment diagnostics cannot disclose them. Keep the public RELEASE_TAG_ALLOWED_SIGNERS and RELEASE_FEED_ED25519_PUBLIC_KEY values in their documented text formats.

Root product checkouts use the public repository over HTTPS with persist-credentials: false. Independent workflows check out their current repository with Gitea's job token and the public Echoion release tools over HTTPS; their private component/dependency reads and release-feed push use the pinned SSH helper. Release API operations use the bot PAT. The component-feed private signing key must not be present in the Echoion product repository, Git, runner images, Actions variables, or release assets.

Independent component repositories

Echoion does not use Git submodules. components.json describes the nine independent repositories: EchoionApi, EchoionHost, EchoionCore, EchoionWeb, EchoionStandalone, EchoionUpdater, EchoionDesktop, EchoionPluginUrlShortenerInternal, and EchoionPluginUrlShortenerExternal. components.lock.json is the immutable release checkout manifest. All Gitea workflows check out the locked revisions as ordinary SSH repositories before entering Docker.

For a new developer checkout:

scripts/prepare-release.sh --workspace ..

For ordinary development CMake follows each component's main branch unless a CPM_<Component>_SOURCE override is supplied. Release builds use the exact lock. After changing a component, make a signed commit and push it over SSH first, then refresh and commit the root lock:

scripts/prepare-release.sh --workspace ..
git add components.lock.json cmake/DependencyLock.cmake
git commit -S -m 'Release: lock Echoion 2.0.0 components'

The preparer refuses dirty, inaccessible, missing, non-fast-forward, or version/tag-inconsistent component repositories, so a lock can never point at unpublished source. Product version changes are separate: edit only project(Echoion VERSION ...) in root CMakeLists.txt; orchestrated component builds and release overrides inherit that value. A stable or beta release tag must have the same numeric base as this CMake version, so v2.0.0 and v2.0.0-rc.1 both require project(Echoion VERSION 2.0.0 ...). The release workflow rejects mismatches before building.

scripts/prepare-release.sh regenerates components.lock.json. When VoidLibrary or VoidTeamspeak advances, update its exact pushed commit in cmake/DependencyLock.cmake in the same lock commit.

Nightlies use the newer of the root CMake version and the next patch after the latest published release. This prevents a stale CMake value from producing a version rollback while still allowing a single CMake edit to move nightlies to a newer minor or major release line.

Create an orphan release-feed branch containing a tracked feeds/ directory, then protect it so only the release bot can push. Protect the v* tag pattern so only the release maintainers represented by RELEASE_TAG_ALLOWED_SIGNERS can create, update, or delete matching tags. The workflow requires the exact v* rule to have an explicit non-empty user or team allowlist. Configure it under repository Settings → Tags → Protected tags; a similar pattern such as v*.* does not satisfy the release check. Gitea uses the same allowlist for tag creation and later tag changes; when immutable release tags are required, add a server-side pre-receive policy that rejects updates and deletion after creation. Protect main in the normal way.

The updater source can use the feed base:

https://<gitea>/<owner>/<repo>/raw/branch/release-feed

or an exact channel catalog:

https://<gitea>/<owner>/<repo>/raw/branch/release-feed/feeds/stable/catalog.json

The catalog resolves immutable component documents under feeds/<channel>/<component>/<version>.json and plugin documents under feeds/<channel>/plugins/<plugin-id>/<version>.json. The embedded updater trust configuration is represented by .gitea/release-keys/official-update-keys.json. scripts/release.sh validates and embeds that JSON automatically. Release workflows also pass the HTTPS channel catalog through --official-update-feed-url, so a fresh installation has a signed official source without operator-side duplication. The v1 feeds/echoion-runtime.json feed is not published at the 2.0 cutover; v1 operators must stop their service and run the signed v2 installer manually.

Stable and beta releases

Create an annotated SSH-signed tag. A version without a prerelease suffix goes to stable; any strict SemVer prerelease goes to beta. First set the product version in the root CMakeLists.txt, commit it, and use the same numeric base for the tag:

git config gpg.format ssh
git config user.signingkey ~/.ssh/echoion-release-maintainer
git tag -s -a v2.0.0 -m 'Echoion 2.0.0'
test "$(git cat-file -t refs/tags/v2.0.0)" = tag
git push origin v2.0.0

The private-key path works without an SSH agent. A .pub path may be used instead when its matching private key is already loaded in ssh-agent.

.gitea/workflows/release.yml rejects a lightweight tag, a non-SSH signature, an untrusted signer, a repository without the exact v* protected tag rule and explicit allowlist, a non-SemVer name, an event object unrelated to the tag, or a checkout whose commit differs from the signed tag target. Release notes contain the signed tag subject and body but not its SSH signature armor.

The workflow creates or resumes a draft, replaces incomplete draft assets, uploads every file in dist/, downloads every asset through Gitea, checks its size and SHA-256, and only then publishes. A rerun against an already published release is read-only and succeeds only when all remote assets still match. The signed catalog and all component feeds are committed together after release publication; a feed failure can therefore be retried without replacing a published release.

Nightly releases

.gitea/workflows/nightly.yml runs at 02:17 UTC and can also be dispatched manually. The highest published vMAJOR.MINOR.PATCH release supplies the next patch as MAJOR.MINOR.(PATCH+1)-nightly.YYYYMMDD.RUN_NUMBER. With no published semantic release, nightlies use the root CMake project(Echoion VERSION x.y.z) value without incrementing it. Drafts, failed publications, and nightly-* releases do not affect the base. Nightlies use the nightly channel, publish as prereleases, and keep the newest 14 Gitea releases. Channel catalogs remain separate, and nightly publication never advances stable component state. Gitea materializes a missing nightly-* Git tag only when the download-verified draft is published; the publisher then verifies its commit immediately and never moves an existing tag whose target differs. Stable and beta publishing require their signed tag to exist before creating a draft. If nightly-* is protected separately, allow the release bot to create and delete it.

Every rolling catalog and latest.json envelope expires 45 days after generation. Scheduled nightlies normally refresh it daily. Alert when the feed branch has not advanced for more than seven days, and treat 30 days without a successful signing run as urgent.

Feed key custody and rotation

The active component-feed public key id is echoion-component-release-2026-07-30-r2. The superseded echoion-component-release-2026-07-30 key is intentionally absent because its private material was revoked before any feed publication. The older echoion-component-release-2026-07 and echoion-release-2026-07 keys remain embedded for compatibility. To rotate, generate the private key on a trusted operator machine:

umask 077
openssl genpkey -algorithm ED25519 -out echoion-release-YYYY-MM.pem
openssl pkey -in echoion-release-YYYY-MM.pem -pubout \
  -out echoion-release-YYYY-MM.pub.pem

The PEM public key contains an RFC 8410 SubjectPublicKeyInfo wrapper. The ed25519 field in release-keys/official-update-keys.json must instead contain the standard Base64 encoding of only the raw 32-byte public key. Derive that value with:

openssl pkey -pubin -in echoion-release-YYYY-MM.pub.pem -outform DER |
  tail -c 32 |
  base64 -w0
printf '\n'

Add the new public key to official builds before signing any feed with it and keep the old public key embedded for at least one full update lifetime. Update the signing key id in component release workflows and replace their private-key secret only after the build containing both trust roots is installed broadly. Replace the product workflow's public-key secret at the same cutover. Immutable version feeds are never rewritten during rotation. Never print the private key or pass it as a command-line argument.

Recovery rules

  • A failed build creates no Gitea release.
  • A failed upload leaves a draft. Rerun the same workflow to replace the partial draft assets.
  • A failed verification never publishes the draft.
  • A published release with mismatched assets is immutable; investigate and create a new version instead of replacing it.
  • A failed feed push leaves the published release available but undiscoverable to auto-update. Rerun the workflow; publication verification is idempotent and the feed step will run again.
  • Never edit release-feed manually. The publisher validates immutable version feeds, replay sequences, and component state before committing the complete transaction.