Commit Graph

53 Commits

Author SHA1 Message Date
joshp123
280744ce0c infra: slim clawdinators aws footprint
What:
- bound CLAWDINATOR image artifact retention with S3 lifecycle, AMI pruning, and import provenance tags
- reduce the AWS fleet to Babelfish-only and make GitHub credentials opt-in per host
- disable the AMI build, nix-openclaw bump, and release workflows by moving them out of .github/workflows/
- update operator docs for the new explicit build and deploy model

Why:
- stop unbounded S3 and snapshot growth from image builds
- remove unattended resurrection paths and shut down the unused t3.large instances
- keep the remaining Babelfish host running without GitHub App credentials or sync timers

Tests:
- `nix shell nixpkgs#shellcheck nixpkgs#shfmt -c bash scripts/lint-shell.sh` (pass)
- `nix build .#nixosConfigurations.clawdinator-babelfish.config.system.build.toplevel .#nixosConfigurations.clawdinator-1.config.system.build.toplevel .#nixosConfigurations.clawdinator-2.config.system.build.toplevel` (pass)
- `AWS_PROFILE=homelab-admin TF_VAR_aws_region=eu-central-1 TF_VAR_ami_id=ami-0a9abe17feeee0079 TF_VAR_ssh_public_key="$(cat ~/.ssh/id_ed25519.pub)" nix shell nixpkgs#opentofu -c sh -lc 'tofu fmt -check && tofu validate'` (pass)
- live AWS apply: destroyed `clawdinator-1` and `clawdinator-2`, replaced Babelfish, and verified only `Fleet Deploy` remains active in GitHub Actions
2026-04-03 15:38:57 +02:00
joshp123
eb3c79c5f5 Add version introspection tool + build info
Expose pinned component revs via /etc/clawdinator/build-info.json and ship a clawdinator-version helper script (logic lives in scripts/, not inline in Nix).

This supports fleet consistency checks and maintainer introspection.
2026-02-15 15:45:00 -08:00
joshp123
d7df4f0e13 Fix openclaw-gateway unit override merge
Remove conflicting systemd unit description override; keep only after/wants deps.
2026-02-15 15:03:56 -08:00
joshp123
fda12f98cb Use nix-openclaw NixOS module for gateway service
- Import nix-openclaw nixosModules.openclaw-gateway
- Replace custom systemd gateway service with upstream module
- Let upstream module own /etc/clawd/openclaw.json generation

This reduces duplication between clawdinators and nix-openclaw and aligns config merge semantics.
2026-02-15 14:56:00 -08:00
joshp123
c0794f84e2 Deep-merge OpenClaw config to avoid per-host clobber
Replace configFragments with a deep-merged config option type so host overrides (e.g. disabling telegram) don't drop sibling keys like channels.discord.

clawdinator-2: disable telegram; keep discord.
2026-02-15 14:24:54 -08:00
joshp123
e5e959f90a CI concurrency + deep-merge config fragments; fix clawdinator-2 channels
- Cancel in-progress image builds on new pushes (concurrency)
- Add services.clawdinator.configFragments for deep-merge tweaks
- Use configFragments in clawdinator-2 to disable telegram without clobbering discord

No host changes; intended to ship via next AMI build.
2026-02-15 13:33:38 -08:00
joshp123
5f99924bd1 Fix public S3 publisher service PATH
Include bash in systemd unit PATH so sync script runs on NixOS.
2026-02-15 12:45:24 -08:00
joshp123
ffb27ab614 Public PR intent S3 bucket + publisher timer
- Provision public S3 bucket (anonymous list/get) for PR intent artifacts
- Grant instance role PutObject and add NixOS systemd timer to publish /memory/pr-intent
- Default agent thinking level to high for GPT-5.2/Codex
- Make OpenTofu instance management explicit (manage_instances) to prevent accidental fleet destroy

Tests: not run (infra/Nix changes)
2026-02-15 12:44:11 -08:00
Josh Palmer
0456fa91ec infra: avoid amazon-init bootstrap deadlock
- drop amazon-init ordering for clawdinator-bootstrap

- wait on fetch-ec2-metadata when available
2026-02-03 17:43:09 -08:00
Josh Palmer
1384ee7b47 infra: restore ec2 user-data fetch
- add fetch-ec2-metadata service for AMI bootstrap

- set git safe.directory for nixos-rebuild

- note clawdinator-2 recovery in ops
2026-02-03 16:36:21 -08:00
Josh Palmer
05d43b1926 infra: add fleet control api + multi-instance
- add control API Lambda + fleet deploy workflow
- introduce instances registry + common host config
- add fleet control skill + scripts
- update bootstrap bundles + secrets docs
- wire OpenTofu for multi-instance + user-data
2026-02-03 01:20:23 +01:00
Josh Palmer
c373a14bb4 🤖 infra: lock telegram allowlist + close gateway ingress
What:
- add telegram allowFrom secret wiring in the Nix module + host configs
- enforce Telegram DM allowlist and disable group traffic
- drop public gateway ingress (SG + firewall)
- document telegram secret handling and update ops memory

