Host upbank2firefly #78
4 changed files with 78 additions and 0 deletions
|
|
@ -28,6 +28,7 @@
|
|||
"readarr"
|
||||
"sonarr"
|
||||
"syncthing"
|
||||
"upbank2firefly"
|
||||
"vaultwarden"
|
||||
# keep-sorted end
|
||||
];
|
||||
|
|
|
|||
76
modules/nixos/features/upbank2firefly.nix
Normal file
76
modules/nixos/features/upbank2firefly.nix
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
port = 5021;
|
||||
in
|
||||
{
|
||||
virtualisation.oci-containers = {
|
||||
backend = "docker";
|
||||
containers.upbank2firefly = {
|
||||
extraOptions = [
|
||||
"--network=host"
|
||||
];
|
||||
image = "compose2nix/upbank2firefly";
|
||||
environment = {
|
||||
FIREFLY_BASEURL = "https://firefly.fi33.buzz";
|
||||
TZ = "Australia/Melbourne";
|
||||
};
|
||||
environmentFiles = [ config.age.secrets.upbank2firefly.path ];
|
||||
volumes = [
|
||||
"/srv/upbank2firefly/app:/app:rw"
|
||||
];
|
||||
ports = [
|
||||
"${toString port}:80/tcp"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
systemd = {
|
||||
services = {
|
||||
"docker-build-upbank2firefly" = {
|
||||
path = with pkgs; [
|
||||
docker
|
||||
git
|
||||
];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
TimeoutSec = 300;
|
||||
};
|
||||
script = ''
|
||||
cd /srv/upbank2firefly
|
||||
git pull
|
||||
docker build -t compose2nix/upbank2firefly .
|
||||
'';
|
||||
};
|
||||
"upbank2firefly-getall" = {
|
||||
script = ''
|
||||
cd /srv/upbank2firefly
|
||||
docker container exec -e FLASK_APP=main upbank2firefly flask getall --since "$(date -d "1 hour ago" +"%Y-%m-%d %H:%M:%S")"
|
||||
'';
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "root";
|
||||
};
|
||||
};
|
||||
};
|
||||
timers."upbank2firefly-getall" = {
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
Unit = "upbank2firefly-getall.service";
|
||||
OnCalendar = "hourly";
|
||||
Persistent = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."upbank2firefly.fi33.buzz" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "fi33.buzz";
|
||||
locations."/".proxyPass = "http://localhost:${toString port}";
|
||||
};
|
||||
|
||||
age.secrets.upbank2firefly.file = ../../../secrets/upbank2firefly.age;
|
||||
}
|
||||
|
|
@ -39,6 +39,7 @@ in
|
|||
"radicale.age".publicKeys = users;
|
||||
"readarr.age".publicKeys = users;
|
||||
"sonarr.age".publicKeys = users;
|
||||
"upbank2firefly.age".publicKeys = users;
|
||||
"vaultwarden-admin.age".publicKeys = users;
|
||||
# keep-sorted end
|
||||
}
|
||||
|
|
|
|||
BIN
secrets/upbank2firefly.age
Normal file
BIN
secrets/upbank2firefly.age
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue