2023-04-22 02:46:55 +02:00
|
|
|
{ config, lib, pkgs, ... }: {
|
2021-11-25 00:59:46 +01:00
|
|
|
imports = [
|
|
|
|
|
../environment.nix
|
|
|
|
|
../hardware/hcloud.nix
|
2022-09-16 01:29:46 +02:00
|
|
|
../modules
|
2021-11-25 00:59:46 +01:00
|
|
|
../modules/nginx.nix
|
|
|
|
|
../modules/synapse.nix
|
|
|
|
|
../modules/nextcloud.nix
|
2021-12-07 08:34:21 +01:00
|
|
|
../modules/dokuwiki.nix
|
2021-12-07 14:57:13 +01:00
|
|
|
../modules/website-marie.nix
|
2021-12-27 16:39:22 +01:00
|
|
|
../modules/roundcube.nix
|
2022-09-15 21:42:58 +02:00
|
|
|
../modules/monitoring-exporters.nix
|
2021-11-25 00:59:46 +01:00
|
|
|
];
|
|
|
|
|
|
2021-11-29 02:04:29 +01:00
|
|
|
sops.secrets = {
|
|
|
|
|
borgSshKey = {
|
|
|
|
|
owner = config.services.borgbackup.jobs.data.user;
|
|
|
|
|
key = "borg/client_keys/backend1/private";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2022-09-16 01:29:46 +02:00
|
|
|
custom = {
|
|
|
|
|
services.backup-job = {
|
|
|
|
|
enable = true;
|
2023-04-22 02:46:55 +02:00
|
|
|
repoName = "bk1";
|
2022-12-01 02:31:13 +01:00
|
|
|
additionalPaths = [ "/var/lib/nextcloud/config" "/var/lib/mastodon" ];
|
2022-09-16 01:29:46 +02:00
|
|
|
readWritePaths = [ "/nix/var/data/murmur" "/nix/var/data/backup/" ];
|
|
|
|
|
preHook = ''
|
|
|
|
|
cp /var/lib/murmur/murmur.sqlite /nix/var/data/murmur/murmur.sqlite
|
|
|
|
|
'';
|
|
|
|
|
startAt = "03:30";
|
|
|
|
|
sshKey = config.sops.secrets.borgSshKey.path;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
services.monit = {
|
|
|
|
|
enable = true;
|
|
|
|
|
additionalConfig = ''
|
|
|
|
|
check file nextcloud-data-mounted with path /var/lib/nextcloud/data/index.html
|
|
|
|
|
start = "${pkgs.systemd}/bin/systemctl start nextcloud-data-sshfs.service"
|
2021-11-25 00:59:46 +01:00
|
|
|
|
2022-09-16 01:29:46 +02:00
|
|
|
check host jellyfin with address jellyfin.banditlair.com
|
|
|
|
|
if failed port 443 protocol https with timeout 20 seconds then alert
|
|
|
|
|
check host stb with address www.societe-de-tir-bertrix.com
|
|
|
|
|
if failed port 443 protocol https with timeout 20 seconds then alert
|
|
|
|
|
|
|
|
|
|
check host transmission with address transmission.banditlair.com
|
|
|
|
|
if failed
|
|
|
|
|
port 443
|
|
|
|
|
protocol https
|
|
|
|
|
status = 401
|
|
|
|
|
with timeout 20 seconds
|
|
|
|
|
then alert
|
2022-10-30 01:05:16 +02:00
|
|
|
|
|
|
|
|
check host osteoview with address osteoview.app
|
2022-10-30 01:53:58 +02:00
|
|
|
if failed
|
|
|
|
|
port 443
|
|
|
|
|
protocol https
|
|
|
|
|
status = 200
|
|
|
|
|
request "/api/_health"
|
|
|
|
|
with timeout 5 seconds
|
2022-10-30 02:47:29 +02:00
|
|
|
content = '[{"]Healthy["]:[{}}]'
|
2022-10-30 01:53:58 +02:00
|
|
|
then alert
|
2022-09-16 01:29:46 +02:00
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
services.dokuwiki.enable = true;
|
|
|
|
|
|
|
|
|
|
services.openssh.enable = true;
|
|
|
|
|
|
|
|
|
|
services.murmur.enable = true;
|
2022-12-01 02:31:13 +01:00
|
|
|
|
2023-12-13 18:51:56 +01:00
|
|
|
services.mastodon.enable = false;
|
2022-09-16 01:29:46 +02:00
|
|
|
};
|
2021-12-27 05:28:51 +01:00
|
|
|
|
2022-12-02 06:36:45 +01:00
|
|
|
services.uptime-kuma = {
|
|
|
|
|
enable = true;
|
2023-04-22 02:46:55 +02:00
|
|
|
settings = { PORT = "3001"; };
|
2022-12-02 06:36:45 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
services.nginx.virtualHosts."uptime.froidmont.org" = {
|
|
|
|
|
serverAliases = [ "status.${config.networking.domain}" ];
|
|
|
|
|
forceSSL = true;
|
|
|
|
|
enableACME = true;
|
|
|
|
|
|
|
|
|
|
locations."/" = {
|
2023-04-22 02:46:55 +02:00
|
|
|
proxyPass =
|
|
|
|
|
"http://127.0.0.1:${config.services.uptime-kuma.settings.PORT}";
|
2022-12-02 06:36:45 +01:00
|
|
|
proxyWebsockets = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2021-11-25 00:59:46 +01:00
|
|
|
networking.firewall.allowedTCPPorts = [ 80 443 64738 ];
|
|
|
|
|
networking.firewall.allowedUDPPorts = [ 64738 ];
|
2023-04-22 02:46:55 +02:00
|
|
|
networking.firewall.interfaces."eth1".allowedTCPPorts =
|
|
|
|
|
[ config.services.prometheus.exporters.node.port 9000 ];
|
2021-11-25 00:59:46 +01:00
|
|
|
|
|
|
|
|
}
|