62 Commits

Author SHA1 Message Date
f28125c9a4 [louise] new ip
All checks were successful
Check flake syntax / flake-check (push) Successful in 5m16s
2026-02-20 19:59:51 +01:00
e46c6bef00 [general] update local vm ip addresses 2026-02-20 19:59:27 +01:00
b012b89a48 [fanny] update hostbridge for local access
All checks were successful
Check flake syntax / flake-check (push) Successful in 5m21s
2026-02-20 19:39:16 +01:00
4d101aee29 [durruti][vpn] rm deprecated cloud/zineshop proxies 2026-02-20 19:38:43 +01:00
93fb64b2c6 [fanny] update proxy for local access and dyndns 2026-02-20 19:37:22 +01:00
a92336fb30 [fanny] add njala api token 2026-02-20 19:36:58 +01:00
0347fa68c7 [hosts] use hostId in offsite net
All checks were successful
Check flake syntax / flake-check (push) Successful in 5m29s
2026-01-30 20:26:12 +01:00
f0e1f07c3e [zones] set ns1 A record 2026-01-30 20:25:49 +01:00
b4d199d00c [ns1] setup forwarding, open ports 2026-01-30 20:25:10 +01:00
bec232a023 [run-vm] override network cfg for local testing 2026-01-30 20:24:43 +01:00
62c92821b4 [microvm] put vms on local network
All checks were successful
Check flake syntax / flake-check (push) Successful in 5m27s
2026-01-28 15:27:21 +01:00
eb1ec22605 [hosts] dont configure network on offsite hosts
Some checks failed
Check flake syntax / flake-check (push) Failing after 1m44s
2026-01-26 14:10:49 +01:00
cb5e68ef16 [dns] init
Some checks failed
Check flake syntax / flake-check (push) Failing after 3m49s
2026-01-26 14:05:12 +01:00
2fda92f712 Merge branch 'staging'
All checks were successful
Check flake syntax / flake-check (push) Successful in 22m9s
2025-12-23 19:14:25 +01:00
6e6448eeca [nextcloud] fix hash for xustom deck32 app
All checks were successful
Check flake syntax / flake-check (push) Successful in 12m51s
2025-12-23 19:13:22 +01:00
530c0cc5f3 [zineshop] re-enable 2025-12-23 19:13:22 +01:00
633b2f4dc7 Fix nix check; Also i disabled the zineshop temporairly 2025-12-23 19:13:22 +01:00
af9253b91c [nixpkgs] 25.05 -> 25.11 2025-12-23 19:13:22 +01:00
a2f8d84d96 [nixpkgs] update 2025-12-23 19:13:22 +01:00
9899889924 [nextcloud] adjust nginx for large fileuploads
All checks were successful
Check flake syntax / flake-check (push) Successful in 11m51s
2025-12-22 19:37:13 +01:00
b3e93349d1 [nextcloud] use fix body size in external code
All checks were successful
Check flake syntax / flake-check (push) Successful in 5m53s
2025-12-10 12:07:15 +01:00
f7d00246e8 [nextcloud] set max_body_size in nginx proxy chain
All checks were successful
Check flake syntax / flake-check (push) Successful in 12m0s
2025-12-10 10:55:38 +01:00
a79afe7dea [nextcloud] enable postgresql backup
All checks were successful
Check flake syntax / flake-check (push) Successful in 8m7s
if we need to restore from backup this is necessary since db state from
zfs snapshots might be corrupted
2025-12-10 10:38:27 +01:00
b94574c640 [fanny] fix flushing init vpn
All checks were successful
Check flake syntax / flake-check (push) Successful in 4m46s
2025-11-15 18:02:20 +01:00
a97de389e5 [fanny] fix typo
Some checks failed
Check flake syntax / flake-check (push) Failing after 2m48s
2025-11-15 17:21:45 +01:00
845379ac86 [fanny] flush wg-initd
Some checks failed
Check flake syntax / flake-check (push) Failing after 2m52s
2025-11-15 17:17:40 +01:00
e91481c405 [initssh] network.flushBeforeStage2
All checks were successful
Check flake syntax / flake-check (push) Successful in 10m17s
2025-11-15 16:50:07 +01:00
d3312c870a [fanny] remove zfs-remote-unlock
All checks were successful
Check flake syntax / flake-check (push) Successful in 5m19s
2025-11-15 16:37:11 +01:00
eee561b650 [fanny] set /24 for wg ip
All checks were successful
Check flake syntax / flake-check (push) Successful in 4m51s
2025-11-15 16:22:03 +01:00
a612221e2a change script to first import storage before unlocking root
All checks were successful
Check flake syntax / flake-check (push) Successful in 4m49s
2025-11-15 16:12:32 +01:00
73c482ece0 [fanny] set vpn pubkey
All checks were successful
Check flake syntax / flake-check (push) Successful in 4m53s
2025-11-15 16:07:17 +01:00
4d4e9d980b [initssh] add iproute2
All checks were successful
Check flake syntax / flake-check (push) Successful in 4m55s
2025-11-15 15:48:40 +01:00
beb3839a6b [initssh] add wireguard-tools 2025-11-15 15:47:38 +01:00
0df32bf47c [initssh] fix busybox 2025-11-15 15:47:02 +01:00
f6bbbdec3e [initssh] add pkgs.busybox to initrd
All checks were successful
Check flake syntax / flake-check (push) Successful in 4m47s
2025-11-15 15:11:47 +01:00
2a5539c204 [fanny] import storage in systemd script
All checks were successful
Check flake syntax / flake-check (push) Successful in 8m51s
2025-11-15 14:51:51 +01:00
9588103e67 [fanny] import storage on boot
All checks were successful
Check flake syntax / flake-check (push) Successful in 4m52s
2025-11-15 14:30:57 +01:00
c18724e9a6 Add wireguard generation to scripts (THIS IS NOT TESTED)
All checks were successful
Check flake syntax / flake-check (push) Successful in 5m20s
2025-11-15 14:02:04 +01:00
b59f4084c0 [fanny] set wg initrd key
All checks were successful
Check flake syntax / flake-check (push) Successful in 4m59s
2025-11-15 13:39:55 +01:00
f6bd56d583 [fanny] setup initrd wireguard
All checks were successful
Check flake syntax / flake-check (push) Successful in 9m48s
2025-11-15 13:12:29 +01:00
f8f68df868 [initssh] load all zfs keys 2025-11-15 13:12:29 +01:00
38e4199e94 [printer-scraping] This should work now
All checks were successful
Check flake syntax / flake-check (push) Successful in 4m42s
2025-10-29 12:16:48 +01:00
ae2ec0d7b2 [printer-scraping] Save server responses for debugging purposes.
All checks were successful
Check flake syntax / flake-check (push) Successful in 4m42s
I'll remove this later
2025-10-27 12:04:27 +01:00
d52e47f88b Merge branch 'add_printer_monitor'
All checks were successful
Check flake syntax / flake-check (push) Successful in 4m51s
2025-10-25 22:39:21 +02:00
523005ed94 Fix string warning, script execution
Some checks failed
Check flake syntax / flake-check (push) Has been cancelled
2025-10-25 22:16:38 +02:00
360d9b3df7 Add command testing 2025-10-25 22:16:03 +02:00
9eb61b166a Add printer scraping 2025-10-25 21:51:14 +02:00
bb2b23faf1 [flake] update tasklist
All checks were successful
Check flake syntax / flake-check (push) Successful in 9m58s
2025-10-20 19:40:38 +02:00
1c0215b104 Merge pull request 'Change the nextcloud deck app to allow dragging on text' (#111) from issue_110 into master
All checks were successful
Check flake syntax / flake-check (push) Successful in 4m55s
Reviewed-on: kalipso/infrastructure#111
2025-10-12 15:50:37 +02:00
0df92ef602 [docs] add dokumentation about updating the modified nextcloud deck app
All checks were successful
Check flake syntax / flake-check (push) Successful in 9m50s
2025-10-11 21:38:50 +02:00
d18df59c66 [nextcloud] change the deck app to allow dragging on text 2025-10-11 21:38:09 +02:00
42b649d1db Update backup access ssh key
All checks were successful
Check flake syntax / flake-check (push) Successful in 11m37s
2025-09-09 19:02:05 +02:00
34854d76da [fanny] increase max_body_size in reverse proxy
All checks were successful
Check flake syntax / flake-check (push) Successful in 10m31s
2025-07-29 18:20:52 +02:00
08b0f46edf [nextcloud] set uploadSize to 10g
All checks were successful
Check flake syntax / flake-check (push) Successful in 11m4s
2025-07-29 16:41:32 +02:00
941fdc0f26 [nextcloud] set maxUploadSize to 1GB
All checks were successful
Check flake syntax / flake-check (push) Successful in 14m19s
2025-07-21 16:09:27 +02:00
4e44bfebd1 [flake] update zineshop
All checks were successful
Check flake syntax / flake-check (push) Successful in 4m30s
2025-07-02 15:17:04 +02:00
dcced9aeb8 [flake] update zineshop
All checks were successful
Check flake syntax / flake-check (push) Successful in 4m52s
2025-07-02 13:30:41 +02:00
12fe31bb79 [flake] update zineshop
All checks were successful
Check flake syntax / flake-check (push) Successful in 5m13s
2025-07-02 11:28:53 +02:00
a75476b657 Fix errors and warnings
All checks were successful
Check flake syntax / flake-check (push) Successful in 4m57s
2025-05-27 00:52:34 +02:00
183fb82d07 Update to 25.05 2025-05-27 00:51:55 +02:00
4ca032fd9a [flake] update zineshop
All checks were successful
Check flake syntax / flake-check (push) Successful in 4m31s
2025-05-11 14:46:44 +02:00
16886fcbad [flake] update zineshop
All checks were successful
Check flake syntax / flake-check (push) Successful in 4m19s
2025-05-11 14:20:28 +02:00
34 changed files with 687 additions and 245 deletions

View File

@@ -21,3 +21,4 @@
- [Updates](./anleitung/updates.md) - [Updates](./anleitung/updates.md)
- [Rollbacks](./anleitung/rollback.md) - [Rollbacks](./anleitung/rollback.md)
- [MicroVM](./anleitung/microvm.md) - [MicroVM](./anleitung/microvm.md)
- [Update Nextcloud](./anleitung/update_nextcloud.md)

View File

@@ -0,0 +1,16 @@
### Updating nextcloud
## Updating the draggable patch
The draggable patch is a one line patch found in the deck repo under `src/components/cards/CardItem.vue`
Direct link: https://git.dynamicdiscord.de/ahtlon/deck/commit/77cbcf42ca80dd32e450839f02faca2e5fed3761
The easiest way to apply is
1. Sync the repo with remote https://github.com/nextcloud/deck/tree/main
2. Checkout the stable branch for the nextcloud version you need
- example `git checkout stable31`
3. Apply the patch using `git cherry-pick bac32ace61e7e1e01168f9220cee1d24ce576d5e`
4. Start a nix-shell with `nix-shell -p gnumake krankerl php84Packages.composer php nodejs_24`
5. run `krankerl package`
6. upload the archive at "./build/artifacts/deck.tar.gz" to a file storage (ask Ahtlon for access to the storj s3 or use own)
7. Change url and sha in the nextcloud configuration.nix `deck = pkgs.fetchNextcloudApp {};`

115
flake.lock generated
View File

@@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1736864502, "lastModified": 1746728054,
"narHash": "sha256-ItkIZyebGvNH2dK9jVGzJHGPtb6BSWLN8Gmef16NeY0=", "narHash": "sha256-eDoSOhxGEm2PykZFa/x9QG5eTH0MJdiJ9aR00VAofXE=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "0141aabed359f063de7413f80d906e1d98c0c123", "rev": "ff442f5d1425feb86344c028298548024f21256d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -21,6 +21,27 @@
"type": "github" "type": "github"
} }
}, },
"dns": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1768143854,
"narHash": "sha256-E5/kyPz4zAZn/lZdvqlF83jMgCWNxmqYjjWuadngCbk=",
"owner": "kirelagin",
"repo": "dns.nix",
"rev": "a97cf4156e9f044fe4bed5be531061000dfabb07",
"type": "github"
},
"original": {
"owner": "kirelagin",
"repo": "dns.nix",
"type": "github"
}
},
"ep3-bs": { "ep3-bs": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -43,6 +64,21 @@
} }
}, },
"flake-utils": { "flake-utils": {
"locked": {
"lastModified": 1614513358,
"narHash": "sha256-LakhOx3S1dRjnh0b5Dg3mbZyH0ToC9I8Y2wKSkBaTzU=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5466c5bbece17adaab2d82fae80b46e807611bf3",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": { "inputs": {
"systems": "systems_3" "systems": "systems_3"
}, },
@@ -67,16 +103,16 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1744117652, "lastModified": 1763992789,
"narHash": "sha256-t7dFCDl4vIOOUMhEZnJF15aAzkpaup9x4ZRGToDFYWI=", "narHash": "sha256-WHkdBlw6oyxXIra/vQPYLtqY+3G8dUVZM8bEXk0t8x4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "b4e98224ad1336751a2ac7493967a4c9f6d9cb3f", "rev": "44831a7eaba4360fb81f2acc5ea6de5fde90aaa3",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-24.11", "ref": "release-25.05",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@@ -102,18 +138,18 @@
}, },
"microvm": { "microvm": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils_2",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
"spectrum": "spectrum" "spectrum": "spectrum"
}, },
"locked": { "locked": {
"lastModified": 1743083165, "lastModified": 1764549796,
"narHash": "sha256-Fz7AiCJWtoWZ2guJwO3B1h3RuJxYWaCzFIqY0Kmkyrs=", "narHash": "sha256-Mswg665P92EoHkBwCwPr/7bdnj04g2Qfb+t02ZEYTHA=",
"owner": "astro", "owner": "astro",
"repo": "microvm.nix", "repo": "microvm.nix",
"rev": "773d5a04e2e10ca7b412270dea11276a496e1b61", "rev": "030d055e877cc13d7525b39f434150226d5e4482",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -145,11 +181,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1742568034, "lastModified": 1764234087,
"narHash": "sha256-QaMEhcnscfF2MqB7flZr+sLJMMYZPnvqO4NYf9B4G38=", "narHash": "sha256-NHF7QWa0ZPT8hsJrvijREW3+nifmF2rTXgS2v0tpcEA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixos-generators", "repo": "nixos-generators",
"rev": "42ee229088490e3777ed7d1162cb9e9d8c3dbb11", "rev": "032a1878682fafe829edfcf5fdfad635a2efe748",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -160,11 +196,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1744366945, "lastModified": 1764440730,
"narHash": "sha256-OuLhysErPHl53BBifhesrRumJNhrlSgQDfYOTXfgIMg=", "narHash": "sha256-ZlJTNLUKQRANlLDomuRWLBCH5792x+6XUJ4YdFRjtO4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "1fe3cc2bc5d2dc9c81cb4e63d2f67c1543340df1", "rev": "9154f4569b6cdfd3c595851a6ba51bfaa472d9f3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -192,11 +228,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1744232761, "lastModified": 1764517877,
"narHash": "sha256-gbl9hE39nQRpZaLjhWKmEu5ejtQsgI5TWYrIVVJn30U=", "narHash": "sha256-pp3uT4hHijIC8JUK5MEqeAWmParJrgBVzHLNfJDZxg4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "f675531bc7e6657c10a18b565cfebd8aa9e24c14", "rev": "2d293cbfa5a793b4c50d17c05ef9e385b90edf6c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -208,16 +244,16 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1744309437, "lastModified": 1764522689,
"narHash": "sha256-QZnNHM823am8apCqKSPdtnzPGTy2ZB4zIXOVoBp5+W0=", "narHash": "sha256-SqUuBFjhl/kpDiVaKLQBoD8TLD+/cTUzzgVFoaHrkqY=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "f9ebe33a928b5d529c895202263a5ce46bdf12f7", "rev": "8bb5646e0bed5dbd3ab08c7a7cc15b75ab4e1d0f",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-24.11", "ref": "nixos-25.11",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@@ -225,6 +261,7 @@
"root": { "root": {
"inputs": { "inputs": {
"disko": "disko", "disko": "disko",
"dns": "dns",
"ep3-bs": "ep3-bs", "ep3-bs": "ep3-bs",
"home-manager": "home-manager", "home-manager": "home-manager",
"mfsync": "mfsync", "mfsync": "mfsync",
@@ -246,11 +283,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1744103455, "lastModified": 1764483358,
"narHash": "sha256-SR6+qjkPjGQG+8eM4dCcVtss8r9bre/LAxFMPJpaZeU=", "narHash": "sha256-EyyvCzXoHrbL467YSsQBTWWg4sR96MH1sPpKoSOelB4=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "69d5a5a4635c27dae5a742f36108beccc506c1ba", "rev": "5aca6ff67264321d47856a2ed183729271107c9c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -262,11 +299,11 @@
"spectrum": { "spectrum": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1733308308, "lastModified": 1759482047,
"narHash": "sha256-+RcbMAjSxV1wW5UpS9abIG1lFZC8bITPiFIKNnE7RLs=", "narHash": "sha256-H1wiXRQHxxPyMMlP39ce3ROKCwI5/tUn36P8x6dFiiQ=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "80c9e9830d460c944c8f730065f18bb733bc7ee2", "rev": "c5d5786d3dc938af0b279c542d1e43bce381b4b9",
"revCount": 792, "revCount": 996,
"type": "git", "type": "git",
"url": "https://spectrum-os.org/git/spectrum" "url": "https://spectrum-os.org/git/spectrum"
}, },
@@ -357,11 +394,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1743458889, "lastModified": 1760981884,
"narHash": "sha256-eVTtsCPio3Wj/g/gvKTsyjh90vrNsmgjzXK9jMfcboM=", "narHash": "sha256-ASFWbOhuB6i3AKze5sHCvTM+nqHIuUEZy9MGiTcdZxA=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "b61466549e2687628516aa1f9ba73f251935773a", "rev": "b67eb2d778a34c0dceb91a236b390fe493aa3465",
"revCount": 30, "revCount": 32,
"type": "git", "type": "git",
"url": "https://git.dynamicdiscord.de/kalipso/tasklist" "url": "https://git.dynamicdiscord.de/kalipso/tasklist"
}, },
@@ -450,11 +487,11 @@
"utils": "utils_4" "utils": "utils_4"
}, },
"locked": { "locked": {
"lastModified": 1745336164, "lastModified": 1764942243,
"narHash": "sha256-Ge9KXaxHSDiw5onii4Ugd6g6LHpLMKplaKyouwdpcFw=", "narHash": "sha256-P02Zm0VAON9SqRxqe6h5vfxgpCBYeiz5JPWGIn6KFFg=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "ef2e6c99a79a17b683d86d560dc790a523f10741", "rev": "f56b7eb6887b7e0fecae4a1f4c1311392eebad8d",
"revCount": 131, "revCount": 156,
"type": "git", "type": "git",
"url": "https://git.dynamicdiscord.de/kalipso/zineshop" "url": "https://git.dynamicdiscord.de/kalipso/zineshop"
}, },

View File

@@ -3,7 +3,7 @@
inputs = { inputs = {
nixos-hardware.url = "github:NixOS/nixos-hardware/master"; nixos-hardware.url = "github:NixOS/nixos-hardware/master";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
sops-nix.url = "github:Mic92/sops-nix"; sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs"; sops-nix.inputs.nixpkgs.follows = "nixpkgs";
@@ -13,6 +13,11 @@
disko.url = "github:nix-community/disko/latest"; disko.url = "github:nix-community/disko/latest";
disko.inputs.nixpkgs.follows = "nixpkgs"; disko.inputs.nixpkgs.follows = "nixpkgs";
dns = {
url = "github:kirelagin/dns.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
utils = { utils = {
url = "github:numtide/flake-utils"; url = "github:numtide/flake-utils";
}; };
@@ -38,7 +43,7 @@
}; };
home-manager= { home-manager= {
url = "github:nix-community/home-manager/release-24.11"; url = "github:nix-community/home-manager/release-25.05";
inputs = { inputs = {
nixpkgs.follows = "nixpkgs"; nixpkgs.follows = "nixpkgs";
}; };

View File

@@ -48,12 +48,12 @@ in
firefox firefox
thunderbird thunderbird
telegram-desktop telegram-desktop
tor-browser-bundle-bin tor-browser
keepassxc keepassxc
libreoffice libreoffice
gimp gimp
inkscape inkscape
okular kdePackages.okular
element-desktop element-desktop
chromium chromium
mpv mpv

View File

@@ -29,7 +29,6 @@ with lib;
enable = true; enable = true;
enablePromtail = true; enablePromtail = true;
logNginx = true; logNginx = true;
lokiHost = "10.0.0.14";
}; };
services.malobeo-tasklist.enable = true; services.malobeo-tasklist.enable = true;

View File

@@ -43,16 +43,6 @@ in
}; };
}; };
services.nginx.virtualHosts."cloud.malobeo.org" = {
forceSSL = true;
enableACME= true;
locations."/" = {
proxyPass = "http://10.0.0.10";
extraConfig = ''
'';
};
};
services.nginx.virtualHosts."grafana.malobeo.org" = { services.nginx.virtualHosts."grafana.malobeo.org" = {
forceSSL = true; forceSSL = true;
enableACME= true; enableACME= true;
@@ -74,23 +64,6 @@ in
}; };
services.nginx.virtualHosts."zines.malobeo.org" = {
forceSSL = true;
enableACME= true;
locations."/" = {
proxyPass = "http://10.0.0.10";
extraConfig = ''
client_body_in_file_only clean;
client_body_buffer_size 32K;
client_max_body_size 50M;
sendfile on;
send_timeout 300s;
'';
};
};
services.nginx.virtualHosts."status.malobeo.org" = { services.nginx.virtualHosts."status.malobeo.org" = {
forceSSL = true; forceSSL = true;
enableACME= true; enableACME= true;

View File

@@ -1,11 +1,14 @@
{ inputs, config, ... }: { inputs, config, ... }:
let let
sshKeys = import ../ssh_keys.nix; sshKeys = import ../ssh_keys.nix;
peers = import ../modules/malobeo/peers.nix;
hosts = import ../hosts.nix {};
in in
{ {
sops.defaultSopsFile = ./secrets.yaml; sops.defaultSopsFile = ./secrets.yaml;
sops.secrets.wg_private = {}; sops.secrets.wg_private = {};
sops.secrets.shop_auth = {}; sops.secrets.shop_auth = {};
sops.secrets.njala_api_key = {};
imports = imports =
[ # Include the results of the hardware scan. [ # Include the results of the hardware scan.
@@ -33,7 +36,7 @@ in
enable = true; enable = true;
enablePromtail = true; enablePromtail = true;
logNginx = true; logNginx = true;
lokiHost = "10.0.0.14"; lokiHost = hosts.malobeo.hosts.overwatch.network.address;
}; };
malobeo.autoUpdate = { malobeo.autoUpdate = {
@@ -85,15 +88,54 @@ in
enable = true; enable = true;
authorizedKeys = sshKeys.admins; authorizedKeys = sshKeys.admins;
ethernetDrivers = ["r8169"]; ethernetDrivers = ["r8169"];
zfsExtraPools = [ "storage" ];
}; };
boot.initrd = {
availableKernelModules = [ "wireguard" ];
# postMountCommands = ''
# ip address flush dev wg-initrd
# ip link set dev wg-initrd down
# '';
systemd = {
enable = true;
network = {
enable = true;
netdevs."30-wg-initrd" = {
netdevConfig = {
Kind = "wireguard";
Name = "wg-initrd";
};
wireguardConfig = { PrivateKeyFile = "/etc/secrets/30-wg-initrd.key"; };
wireguardPeers = [{
AllowedIPs = peers.vpn.allowedIPs;
PublicKey = peers.vpn.publicKey;
Endpoint = "${peers.vpn.publicIp}:${builtins.toString(peers.vpn.listenPort)}";
PersistentKeepalive = 25;
}];
};
networks."30-wg-initrd" = {
name = "wg-initrd";
addresses = [{ Address = "${peers.fanny-initrd.address}/24"; }];
};
};
};
};
boot.initrd.secrets."/etc/secrets/30-wg-initrd.key" = "/etc/wireguard/wg.private";
services.malobeo.vpn = { services.malobeo.vpn = {
enable = true; enable = true;
name = "fanny"; name = "fanny";
privateKeyFile = config.sops.secrets.wg_private.path; privateKeyFile = config.sops.secrets.wg_private.path;
}; };
services.malobeo.microvm.enableHostBridge = true; services.malobeo.microvm = {
enableHostBridge = true;
interface = "enp1s0";
gateway = "192.168.1.1";
address = "192.168.1.2/24";
};
services.malobeo.microvm.deployHosts = [ services.malobeo.microvm.deployHosts = [
"overwatch" "overwatch"
"infradocs" "infradocs"
@@ -114,29 +156,61 @@ in
}; };
}; };
security.acme = {
acceptTerms = true;
defaults.email = "malobeo@systemli.org";
defaults = {
dnsProvider = "njalla";
credentialsFile = config.sops.secrets.njala_api_key.path;
dnsPropagationCheck = false;
};
};
services.nginx = { services.nginx = {
enable = true; enable = true;
virtualHosts."docs.malobeo.org" = { virtualHosts."docs.malobeo.org" = {
locations."/" = { locations."/" = {
proxyPass = "http://10.0.0.11:9000"; proxyPass = "http://${hosts.malobeo.hosts.infradocs.network.address}:9000";
extraConfig = '' extraConfig = ''
proxy_set_header Host $host; proxy_set_header Host $host;
''; '';
}; };
}; };
virtualHosts."cloud.malobeo.org" = { virtualHosts."cloud.hq.malobeo.org" = {
forceSSL = true;
enableACME = true;
acmeRoot = null;
locations."/" = { locations."/" = {
proxyPass = "http://10.0.0.13"; proxyPass = "http://${hosts.malobeo.hosts.nextcloud.network.address}";
extraConfig = '' extraConfig = ''
proxy_set_header Host $host; proxy_set_header Host $host;
client_max_body_size ${inputs.self.nixosConfigurations.nextcloud.config.services.nextcloud.maxUploadSize};
client_body_timeout 3600s;
send_timeout 3600s;
fastcgi_buffers 64 4K;
'';
};
};
virtualHosts."cloud.malobeo.org" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://${hosts.malobeo.hosts.nextcloud.network.address}";
extraConfig = ''
proxy_set_header Host $host;
client_max_body_size ${inputs.self.nixosConfigurations.nextcloud.config.services.nextcloud.maxUploadSize};
client_body_timeout 3600s;
send_timeout 3600s;
fastcgi_buffers 64 4K;
''; '';
}; };
}; };
virtualHosts."grafana.malobeo.org" = { virtualHosts."grafana.malobeo.org" = {
locations."/" = { locations."/" = {
proxyPass = "http://10.0.0.14"; proxyPass = "http://${hosts.malobeo.hosts.overwatch.network.address}";
extraConfig = '' extraConfig = ''
proxy_set_header Host $host; proxy_set_header Host $host;
''; '';
@@ -145,19 +219,38 @@ in
virtualHosts."tasklist.malobeo.org" = { virtualHosts."tasklist.malobeo.org" = {
locations."/" = { locations."/" = {
proxyPass = "http://10.0.0.5:8080"; proxyPass = "http://${hosts.malobeo.hosts.durruti.network.address}:8080";
extraConfig = '' extraConfig = ''
proxy_set_header Host $host; proxy_set_header Host $host;
''; '';
}; };
}; };
virtualHosts."zines.malobeo.org" = { virtualHosts."zines.hq.malobeo.org" = {
# created with: nix-shell --packages apacheHttpd --run 'htpasswd -B -c foo.txt malobeo' forceSSL = true;
# then content of foo.txt put into sops enableACME = true;
# basicAuthFile = config.sops.secrets.shop_auth.path; acmeRoot = null;
locations."/" = { locations."/" = {
proxyPass = "http://10.0.0.15:8080"; proxyPass = "http://${hosts.malobeo.hosts.zineshop.network.address}:8080";
extraConfig = ''
proxy_set_header Host $host;
client_body_in_file_only clean;
client_body_buffer_size 32K;
client_max_body_size 50M;
sendfile on;
send_timeout 300s;
'';
};
};
virtualHosts."zines.malobeo.org" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://${hosts.malobeo.hosts.zineshop.network.address}:8080";
extraConfig = '' extraConfig = ''
proxy_set_header Host $host; proxy_set_header Host $host;

View File

@@ -1,9 +1,6 @@
wg_private: ENC[AES256_GCM,data:YEmIfgtyHE9msYijva0Ye2w7shVmYBPZ3mcKRF7Cy20xa6yHEUQ0kC2OWnM=,iv:ouK6fHcrxrEtsmiPmtCz9Ca8Ec1algOifrgZSBNHi74=,tag:524e/SQt++hwVyeWruCsLg==,type:str] wg_private: ENC[AES256_GCM,data:YEmIfgtyHE9msYijva0Ye2w7shVmYBPZ3mcKRF7Cy20xa6yHEUQ0kC2OWnM=,iv:ouK6fHcrxrEtsmiPmtCz9Ca8Ec1algOifrgZSBNHi74=,tag:524e/SQt++hwVyeWruCsLg==,type:str]
njala_api_key: ENC[AES256_GCM,data:uEzx7KeI7ZZP63Igu5vHmuvASVxJai8bezM40UZVobQMr7r6opjnVTc0BPyIGfnG2mx/6Bo=,iv:lch04oGn6bkqtBGVzYlz6B97FGXlGOoxkiT1IplSxm4=,tag:bzXx2jSqFBv1hgJO1r5i+w==,type:str]
sops: sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age: age:
- recipient: age18jn5mrfs4gqrnv0e2sxsgh3kq4sgxx39hwr8z7mz9kt7wlgaasjqlr88ng - recipient: age18jn5mrfs4gqrnv0e2sxsgh3kq4sgxx39hwr8z7mz9kt7wlgaasjqlr88ng
enc: | enc: |
@@ -23,8 +20,8 @@ sops:
NjJ5cFdTVS9NZmVWMjcrcHo2WDZEZDgKiDwkuUn90cDmidwYGZBb5qp+4R1HafV0 NjJ5cFdTVS9NZmVWMjcrcHo2WDZEZDgKiDwkuUn90cDmidwYGZBb5qp+4R1HafV0
vMQfjT9GrwB5K/O1GumOmvbzLNhvO2vRZJhfVHzyHLzQK64abQgF5Q== vMQfjT9GrwB5K/O1GumOmvbzLNhvO2vRZJhfVHzyHLzQK64abQgF5Q==
-----END AGE ENCRYPTED FILE----- -----END AGE ENCRYPTED FILE-----
lastmodified: "2025-01-19T22:46:09Z" lastmodified: "2026-02-20T18:33:50Z"
mac: ENC[AES256_GCM,data:eU3SIqAGrgbO2tz4zH1tgYcif7oe5j+/wmdYl2xXXI+D6IhiKrTJGvzE3rd3ElEpb+Bg0UQId952U2Ut0yPTfxGLtdlbJA66CmhLAksByoJ8lOXUcp/qDyA4yMRSuwYG2v7uF2crvue9fyRfZ7hl7abE/Q7Z2UjOKqhSZC5cO3U=,iv:NmCVvtBWZRzhpr5nMLy+98VuQZWoUms7xFSxq8PMvBA=,tag:UWjA7oqoNWh4wb0myNg7FA==,type:str] mac: ENC[AES256_GCM,data:YlsQVjfgtlcSObjLiZif/sOJNx2PqH9q0kguPgBSwAoNiX2/eJhNH2WwtQ8uXQfdPiX7kwfFrl2E0xevqwLv+4AICr+9v6oCfcUHJYPRdkLfCs0jXyvnZr52LzfyV3GOPah/j8Uye9d9sspUMqqaXewoeWtrXHgo277pQVdrKxM=,iv:Xb5ckc/cvpGqkZoViTrw8rUniO2OWy0/rNfhF+Qb/iM=,tag:ZhI4jS2Iyig9juVGAeii+w==,type:str]
pgp: pgp:
- created_at: "2025-01-19T22:45:26Z" - created_at: "2025-01-19T22:45:26Z"
enc: |- enc: |-
@@ -65,4 +62,4 @@ sops:
-----END PGP MESSAGE----- -----END PGP MESSAGE-----
fp: aef8d6c7e4761fc297cda833df13aebb1011b5d4 fp: aef8d6c7e4761fc297cda833df13aebb1011b5d4
unencrypted_suffix: _unencrypted unencrypted_suffix: _unencrypted
version: 3.9.2 version: 3.11.0

View File

@@ -1,11 +1,8 @@
wg_private: ENC[AES256_GCM,data:kFuLzZz9lmtUccQUIYiXvJRf7WBg5iCq1xxCiI76J3TaIBELqgbEmUtPR4g=,iv:0S0uzX4OVxQCKDOl1zB6nDo8152oE7ymBWdVkPkKlro=,tag:gg1n1BsnjNPikMBNB60F5Q==,type:str] wg_private: ENC[AES256_GCM,data:kFuLzZz9lmtUccQUIYiXvJRf7WBg5iCq1xxCiI76J3TaIBELqgbEmUtPR4g=,iv:0S0uzX4OVxQCKDOl1zB6nDo8152oE7ymBWdVkPkKlro=,tag:gg1n1BsnjNPikMBNB60F5Q==,type:str]
shop_cleartext: ENC[AES256_GCM,data:sifpX/R6JCcNKgwN2M4Dbflgnfs5CqB8ez5fULPohuFS6k36BLemWzEk,iv:1lRYausj7V/53sfSO9UnJ2OC/Si94JXgIo81Ld74BE8=,tag:5osQU/67bvFeUGA90BSiIA==,type:str] shop_cleartext: ENC[AES256_GCM,data:sifpX/R6JCcNKgwN2M4Dbflgnfs5CqB8ez5fULPohuFS6k36BLemWzEk,iv:1lRYausj7V/53sfSO9UnJ2OC/Si94JXgIo81Ld74BE8=,tag:5osQU/67bvFeUGA90BSiIA==,type:str]
shop_auth: ENC[AES256_GCM,data:0NDIRjmGwlSFls12sCb5OlgyGTCHpPQIjycEJGhYlZsWKhEYXV2u3g1RHMkF8Ny913jarjf0BgwSq5pBD9rgPL9t8X8=,iv:3jgCv/Gg93Mhdm4eYzwF9QrK14QL2bcC4wwSajCA88o=,tag:h8dhMK46hABv9gYW4johkA==,type:str] shop_auth: ENC[AES256_GCM,data:0NDIRjmGwlSFls12sCb5OlgyGTCHpPQIjycEJGhYlZsWKhEYXV2u3g1RHMkF8Ny913jarjf0BgwSq5pBD9rgPL9t8X8=,iv:3jgCv/Gg93Mhdm4eYzwF9QrK14QL2bcC4wwSajCA88o=,tag:h8dhMK46hABv9gYW4johkA==,type:str]
njala_api_key: ENC[AES256_GCM,data:T9cZas/3ju54h22SaDnx/dx4lhJiMi6foRilxSDxQ+e0bw2A8szkFPdxqK6XSuRckCUg3YI=,iv:HonCrH0H2rfUC7VMk8jRV/12NJBXh8uICos0OAHfETI=,tag:aGoiGzljuoX2RoPDlOKgOA==,type:str]
sops: sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age: age:
- recipient: age136sz3lzhxf74ryruvq34d4tmmxnezkqkgu6zqa3dm582c22fgejqagrqxk - recipient: age136sz3lzhxf74ryruvq34d4tmmxnezkqkgu6zqa3dm582c22fgejqagrqxk
enc: | enc: |
@@ -25,8 +22,8 @@ sops:
QVZyNWVOMTh3ejBha21Qb2xCRkFERGMKH9nMQUoS5bGcLUx2T1dOmKd9jshttTrP QVZyNWVOMTh3ejBha21Qb2xCRkFERGMKH9nMQUoS5bGcLUx2T1dOmKd9jshttTrP
SKFx7MXcjFRLKS2Ij12V8ftjL3Uod6be5zoMibkxK19KmXY/514Jww== SKFx7MXcjFRLKS2Ij12V8ftjL3Uod6be5zoMibkxK19KmXY/514Jww==
-----END AGE ENCRYPTED FILE----- -----END AGE ENCRYPTED FILE-----
lastmodified: "2025-04-14T10:34:55Z" lastmodified: "2026-02-20T18:33:24Z"
mac: ENC[AES256_GCM,data:vcDXtTi0bpqhHnL6XanJo+6a8f5LAE628HazDVaNO34Ll3eRyhi95eYGXQDDkVk2WUn9NJ5oCMPltnU82bpLtskzTfQDuXHaPZJq5gtOuMH/bAKrY0dfShrdyx71LkA4AFlcI1P5hchpbyY1FK3iqe4D0miBv+Q8lCMgQMVrfxI=,iv:1lMzH899K0CnEtm16nyq8FL/aCkSYJVoj7HSKCyUnPg=,tag:mEbkmFNg5VZtSKqq80NrCw==,type:str] mac: ENC[AES256_GCM,data:JpZRz3fUMkGbIVVtP1TerhQ+BY3nOsgJsTxb7Uqw9RL7JxvurbWeYK9GTAUzJeGi5O7XQia6/M2MI+K1xxGF4AM7NeSLiZEfGeGC4zmV7inIFgNJy/1lUdnsnZkw8NeOKx16t1b+GqY4xGhDcpVU12RaU4D7/Z0BBM+soc9O6hg=,iv:Um49dRgm5i0I0BrWqsEwn4zjm8eOdnl6SQgG9gScCXU=,tag:0JaSpb8V4WoismawGEYTlg==,type:str]
pgp: pgp:
- created_at: "2025-02-11T18:32:49Z" - created_at: "2025-02-11T18:32:49Z"
enc: |- enc: |-
@@ -67,4 +64,4 @@ sops:
-----END PGP MESSAGE----- -----END PGP MESSAGE-----
fp: aef8d6c7e4761fc297cda833df13aebb1011b5d4 fp: aef8d6c7e4761fc297cda833df13aebb1011b5d4
unencrypted_suffix: _unencrypted unencrypted_suffix: _unencrypted
version: 3.9.4 version: 3.11.0

View File

@@ -1,82 +1,102 @@
{ ... }: { ... }:
let
createMaloNet = hostId: mac: {
local = true;
hostId = hostId;
address = "192.168.1.${hostId}";
gateway = "192.168.1.1";
nameservers = [ "192.168.1.17" "1.1.1.1" ]; #setting ns1 as nameserver
mac = mac;
};
createOffsiteNet = hostId: mac: {
local = false;
hostId = hostId;
address = "10.0.0.${hostId}";
gateway = "10.0.0.1";
nameservers = [ "1.1.1.1" ];
mac = mac;
};
in
{ {
#TODO: fix local 192.168.1.0/24 addresses they are just palceholders!
malobeo = { malobeo = {
hosts = { hosts = {
louise = { louise = {
type = "host"; type = "host";
network = {
local = true;
hostId = "11";
address = "192.168.1.101";
};
}; };
bakunin = { bakunin = {
type = "host"; type = "host";
network = {
local = true;
hostId = "12";
address = "192.168.1.12";
};
}; };
fanny = { fanny = {
type = "host"; type = "host";
network = {
local = true;
hostId = "13";
address = "192.168.1.13";
};
}; };
lucia = { lucia = {
type = "rpi"; type = "rpi";
network = {
local = true;
hostId = "15";
address = "192.168.1.15";
};
}; };
durruti = { durruti = {
type = "microvm"; type = "microvm";
network = { network = createMaloNet "5" "52:DA:0D:F9:EF:F9";
address = "10.0.0.5";
mac = "52:DA:0D:F9:EF:F9";
};
}; };
vpn = { vpn = {
type = "microvm"; type = "microvm";
network = { network = createOffsiteNet "10" "52:DA:0D:F9:EF:E6";
address = "10.0.0.10";
mac = "D0:E5:CA:F0:D7:E6";
};
}; };
infradocs = { infradocs = {
type = "microvm"; type = "microvm";
network = { network = createMaloNet "11" "52:DA:0D:F9:EF:E7";
address = "10.0.0.11";
mac = "D0:E5:CA:F0:D7:E7";
};
}; };
uptimekuma = { uptimekuma = {
type = "microvm"; type = "microvm";
network = { network = createOffsiteNet "12" "52:DA:0D:F9:EF:E8";
address = "10.0.0.12";
mac = "D0:E5:CA:F0:D7:E8";
};
}; };
nextcloud = { nextcloud = {
type = "microvm"; type = "microvm";
network = { network = createMaloNet "13" "52:DA:0D:F9:EF:E9";
address = "10.0.0.13";
mac = "D0:E5:CA:F0:D7:E9";
};
}; };
overwatch = { overwatch = {
type = "microvm"; type = "microvm";
network = { network = createMaloNet "14" "52:DA:0D:F9:EF:E0";
address = "10.0.0.14";
mac = "D0:E5:CA:F0:D7:E0";
};
}; };
zineshop = { zineshop = {
type = "microvm"; type = "microvm";
network = { network = createMaloNet "15" "52:DA:0D:F9:EF:F1";
address = "10.0.0.15";
mac = "D0:E5:CA:F0:D7:F1";
};
}; };
testvm = { ns1 = {
type = "host"; type = "microvm";
network = createMaloNet "17" "52:DA:0D:F9:EF:F3";
}; };
}; };
}; };

View File

@@ -19,7 +19,6 @@ with lib;
enable = true; enable = true;
enablePromtail = true; enablePromtail = true;
logNginx = true; logNginx = true;
lokiHost = "10.0.0.14";
}; };
system.stateVersion = "22.11"; # Did you read the comment? system.stateVersion = "22.11"; # Did you read the comment?

View File

@@ -31,12 +31,12 @@
firefox firefox
thunderbird thunderbird
telegram-desktop telegram-desktop
tor-browser-bundle-bin tor-browser
keepassxc keepassxc
libreoffice libreoffice
gimp gimp
inkscape inkscape
okular kdePackages.okular
element-desktop element-desktop
chromium chromium
mpv mpv

View File

@@ -35,8 +35,7 @@ in
services = { services = {
dokuwiki.sites."wiki.malobeo.org" = { dokuwiki.sites."wiki.malobeo.org" = {
enable = true; #acl = "* @ALL 8"; # everyone can edit using this config
#acl = "* @ALL 8"; # everyone can edit using this config
# note there is a users file at # note there is a users file at
# /var/lib/dokuwiki/<wiki-name>/users.auth.php # /var/lib/dokuwiki/<wiki-name>/users.auth.php
# makes sense to edit it by hand # makes sense to edit it by hand

View File

@@ -43,7 +43,7 @@ rec {
]; ];
defaultModules = baseModules; defaultModules = baseModules;
makeMicroVM = hostName: ipv4Addr: macAddr: modules: [ makeMicroVM = hostName: network: modules: [
{ {
microvm = { microvm = {
hypervisor = "cloud-hypervisor"; hypervisor = "cloud-hypervisor";
@@ -83,7 +83,7 @@ rec {
{ {
type = "tap"; type = "tap";
id = "vm-${hostName}"; id = "vm-${hostName}";
mac = "${macAddr}"; mac = "${network.mac}";
} }
]; ];
}; };
@@ -93,9 +93,9 @@ rec {
systemd.network.networks."20-lan" = { systemd.network.networks."20-lan" = {
matchConfig.Type = "ether"; matchConfig.Type = "ether";
networkConfig = { networkConfig = {
Address = [ "${ipv4Addr}/24" ]; Address = [ "${network.address}/24" ];
Gateway = "10.0.0.1"; Gateway = "${network.gateway}";
DNS = ["1.1.1.1"]; DNS = network.nameservers;
DHCP = "no"; DHCP = "no";
}; };
}; };
@@ -165,6 +165,16 @@ rec {
}); });
}; };
systemd.network.networks."20-lan" = pkgs.lib.mkForce {
matchConfig.Type = "ether";
networkConfig = {
Address = [ "10.0.0.${hosts.malobeo.hosts.${hostname}.network.hostId}/24" ];
Gateway = "10.0.0.1";
DNS = [ "1.1.1.1" ];
DHCP = "no";
};
};
boot.isContainer = pkgs.lib.mkForce false; boot.isContainer = pkgs.lib.mkForce false;
services.timesyncd.enable = false; services.timesyncd.enable = false;
users.users.root.password = ""; users.users.root.password = "";
@@ -210,8 +220,7 @@ rec {
specialArgs.self = self; specialArgs.self = self;
config = { config = {
imports = (makeMicroVM "${name}" imports = (makeMicroVM "${name}"
"${hosts.malobeo.hosts.${name}.network.address}" hosts.malobeo.hosts.${name}.network [
"${hosts.malobeo.hosts.${name}.network.mac}" [
../${name}/configuration.nix ../${name}/configuration.nix
(vmMicroVMOverwrites name { (vmMicroVMOverwrites name {
withNetworking = true; withNetworking = true;
@@ -250,7 +259,7 @@ rec {
modules = (if (settings.type != "microvm") then modules = (if (settings.type != "microvm") then
defaultModules ++ [ ../${host}/configuration.nix ] defaultModules ++ [ ../${host}/configuration.nix ]
else else
makeMicroVM "${host}" "${settings.network.address}" "${settings.network.mac}" [ makeMicroVM "${host}" settings.network [
inputs.microvm.nixosModules.microvm inputs.microvm.nixosModules.microvm
../${host}/configuration.nix ../${host}/configuration.nix
]); ]);

View File

@@ -22,6 +22,11 @@ in
description = "Ethernet drivers to load: run `lspci -k | grep -iA4 ethernet`"; description = "Ethernet drivers to load: run `lspci -k | grep -iA4 ethernet`";
example = "r8169"; example = "r8169";
}; };
zfsExtraPools = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
description = "Name or GUID of extra ZFS pools that you wish to import during boot.";
};
}; };
config = lib.mkIf (cfg.enable && config.malobeo.disks.encryption) { config = lib.mkIf (cfg.enable && config.malobeo.disks.encryption) {
@@ -32,35 +37,43 @@ in
zfs = { zfs = {
forceImportAll = true; forceImportAll = true;
requestEncryptionCredentials = true; requestEncryptionCredentials = true;
extraPools = cfg.zfsExtraPools;
}; };
initrd = { initrd = {
availableKernelModules = cfg.ethernetDrivers; availableKernelModules = cfg.ethernetDrivers;
systemd = { systemd = {
initrdBin = [ pkgs.busybox pkgs.wireguard-tools pkgs.iproute2 ];
enable = true; enable = true;
network.enable = true; network.enable = true;
services."stopInitVpn" = {
description = "stop init vpn";
wantedBy = [
"initrd.target"
];
after = [
"zfs.target"
];
serviceConfig.StandardOutput = "journal+console";
script = ''
networkctl down wg-initrd
'';
serviceConfig.Type = "oneshot";
};
}; };
network.ssh = { network = {
enable = true; flushBeforeStage2 = true;
port = 222; ssh = {
authorizedKeys = cfg.authorizedKeys; enable = true;
hostKeys = [ "/etc/ssh/initrd" ]; port = 222;
authorizedKeys = cfg.authorizedKeys;
hostKeys = [ "/etc/ssh/initrd" ];
};
}; };
secrets = { secrets = {
"/etc/ssh/initrd" = "/etc/ssh/initrd"; "/etc/ssh/initrd" = "/etc/ssh/initrd";
}; };
systemd.services.zfs-remote-unlock = {
description = "Prepare for ZFS remote unlock";
wantedBy = ["initrd.target"];
after = ["systemd-networkd.service"];
path = with pkgs; [ zfs ];
serviceConfig.Type = "oneshot";
script = ''
echo "systemctl default" >> /var/empty/.profile
'';
};
}; };
kernelParams = [ "ip=::::${hostName}-initrd::dhcp" ]; kernelParams = [ "ip=::::${hostName}-initrd::dhcp" ];
}; };
}; };
} }

View File

@@ -1,6 +1,7 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.malobeo.metrics; cfg = config.malobeo.metrics;
hosts = import ../../hosts.nix {};
in in
{ {
options.malobeo.metrics = { options.malobeo.metrics = {
@@ -21,7 +22,7 @@ in
}; };
lokiHost = lib.mkOption { lokiHost = lib.mkOption {
type = lib.types.str; type = lib.types.str;
default = "10.0.0.14"; default = hosts.malobeo.hosts.overwatch.network.address;
description = "Address of loki host"; description = "Address of loki host";
}; };
}; };

View File

@@ -14,6 +14,26 @@ in
description = lib.mdDoc "Setup bridge device for microvms."; description = lib.mdDoc "Setup bridge device for microvms.";
}; };
interface = mkOption {
default = "eno1";
type = types.str;
};
gateway = mkOption {
default = "10.0.0.1";
type = types.str;
};
address = mkOption {
default = "10.0.0.1/24";
type = types.str;
};
dns = mkOption {
default = [ "1.1.1.1" ];
type = types.listOf types.str;
};
enableHostBridgeUnstable = mkOption { enableHostBridgeUnstable = mkOption {
default = false; default = false;
type = types.bool; type = types.bool;
@@ -47,29 +67,29 @@ in
systemd.network = mkIf (cfg.enableHostBridge || cfg.enableHostBridgeUnstable) { systemd.network = mkIf (cfg.enableHostBridge || cfg.enableHostBridgeUnstable) {
enable = true; enable = true;
# create a bride device that all the microvms will be connected to networks."10-lan" = {
netdevs."10-microvm".netdevConfig = { matchConfig.Name = [ "${cfg.interface}" "vm-*"];
Kind = "bridge";
Name = "microvm";
};
networks."10-microvm" = {
matchConfig.Name = "microvm";
networkConfig = { networkConfig = {
DHCPServer = true; Bridge = "malobeo0";
IPv6SendRA = true;
}; };
addresses = if cfg.enableHostBridgeUnstable then [
{ Address = "10.0.0.1/24"; }
] else [
{ addressConfig.Address = "10.0.0.1/24"; }
];
}; };
# connect the vms to the bridge netdevs."malobeo0" = {
networks."11-microvm" = { netdevConfig = {
matchConfig.Name = "vm-*"; Name = "malobeo0";
networkConfig.Bridge = "microvm"; Kind = "bridge";
};
};
networks."10-lan-bridge" = {
matchConfig.Name = "malobeo0";
networkConfig = {
Address = [ "${cfg.address}" ];
Gateway = "${cfg.gateway}";
DNS = cfg.dns;
IPv6AcceptRA = true;
};
linkConfig.RequiredForOnline = "routable";
}; };
}; };

View File

@@ -44,6 +44,14 @@
publicKey = "3U59F6T1s/1LaZBIa6wB0qsVuO6pRR9jfYZJIH2piAU="; publicKey = "3U59F6T1s/1LaZBIa6wB0qsVuO6pRR9jfYZJIH2piAU=";
}; };
"fanny-initrd" = {
role = "client";
address = "10.100.0.102";
allowedIPs = [ "10.100.0.102/32" ];
#TODO: UPDATE
publicKey = "h1A2yt7OQ5EJIilC8tQg203u27o6J6/c+Kd/pZ4UWAY=";
};
"backup0" = { "backup0" = {
role = "client"; role = "client";
address = "10.100.0.20"; address = "10.100.0.20";

View File

@@ -0,0 +1,41 @@
{ inputs }:
let
vpnNS = "vpn";
localNS = "hq";
peers = import ./peers.nix;
hosts = ((import ../../hosts.nix ) {}).malobeo.hosts;
in
{
SOA = {
nameServer = "ns1";
adminEmail = "admin@malobeo.org";
serial = 2019030801;
};
useOrigin = false;
NS = [
"ns1.malobeo.org."
];
subdomains = {
ns1 = {
A = [ hosts.ns1.network.address ];
};
${localNS} = {
A = [ hosts.fanny.network.address ];
subdomains = builtins.mapAttrs (name: value: if value.network.local == true then {
A = [ value.network.address ];
} else {}) hosts;
};
${vpnNS} = {
A = [ peers.vpn.address ];
subdomains = builtins.mapAttrs (name: value: if value.role != "server" then {
A = [ value.address ];
} else {}) peers;
};
};
}

View File

@@ -2,6 +2,9 @@
with lib; with lib;
let
hosts = import ../hosts.nix {};
in
{ {
sops.defaultSopsFile = ./secrets.yaml; sops.defaultSopsFile = ./secrets.yaml;
sops.secrets = { sops.secrets = {
@@ -28,15 +31,18 @@ with lib;
enable = true; enable = true;
enablePromtail = true; enablePromtail = true;
logNginx = true; logNginx = true;
lokiHost = "10.0.0.14"; };
services.postgresqlBackup = {
enable = true;
}; };
services.nextcloud = { services.nextcloud = {
enable = true; enable = true;
package = pkgs.nextcloud31; package = pkgs.nextcloud32;
hostName = "cloud.malobeo.org"; hostName = "cloud.malobeo.org";
config.adminpassFile = config.sops.secrets.nextcloudAdminPass.path; config.adminpassFile = config.sops.secrets.nextcloudAdminPass.path;
#https = true; #disable for testing maxUploadSize = "10G";
datadir = "/data/services/nextcloud/"; datadir = "/data/services/nextcloud/";
database.createLocally = true; database.createLocally = true;
config.dbtype = "pgsql"; config.dbtype = "pgsql";
@@ -47,16 +53,16 @@ with lib;
}; };
extraAppsEnable = true; extraAppsEnable = true;
extraApps = { extraApps = {
inherit (config.services.nextcloud.package.packages.apps) contacts calendar deck polls registration collectives forms; inherit (config.services.nextcloud.package.packages.apps) contacts calendar polls registration collectives forms;
appointments = pkgs.fetchNextcloudApp { deck = pkgs.fetchNextcloudApp {
sha256 = "sha256-ls1rLnsX7U9wo2WkEtzhrvliTcWUl6LWXolE/9etJ78="; sha256 = "sha256-epjwIANb6vTNx9KqaG6jZc14YPoFMBTCj+/c9JHcWkA=";
url = "https://github.com/SergeyMosin/Appointments/raw/refs/tags/v2.4.3/build/artifacts/appstore/appointments.tar.gz"; url = "https://link.storjshare.io/raw/jvrl62dakd6htpyxohjkiiqiw5ma/mal/deck32.tar.gz";
license = "agpl3Plus"; license = "agpl3Plus";
}; };
}; };
settings = { settings = {
trusted_domains = ["10.0.0.13"]; trusted_domains = [ "cloud.malobeo.org" ];
trusted_proxies = [ "10.0.0.1" ]; trusted_proxies = [ hosts.malobeo.hosts.fanny.network.address ];
"maintenance_window_start" = "1"; "maintenance_window_start" = "1";
"default_phone_region" = "DE"; "default_phone_region" = "DE";
}; };

View File

@@ -0,0 +1,52 @@
{ config, self, lib, inputs, pkgs, ... }:
with lib;
with inputs;
let
dns = inputs.dns;
in
{
networking = {
hostName = mkDefault "ns1";
useDHCP = false;
};
imports = [
../modules/malobeo_user.nix
../modules/sshd.nix
../modules/minimal_tools.nix
../modules/autoupdate.nix
];
networking.firewall = {
enable = true;
allowedTCPPorts = [ 53 ];
allowedUDPPorts = [ 53 ];
};
services.bind = {
enable = true;
forwarders = [
"1.1.1.1"
"1.0.0.1"
];
cacheNetworks = [
"127.0.0.0/24"
"10.0.0.0/24"
"192.168.1.0/24"
"10.100.0.0/24"
];
zones = {
"malobeo.org" = {
master = true;
file = pkgs.writeText "zone-malobeo.org" (dns.lib.toString "malobeo.org" (import ../modules/malobeo/zones.nix { inherit inputs; }));
};
};
};
system.stateVersion = "22.11"; # Did you read the comment?
}

View File

@@ -2,6 +2,9 @@
with lib; with lib;
let
hosts = import ../hosts.nix {};
in
{ {
networking = { networking = {
hostName = mkDefault "overwatch"; hostName = mkDefault "overwatch";
@@ -12,6 +15,7 @@ with lib;
self.nixosModules.malobeo.metrics self.nixosModules.malobeo.metrics
../modules/malobeo_user.nix ../modules/malobeo_user.nix
../modules/sshd.nix ../modules/sshd.nix
./printer_module.nix
]; ];
networking.firewall.allowedTCPPorts = [ 80 3100 ]; networking.firewall.allowedTCPPorts = [ 80 3100 ];
@@ -20,7 +24,6 @@ with lib;
enable = true; enable = true;
enablePromtail = true; enablePromtail = true;
logNginx = false; logNginx = false;
lokiHost = "10.0.0.14";
}; };
services.grafana = { services.grafana = {
@@ -66,9 +69,9 @@ with lib;
services.nginx = { services.nginx = {
enable = true; enable = true;
virtualHosts.${config.services.grafana.domain} = { virtualHosts.${config.services.grafana.settings.server.domain} = {
locations."/" = { locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.services.grafana.port}"; proxyPass = "http://127.0.0.1:${toString config.services.grafana.settings.server.http_port}";
proxyWebsockets = true; proxyWebsockets = true;
extraConfig = '' extraConfig = ''
@@ -77,6 +80,8 @@ with lib;
}; };
}; };
}; };
printer_scraping.enable = true;
services.prometheus = { services.prometheus = {
enable = true; enable = true;
@@ -89,34 +94,40 @@ with lib;
targets = [ "127.0.0.1:9002" ]; targets = [ "127.0.0.1:9002" ];
}]; }];
} }
{
job_name = "printer";
static_configs = [{
targets = [ "127.0.0.1:9091" ];
}];
}
{ {
job_name = "durruti"; job_name = "durruti";
static_configs = [{ static_configs = [{
targets = [ "10.0.0.5:9002" ]; targets = [ "${hosts.malobeo.hosts.durruti.network.address}:9002" ];
}]; }];
} }
{ {
job_name = "infradocs"; job_name = "infradocs";
static_configs = [{ static_configs = [{
targets = [ "10.0.0.11:9002" ]; targets = [ "${hosts.malobeo.hosts.infradocs.network.address}:9002" ];
}]; }];
} }
{ {
job_name = "nextcloud"; job_name = "nextcloud";
static_configs = [{ static_configs = [{
targets = [ "10.0.0.13:9002" ]; targets = [ "${hosts.malobeo.hosts.nextcloud.network.address}:9002" ];
}]; }];
} }
{ {
job_name = "zineshop"; job_name = "zineshop";
static_configs = [{ static_configs = [{
targets = [ "10.0.0.15:9002" ]; targets = [ "${hosts.malobeo.hosts.zineshop.network.address}:9002" ];
}]; }];
} }
{ {
job_name = "fanny"; job_name = "fanny";
static_configs = [{ static_configs = [{
targets = [ "10.0.0.1:9002" ]; targets = [ "${hosts.malobeo.hosts.fanny.network.address}:9002" ];
}]; }];
} }
# add vpn - check how to reach it first. most probably 10.100.0.1 # add vpn - check how to reach it first. most probably 10.100.0.1

View File

@@ -23750,8 +23750,8 @@
}, },
{ {
"current": { "current": {
"text": "10.0.0.13:9002", "text": "192.168.1.13:9002",
"value": "10.0.0.13:9002" "value": "192.168.1.13:9002"
}, },
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",

View File

@@ -0,0 +1,33 @@
{config, lib, pkgs, ...}:
{
options.printer_scraping = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enable the script to pull data from the printer";
};
timer = lib.mkOption {
type = lib.types.str;
default = "1m";
description = "systemd timer for script execution";
};
};
config = lib.mkIf config.printer_scraping.enable {
systemd.services."printer-scraping" = {
description = "Pull printer stats and upload to influxdb";
serviceConfig.Type = "oneshot";
path = with pkgs; [yq jq curl bash];
script = "bash ${./pull_info.sh}";
};
systemd.timers."printer-scraping" = {
wantedBy = ["timers.target"];
timerConfig = {
OnBootSec = "5s";
OnUnitActiveSec = config.printer_scraping.timer;
Unit = "printer-scraping.service";
};
};
services.prometheus.pushgateway.enable = true; #Im not dealing with influx
};
}

View File

@@ -6,7 +6,7 @@ positions:
filename: /tmp/positions.yaml filename: /tmp/positions.yaml
clients: clients:
- url: http://10.0.0.13:3100/loki/api/v1/push - url: http://192.168.1.13:3100/loki/api/v1/push
scrape_configs: scrape_configs:

View File

@@ -0,0 +1,133 @@
#!/usr/bin/env bash
set -eo pipefail
for command in "jq" "xq" "grep" "curl" "sed"
do
if ! command -v $command >/dev/null 2>&1
then
echo "$command could not be found"
exit 1
fi
done
#Functions---------------
get_cookie () {
if [[ $1 == "-d" ]]; then
cookie=$(cat request_example_1.txt)
else
cookie=$(curl -s -D - -X GET http://192.168.1.42/wcd/index.html)
fi
exitCode="$?"
if [[ $exitCode == "7" ]];
then
echo "Server offline"
exit 0
elif [[ $exitCode != "0" ]];
then
echo "Something went wrong"
exit 1
fi
cookie=$(echo "$cookie" | grep Set-Cookie | grep -oP "ID=\K[^.]+" )
if [[ $cookie == "" ]]
then
echo "No cookie got!"
exit 1
fi
}
get_values () {
local path="$1"
local -n keys=$2
local name="$3"
local_system_counter_data=$(echo "$system_counter_data" | jq "$path | .[]")
for key in "${keys[@]}";
do
value=$(echo "$local_system_counter_data" |
jq "select(.Type==\"$key\") | .Count" |
sed 's/"//g'
)
valueStore=$(echo "$valueStore"; echo "$name"_"$key" "$value")
done
}
get_values_DeviceStatus () {
local -n keys=$1
local name="$2"
local_system_counter_data=$(echo "$system_counter_data" | jq ".MFP.Common.DeviceStatus")
for key in "${keys[@]}";
do
value=$(echo "$local_system_counter_data" |
jq ".$key" |
sed 's/"//g'
)
valueStore=$(echo "$valueStore"; echo "$name"_"$key" "$value")
done
}
get_values_consumables () {
local -n keys=$1
local name="$2"
local_system_consumables_data=$(echo "$system_consumables_data" | jq ".[] |.DeviceInfo.ConsumableList.Consumable | .[]")
for key in "${keys[@]}";
do
value=$(
echo "$local_system_consumables_data" |
jq "select(.Name==\"$key\") | .CurrentLevel.LevelPer" |
sed 's/"//g'
)
valueStore=$(echo "$valueStore"; echo "$name"_"${key//[^a-zA-Z_-]/_}" "$value")
done
}
#End Functions----------
#Variables-----------------------
system_counter_DeviceStatus_keys=("ScanStatus" "PrintStatus" "Processing" "NetworkErrorStatus" "KmSaasgw" "HddMirroringErrorStatus")
system_counter_TotalCounter_keys=("Total" "DuplexTotal" "Document" "Paper" "TotalLarge" "PrintPageTotal" "PaperSizeA3" "PaperSizeA4" "PaperSizeB4" "PaperSizeB5" "PaperSizeOther" "Nin12in1" "PaperTypeNormal" "PaperTypeOther")
system_counter_FullColorCounter_keys=("PrintPageTotal" "A3" "A4" "B4" "B5" "Other")
system_counter_BlackCounter_keys=("PrintPageTotal" "A3" "A4" "B4" "B5" "Other")
system_counter_DoubleColorCounter_keys=("PrintPageTotal" "A3" "A4" "B4" "B5" "Other")
system_counter_CopyCounter_keys=("BwTotal" "FullColorTotal" "Total" "BwLarge" "FullColorLarge" "BiColorLarge")
system_counter_PrintCounter_keys=("BwTotal" "FullColorTotal" "BiColorTotal" "Total" "BwLarge" "FullColorLarge" "BiColorLarge")
system_counter_ScanFaxCounter_keys=("DocumentReadTotal" "DocumentReadLarge" "FaxReceive" "FaxSend")
system_consumables_base_keys=("Toner (Yellow)" "Toner (Magenta)" "Toner (Cyan)" "Toner (Black)" "Drum Cartridge (Cyan)" "Developer Cartridge (Cyan)" "Drum Cartridge (Magenta)" "Developer Cartridge (Magenta)" "Drum Cartridge (Yellow)" "Developer Cartridge (Yellow)" "Drum Cartridge (Black)" "Developer Cartridge (Black)" "Fusing Unit" "Image Transfer Belt Unit" "Transfer Roller Unit")
#End Variables-------------
echo "Getting cookie"
get_cookie "$@"
echo "Start extracting info from system_counter"
if [[ $1 == "-d" ]]; then
system_counter_data=$(cat system_counter.xml |xq)
else
system_counter_data=$(curl -s -X GET http://192.168.1.42/wcd/system_counter.xml -H "Cookie: ID=$cookie" |xq)
fi
get_values ".MFP.Count.UserCounterInfo.TotalCounterList.TotalCounter" system_counter_TotalCounter_keys TotalCounter
get_values ".MFP.Count.UserCounterInfo.PaperSheetCounter.FullColorCounterList.FullColorCounter" system_counter_FullColorCounter_keys FullColorCounter
get_values ".MFP.Count.UserCounterInfo.PaperSheetCounter.BlackCounterList.BlackCounter" system_counter_BlackCounter_keys BlackCounter
get_values ".MFP.Count.UserCounterInfo.PaperSheetCounter.DoubleColorCounterList.DoubleColorCounter" system_counter_DoubleColorCounter_keys DoubleColorCounter
get_values ".MFP.Count.UserCounterInfo.CopyCounterList.CopyCounter" system_counter_CopyCounter_keys CopyCounter
get_values ".MFP.Count.UserCounterInfo.ScanFaxCounterList.ScanFaxCounter" system_counter_ScanFaxCounter_keys ScanFaxCounter
get_values_DeviceStatus system_counter_DeviceStatus_keys DeviceStatus
echo "Start extracting info from system_consumables"
if [[ $1 == "-d" ]]; then
system_consumables_data=$(cat system_consumables.xml |xq)
else
system_consumables_data=$(curl -s -X GET http://192.168.1.42/wcd/system_consumable.xml -H "Cookie: ID=$cookie" |xq)
fi
get_values_consumables system_consumables_base_keys Consumables
echo "Sending data to prometheus-pushgateway..."
echo "$valueStore" | curl -s --data-binary @- http://localhost:9091/metrics/job/printer
echo "Success!"
exit 0

View File

@@ -7,6 +7,6 @@
]; ];
backup = [ backup = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDIGryhnXdmbGObONG88K+c9zeduMrwtoLHwzMDZg3UXB+Cnq2FXWOrlLZxA+95VUgHpyGZiykJmzeWrKhldDlDeGGd8QCCLeuliiOgXADTYjWaVfhd+6arPZrK2VtqqsguvH40gW1xfoGAOmAT4WFnxWxIaEip0V2u6NOoKTiH9I3bz2Qe4lfJvPXig+XwCXcukXd6XUkDFYDpiw8XNV3X7pqTus5d2RYR97bAhIYZZQ6h50ZpTY8N0lFh4RY5yfx8BhxJW3tfoi9uZvVuPx7dGPsZsSniENFPMNz3UwHGitTJMr4088cJrAGgd5lyFuLouiHiM2JMGA0wx9wWTbWJEwTLaTVQK9gSJf857ndV2zCh9vKlfko4w9bQgqxKg4U/mY8dXX1E7D51nD2ci8Ed+ZG+NEneFLyZhLsD82GkBY+YovA+4xm/pcx+hBhlyqGNxI8v+Jh+JhEyD/ZLgJfq3ZMbGIGsTiDwZ2flLLxImHHEoDoT6PHU6hDhPDJu560=" "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDIGryhnXdmbGObONG88K+c9zeduMrwtoLHwzMDZg3UXB+Cnq2FXWOrlLZxA+95VUgHpyGZiykJmzeWrKhldDlDeGGd8QCCLeuliiOgXADTYjWaVfhd+6arPZrK2VtqqsguvH40gW1xfoGAOmAT4WFnxWxIaEip0V2u6NOoKTiH9I3bz2Qe4lfJvPXig+XwCXcukXd6XUkDFYDpiw8XNV3X7pqTus5d2RYR97bAhIYZZQ6h50ZpTY8N0lFh4RY5yfx8BhxJW3tfoi9uZvVuPx7dGPsZsSniENFPMNz3UwHGitTJMr4088cJrAGgd5lyFuLouiHiM2JMGA0wx9wWTbWJEwTLaTVQK9gSJf857ndV2zCh9vKlfko4w9bQgqxKg4U/mY8dXX1E7D51nD2ci8Ed+ZG+NEneFLyZhLsD82GkBY+YovA+4xm/pcx+hBhlyqGNxI8v+Jh+JhEyD/ZLgJfq3ZMbGIGsTiDwZ2flLLxImHHEoDoT6PHU6hDhPDJu560="
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJKl5FWPskhlnzJs1+mMYrVTMNnRG92uFKUgGlteTPhL" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPP4s6qNKwtu2l5DRKU/Xo6lMRztqNw/MOVsKx58kUE8 root@silizium"
]; ];
} }

View File

@@ -40,15 +40,6 @@ with lib;
}; };
}; };
virtualHosts."cloud.malobeo.org" = {
locations."/" = {
proxyPass = "http://10.100.0.101";
extraConfig = ''
proxy_set_header Host $host;
'';
};
};
virtualHosts."grafana.malobeo.org" = { virtualHosts."grafana.malobeo.org" = {
locations."/" = { locations."/" = {
proxyPass = "http://10.100.0.101"; proxyPass = "http://10.100.0.101";
@@ -66,28 +57,6 @@ with lib;
''; '';
}; };
}; };
virtualHosts."zines.malobeo.org" = {
locations."/" = {
proxyPass = "http://10.100.0.101";
extraConfig = ''
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Authorization $http_authorization; # Pass the Authorization header
proxy_pass_header Authorization;
client_body_in_file_only clean;
client_body_buffer_size 32K;
client_max_body_size 50M;
sendfile on;
send_timeout 300s;
'';
};
};
}; };
system.stateVersion = "22.11"; # Did you read the comment? system.stateVersion = "22.11"; # Did you read the comment?

