Wip Server
Some checks failed
Nix Build / build-nixos (push) Failing after 33s

This commit is contained in:
soraefir
2024-04-20 12:58:28 +02:00
parent 93dd93561f
commit 832471f37d
9 changed files with 174 additions and 33 deletions

View File

@ -1,4 +1,6 @@
{ pkgs, ... }: {
{ config, pkgs, ... }:
let serverCfg = config.syscfg.server;
in {
project.name = "Authentik";
networks = {
@ -40,8 +42,8 @@
restart = "unless-stopped";
networks = [ "internal" "external" ];
volumes = [
"${DATA_PATH}/authentik/media:/media"
"${DATA_PATH}/authentik/templates:/templates"
"${serverCfg.dataPath}/authentik/media:/media"
"${serverCfg.dataPath}/authentik/templates:/templates"
];
environment = {
"AUTHENTIK_REDIS__HOST" = "auth_redis";
@ -50,25 +52,25 @@
"AUTHENTIK_POSTGRESQL__NAME" = "authentik";
"AUTHENTIK_POSTGRESQL__PASSWORD" = "AUTHENTIK_DB_PASSWORD";
"AUTHENTIK_SECRET_KEY" = "AUTHENTIK_SECRET_KEY";
"AUTHENTIK_EMAIL__HOST" = "${MAIL_SERVER_DOMAIN}";
"AUTHENTIK_EMAIL__HOST" = "${serverCfg.mailDomain}";
"AUTHENTIK_EMAIL__PORT" = "587";
"AUTHENTIK_EMAIL__USERNAME" = "noreply@${MAIL_HOST_DOMAIN}";
"AUTHENTIK_EMAIL__USERNAME" = "noreply@${serverCfg.hostDomain}";
"AUTHENTIK_EMAIL__PASSWORD" = "AUTHENTIK_EMAIL_PASSWORD";
"AUTHENTIK_EMAIL__USE_TLS" = "true";
"AUTHENTIK_EMAIL__USE_SSL" = "false";
"AUTHENTIK_EMAIL__TIMEOUT" = "10";
"AUTHENTIK_EMAIL__FROM" = "sso@noreply.${MAIL_HOST_DOMAIN}";
"AUTHENTIK_EMAIL__FROM" = "sso@noreply.${serverCfg.hostDomain}";
};
labels = {
"traefik.enable" = "true";
"traefik.http.routers.sso.entrypoints" = "web-secure";
"traefik.http.routers.sso.rule" = "Host(`sso.${HOST_DOMAIN}`)";
"traefik.http.routers.sso.rule" = "Host(`sso.${serverCfg.hostDomain}`)";
"traefik.http.routers.sso.tls" = "true";
"traefik.http.services.sso.loadbalancer.server.port" = "9000";
"traefik.docker.network" = "external";
};
command = "server";
service.ports = [
ports = [
"9999:9000" # host:container
];
};
@ -79,8 +81,8 @@
restart = "unless-stopped";
networks = [ "internal" ];
volumes = [
"${DATA_PATH}/authentik/media:/media"
"${DATA_PATH}/authentik/templates:/templates"
"${serverCfg.dataPath}/authentik/media:/media"
"${serverCfg.dataPath}/authentik/templates:/templates"
"/var/run/docker.sock:/var/run/docker.sock"
];
environment = {

View File

@ -1,4 +1,6 @@
{ pkgs, ... }: {
{ config, pkgs, ... }:
let serverCfg = config.syscfg.server;
in {
project.name = "Cloud";
networks = {
@ -17,16 +19,17 @@
restart = "unless-stopped";
networks = [ "external" ];
volumes = [
"${DATA_PATH}/data/nextcloud:/var/www/html"
"${DATA_PATH}/data/music:/media/music"
"${DATA_PATH}/data/video:/media/video"
"${DATA_PATH}/data/photo:/media/photo"
"${serverCfg.configPath}/data/nextcloud:/var/www/html"
"${serverCfg.dataPath}/data/music:/media/music"
"${serverCfg.dataPath}/data/video:/media/video"
"${serverCfg.dataPath}/data/photo:/media/photo"
];
tmpfs = [ "/tmp" ];
labels = {
"traefik.enable" = "true";
"traefik.http.routers.nextcloud.entrypoints" = "web-secure";
"traefik.http.routers.nextcloud.rule" = "Host(`cloud.${HOST_DOMAIN}`)";
"traefik.http.routers.nextcloud.rule" =
"Host(`cloud.${serverCfg.hostDomain}`)";
"traefik.http.routers.nextcloud.tls" = "true";
"traefik.http.routers.nextcloud.middlewares" =
"sts_headers,nextcloud-caldav";
@ -52,9 +55,9 @@
environment = {
username = "COLLABORA_USER";
password = "COLLABORA_PASSWORD";
aliasgroup1 = "https://cloud.${HOST_DOMAIN}";
server_name = "office.${HOST_DOMAIN}";
VIRTUAL_HOST = "office.${HOST_DOMAIN}";
aliasgroup1 = "https://cloud.${serverCfg.hostDomain}";
server_name = "office.${serverCfg.hostDomain}";
VIRTUAL_HOST = "office.${serverCfg.hostDomain}";
VIRTUAL_PORT = "9980";
VIRTUAL_PROTO = "http";
DONT_GEN_SSL_CERT = "true";
@ -66,7 +69,8 @@
labels = {
"traefik.enable" = "true";
"traefik.http.routers.collabora.entrypoints" = "web-secure";
"traefik.http.routers.collabora.rule" = "Host(`office.${HOST_DOMAIN}`)";
"traefik.http.routers.collabora.rule" =
"Host(`office.${serverCfg.hostDomain}`)";
"traefik.http.routers.collabora.tls" = "true";
};
};
@ -77,15 +81,15 @@
restart = "unless-stopped";
networks = [ "external" ];
volumes = [
"${DATA_PATH}/ether/etherpad/data:/opt/etherpad-lite/var"
"/${DATA_PATH}/ether/etherpad/APIKEY.txt:/opt/etherpad-lite/APIKEY.txt"
"${serverCfg.dataPath}/ether/etherpad/data:/opt/etherpad-lite/var"
"/${serverCfg.dataPath}/ether/etherpad/APIKEY.txt:/opt/etherpad-lite/APIKEY.txt"
];
environment = {
NODE_ENV = "production";
TITLE = "Helcel-Pad";
DB_TYPE = "mysql";
DB_HOST = DB_HOST;
DB_PORT = DB_PORT;
DB_HOST = serverCfg.dbHost;
DB_PORT = serverCfg.dbPort;
DB_NAME = "etherpad";
DB_USER = "ETHERPAD_DB_USER";
DB_PASS = "ETHERPAD_DB_PASSWORD";
@ -99,7 +103,8 @@
labels = {
"traefik.enable" = "true";
"traefik.http.routers.etherpad.entrypoints" = "web-secure";
"traefik.http.routers.etherpad.rule" = "Host(`pad.${HOST_DOMAIN}`)";
"traefik.http.routers.etherpad.rule" =
"Host(`pad.${serverCfg.hostDomain}`)";
"traefik.http.routers.etherpad.tls" = "true";
};
};
@ -110,8 +115,8 @@
restart = "unless-stopped";
networks = [ "external" "internal" ];
volumes = [
"${DATA_PATH}/ether/etherpad/data:/opt/etherpad-lite/var"
"/${DATA_PATH}/ether/etherpad/APIKEY.txt:/opt/etherpad-lite/APIKEY.txt"
"${serverCfg.dataPath}/ether/etherpad/data:/opt/etherpad-lite/var"
"/${serverCfg.dataPath}/ether/etherpad/APIKEY.txt:/opt/etherpad-lite/APIKEY.txt"
];
environment = {
NODE_ENV = "production";
@ -124,7 +129,8 @@
labels = {
"traefik.enable" = "true";
"traefik.http.routers.ethercalc.entrypoints" = "web-secure";
"traefik.http.routers.ethercalc.rule" = "Host(`calc.${HOST_DOMAIN}`)";
"traefik.http.routers.ethercalc.rule" =
"Host(`calc.${serverCfg.hostDomain}`)";
"traefik.http.routers.ethercalc.tls" = "true";
};
};
@ -134,7 +140,7 @@
container_name = "ethercalc-redis";
restart = "unless-stopped";
networks = [ "internal" ];
volumes = [ "${DATA_PATH}/ether/ethercalc/redis:/data" ];
volumes = [ "${serverCfg.dataPath}/ether/ethercalc/redis:/data" ];
environment = { };
labels = { "traefik.enable" = "false"; };
};