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 = "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"; };
};