diff options
Diffstat (limited to 'hosts/vidhar')
-rw-r--r-- | hosts/vidhar/default.nix | 2 | ||||
-rw-r--r-- | hosts/vidhar/firefly-iii/app_key | 24 | ||||
-rw-r--r-- | hosts/vidhar/firefly-iii/default.nix | 64 | ||||
-rw-r--r-- | hosts/vidhar/network/ruleset.nft | 4 | ||||
-rw-r--r-- | hosts/vidhar/pgbackrest/default.nix | 2 |
5 files changed, 95 insertions, 1 deletions
diff --git a/hosts/vidhar/default.nix b/hosts/vidhar/default.nix index 9660931d..90e58b42 100644 --- a/hosts/vidhar/default.nix +++ b/hosts/vidhar/default.nix | |||
@@ -4,7 +4,7 @@ with lib; | |||
4 | 4 | ||
5 | { | 5 | { |
6 | imports = with flake.nixosModules.systemProfiles; [ | 6 | imports = with flake.nixosModules.systemProfiles; [ |
7 | ./zfs.nix ./network ./samba.nix ./dns ./prometheus ./borg ./pgbackrest ./postgresql.nix ./immich.nix ./paperless | 7 | ./zfs.nix ./network ./samba.nix ./dns ./prometheus ./borg ./pgbackrest ./postgresql.nix ./immich.nix ./paperless ./firefly-iii |
8 | tmpfs-root zfs | 8 | tmpfs-root zfs |
9 | initrd-all-crypto-modules default-locale openssh rebuild-machines | 9 | initrd-all-crypto-modules default-locale openssh rebuild-machines |
10 | build-server | 10 | build-server |
diff --git a/hosts/vidhar/firefly-iii/app_key b/hosts/vidhar/firefly-iii/app_key new file mode 100644 index 00000000..b318b9c1 --- /dev/null +++ b/hosts/vidhar/firefly-iii/app_key | |||
@@ -0,0 +1,24 @@ | |||
1 | { | ||
2 | "data": "ENC[AES256_GCM,data:Z/u19vdnY5B76AaQCZOaXGRHTXiAaZ3OlnpEwehK40De6EoTzvs8BzC4/a6KVam5JDjcog==,iv:ZlCNcjQV1brRllTVdfFjhOcDe7sjHIRVbjs/dNT/w0o=,tag:bAtBraAy+i02pyVuhWoXBg==,type:str]", | ||
3 | "sops": { | ||
4 | "kms": null, | ||
5 | "gcp_kms": null, | ||
6 | "azure_kv": null, | ||
7 | "hc_vault": null, | ||
8 | "age": [ | ||
9 | { | ||
10 | "recipient": "age1rmmhetcmllq0ahl5qznlr0eya2zdxwl9h6y5wnl97d2wtyx5t99sm2u866", | ||
11 | "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBIZEZVVTZLU2VPQmM2Tjk3\nVEUvVitWRjdGRnE2Vm9FVjFhTk1IZ0g1bjJjCjd5dnZNd1VrTVc4QktRM0Z2aFdp\nVlRqLy9BMDV4VGI1SjdmWTFFVFZONG8KLS0tIHRYMGlpalZZUEJFU3c0Z0hXK1lQ\ndnFndWJmTTFjWVAzdkhwN0x6eHVHVmsKVls/ERf4ZfnTqryB6yt5OcjU42RlgAoD\nmMZzuEbhuGBApu2rEKlo4v/AKST6OVIlsiYr0na2W4vlmBOEs8OB1g==\n-----END AGE ENCRYPTED FILE-----\n" | ||
12 | }, | ||
13 | { | ||
14 | "recipient": "age1qffdqvy9arld9zd5a5cylt0n98xhcns5shxhrhwjq5g4qa844ejselaa4l", | ||
15 | "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBCcVVJZWNkMzlYc1lOMzlu\nai82RjhkZm5UYVplV0NNTjZlWm8zcmpCaW1BCnhMaGV5NFNkUUw5ODM5OVZZMUxO\nUUpVTGhtZDM4VzF3WXhTMFpHLytKUzAKLS0tIEZCSVFIODRhRDZuMzFFbSt1YlBI\ndldaZEd6dTBvU2huREhoQ3VNQ2NNdWMKyGuG1tzxIas5G6nlWRkgbxHTOGQ8cLx6\nOw83t98BBfWSZVTuUfHAemn5fPsjRUhsZvEuH70NvQXDRxSvV2nvww==\n-----END AGE ENCRYPTED FILE-----\n" | ||
16 | } | ||
17 | ], | ||
18 | "lastmodified": "2025-02-18T18:05:57Z", | ||
19 | "mac": "ENC[AES256_GCM,data:7rl6npBWEFeS+IZMLb2+jLcs1d5gSzZyGkCDcrpAbxAB7doAp4vh5DJUEFnAUMtN/iHlwjX71pRNjBHLlYqCs344aaGkcEVMDO/C2m8efuPq+qIi+z372PlM+ekVDXquthvc8fcPhsCWHyso1LTpDjMRqf6kizk0wEtwJj5kOWA=,iv:OEaeQUJ2f0XZidWkttC8Y+WAkDyNkViTNiiDgy5QKr8=,tag:ERsBlT0T3iZvoEWcRhTpPA==,type:str]", | ||
20 | "pgp": null, | ||
21 | "unencrypted_suffix": "_unencrypted", | ||
22 | "version": "3.9.4" | ||
23 | } | ||
24 | } \ No newline at end of file | ||
diff --git a/hosts/vidhar/firefly-iii/default.nix b/hosts/vidhar/firefly-iii/default.nix new file mode 100644 index 00000000..026d4643 --- /dev/null +++ b/hosts/vidhar/firefly-iii/default.nix | |||
@@ -0,0 +1,64 @@ | |||
1 | { config, ... }: | ||
2 | { | ||
3 | config = { | ||
4 | services.postgresql = { | ||
5 | ensureDatabases = [ "firefly-iii" ]; | ||
6 | ensureUsers = [ | ||
7 | { name = "firefly-iii"; | ||
8 | ensureDBOwnership = true; | ||
9 | } | ||
10 | ]; | ||
11 | }; | ||
12 | |||
13 | services.firefly-iii = { | ||
14 | enable = true; | ||
15 | enableNginx = true; | ||
16 | group = "firefly-iii"; | ||
17 | virtualHost = "firefly.yggdrasil.li"; | ||
18 | settings = { | ||
19 | DB_CONNECTION = "pgsql"; | ||
20 | DB_DATABASE = "firefly-iii"; | ||
21 | APP_KEY_FILE = config.sops.secrets."firefly-iii_app_key".path; | ||
22 | APP_URL = "https://${config.services.firefly-iii.virtualHost}"; | ||
23 | }; | ||
24 | }; | ||
25 | |||
26 | services.nginx = { | ||
27 | commonHttpConfig = '' | ||
28 | map $http_x_forwarded_proto $fastcgi_param_https_variable { | ||
29 | default '''; | ||
30 | https 'on'; | ||
31 | } | ||
32 | ''; | ||
33 | virtualHosts.${config.services.firefly-iii.virtualHost} = { | ||
34 | listen = [ | ||
35 | { addr = "[2a03:4000:52:ada:4:1::]"; port = 9000; } | ||
36 | ]; | ||
37 | extraConfig = '' | ||
38 | set_real_ip_from 2a03:4000:52:ada:4::; | ||
39 | ''; | ||
40 | locations."~ \\.php$" = { | ||
41 | extraConfig = '' | ||
42 | fastcgi_param HTTPS $fastcgi_param_https_variable; | ||
43 | ''; | ||
44 | }; | ||
45 | }; | ||
46 | }; | ||
47 | |||
48 | sops.secrets."firefly-iii_app_key" = { | ||
49 | format = "binary"; | ||
50 | sopsFile = ./app_key; | ||
51 | group = config.services.firefly-iii.group; | ||
52 | mode = "0440"; | ||
53 | restartUnits = [ "firefly-iii-setup.service" "firefly-iii-cron.service" "phpfpm-firefly-iii.service" ]; | ||
54 | }; | ||
55 | |||
56 | users.groups.${config.services.firefly-iii.group} = {}; | ||
57 | |||
58 | systemd.services = { | ||
59 | nginx.serviceConfig.SupplementaryGroups = [ config.services.firefly-iii.group ]; | ||
60 | "firefly-iii-setup".serviceConfig.ReadWritePaths = [ "/run/postgresql" ]; | ||
61 | "firefly-iii-cron".serviceConfig.ReadWritePaths = [ "/run/postgresql" ]; | ||
62 | }; | ||
63 | }; | ||
64 | } | ||
diff --git a/hosts/vidhar/network/ruleset.nft b/hosts/vidhar/network/ruleset.nft index 3ead8fac..5398cbee 100644 --- a/hosts/vidhar/network/ruleset.nft +++ b/hosts/vidhar/network/ruleset.nft | |||
@@ -93,6 +93,7 @@ table inet filter { | |||
93 | counter pgbackrest-rx {} | 93 | counter pgbackrest-rx {} |
94 | counter immich-rx {} | 94 | counter immich-rx {} |
95 | counter paperless-rx {} | 95 | counter paperless-rx {} |
96 | counter firefly-rx {} | ||
96 | 97 | ||
97 | counter established-rx {} | 98 | counter established-rx {} |
98 | 99 | ||
@@ -123,6 +124,7 @@ table inet filter { | |||
123 | counter pgbackrest-tx {} | 124 | counter pgbackrest-tx {} |
124 | counter immich-tx {} | 125 | counter immich-tx {} |
125 | counter paperless-tx {} | 126 | counter paperless-tx {} |
127 | counter firefly-tx {} | ||
126 | 128 | ||
127 | counter tx {} | 129 | counter tx {} |
128 | 130 | ||
@@ -200,6 +202,7 @@ table inet filter { | |||
200 | 202 | ||
201 | iifname bifrost tcp dport 2283 ip6 saddr $bifrost_surtr counter name immich-rx accept | 203 | iifname bifrost tcp dport 2283 ip6 saddr $bifrost_surtr counter name immich-rx accept |
202 | iifname bifrost tcp dport 28981 ip6 saddr $bifrost_surtr counter name paperless-rx accept | 204 | iifname bifrost tcp dport 28981 ip6 saddr $bifrost_surtr counter name paperless-rx accept |
205 | iifname bifrost tcp dport 9000 ip6 saddr $bifrost_surtr counter name firefly-rx accept | ||
203 | 206 | ||
204 | ct state { established, related } counter name established-rx accept | 207 | ct state { established, related } counter name established-rx accept |
205 | 208 | ||
@@ -250,6 +253,7 @@ table inet filter { | |||
250 | 253 | ||
251 | iifname bifrost tcp sport 2283 ip6 daddr $bifrost_surtr counter name immich-tx accept | 254 | iifname bifrost tcp sport 2283 ip6 daddr $bifrost_surtr counter name immich-tx accept |
252 | iifname bifrost tcp sport 28981 ip6 daddr $bifrost_surtr counter name paperless-tx accept | 255 | iifname bifrost tcp sport 28981 ip6 daddr $bifrost_surtr counter name paperless-tx accept |
256 | iifname bifrost tcp sport 28981 ip6 daddr $bifrost_surtr counter name firefly-tx accept | ||
253 | 257 | ||
254 | 258 | ||
255 | counter name tx | 259 | counter name tx |
diff --git a/hosts/vidhar/pgbackrest/default.nix b/hosts/vidhar/pgbackrest/default.nix index 1e0828ce..38d68335 100644 --- a/hosts/vidhar/pgbackrest/default.nix +++ b/hosts/vidhar/pgbackrest/default.nix | |||
@@ -159,5 +159,7 @@ in { | |||
159 | group = "pgbackrest"; | 159 | group = "pgbackrest"; |
160 | mode = "0400"; | 160 | mode = "0400"; |
161 | }; | 161 | }; |
162 | |||
163 | systemd.services.postgresql.serviceConfig.SupplementaryGroups = [ "pgbackrest" ]; | ||
162 | }; | 164 | }; |
163 | } | 165 | } |