hosts/suwako: use 2 filehost services :wowo:

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2025-11-11 22:35:36 +05:30
parent 3e7e404d4c
commit 95825c6ff1
5 changed files with 376 additions and 546 deletions

View File

@@ -16,6 +16,7 @@
domain = { domain = {
natto = "weirdnatto.in"; natto = "weirdnatto.in";
amneesh = "amneesh.com"; amneesh = "amneesh.com";
chutiya = "chutiya.online";
}; };
}; };

851
flake.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -52,7 +52,7 @@
}; };
filehost = { filehost = {
url = "github:natto1784/simpler-filehost"; url = "github:natto1784/yamaf";
}; };
nix-gaming.url = "github:fufexan/nix-gaming"; nix-gaming.url = "github:fufexan/nix-gaming";

View File

@@ -1,25 +1,39 @@
{ {
config, lib,
pkgs, pkgs,
inputs, inputs,
conf, conf,
... ...
}: }:
{ {
systemd.services.filehost = { systemd.services = rec {
enable = true; filehost = {
wantedBy = [ "multi-user.target" ]; enable = true;
serviceConfig = { wantedBy = [ "multi-user.target" ];
Type = "simple"; serviceConfig = {
Environment = [ Type = "simple";
"TITLE=nattofiles" Environment = [
"USER_URL=https://f.${conf.network.addresses.domain.natto}" "TITLE=nattofiles"
"ROCKET_LIMITS={file=\"512MB\",data-form=\"512MB\"}" "INTERNAL_HOST=0.0.0.0"
"ROCKET_LOG_LEVEL=debug" "INTERNAL_PORT=8000"
"ROCKET_ADDRESS=0.0.0.0" "MAX_FILESIZE_MB=500"
]; "EXTERNAL_HAS_TLS=1"
Restart = "on-failure"; "EXTERNAL_HOST=f.${conf.network.addresses.domain.natto}"
ExecStart = "${inputs.filehost.packages.${pkgs.system}.simpler-filehost}/bin/simpler-filehost"; ];
Restart = "on-failure";
ExecStart = "${inputs.filehost.packages.${pkgs.system}.yamaf}/bin/yamaf";
};
};
filehost-chutiya = lib.recursiveUpdate filehost {
serviceConfig.Environment = [
"TITLE=chutiyafiles"
"INTERNAL_HOST=0.0.0.0"
"INTERNAL_PORT=8001"
"MAX_FILESIZE_MB=500"
"EXTERNAL_HAS_TLS=1"
"EXTERNAL_HOST=f.${conf.network.addresses.domain.chutiya}"
];
};
}; };
};
} }

View File

@@ -1,6 +1,7 @@
{ conf, ... }: { conf, ... }:
let let
domain = conf.network.addresses.domain.natto; domain = conf.network.addresses.domain.natto;
chutiya = conf.network.addresses.domain.chutiya;
in in
{ {
services.nginx = { services.nginx = {
@@ -35,6 +36,17 @@ in
in in
with conf.network.addresses.wireguard.ips; with conf.network.addresses.wireguard.ips;
{ {
"${chutiya}" = {
addSSL = true;
enableACME = true;
locations."/" = {
root = "/var/lib/chutiya";
index = "index.html";
};
serverAliases = [ "www.${chutiya}" ];
};
"moj.${domain}" = genericHttpRProxy { addr = "https://${suwako}:25565"; }; "moj.${domain}" = genericHttpRProxy { addr = "https://${suwako}:25565"; };
"puffer.${domain}" = genericHttpRProxy { "puffer.${domain}" = genericHttpRProxy {
@@ -59,7 +71,15 @@ in
}; };
# Personal filehost # Personal filehost
"f.${domain}" = genericHttpRProxy { addr = "http://${suwako}:8000"; }; "f.${chutiya}" = genericHttpRProxy {
addr = "http://${suwako}:8001";
conf = "client_max_body_size 512M;";
};
"f.${domain}" = genericHttpRProxy {
addr = "http://${suwako}:8000";
conf = "client_max_body_size 512M;";
};
}; };
}; };
} }