Revert "Set up CGM repository"

This commit is contained in:
coolneng 2024-07-16 19:02:25 +02:00
parent 8d6ec59a29
commit 9d600f8c95
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
6 changed files with 29 additions and 58 deletions

View File

@ -38,38 +38,10 @@
ports = [ "127.0.0.1:9641:9641" ]; ports = [ "127.0.0.1:9641:9641" ];
volumes = [ "/vault/mqtt2prometheus/config.yaml:/config.yaml" ]; volumes = [ "/vault/mqtt2prometheus/config.yaml:/config.yaml" ];
}; };
# CGM repository
nightscout = {
image =
"nightscout/cgm-remote-monitor@sha256:ce522a9fe9b1373f576329e48349a622c8a9b6177c93dc2771152df36dd90876";
environmentFiles = [ config.age.secrets.nightscout.path ];
extraOptions = [ "--pod=cgm-repo" ];
dependsOn = [ "mongodb" ];
};
# CGM repository database
mongodb = {
image =
"mongo:4.4.9@sha256:0837a92d01bcc8c750a8d692ed4df33f0befd07ef261b23e7d9feda04bacd3eb";
volumes = [ "/vault/mongodb:/data/db" ];
extraOptions = [ "--pod=cgm-repo" ];
};
}; };
}; };
}; };
# Allow networking between Cgm-Repo and MongoDB
systemd.services.create-cgm-repo-pod = {
serviceConfig.Type = "oneshot";
wantedBy = [ "podman-mongodb.service" ];
script = with pkgs; ''
${podman}/bin/podman pod exists cgm-repo || ${podman}/bin/podman pod create -n cgm-repo -p '127.0.0.1:1337:1337'
'';
};
# Start services after ZFS mount # Start services after ZFS mount
systemd.services.podman-mongodb.unitConfig.RequiresMountsFor =
[ /vault/mongodb ];
systemd.services.podman-mqtt2prometheus.unitConfig.RequiresMountsFor =
[ /vault/mqtt2prometheus ];
systemd.services.podman-mqtt2prometheus.unitConfig.RequiresMountsFor = [ /vault/mqtt2prometheus ]; systemd.services.podman-mqtt2prometheus.unitConfig.RequiresMountsFor = [ /vault/mqtt2prometheus ];
} }

View File

