Add flowtrack period tracker

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-18 09:01:45 +01:00
parent 56cad1cfb5
commit 4a5663f795
6 changed files with 63 additions and 2 deletions

View file

@ -44,6 +44,8 @@
{ domain = "reddit.nordhammer.it"; policy = "one_factor"; }
{ domain = "panel.nordhammer.it"; policy = "one_factor"; }
{ domain = "stardew.nordhammer.it"; policy = "one_factor"; }
# Health data: only the two people the app knows about.
{ domain = "flowtrack.nordhammer.it"; policy = "one_factor"; subject = [ "user:kayla" "user:fred" ]; }
];
};
@ -52,8 +54,10 @@
domain = "nordhammer.it";
authelia_url = "https://auth.nordhammer.it";
}];
expiration = "12h";
inactivity = "2h";
# Long enough that the home-screen Flowtrack app on a phone does not
# ask for a login every time it opens.
expiration = "30d";
inactivity = "7d";
};
storage.local.path = "/var/lib/authelia-main/db.sqlite3";

21
services/flowtrack.nix Normal file
View file

@ -0,0 +1,21 @@
# services/flowtrack.nix — Kayla's private period tracker.
#
# The application and NixOS module live in the standalone flowtrack flake.
# nginx is the only public listener and Authelia admits just kayla and fred;
# the app maps them to owner and read-only viewer. Nightly snapshots go
# straight to the SSD branch of the pool (not via mergerfs), which had the
# cleanest SMART record of the data disks.
{ config, lib, ... }:
{
config = lib.mkIf (config.networking.hostName == "FredOS-Mediaserver") {
services.flowtrack = {
enable = true;
port = 8093;
editors = [ "kayla" ];
viewers = [ "fred" ];
backup.directory = "/mnt/disk2/backups/flowtrack";
};
systemd.tmpfiles.rules = [ "d /mnt/disk2/backups 0755 root root -" ];
};
}

View file

@ -203,6 +203,13 @@ in
proxy_set_header Remote-Email $email;
'';
};
# Period tracker. The app trusts Remote-User for roles, so nginx must
# always overwrite it with the Authelia identity.
"flowtrack.nordhammer.it" = lib.recursiveUpdate (protectedProxy 8093) {
locations."/".extraConfig = autheliaAuthConfig + ''
proxy_set_header Remote-User $user;
'';
};
# Pelican game panel. Can't turn off its own login (no such option
# upstream), so Authelia is the outer gate and the Pelican account