Why:
- restrict Telegram access to a single maintainer
- remove unnecessary public exposure for the gateway port
- keep secret wiring explicit in docs

Tests:
- nix flake check
2026-02-03 00:07:33 +01:00
Josh Palmer
fbd6dc2118 Seed pi auth.json from agenix keys
- add pi-auth script to build auth.json at runtime
- wire clawdinator-pi-auth service after agenix

Tests: not run (config/script only)
2026-02-02 17:08:44 +01:00
Josh Palmer
8a1deeed09 Add pi coding agent tool + settings
- package pi-coding-agent with a vendored lockfile
- add pi to toolchain and expose settings file via tmpfiles
- seed pi defaults to match local model choices

Tests: nix build --no-link --impure --expr 'let pkgs = import <nixpkgs> {}; in pkgs.callPackage ./nix/tools/pi-coding-agent.nix {}'
2026-02-02 16:47:40 +01:00
Josh Palmer
2b97a7afce infra: enlarge host + add swap + set git identity
- set default instance type to t3.large
- add 8GiB swapfile on host
- set global git name/email for clawdinator user
2026-02-01 17:36:11 +01:00
Josh Palmer
2f6b950eb8 fix: ensure github token env path writable for clawdinator
- enforce /run/clawd ownership via tmpfiles z rule
- precreate + chown github-app.env
2026-02-01 12:30:43 +01:00
Josh Palmer
2320639342 fix: allow gh token refresh without sudo
- run github-app-token service as clawdinator user
- add clawdinator-gh-refresh command + tools note
- move canned-response guardrails to workspace AGENTS
2026-02-01 12:04:16 +01:00
Josh Palmer
3975a6485c fix: gh config perms for clawdinator user
- chown -R /var/lib/clawd/gh after gh auth login
- ensure config.yml readable by clawdinator
- prevents gh auth/config permission errors
2026-02-01 00:29:54 +01:00
Josh Palmer
c0022322d6 fix: use correct gateway binary name
Use  (openclaw if present, else moltbot) in
clawdinator-gateway wrapper and ExecStart fallback.
Prevents exit 127 when openclaw binary is renamed.
2026-01-31 23:52:01 +01:00
Josh Palmer
b7efe5017b fix: keep gh auth fresh without env tokens
- Write GH CLI auth file (/var/lib/clawd/gh/hosts.yml) on token refresh
- Set GH_CONFIG_DIR for the gateway service
- Stop injecting GH_TOKEN into clawdinator service env
- Document GH CLI auth file in docs/SECRETS.md
2026-01-31 23:36:20 +01:00
Josh Palmer
8470c3c5c2 fix: prevent GitHub token expiry mid-session
- Change token refresh from hourly to every 45 min (tokens expire at 1h)
- Restart clawdinator service after token refresh so the process
  picks up the new GH_TOKEN from the env file
- Root cause: bot reads GH_TOKEN at startup, never re-reads
2026-01-31 23:23:04 +01:00
Josh Palmer
52d9b34693 🔄 rebrand: update to openclaw packages + config
Update to nix-openclaw 9d8bafc4 with renamed packages.

- Packages: moltbot-gateway → openclaw-gateway, moltbot → openclaw
- Binary: bin/moltbot → bin/openclaw
- Config: moltbot.json → openclaw.json
- Log: moltbot.log → openclaw.log
- Zero moltbot references remaining in repo.

Tests: not run (CI will validate flake eval + AMI build)
2026-01-30 14:35:26 +01:00
Josh Palmer
c2c3bf4f46 🔄 rebrand: moltbot → openclaw, clawdinators
Rename org references from moltbot to openclaw across all config, docs,
CI workflows, flake inputs, secret names, and repo seeds.

Mapping:
- org: moltbot → openclaw
- repos: moltinators → clawdinators, nix-moltbot → nix-openclaw, molthub → clawhub
- secrets: moltinator-* → clawdinator-*
- flake input: nix-moltbot → nix-openclaw
- GH repos renamed: openclaw/nix-openclaw, openclaw/clawdinators

Upstream package/binary names (moltbot, moltbot-gateway, moltbot.json)
kept as-is — those come from nix-openclaw and haven't been renamed yet.

Tests: not run (rename-only change; CI will validate flake eval)
2026-01-30 14:30:46 +01:00
Josh Palmer
b9b3ad6ffe 🤖 ops: sync openclaw org
Set githubSync org default to openclaw and override on clawdinator-1.
Make gh-sync headers reflect configured org.