View File

@@ -20,7 +20,6 @@ with lib;
enable = true; enable = true;
enablePromtail = true; enablePromtail = true;
logNginx = true; logNginx = true;
lokiHost = "10.0.0.14";
}; };
services.printing.enable = true; services.printing.enable = true;

View File

@@ -37,7 +37,7 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems
sops.sops-init-gpg-key sops.sops-init-gpg-key
pkgs.sops pkgs.sops
pkgs.age pkgs.age
pkgs.python310Packages.grip pkgs.python313Packages.grip
pkgs.mdbook pkgs.mdbook
pkgs.ssh-to-age pkgs.ssh-to-age
microvmpkg.microvm microvmpkg.microvm

View File

@@ -31,10 +31,13 @@ cd "$pwpath"
# Generate SSH keys # Generate SSH keys
ssh-keygen -f $hostkey -t ed25519 -N "" -C "root@$host" ssh-keygen -f $hostkey -t ed25519 -N "" -C "root@$host"
ssh-keygen -f $initrdkey -t ed25519 -N "" -C "root@$host-initrd" ssh-keygen -f $initrdkey -t ed25519 -N "" -C "root@$host-initrd"
wg genkey > wg.private
publickey=$(cat wg.private | wg pubkey)
#encrypt the private keys #encrypt the private keys
sops -e -i ./$hostkey sops -e -i ./$hostkey
sops -e -i ./$initrdkey sops -e -i ./$initrdkey
sops -e -i ./wg.private
#generate encryption key #generate encryption key
tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 20 > disk.key tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 20 > disk.key
@@ -45,6 +48,9 @@ echo
echo "Hier ist der age public key für sops etc:" echo "Hier ist der age public key für sops etc:"
echo "$(ssh-to-age -i ./"$hostkey".pub)" echo "$(ssh-to-age -i ./"$hostkey".pub)"
echo echo
echo "Hier ist der wireguard pubkey für das gerät"
echo "$publickey"
echo
echo "Hier ist eine reproduzierbare mac-addresse:" echo "Hier ist eine reproduzierbare mac-addresse:"
echo "$hostname"|md5sum|sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/' echo "$hostname"|md5sum|sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/'

