2023-12-07 01:07:31 +01:00
|
|
|
{ pkgs, ... }:
|
|
|
|
let
|
|
|
|
HOST_DOMAIN = "helcel.net";
|
|
|
|
DB_HOST = "10.10.1.2";
|
|
|
|
DB_PORT = "3306";
|
|
|
|
MAIL_HOST_DOMAIN = "norereply.${HOST_DOMAIN}";
|
|
|
|
MAIL_SERVER_DOMAIN = "mail.infomaniak.com";
|
|
|
|
DATA_PATH = "/media/data/";
|
|
|
|
in {
|
|
|
|
project.name = "Cloud";
|
|
|
|
|
|
|
|
networks = {
|
|
|
|
internal = {
|
|
|
|
internal = true;
|
|
|
|
external = false;
|
|
|
|
};
|
|
|
|
external = { external = true; };
|
|
|
|
};
|
|
|
|
|
|
|
|
services = {
|
|
|
|
|
|
|
|
cloud_nextcloud.service = {
|
|
|
|
image = "nextcloud:27";
|
|
|
|
container_name = "cloud";
|
|
|
|
restart = "unless-stopped";
|
|
|
|
networks = [ "external" ];
|
2023-11-17 09:55:29 +01:00
|
|
|
volumes = [
|
2023-12-07 01:07:31 +01:00
|
|
|
"${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"
|
|
|
|
];
|
|
|
|
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.tls" = "true";
|
2023-11-17 09:55:29 +01:00
|
|
|
"traefik.http.routers.nextcloud.middlewares" =
|
|
|
|
"sts_headers,nextcloud-caldav";
|
2023-12-07 01:07:31 +01:00
|
|
|
|
2023-11-17 09:55:29 +01:00
|
|
|
"traefik.http.middlewares.nextcloud-caldav.redirectregex.permanent" =
|
|
|
|
"true";
|
|
|
|
"traefik.http.middlewares.nextcloud-caldav.redirectregex.regex" =
|
|
|
|
"^https://(.*)/.well-known/(card|cal)dav";
|
|
|
|
"traefik.http.middlewares.nextcloud-caldav.redirectregex.replacement" =
|
|
|
|
"https://$\${1}/remote.php/dav/";
|
2023-12-07 01:07:31 +01:00
|
|
|
"traefik.http.middlewares.sts_headers.headers.stsSeconds" = "15552000";
|
2023-11-17 09:55:29 +01:00
|
|
|
"traefik.http.middlewares.sts_headers.headers.stsIncludeSubdomains" =
|
|
|
|
"true";
|
2023-12-07 01:07:31 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
cloud_office.service = {
|
|
|
|
image = "collabora/code:latest";
|
|
|
|
container_name = "cloud_office";
|
|
|
|
restart = "unless-stopped";
|
|
|
|
networks = [ "external" ];
|
|
|
|
volumes = [ ];
|
|
|
|
environment = {
|
|
|
|
username = "COLLABORA_USER";
|
|
|
|
password = "COLLABORA_PASSWORD";
|
|
|
|
aliasgroup1 = "https://cloud.${HOST_DOMAIN}";
|
|
|
|
server_name = "office.${HOST_DOMAIN}";
|
|
|
|
VIRTUAL_HOST = "office.${HOST_DOMAIN}";
|
|
|
|
VIRTUAL_PORT = "9980";
|
|
|
|
VIRTUAL_PROTO = "http";
|
|
|
|
DONT_GEN_SSL_CERT = "true";
|
|
|
|
RESOLVE_TO_PROXY_IP = "true";
|
|
|
|
NETWORK_ACCESS = "internal";
|
|
|
|
extra_params = "--o:ssl.enable=false --o:ssl.termination=true";
|
|
|
|
dictionaries = "en fr de jp no";
|
|
|
|
};
|
|
|
|
labels = {
|
|
|
|
"traefik.enable" = "true";
|
|
|
|
"traefik.http.routers.collabora.entrypoints" = "web-secure";
|
|
|
|
"traefik.http.routers.collabora.rule" = "Host(`office.${HOST_DOMAIN}`)";
|
|
|
|
"traefik.http.routers.collabora.tls" = "true";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
cloud_etherpad.service = {
|
|
|
|
image = "etherpad/etherpad:latest";
|
|
|
|
container_name = "etherpad";
|
|
|
|
restart = "unless-stopped";
|
|
|
|
networks = [ "external" ];
|
2023-11-17 09:55:29 +01:00
|
|
|
volumes = [
|
2023-12-07 01:07:31 +01:00
|
|
|
"${DATA_PATH}/ether/etherpad/data:/opt/etherpad-lite/var"
|
|
|
|
"/${DATA_PATH}/ether/etherpad/APIKEY.txt:/opt/etherpad-lite/APIKEY.txt"
|
|
|
|
];
|
2023-11-17 09:55:29 +01:00
|
|
|
environment = {
|
2023-12-07 01:07:31 +01:00
|
|
|
NODE_ENV = "production";
|
|
|
|
TITLE = "Helcel-Pad";
|
|
|
|
DB_TYPE = "mysql";
|
|
|
|
DB_HOST = DB_HOST;
|
|
|
|
DB_PORT = DB_PORT;
|
|
|
|
DB_NAME = "etherpad";
|
|
|
|
DB_USER = "ETHERPAD_DB_USER";
|
|
|
|
DB_PASS = "ETHERPAD_DB_PASSWORD";
|
|
|
|
DB_CHARSET = "utf8mb4";
|
|
|
|
DEFAULT_PAD_TEXT = "P A D";
|
|
|
|
PAD_OPTIONS_SHOW_LINE_NUMBERS = "true";
|
|
|
|
PAD_OPTIONS_USE_MONOSPACE_FONT = "true";
|
|
|
|
ADMIN_PASSWORD = "ETHERPAD_ADMIN_PASSWORD";
|
|
|
|
SKIN_VARIANTS = "super-dark-toolbar light-editor dark-background";
|
|
|
|
};
|
|
|
|
labels = {
|
|
|
|
"traefik.enable" = "true";
|
|
|
|
"traefik.http.routers.etherpad.entrypoints" = "web-secure";
|
|
|
|
"traefik.http.routers.etherpad.rule" = "Host(`pad.${HOST_DOMAIN}`)";
|
|
|
|
"traefik.http.routers.etherpad.tls" = "true";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
cloud_ethercalc.service = {
|
|
|
|
image = "audreyt/ethercalc:latest";
|
|
|
|
container_name = "ethercalc";
|
|
|
|
restart = "unless-stopped";
|
|
|
|
networks = [ "external" "internal" ];
|
2023-11-17 09:55:29 +01:00
|
|
|
volumes = [
|
2023-12-07 01:07:31 +01:00
|
|
|
"${DATA_PATH}/ether/etherpad/data:/opt/etherpad-lite/var"
|
|
|
|
"/${DATA_PATH}/ether/etherpad/APIKEY.txt:/opt/etherpad-lite/APIKEY.txt"
|
|
|
|
];
|
2023-11-17 09:55:29 +01:00
|
|
|
environment = {
|
2023-12-07 01:07:31 +01:00
|
|
|
NODE_ENV = "production";
|
|
|
|
TITLE = "Helcel-Calc";
|
|
|
|
REDIS_PORT_6379_TCP_ADDR = "redis";
|
|
|
|
REDIS_PORT_6379_TCP_PORT = "6379";
|
|
|
|
ADMIN_PASSWORD = "ETHERPAD_ADMIN_PASSWORD";
|
|
|
|
SKIN_VARIANTS = "super-dark-toolbar light-editor dark-background";
|
|
|
|
};
|
|
|
|
labels = {
|
|
|
|
"traefik.enable" = "true";
|
|
|
|
"traefik.http.routers.ethercalc.entrypoints" = "web-secure";
|
|
|
|
"traefik.http.routers.ethercalc.rule" = "Host(`calc.${HOST_DOMAIN}`)";
|
|
|
|
"traefik.http.routers.ethercalc.tls" = "true";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
cloud_redis.service = {
|
|
|
|
image = "redis:latest";
|
|
|
|
container_name = "ethercalc-redis";
|
|
|
|
restart = "unless-stopped";
|
|
|
|
networks = [ "internal" ];
|
|
|
|
volumes = [ "${DATA_PATH}/ether/ethercalc/redis:/data" ];
|
|
|
|
environment = { };
|
|
|
|
labels = { "traefik.enable" = "false"; };
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|