2024-08-26 05:38:10 +02:00
|
|
|
{
|
|
|
|
|
config,
|
|
|
|
|
lib,
|
|
|
|
|
pkgs,
|
|
|
|
|
...
|
|
|
|
|
}:
|
|
|
|
|
{
|
|
|
|
|
imports = [
|
|
|
|
|
../environment.nix
|
|
|
|
|
../hardware/hcloud.nix
|
|
|
|
|
../modules
|
|
|
|
|
];
|
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 = {
|
2024-03-26 23:37:53 +01:00
|
|
|
|
2022-09-16 01:29:46 +02:00
|
|
|
services.backup-job = {
|
|
|
|
|
enable = true;
|
2023-04-22 02:46:55 +02:00
|
|
|
repoName = "bk1";
|
2024-08-26 05:38:10 +02:00
|
|
|
additionalPaths = [
|
|
|
|
|
"/var/lib/nextcloud/config"
|
|
|
|
|
"/var/lib/mastodon"
|
|
|
|
|
];
|
|
|
|
|
readWritePaths = [
|
|
|
|
|
"/nix/var/data/murmur"
|
|
|
|
|
"/nix/var/data/backup/"
|
|
|
|
|
];
|
2022-09-16 01:29:46 +02:00
|
|
|
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
|
2024-08-26 05:38:10 +02:00
|
|
|
content = "Healthy"
|
2022-10-30 01:53:58 +02:00
|
|
|
then alert
|
2022-09-16 01:29:46 +02:00
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2024-03-26 23:37:53 +01:00
|
|
|
services.nginx.enable = true;
|
2022-09-16 01:29:46 +02:00
|
|
|
services.dokuwiki.enable = true;
|
|
|
|
|
services.openssh.enable = true;
|
|
|
|
|
services.murmur.enable = true;
|
2023-12-13 18:51:56 +01:00
|
|
|
services.mastodon.enable = false;
|
2024-03-26 23:37:53 +01:00
|
|
|
services.synapse.enable = true;
|
|
|
|
|
services.nextcloud.enable = true;
|
|
|
|
|
services.roundcube.enable = true;
|
|
|
|
|
services.monitoring-exporters.enable = true;
|
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;
|
2024-08-26 05:38:10 +02:00
|
|
|
settings = {
|
|
|
|
|
PORT = "3001";
|
|
|
|
|
};
|
2022-12-02 06:36:45 +01:00
|
|
|
};
|
|
|
|
|
|
2024-03-26 23:37:53 +01:00
|
|
|
services.nginx.virtualHosts = {
|
|
|
|
|
"osteopathie.froidmont.org" = {
|
|
|
|
|
enableACME = true;
|
|
|
|
|
forceSSL = true;
|
|
|
|
|
root = "/nix/var/data/website-marie";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
"uptime.froidmont.org" = {
|
|
|
|
|
serverAliases = [ "status.${config.networking.domain}" ];
|
|
|
|
|
forceSSL = true;
|
|
|
|
|
enableACME = true;
|
2022-12-02 06:36:45 +01:00
|
|
|
|
2024-03-26 23:37:53 +01:00
|
|
|
locations."/" = {
|
2024-08-26 05:38:10 +02:00
|
|
|
proxyPass = "http://127.0.0.1:${config.services.uptime-kuma.settings.PORT}";
|
2024-03-26 23:37:53 +01:00
|
|
|
proxyWebsockets = true;
|
|
|
|
|
};
|
2022-12-02 06:36:45 +01:00
|
|
|
};
|
|
|
|
|
|
2024-03-26 23:37:53 +01:00
|
|
|
"www.fautlfer.com" = {
|
|
|
|
|
enableACME = true;
|
|
|
|
|
forceSSL = true;
|
2024-01-30 08:20:48 +01:00
|
|
|
|
2024-03-26 23:37:53 +01:00
|
|
|
locations."= /".extraConfig = ''
|
|
|
|
|
return 302 https://blogz.zaclys.com/faut-l-fer/;
|
|
|
|
|
'';
|
|
|
|
|
};
|
2024-01-30 08:20:48 +01:00
|
|
|
|
2024-03-26 23:37:53 +01:00
|
|
|
"fautlfer.com" = {
|
|
|
|
|
enableACME = true;
|
|
|
|
|
forceSSL = true;
|
2024-01-30 08:20:48 +01:00
|
|
|
|
2024-03-26 23:37:53 +01:00
|
|
|
locations."= /".extraConfig = ''
|
|
|
|
|
return 302 https://blogz.zaclys.com/faut-l-fer/;
|
|
|
|
|
'';
|
|
|
|
|
};
|
2024-01-30 08:20:48 +01:00
|
|
|
};
|
|
|
|
|
|
2024-08-26 05:38:10 +02:00
|
|
|
networking.firewall.allowedTCPPorts = [
|
|
|
|
|
80
|
|
|
|
|
443
|
|
|
|
|
64738
|
|
|
|
|
];
|
2021-11-25 00:59:46 +01:00
|
|
|
networking.firewall.allowedUDPPorts = [ 64738 ];
|
2024-08-26 05:38:10 +02:00
|
|
|
networking.firewall.interfaces."eth1".allowedTCPPorts = [
|
|
|
|
|
config.services.prometheus.exporters.node.port
|
|
|
|
|
9000
|
|
|
|
|
];
|
2021-11-25 00:59:46 +01:00
|
|
|
|
|
|
|
|
}
|