View File

@@ -40,7 +40,9 @@ trap cleanup EXIT
# Create the directory where sshd expects to find the host keys # Create the directory where sshd expects to find the host keys
install -d -m755 "$temp/etc/ssh/" install -d -m755 "$temp/etc/ssh/"
install -d -m755 "$temp/etc/wireguard/"
##TODO:: wg genkey + pubkey --> /etc/wireguard/wg.private
diskKey=$(sops -d $pwpath/disk.key) diskKey=$(sops -d $pwpath/disk.key)
echo "$diskKey" > /tmp/secret.key echo "$diskKey" > /tmp/secret.key
@@ -48,6 +50,7 @@ sops -d "$pwpath/$hostkey" > "$temp/etc/ssh/$hostname"
sops -d "$pwpath/$initrdkey" > "$temp/etc/ssh/initrd" sops -d "$pwpath/$initrdkey" > "$temp/etc/ssh/initrd"
sops -d "$pwpath/wg.private" > "$temp/etc/wireguard/wg.private"
# # Set the correct permissions so sshd will accept the key # # Set the correct permissions so sshd will accept the key
chmod 600 "$temp/etc/ssh/$hostname" chmod 600 "$temp/etc/ssh/$hostname"
chmod 600 "$temp/etc/ssh/initrd" chmod 600 "$temp/etc/ssh/initrd"

