mirror of
https://github.com/RichieCahill/dotfiles.git
synced 2026-04-17 04:58:19 -04:00
add Signal command and control bot service
Python service for jeeves that communicates over Signal via signal-cli-rest-api. Implements device verification via safety numbers (unverified devices cannot run commands until verified over SSH), and a van inventory command that uses an LLM on BOB (ollama) to parse receipt photos or text lists into structured inventory data. The LLM backend is configurable to swap models easily. https://claude.ai/code/session_01AKXQBuVBsW7J1YbukDiQ7A
This commit is contained in:
42
systems/jeeves/services/signal_bot.nix
Normal file
42
systems/jeeves/services/signal_bot.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
vars = import ../vars.nix;
|
||||
in
|
||||
{
|
||||
systemd.services.signal-bot = {
|
||||
description = "Signal command and control bot";
|
||||
after = [
|
||||
"network.target"
|
||||
"podman-signal_cli_rest_api.service"
|
||||
];
|
||||
wants = [ "podman-signal_cli_rest_api.service" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
environment = {
|
||||
PYTHONPATH = "${inputs.self}";
|
||||
};
|
||||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
EnvironmentFile = "${vars.secrets}/services/signal-bot";
|
||||
ExecStart = "${pkgs.my_python}/bin/python -m python.signal_bot.main";
|
||||
StateDirectory = "signal-bot";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "10s";
|
||||
StandardOutput = "journal";
|
||||
StandardError = "journal";
|
||||
NoNewPrivileges = true;
|
||||
ProtectSystem = "strict";
|
||||
ProtectHome = "read-only";
|
||||
PrivateTmp = true;
|
||||
ReadWritePaths = [ "/var/lib/signal-bot" ];
|
||||
ReadOnlyPaths = [
|
||||
"${inputs.self}"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user