@ -1,10 +1,16 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
let let
stateDir = "/var/lib/dnscrypt-proxy"; stateDir = "/var/lib/dnscrypt-proxy";
blocklist = "${stateDir}/blocklist.txt"; blocklist = "${stateDir}/blocklist.txt";
in { in
{
# PostgreSQL daily backups # PostgreSQL daily backups
services.postgresqlBackup = { services.postgresqlBackup = {
enable = true; enable = true;
@ -18,7 +24,10 @@ in {
systemd.services.download-dns-blocklist = { systemd.services.download-dns-blocklist = {
description = "Download hosts-blocklists"; description = "Download hosts-blocklists";
wantedBy = [ "default.target" ]; wantedBy = [ "default.target" ];
path = with pkgs; [ curl coreutils ]; path = with pkgs; [
curl
coreutils
];
script = '' script = ''
curl -L https://download.dnscrypt.info/blacklists/domains/mybase.txt -o ${blocklist} curl -L https://download.dnscrypt.info/blacklists/domains/mybase.txt -o ${blocklist}
''; '';

View File

@ -1,5 +1,11 @@
# Web services configuration # Web services configuration
{ config, pkgs, lib, ... }: { {
config,
pkgs,
lib,
...
}:
{
# Reverse proxy configuration # Reverse proxy configuration
services.nginx = { services.nginx = {
@ -9,8 +15,7 @@
recommendedProxySettings = true; recommendedProxySettings = true;
recommendedOptimisation = true; recommendedOptimisation = true;
clientMaxBodySize = "0"; clientMaxBodySize = "0";
sslCiphers = sslCiphers = "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK:!AES128";
"ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK:!AES128";
sslProtocols = "TLSv1.2 TLSv1.3"; sslProtocols = "TLSv1.2 TLSv1.3";
sslDhparam = "/var/lib/dhparams/nginx.pem"; sslDhparam = "/var/lib/dhparams/nginx.pem";
commonHttpConfig = '' commonHttpConfig = ''
@ -36,10 +41,8 @@
locations = { locations = {
"/radicale/".return = "301 https://radicale.coolneng.duckdns.org"; "/radicale/".return = "301 https://radicale.coolneng.duckdns.org";
"/syncthing/".return = "301 https://sync.coolneng.duckdns.org"; "/syncthing/".return = "301 https://sync.coolneng.duckdns.org";
"/gitea/".extraConfig = "/gitea/".extraConfig = "rewrite ^/gitea/(.*)$ https://git.coolneng.duckdns.org/$1 last;";
"rewrite ^/gitea/(.*)$ https://git.coolneng.duckdns.org/$1 last;"; "/miniflux/".extraConfig = "rewrite ^/miniflux/(.*)$ https://rss.coolneng.duckdns.org/$1 last;";
"/miniflux/".extraConfig =
"rewrite ^/miniflux/(.*)$ https://rss.coolneng.duckdns.org/$1 last;";
# Delegation for Matrix # Delegation for Matrix
"/.well-known/" = { "/.well-known/" = {
alias = "${../well-known}" + "/"; alias = "${../well-known}" + "/";
@ -111,8 +114,7 @@
ssl = true; ssl = true;
} }
]; ];
locations."~ ^(/_matrix|/_synapse/client)".proxyPass = locations."~ ^(/_matrix|/_synapse/client)".proxyPass = "http://localhost:8008";
"http://localhost:8008";
}; };
"element.coolneng.duckdns.org" = { "element.coolneng.duckdns.org" = {
useACMEHost = "coolneng.duckdns.org"; useACMEHost = "coolneng.duckdns.org";
@ -165,16 +167,6 @@
proxyWebsockets = true; proxyWebsockets = true;
}; };
}; };
"nightscout.coolneng.duckdns.org" = {
useACMEHost = "coolneng.duckdns.org";
forceSSL = true;
locations."/" = {
proxyPass = "http://localhost:1337";
extraConfig = ''
proxy_set_header X-Forwarded-For $remote_addr;
'';
};
};
}; };
}; };
@ -188,9 +180,9 @@
webroot = "/var/lib/acme/acme-challenge"; webroot = "/var/lib/acme/acme-challenge";
ocspMustStaple = true; ocspMustStaple = true;
}; };
certs."coolneng.duckdns.org".extraDomainNames = certs."coolneng.duckdns.org".extraDomainNames = lib.attrsets.mapAttrsToList (
lib.attrsets.mapAttrsToList (name: value: "${name}") name: value: "${name}"
config.services.nginx.virtualHosts; ) config.services.nginx.virtualHosts;
}; };
# Generate dhparams # Generate dhparams

View File

@ -37,7 +37,6 @@ services=(
"podman-mqtt2prometheus.service" "podman-mqtt2prometheus.service"
"prometheus.service" "prometheus.service"
"grafana.service" "grafana.service"
"podman-nightscout.service"
) )
for var in "${services[@]}"; do for var in "${services[@]}"; do

Binary file not shown.

View File

@ -1,7 +1,7 @@
let let
zion = zion = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFRqINHR7/zc+c3/PuR+NeSsBHXXzBiEtFWSK6QaxQTW";
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFRqINHR7/zc+c3/PuR+NeSsBHXXzBiEtFWSK6QaxQTW"; in
in { {
"wireguard.age".publicKeys = [ zion ]; "wireguard.age".publicKeys = [ zion ];
"syncthing.age".publicKeys = [ zion ]; "syncthing.age".publicKeys = [ zion ];
"msmtp.age".publicKeys = [ zion ]; "msmtp.age".publicKeys = [ zion ];
@ -14,7 +14,6 @@ in {
"telegram.age".publicKeys = [ zion ]; "telegram.age".publicKeys = [ zion ];
"mqtt-sender.age".publicKeys = [ zion ]; "mqtt-sender.age".publicKeys = [ zion ];
"mqtt-receiver.age".publicKeys = [ zion ]; "mqtt-receiver.age".publicKeys = [ zion ];
"nightscout.age".publicKeys = [ zion ];
"facebook.age".publicKeys = [ zion ]; "facebook.age".publicKeys = [ zion ];
"signal.age".publicKeys = [ zion ]; "signal.age".publicKeys = [ zion ];
} }