Imported from kodx/sui-control (
AGENTS.md). Install upstream withnpx skills add kodx/sui-control. Copyright stays with the author.
SUI-Control — Agent instructions
Build & verify
- Build:
bash build/build.sh→ producessui-control-install.sh(available in GitHub Releases). Run wheneverlib/,templates/, orsui-control.shchanges. - Debian package:
bash build/build.sh deb→ builds.debtobuild/artifacts/. Use--localfor Docker-based build. VERSIONis a build artifact, not a tracked file:build/build.shwrites$PROJECT_DIR/VERSION(gitignored) from the currentv*tag during every build. Do not commit it; the deb packaging andsui-control.shread it after a build.- Version bump:
bash build/bump-version.sh <major|minor|patch>— bumps semver, creates annotated tag. Add--dry-runto preview. - Pre-commit:
.githooks/pre-commitruns shellcheck on staged.shfiles and actionlint on workflows. Set up viagit config core.hooksPath .githooks. build.shalso runs shellcheck on source files and the built artifact. A failing build means shellcheck errors.
Architecture
- Two entry points:
sui-control.sh(development/manager) andsui-control-install.sh(self-contained installer, available from GitHub Releases) - FHS layout:
- Package (
lib/,templates/,sui-control.sh;VERSIONgenerated at build time): auto-detected from$(dirname "$(realpath "$0")"), or/opt/s-uiwhen installed - Config:
/etc/sui-control/sui-control.conf - Runtime data:
/var/lib/sui-control/(bin/,db/,cert/,acme/,systemd/)
- Package (
- Init system abstraction:
install_renewal_timer/remove_renewal_timerdispatch to 5 backends (systemd, OpenRC, runit, s6, dinit). Non-systemd backends create cron job for renewal. - Service commands (
start,stop,restart) allowsui-control.shto be used as a system service script by any init system.
Conventions
templates/*.conf.tpl: no SPDX (config template, not a script)lib/*.sh: no shebang (sourced), SPDX header (GPL-3.0-or-later)sui-control.sh:#!/usr/bin/env bash, readsVERSIONat runtime, setsPACKAGE_DIRbuild/build.sh:#!/usr/bin/env bash, writes theVERSIONfile at the project root (gitignored) from the currentv*tag or defaults to0.0.0-dev, and embeds it asreadonly BUILT_VERSION# shellcheck disable=SCxxxxon specific lines only; file-wide only for cross-file variables (SC2034, SC2154, SC2153 in built artifact)- ACME:
--domainfor FQDN (~90-day cert, weekly timer),--ipfor IP (~6-day cert, daily timer). Mutually exclusive. - Self-signed cert mode handled entirely by
generate_self_signed_cert()in actions.sh; no ACME interaction. - Docker images (
SUI_IMAGE,CURL_TEST_IMAGE,ACME_IMAGE) default to:latestintentionally — they are overridable viasui-control.conf. Pinning is left to the user. - GitHub Actions:
actions/checkout@v7— bump when newer major versions are released
Commits
- Types: feat:, fix:, build:, chore:, ci:, docs:, perf:, refactor:, style:, test:, revert:
- Format:
type: short description+ blank line + bullet points - Always show the proposed message for approval first. Never push.