Commit graph

23 commits

Author SHA1 Message Date
Dan 955b6e91b4 Fix killswitch paths in watchdog scripts, remove replaceStrings workaround 2026-01-05 09:12:46 -08:00
Dan e1e9e2d635 Add zig to system packages 2026-01-04 16:38:11 -08:00
Dan 1158f3a37b Add bun as preferred JS package manager for faster installs 2026-01-04 13:49:56 -08:00
Dan a2c994b1d1 Set COLORTERM for truecolor terminals in SSH sessions 2026-01-04 10:02:25 -08:00
Dan 79d278ba61 Add terminfo for ghostty and kitty terminals
Source ghostty.terminfo from nixpkgs-unstable since it's not
available in nixos-24.05 stable.
2026-01-03 18:02:40 -08:00
Dan 74cf842afd Improve dev onboarding: devs group, npm setup, AGENTS.md
- Add users.groups.devs for shared resources
- dev-add: check devs group exists before creating user
- dev-add: use .profile for login shell PATH setup
- dev-add: configure npm prefix and .npm-global directory
- dev-add: create AGENTS.md with friendly capability guide
- Update onboarding message with npm install examples
- Add docs/server-AGENTS.md for reference

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 17:11:03 -08:00
Dan bc81b4ec15 Rename learner to dev across codebase
- scripts/learner-*.sh → scripts/dev-*.sh
- docs/learner-*.md → docs/dev-*.md
- tests/test-learner-env.sh → tests/test-dev-env.sh
- Update all internal references

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 10:42:34 -08:00
Dan 26be2b1548 Add per-user resource limits via activation script
Creates drop-in at /run/systemd/system/user-.slice.d/50-limits.conf
to enforce per-user limits (vs slice-wide):
- MemoryMax=50% (~1GB per user)
- TasksMax=200 per user
- CPUQuota=200% (max 2 cores sustained)

Prevents one user from starving others.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 10:02:37 -08:00
Dan f8e77c44b1 Fix code review items from security scripts
- egress-watchdog: Use process substitution to avoid subshell gotcha
- killswitch: Rename USER to TARGET_USER (avoid shadowing builtin)
- Add documentation comments for UID range and grep -P dependency

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 09:35:40 -08:00
Dan cd534a09f2 Declarative script deployment via writeShellApplication
- Package watchdog scripts (killswitch, cpu-watchdog, egress-watchdog)
  with proper runtimeInputs, referenced directly by systemd
- Package admin scripts (learner-add, learner-remove) in systemPackages
- Fix ShellCheck issues in scripts (SC2129, SC2155, SC2115, SC2162)
- Remove manual /usr/local/bin deployment, scripts deploy with nixos-rebuild
- Update AGENTS.md with new deployment workflow

Closes epic ops-jrz1-gwk

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 09:21:47 -08:00
Dan fb7d6d03a2 Add egress-watchdog for rate limit abuse detection
Monitors EGRESS-LIMIT kernel log entries, tracks strikes per user,
triggers killswitch after 3 consecutive violations within a minute.
Runs every minute via systemd timer.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 06:02:34 -08:00
Dan 5c4b2aac84 Add egress logging and rate limiting
- Log all new outbound connections from users (EGRESS: prefix)
- Rate limit: 30/min sustained, burst 60
- Over-limit connections logged (EGRESS-LIMIT:) and rejected
- Closes ops-jrz1-p2d, ops-jrz1-cmv

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 21:12:18 -08:00
Dan 89f2987f1e Add cgroups limits and CPU watchdog
- User slice: MemoryMax 80%, TasksMax 500, CPUWeight 100
- CPU watchdog: detects sustained abuse (>180% for 5 min), kills user
- Fixed scripts for NixOS (shebang, PATH)
- Closes ops-jrz1-8m7, ops-jrz1-1bk

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 21:02:18 -08:00
Dan 21d3038aca Add opencode and nodejs to system packages
- opencode (v1.0.224) via flake input from github:sst/opencode
- nodejs_22 for npm-based AI tools (gemini-cli, codex)
- Closes ops-jrz1-ecw

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 17:41:48 -08:00
Dan 0ce7bc73d9 Add tmux and beads to system packages
- tmux for session persistence
- beads (bd CLI) via flake input from github:steveyegge/beads
- Closes ops-jrz1-d38, ops-jrz1-jvt

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 17:26:11 -08:00
Dan bd7bdda2b3 Add Claude Code CLI to dev environment
- Install claude binary to /usr/local/bin
- Symlink to ~/.local/bin for users (in PATH)
- Update learner-add.sh to set up symlink for new users
- Add /usr/local/bin to PATH via shellInit
2026-01-02 14:45:49 -08:00
Dan f6540cfbd5 Add direnv to system packages for per-project devshells 2026-01-02 12:32:32 -08:00
Dan d387b0b910 Add learner environment integration tests
- test-learner-env.sh: SSH, nix-ld, Slack tokens, Python, API connectivity
- test-slack-bolt.py: Socket Mode connection test
- Makefile: test runner with env/slack-bolt/vscode targets
- Add python3 + uv to system packages

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 12:16:58 -08:00
Dan 0cbbb19da2 Allow olm-3.2.16 for mautrix bridges in production
- Add permittedInsecurePackages for deprecated olm library
- Required by mautrix-slack, mautrix-whatsapp, mautrix-gmessages bridges
- Acceptable risk for Matrix bridge functionality until alternatives available
2025-10-21 18:37:03 -07:00
Dan 982d2886e4 Add ACME configuration for Let's Encrypt certificates
- Accept Let's Encrypt terms of service
- Configure email for certificate notifications (dlei@duck.com)
- Nginx virtual hosts already configured with enableACME and forceSSL

Ready for deployment to VPS.
2025-10-21 18:34:13 -07:00
Dan 413a44a9d8 Configure ops-jrz1 for production deployment to Vultr VPS
- Add hardware-configuration.nix from VPS (45.77.205.49)
- Update configuration.nix with correct boot loader (/dev/vda) and network (ens3)
- Enable Matrix homeserver and dev-platform services in hosts/ops-jrz1.nix
- Configure for clarun.xyz domain with Matrix, Forgejo, and mautrix-slack
- Add SSH authorized keys and enable Nix flakes

Ready to deploy to replace ops-base configuration.
2025-10-21 18:13:32 -07:00
Dan 2cbeb0eb7b Add minimal filesystem configuration for flake validation
Generated with Claude Code - https://claude.com/claude-code
2025-10-13 14:53:26 -07:00
Dan 894e7241f1 Initialize ops-jrz1 repository with Matrix platform extraction foundation
- Add speckit workflow infrastructure (.claude, .specify)
- Create NixOS configuration skeleton (flake.nix, configuration.nix, hosts/ops-jrz1.nix)
- Add sanitization scripts with 22 rules for personal info removal
- Add validation scripts with gitleaks integration
- Configure git hooks (pre-commit, pre-push) for security validation
- Add project documentation (README, LICENSE)
- Add comprehensive .gitignore for Nix, secrets, staging

Phase 1 and Phase 2 complete. Foundation ready for module extraction from ops-base.
2025-10-13 13:37:17 -07:00