summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/storj/client.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2021-03-19 09:19:25 +0100
committerlassulus <lassulus@lassul.us>2021-03-19 09:19:25 +0100
commit86b458d5d3aaac94d51b0a860376725c0a70b6fb (patch)
tree82407d4e8454b3abfbb8288f8bc6765c64bf036b /makefu/2configs/storj/client.nix
parent3bbbc82ae9ab9f0ac737b2ff0b55b50ae9c77b8a (diff)
parent758660945c712b645e755e9101a9fd3d8a325c91 (diff)
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'makefu/2configs/storj/client.nix')
-rw-r--r--makefu/2configs/storj/client.nix20
1 files changed, 19 insertions, 1 deletions
diff --git a/makefu/2configs/storj/client.nix b/makefu/2configs/storj/client.nix
index e37e2ce23..5e6753403 100644
--- a/makefu/2configs/storj/client.nix
+++ b/makefu/2configs/storj/client.nix
@@ -1,4 +1,8 @@
{ lib, ... }:
+let
+ port = "14002";
+internal-ip = "192.168.1.11";
+in
{
networking.firewall.allowedTCPPorts = [ 28967 ];
virtualisation.oci-containers.containers.storj-storagenode = {
@@ -6,7 +10,7 @@
ports = [
# TODO: omo ip
"0.0.0.0:28967:28967"
- "127.0.0.1:14002:14002"
+ "127.0.0.1:${port}:${port}"
];
environment = {
# SETUP = "true"; # must be run only once ...
@@ -24,4 +28,18 @@
StandardOutput = 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;
+ }
+ '';
+ };
}