1.9 KiB
1.9 KiB
Remote Services
Cargo workspace with the server-side pieces of Noisebell. Runs on any Linux box.
| Service | Port | What it does |
|---|---|---|
cache-service/ |
3000 | Polls the Pi, stores the latest state in SQLite, fans out webhooks |
discord-bot/ |
3001 | Posts door status to a Discord channel |
noisebell-common/ |
— | Shared types and helpers |
See each service's README for configuration and API docs.
Building
cargo build --release
Or with Nix:
nix build .#noisebell-cache
nix build .#noisebell-discord
NixOS deployment
The flake exports NixOS modules. Each service runs as a hardened systemd unit behind Caddy.
{
inputs.noisebell.url = "git+https://git.extremist.software/jet/noisebell?dir=remote";
outputs = { self, nixpkgs, noisebell, ... }: {
nixosConfigurations.myhost = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
noisebell.nixosModules.default
({ ... }: {
services.noisebell-cache = {
enable = true;
domain = "cache.noisebell.example.com";
piAddress = "http://noisebell-pi:80";
piApiKeyFile = "/run/secrets/noisebell-pi-api-key";
inboundApiKeyFile = "/run/secrets/noisebell-inbound-api-key";
outboundWebhooks = [{
url = "http://localhost:3001/webhook";
secretFile = "/run/secrets/noisebell-discord-webhook-secret";
}];
};
services.noisebell-discord = {
enable = true;
domain = "discord.noisebell.example.com";
discordTokenFile = "/run/secrets/noisebell-discord-token";
channelId = "123456789012345678";
webhookSecretFile = "/run/secrets/noisebell-discord-webhook-secret";
};
})
];
};
};
}