Compare commits
2 Commits
3553afc8d8
...
d187aaba79
Author | SHA1 | Date |
---|---|---|
Tim Van Baak | d187aaba79 | |
Tim Van Baak | edddf6e610 |
|
@ -3,6 +3,7 @@
|
|||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./fileserver.nix
|
||||
./jellyfin.nix
|
||||
./samba.nix
|
||||
];
|
||||
|
@ -28,6 +29,8 @@
|
|||
enable = true;
|
||||
allowedTCPPorts = [
|
||||
7474 # mirror revproxy
|
||||
7475 # http serve tvb pool
|
||||
7476 # tvb catacomb host server
|
||||
];
|
||||
};
|
||||
|
||||
|
@ -39,14 +42,33 @@
|
|||
rejectSSL = true;
|
||||
locations."/".return = "444";
|
||||
};
|
||||
"pool.backyard.home" = {
|
||||
listen = [
|
||||
{ addr = "10.22.20.8"; }
|
||||
# Alternative port to ensure the right vhost connects
|
||||
{ addr = "10.22.20.8"; port = 7475; }
|
||||
];
|
||||
root = "/pool/tvb";
|
||||
locations."/".extraConfig = ''
|
||||
autoindex on;
|
||||
autoindex_exact_size off;
|
||||
'';
|
||||
};
|
||||
"mirror.backyard.home" = {
|
||||
listen = [
|
||||
{ addr = "10.22.20.8"; }
|
||||
# Serve the mirror on a unique port to ensure the revproxy connects to the right vhost
|
||||
# Alternative port to ensure the right vhost connects
|
||||
{ addr = "10.22.20.8"; port = 7474; }
|
||||
];
|
||||
root = "/pool/tvb/doc/website/mirror";
|
||||
};
|
||||
"files.backyard.home" = {
|
||||
listen = [
|
||||
{ addr = "10.22.20.8"; port = 7476; }
|
||||
];
|
||||
locations."/".tryFiles = "\$uri @indexer";
|
||||
locations."@indexer".proxyPass = "http://localhost:5000";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
# nas indexer server module
|
||||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
# Build the catacomb server package
|
||||
catacombServerSource = builtins.fetchGit {
|
||||
url = "https://git.alogoulogoi.com/Jaculabilis/catacomb-server.git";
|
||||
ref = "develop-nix";
|
||||
rev = "3d6fb16948c377f94d030648849f120c8ada3884";
|
||||
};
|
||||
catacombServer = pkgs.callPackage catacombServerSource {
|
||||
pkgs = import (fetchTarball {
|
||||
url = "https://github.com/NixOS/nixpkgs/archive/405d762a1a05ffed2ac820eb4bae4bc49bc3abf2.tar.gz";
|
||||
sha256 = "6c835ea038bdfe170029a8bd4276c9d3a95c275159ec05426672fa8092c7947d";
|
||||
}) {
|
||||
system = "x86_64-linux";
|
||||
};
|
||||
};
|
||||
|
||||
# Host-mode server run script
|
||||
hostRun = pkgs.writeShellScriptBin "catacomb-run-host.sh" ''
|
||||
${catacombServer}/bin/gunicorn \
|
||||
--bind=localhost:5000 \
|
||||
--workers=3 \
|
||||
--log-level=debug \
|
||||
--env CATACOMB_ROOT=/pool/tvb \
|
||||
--env CATACOMB_MODE=host \
|
||||
--env CATACOMB_TOKENS=/var/empty \
|
||||
--env CATACOMB_GUEST_HOST=catacomb.alogoulogoi.com \
|
||||
"catacomb.server:wsgi()"
|
||||
'';
|
||||
in
|
||||
{
|
||||
# Set up the host mode service
|
||||
systemd.services."catacomb-host" = {
|
||||
enable = true;
|
||||
description = "catapool host-mode index server";
|
||||
script = "${hostRun}/bin/catacomb-run-host.sh";
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
User = "nginx";
|
||||
};
|
||||
requires = [ "zfs.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
};
|
||||
}
|
|
@ -243,6 +243,7 @@ in {
|
|||
];
|
||||
"10.22.20.8" = [
|
||||
"backyard.home"
|
||||
"pool.backyard.home"
|
||||
"mirror.backyard.home"
|
||||
"jellyfin.home.ktvb.site"
|
||||
];
|
||||
|
|
Loading…
Reference in New Issue