View File

@@ -24,14 +24,16 @@ diskkey=$(sops -d machines/$hostname/secrets/disk.key)
echo echo
if [ $# = 1 ] if [ $# = 1 ]
then then
echo "$diskkey" | ssh $sshoptions root@$hostname-initrd "systemd-tty-ask-password-agent" #root ssh $sshoptions root@$hostname-initrd "zpool import -a"
echo "$diskkey" | ssh $sshoptions root@$hostname-initrd "zfs load-key storage/encrypted" #root
echo "$diskkey" | ssh $sshoptions root@$hostname-initrd "systemd-tty-ask-password-agent" #data echo "$diskkey" | ssh $sshoptions root@$hostname-initrd "systemd-tty-ask-password-agent" #data
elif [ $# = 2 ] elif [ $# = 2 ]
then then
ip=$2 ip=$2
echo "$diskkey" | ssh $sshoptions root@$ip "systemd-tty-ask-password-agent" #root ssh $sshoptions root@$ip "zpool import -a"
echo "$diskkey" | ssh $sshoptions root@$ip "systemd-tty-ask-password-agent" #data echo "$diskkey" | ssh $sshoptions root@$ip "zfs load-key storage/encrypted"
echo "$diskkey" | ssh $sshoptions root@$ip "systemd-tty-ask-password-agent"
else else
echo echo