Signed-off-by: faumaray <faumaray@gmail.com>
This commit is contained in:
faumaray committed 2026-07-25 23:44:48 +03:00
1 parent 639362fbf5
commit bdd69f0aad
101 files changed
+22691 -531

No files matched your search

+91 -15
View File
@@ -56,6 +56,12 @@ Docker is the only host requirement for the default release command:
scripts/release.sh --version 1.2.3
```
When validating coordinated, not-yet-published dependency changes, pass
`--void-source ../VoidLibrary --void-teamspeak-source ../VoidTeamspeak`. The
container builder mounts those source trees read-only and still builds into a
clean directory; normal published releases omit the overrides and use the
version-pinned dependencies.
It builds with a version-pinned GCC 16/FFmpeg 8.0.3 toolchain on Ubuntu 22.04,
runs the C++ and frontend test suites, installs into a clean staging tree,
bundles dynamic dependencies, validates the ELF closure with `readelf`, and
@@ -127,18 +133,24 @@ and leaves the unit disabled and stopped; add `--start` to enable and start it.
Every installation uses immutable `versions/<version>/` payloads and an atomic
`current` symlink. Configuration is created once and is not overwritten by an
upgrade. The standard mutable paths are:
upgrade. The default `self-contained` layout keeps everything needed by the bot
under one prefix:
| Mode | Configuration | State, database, logs, cache and temporary files |
|---|---|---|
| user/portable with no or user service | `$XDG_CONFIG_HOME/echoion` | `$XDG_STATE_HOME/echoion` |
| system/portable with system service | `/etc/echoion` | `/var/lib/echoion` |
| self-contained | `<prefix>/config` | `<prefix>/data` |
| Path | Contents |
|---|---|
| `<prefix>/versions/<version>` | immutable executable, Core, shared libraries, web assets, service templates, and manifest |
| `<prefix>/current` | atomic link to the selected immutable version |
| `<prefix>/libexec/updater/<installer-version>` | installer-managed helper plus its private dynamic library closure; never selected through `current` |
| `<prefix>/config` | configuration |
| `<prefix>/state` | identity, database, update journals, and durable state |
| `<prefix>/cache`, `<prefix>/logs`, `<prefix>/incoming` | cache, logs, and operator-supplied local update input |
Override them with `--config-dir` and `--state-dir`. In a self-contained
portable install, runtime code, web assets, config, identity, database,
extensions, logs, downloaded helpers, cache, and temporary audio all remain
below the selected prefix.
Select `--data-layout standard` to use conventional external mutable paths:
`$XDG_CONFIG_HOME/echoion`, `$XDG_STATE_HOME/echoion`, and
`$XDG_CACHE_HOME/echoion` for a user service, or `/etc/echoion`,
`/var/lib/echoion`, `/var/cache/echoion`, and `/var/log/echoion` for a system
service. `--config-dir` and `--state-dir` remain available as explicit
overrides.
A self-contained portable install also creates `<prefix>/echoion`; use that
launcher instead of invoking `current/bin/echoiond` directly. It derives the
@@ -147,9 +159,34 @@ can be moved as one folder and run from the new path. If a portable service was
registered, uninstall or re-register its unit before moving the tree because
systemd stores an absolute executable path.
The installer executes only the daemon's offline `--validate-install` mode to
verify every immutable file, symlink, mode, and SHA-256 before switching
`current`; it does not initialize the TeamSpeak client or load Core.
The installer does not execute `echoiond`, `Echoion.ts`, plugins, or the updater.
Its standalone manifest validator verifies every immutable file, symlink, mode,
and SHA-256 before switching `current`. Service registration renders both the
bot unit and a hardened local updater timer, but leaves them disabled and
stopped unless `--start` is supplied.
### Updates
The daemon checks signed feeds and applies independent policies for the runtime
bundle, Core, and managed plugins. Each component can select its own source URL
and channel through the `updates` object in `config.json`; bearer tokens are
read only from named environment variables. HTTPS is required for remote custom
sources. A `file://` source is accepted only below the installation's managed
`incoming` directory.
The privileged updater helper never downloads content and never launches the
bot. For a system service, the timer executes a fixed root-owned helper bundle
below `<prefix>/libexec/updater/`; both its executable and dynamic libraries are
independent of the candidate-controlled `current` link. The helper consumes fixed-schema local
requests, validates a staged runtime into a new immutable version, atomically
changes `current`, and leaves a durable health journal. The new daemon must run
successfully for 30 seconds before its commit request makes the version healthy.
Helper passes inside the durable grace period leave the candidate pending, and
a matching commit request is processed before rollback. After the deadline, an
unconfirmed candidate is restored to the previous version and recorded as
failed. `retainHealthyVersions` keeps the active version plus the configured
number of previously committed healthy versions; interrupted or failed
candidates do not consume that rollback allowance.
To remove an install, run `<prefix>/uninstall.sh`. Configuration and state are
preserved by default. Add `--purge` to remove directories that this installer
@@ -258,8 +295,9 @@ directories, verifies the bundle's v2 whole-payload manifest, copies the full
runtime tree, and then renames `pending-release.json` into place. The running
daemon validates every declared file in a child process, checkpoints Core
state, disconnects cleanly, and re-execs the staged binary. The installer does
not enable this development watcher; installed upgrades are performed by
running the new `.run` artifact against the same prefix.
not enable this development watcher; installed upgrades are performed by the
signed updater. Running a new `.run` artifact against the same prefix remains
the offline/manual upgrade path.
### Adding Commands
@@ -295,6 +333,44 @@ contains:
- the external v2 manifest and ELF dependency report;
- `SHA256SUMS` for all published artifacts.
Pass `--update-url` to emit a matching unsigned runtime feed payload, with
optional `--update-channel`, `--update-feed-id`, and `--update-sequence`
overrides:
```bash
scripts/release.sh --version 1.2.3 \
--update-url https://updates.example.org/echoion-1.2.3-linux-x86_64.tar.zst \
--update-channel stable --update-sequence 123
```
Production feeds should be wrapped in an Ed25519 envelope. The generator signs
the exact payload bytes and never places the private key in the release. It
generates runtime feeds by default; use `--component core` for a Core shared
library or `--component plugin --artifact-id ID` for a managed plugin. Core and
plugin feeds do not require a runtime release manifest:
```bash
scripts/generate-update-feed.py \
--artifact dist/echoion-1.2.3-linux-x86_64.tar.zst \
--manifest dist/echoion-1.2.3-linux-x86_64.manifest.json \
--version 1.2.3 \
--url https://updates.example.org/echoion-1.2.3-linux-x86_64.tar.zst \
--sequence 123 \
--output-payload dist/echoion-1.2.3.update-payload.json \
--output-envelope dist/echoion-1.2.3.update.json \
--key-id production-2026 --private-key /secure/echoion-update.pem
```
For example, a plugin feed can be produced independently:
```bash
scripts/generate-update-feed.py \
--component plugin --artifact-id lyrics \
--artifact dist/lyrics-2.0.0.so --version 2.0.0 \
--url https://updates.example.org/plugins/lyrics-2.0.0.so \
--output-payload dist/lyrics-2.0.0.update-payload.json
```
The archive and installer contain the same relocatable dynamic payload. They do
not depend on DEB/RPM metadata or static linking, so one build can be installed
on the supported Ubuntu, Debian, and Arch targets.