Tests: not run (config change)
2026-01-30 12:15:37 +01:00
Josh Palmer
682523d829 🤖 nix: give clawdinator a shell
Set the system user shell to bash so exec/memory wrappers can run.

Tests: not run (requires CI image build)
2026-01-30 09:49:03 +01:00
Josh Palmer
78f57df5a8 🤖 chore: move to moltbot upstream + sync tooling
What:
- swap nix-moltbot inputs, packages, and workflow automation
- update secrets wiring, repo seeds, and org references for moltbot
- fix self-update path and moltbot config/log defaults

Why:
- align infra with moltbot rename and new packaging
- restore update pipeline + consistent bootstrap artifacts

Tests:
- ./scripts/build-image.sh (fails: /build chmod permission on darwin)
2026-01-28 18:36:10 +01:00
Josh Palmer
68eb171c87 fix: make clawdinator-agenix oneshot idempotent 2026-01-10 23:26:10 +01:00
Josh Palmer
24aa7c9012 fix: chown agenix secrets after install 2026-01-10 23:00:28 +01:00
Josh Palmer
dbc56ac55d fix: avoid system build recursion in post-bootstrap agenix 2026-01-10 22:16:46 +01:00
Josh Palmer
10939b4076 fix: run agenix after bootstrap 2026-01-10 22:13:26 +01:00
Josh Palmer
b54c71288e fix: guard agenix install without exiting activation 2026-01-10 19:23:00 +01:00
Josh Palmer
1fe52774dc fix: skip agenix install when secrets missing 2026-01-10 19:13:31 +01:00
Josh Palmer
a809f29154 fix: tolerate missing agenix secrets in image build 2026-01-10 19:00:07 +01:00
Josh Palmer
3ac78341af Fix systemd wants list for bootstrap 2026-01-10 17:06:52 +01:00
Josh Palmer
a7106d3072 Move secrets + repo seeds to runtime bootstrap 2026-01-10 17:04:18 +01:00
Josh Palmer
697f843c3f ci: enable garnix cache + update nix-clawdbot 2026-01-10 14:24:34 +01:00
Josh Palmer
3a79cbe6ba Add OpenAI key wiring for clawdinator 2026-01-09 01:24:04 +01:00
CLAWDINATOR
9b79df7a51 feat(cron): add hourly heartbeat job
- Add cron-jobs.json with heartbeat job (hourly)
- Add cronJobsFile option to clawdinator module
- Deploy cron jobs file to /etc/clawd/cron-jobs.json
- Configure cron.store to use deployed file
2026-01-09 00:04:22 +00:00
CLAWDINATOR
956fdcdc5e fix(nix): add toolchain packages to clawdinator service path
Service PATH only had coreutils/git/rsync. Toolchain (gh, curl, jq, etc.)
was in environment.systemPackages but not in the service's path, so the
gateway couldn't use them.

Adds toolchain.packages to systemd service path.
2026-01-08 22:47:12 +00:00
Josh Palmer
a7e0c038e1 Bake repo seeds into image build 2026-01-08 23:21:58 +01:00
Josh Palmer
d1b9620bfb Allow clawdinator to read GitHub app token env 2026-01-08 21:59:09 +01:00
Josh Palmer
1ef5b556b0 Fix EFS memory permissions and expose memory tools 2026-01-08 19:11:35 +01:00
Josh Palmer
f33262cd79 Add bash to github sync service path 2026-01-08 18:49:03 +01:00
Josh Palmer
8766cc9588 Seed workspace dirs and harden github sync 2026-01-08 17:54:35 +01:00
Josh Palmer
557c9d411d 🤖 Add triage skill + GitHub sync for maintainer bot
What:
- Add `triage` skill for Now/Next/Later priority summaries
- Add `gh-sync.sh` script to fetch PRs/issues from clawdbot org
- Add systemd timer for periodic GitHub sync (every 15 min)
- Add `memory/github/` directory for synced state

Why:
- Enable maintainer bot to surface clear recommendations
- ZFC-compliant: script does pure IO, AI does all reasoning
- Real-time-ish data via periodic sync to shared memory

Skill triggers: "triage", "priorities", "what's hot", "status"
Output: Now/Next/Later buckets with links + recommended actions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 17:54:25 +01:00
Josh Palmer
7ede0904a5 auth repo seeding with github app token 2026-01-08 15:00:49 +01:00
Josh Palmer
153392d60d run seed scripts with bash 2026-01-08 14:56:50 +01:00
Josh Palmer
4a632a8b21 ensure bash for memory init 2026-01-08 14:55:05 +01:00
Josh Palmer
1cc5418f46 Limit tools.md to installed toolchain 2026-01-08 14:38:14 +01:00
Josh Palmer
fe0b471ee8 Document toolchain propagation and auto-seed tools 2026-01-08 14:33:05 +01:00