ma storj: expose web-ui

This commit is contained in:
makefu 2021-03-17 20:04:50 +01:00
parent cdd6a61fef
commit a8a06688c3

View file

@ -1,4 +1,8 @@
{ lib, ... }: { lib, ... }:
let
port = "14002";
internal-ip = "192.168.1.11";
in
{ {
networking.firewall.allowedTCPPorts = [ 28967 ]; networking.firewall.allowedTCPPorts = [ 28967 ];
virtualisation.oci-containers.containers.storj-storagenode = { virtualisation.oci-containers.containers.storj-storagenode = {
@ -6,7 +10,7 @@
ports = [ ports = [
# TODO: omo ip # TODO: omo ip
"0.0.0.0:28967:28967" "0.0.0.0:28967:28967"
"127.0.0.1:14002:14002" "127.0.0.1:${port}:${port}"
]; ];
environment = { environment = {
# SETUP = "true"; # must be run only once ... # SETUP = "true"; # must be run only once ...
@ -24,4 +28,18 @@
StandardOutput = lib.mkForce "journal"; StandardOutput = lib.mkForce "journal";
StandardError = lib.mkForce "journal"; StandardError = lib.mkForce "journal";
}; };
services.nginx.virtualHosts."storj" = {
serverAliases = [
"storj.lan"
];
locations."/".proxyPass = "http://localhost:${port}";
locations."/".proxyWebsockets = true;
extraConfig = ''
if ( $server_addr != "${internal-ip}" ) {
return 403;
}
'';
};
} }