Skip to content

finbot.service: DynamicUser and sandbox; the util tools find the service's data directory - #58

Merged
robdevops merged 3 commits into
mainfrom
claude/kind-newton-ad0z2q
Oct 23, 2026
Merged

robdevops merged 3 commits into
mainfrom
claude/kind-newton-ad0z2q

Conversation

@robdevops

Copy link
Copy Markdown
Owner

What this PR holds

finbot.service

  • Takes the production unit: DynamicUser=yes, StateDirectory=finbot, the checkout in /opt/finbot, and the sandbox (ProtectSystem=strict, ProtectHome=yes, PrivateTmp, PrivateDevices, PrivateUsers, MemoryDenyWriteExecute, empty capability sets, SystemCallFilter=@system-service, the Protect* kernel lines, RestrictAddressFamilies, memory limits). TasksMax=256 (production uses 64): finbot runs a thread per message, press, scheduled job and priming task.

Data directory

  • lib/config.py: the util tools (sync_defaults.py, check_config.py, flush.py, slack_manifest.py, which set FINBOT_CHECK_ONLY), run by hand without STATE_DIRECTORY, use /var/lib/private/finbot when it exists, so they act on the directory the service reads. The bot itself never does; DATA_DIR and STATE_DIRECTORY still win.
  • doc/install.md: the Debian steps in order (code in /opt/finbot, finbot.env, check, start the unit, optional settings with the exact sudo commands); doc/configuration.md, doc/caching.md, defaults/finbot.env: the data-directory rule stated once, the migration steps, and not to set DATA_DIR under the unit.
  • Also on the branch: the CLAUDE.md pull-request rules are back (revert of the earlier removal), and origin/main is merged in.

Test plan

  • .venv/bin/python -m unittest discover -s tests -b (652 tests, offline)
  • systemd-analyze verify finbot.service (only complaints: /opt/finbot does not exist in the cloud environment)
  • CI on 3.x and 3.13.5, and the docker job

Generated by Claude Code

…oduction unit; the checkout in /opt/finbot

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JVEkZofdPjQ4jtXFKipeUX
…he data-directory doc say where the files go

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JVEkZofdPjQ4jtXFKipeUX
@robdevops
robdevops merged commit 3312786 into main Oct 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants