35 Commits
Author SHA1 Message Date
wweir 3c869cd32d fix(sowerd): give the service a soft heap ceiling on every install path
The 2026-10-12 OOM killed the host, not the service: sowerd had no memory
ceiling anywhere while the sower client has had SOWER_MEMORY_LIMIT_MB since
d0031e4. Put a GOMEMLIMIT on the unit the installer writes and on the
packaged unit, so a runaway heap degrades sowerd instead of OOM-killing the
machine it runs on. kr already carries the same value through a drop-in.
2026-10-12 17:58:08 +08:00
wweir 80dfa072e9 fix(ci): build the release binaries before copying packaging files in
Every published artifact was stamped `vcs.modified=true` with module version
`+dirty` (verified on v1.6.1, v1.6.2 and v1.7.0): the packaging step copies
`.github/sower.toml` and the service files into the repository root, and the
toolchain records the worktree state at build time. sowerd.service is neither
tracked nor ignored, so the tree was dirty before the compiler ran. Kr's edge
deployment rule ("confirm vcs.modified=false") was therefore unsatisfiable
from a release artifact, and the binary could not be held to any commit.

Move the copies and the tarball into a Package step that runs after the build.
Verified locally: building this commit on a clean tree reports `v1.7.0` with
vcs.modified=false, while copying one service file in first reproduces
`v1.7.0+dirty` — the same experiment the next tag re-runs end to end.
2026-10-12 15:58:09 +08:00
wweir f37e5fa758 feat(install): add a one-shot installer for systemd, procd and launchd
Installing sower meant grabbing a tarball and wiring the service up by hand,
and the packaged unit was too fragile for something a resolver depends on
(on-failure restart after 1min, no memory limit).

Add install.sh: detects the platform and init system, installs or upgrades
the binary atomically, keeps an existing config, verifies the release
SHA256SUMS unless explicitly opted out, and registers the service on systemd,
OpenWrt procd or macOS launchd. Every network call carries an explicit
timeout, the OpenWrt init script ships in Linux tarballs, the release
workflow generates SHA256SUMS, the README documents the installer, and
make test syntax-checks the scripts.
2026-09-18 22:53:55 +08:00
wweir d0031e4106 fix(sower): keep the soft heap limit above the live rule heap
The default 128 MiB soft memory limit sits below the ~105 MB live heap the
full pexcn rule sets build, so the GC goal gets pinned to the live heap and
every allocation triggers a full-heap mark: measured 39% CPU on an otherwise
idle gateway with a GC cycle every 300-500 ms.

Raise the default to 512 MiB, resolve the limit in a testable helper that
covers GOMEMLIMIT/override/disable precedence, and declare the same value in
the packaged service plus the example configs so a deployment can tune it
without a rebuild.
2026-09-18 22:37:03 +08:00
wweir 44b7eefe91 ci(release): copy every matrix service file from .github
matrix.service lists space-separated file names ("sower.service
sowerd.service"), but the .github/ prefix only applied to the first,
so every Linux job failed with 'cannot stat sowerd.service' in
Prepare packaging files. Broken since 1e44871; first exercised by
the v1.6.0 tag. Loop over the list and prefix each file individually.
2026-09-18 18:16:00 +08:00
wweir 1e4487193c ci(release): build per-arch matrix with aggregated release job
- replace hand-rolled make build loop with a strategy.matrix across 11
  targets: linux (amd64, arm64, armv7, riscv64, loong64, mips, mipsle),
  darwin (amd64, arm64), windows (amd64, arm64)
- add dedicated web job so the admin console is built once and reused
- aggregate all tarballs in a single release job to avoid concurrent
  release edits from matrix jobs
- drop stale sower.yaml references (config is TOML-only) and the
  bun-less make build that would fail on runners
2026-08-11 14:32:45 +08:00
wweir 52f9205e6a refactor(config): drop YAML support, keep TOML only 2026-08-10 16:17:11 +08:00
wweir 4c3d4e399e ci: checkout before setup-go to enable module cache 2026-08-09 21:34:08 +08:00
wweir b77925d22e chore(deps): update go, web and CI dependencies 2026-08-09 21:31:15 +08:00
wweir ffc631adaa fix(ci): install bun before building web assets 2026-08-09 21:19:07 +08:00
wweir 0ef0686530 chore(release): package toml client configs 2026-04-25 03:20:41 +08:00
wweir 71eede9460 fix: align example config with snake case loader 2026-03-31 07:46:32 +08:00
wweir 53b1de41d0 Update sower.service to use -c option for config file 2025-08-16 11:03:31 +08:00
wweir eadb2f0bdf fix: sync example config with codes 2024-09-23 19:09:22 +08:00
wweir ac09663bc4 feat: multi ips, change default config 2024-05-14 14:06:46 +08:00
wweir 0c83462b91 chore: update dependencies 2024-05-08 13:36:21 +08:00
wweir 2948ffb7db feat: add yaml example config 2022-06-03 08:18:13 +08:00
wweir 3412643b6e feat: add restart policy 2022-05-16 07:28:29 +08:00
wweir 78d36b0c19 feat: change default config for safety 2022-04-30 16:13:53 +08:00
wweir a86de61a45 chore: add default config and service scripts 2021-11-10 20:08:46 +08:00
wweir ffca4220d6 chore: fix cicd 2021-11-10 19:27:35 +08:00
wweir dabcf998c9 fix windows release binary 2021-09-09 08:09:59 +08:00
wweir 133684e5d2 update golang version 2021-08-18 13:16:52 +08:00
wweir cfc1afb710 change architecture diagram 2021-08-09 08:30:38 +08:00
wweir 5cf8df2a7a change binary name 2021-07-19 16:02:26 +08:00
wweir 585cc01744 update depency 2021-07-18 00:48:39 +08:00
wweir 8307128844 refactor, start v0.8 2021-07-17 08:05:02 +08:00
wweir 291ae3f85a Optimize CI workflow 2020-03-21 11:51:12 +08:00
wweir 90c497b8da Optimize router 2020-03-21 10:50:41 +08:00
wweir c38d519f92 Fix CI 2020-02-17 09:07:01 +08:00
wweir 85226890c5 Support run as system service 2020-02-16 05:57:44 +08:00
wweir 1a24286bbc Refactor to tls 2020-02-15 15:52:15 +08:00
wweir cbe943a020 Migrate ci from circleci to github actions 2019-09-26 07:52:29 +08:00
wweir acb3f58526 Update go.yml 2019-09-11 19:01:24 +08:00
wweir 50684272c9 Update go.yml 2019-09-11 18:13:48 +08:00