Added transfer-sh and basic caddy config and lapserv host config.

This commit is contained in:
Jurn Wubben 2025-03-27 19:29:22 +01:00
parent 58dcc86ca8
commit cc42ce672d
8 changed files with 95 additions and 3 deletions

View file

@ -5,6 +5,7 @@
./network
./nix
./programs
./server
./services
];
}

View file

@ -1,3 +1,23 @@
{config, ...}: {
niksos.server.enable = config.niksos.server.enable;
services.caddy = {
enable = config.niksos.server;
email = "jurnwubben@gmail.com";
enableReload = false;
virtualHosts."share.jsw.tf" = {
serverAliases = ["www.share.jsw.tf"];
extraConfig = ''
reverse_proxy :9000
'';
};
globalConfig = ''
http_port 80
https_port 443
auto_https off
bind 192.168.1.114
'';
};
networking.firewall.allowedTCPPorts = [80 443];
}

View file

@ -1,4 +1,4 @@
{lib, ...}: {
imports = [./caddy.nix];
options.niksos.server.enable = lib.mKEnableOption "server servcies (such as caddy).";
imports = [./caddy.nix ./transfer-sh.nix];
options.niksos.server = lib.mkEnableOption "server servcies (such as caddy)."; #TODO: per service option.
}

View file

@ -0,0 +1,18 @@
{config, ...}: {
services.transfer-sh = {
enable = config.niksos.server;
settings = {
PURGE_DAYS = 7;
MAX_UPLOAD_SIZE = 4 * 1000 * 1000; # 2gb
# CORS_DOMAINS = "transfer.jsw.tf"; #FIXME: open it to the world wide web.
BASEDIR = "/var/lib/transfer.sh";
LISTENER = ":9000";
};
};
systemd.services.transfer-sh.serviceConfig = {
StateDirectory = "transfer.sh";
StateDirectoryMode = "0750";
};
#TODO: caddy
}