From 489bb683e03a6faf9632b9e972edb116de0f1d03 Mon Sep 17 00:00:00 2001 From: Joeri Exelmans Date: Sat, 27 Sep 2025 13:14:07 +0200 Subject: [PATCH 1/2] add refinery service (docker) and reverse proxy --- deemz.org/configuration.nix | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/deemz.org/configuration.nix b/deemz.org/configuration.nix index ca915a6..c44572f 100644 --- a/deemz.org/configuration.nix +++ b/deemz.org/configuration.nix @@ -295,6 +295,21 @@ let secrets = import ../secrets.nix; in proxy_buffering off; ''; }; + locations."/refinery/" = { + proxyPass = "http://127.0.0.1:8888/"; + proxyWebsockets = true; + extraConfig = '' + #rewrite /refinery/(.*) /$1 break; + ''; + }; + locations."/xtext-service" = { + proxyPass = "http://127.0.0.1:8888/xtext-service"; + proxyWebsockets = true; + }; + locations."/api/v1/" = { + proxyPass = "http://127.0.0.1:8888/api/v1/"; + proxyWebsockets = true; + }; locations."/git/" = { basicAuth = {}; proxyPass = "http://127.0.0.1:27365/"; @@ -378,6 +393,18 @@ let secrets = import ../secrets.nix; in virtualisation.docker = { enable = true; }; + virtualisation.oci-containers.containers = { + refinery = { + image = "ghcr.io/graphs4value/refinery:latest"; + ports = [ "127.0.0.1:8888:8888" ]; + environment = { + REFINERY_PUBLIC_HOST = "deemz.org"; + #REFINERY_PUBLIC_PORT = ""; + REFINERY_MODEL_GENERATION_TIMEOUT_SEC = "60"; + REFINERY_MODEL_GENERATION_THREAD_COUNT = "10"; + }; + }; + }; # This value determines the NixOS release from which the default From 16e45351cc0b1112a3ad8949a833d1f6dd3845ce Mon Sep 17 00:00:00 2001 From: Joeri Exelmans Date: Thu, 2 Oct 2025 11:32:56 +0200 Subject: [PATCH 2/2] refine configuration of refinery --- deemz.org/configuration.nix | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/deemz.org/configuration.nix b/deemz.org/configuration.nix index c44572f..471a3ab 100644 --- a/deemz.org/configuration.nix +++ b/deemz.org/configuration.nix @@ -256,12 +256,14 @@ let secrets = import ../secrets.nix; in ''; proxyWebsockets = true; }; + locations."/public" = { basicAuth = {}; extraConfig = '' autoindex off; ''; }; + locations."/plantuml" = { basicAuth = {}; extraConfig = '' @@ -270,6 +272,7 @@ let secrets = import ../secrets.nix; in proxyPass = "http://127.0.0.1:8080/plantuml"; proxyWebsockets = true; }; + locations."/transmission/web/" = { basicAuth = userlist; proxyPass = "http://127.0.0.1:9091/transmission/web/"; @@ -280,6 +283,7 @@ let secrets = import ../secrets.nix; in proxyPass = "http://127.0.0.1:9091/transmission/rpc"; proxyWebsockets = true; }; + #locations."/jellyfin/" = { ##basicAuth = userlist; #proxyPass = "http://127.0.0.1:8096/jellyfin/"; @@ -295,30 +299,28 @@ let secrets = import ../secrets.nix; in proxy_buffering off; ''; }; + locations."/refinery/" = { proxyPass = "http://127.0.0.1:8888/"; proxyWebsockets = true; + }; + locations."/refinery/api/" = { + proxyPass = "http://127.0.0.1:8888/api/"; extraConfig = '' - #rewrite /refinery/(.*) /$1 break; + chunked_transfer_encoding off; + proxy_buffering off; + proxy_cache off; ''; }; - locations."/xtext-service" = { - proxyPass = "http://127.0.0.1:8888/xtext-service"; - proxyWebsockets = true; - }; - locations."/api/v1/" = { - proxyPass = "http://127.0.0.1:8888/api/v1/"; - proxyWebsockets = true; - }; + locations."/git/" = { basicAuth = {}; proxyPass = "http://127.0.0.1:27365/"; proxyWebsockets = true; }; + forceSSL = true; enableACME = true; - - extraConfig = '' charset UTF-8; disable_symlinks off; @@ -395,11 +397,13 @@ let secrets = import ../secrets.nix; in }; virtualisation.oci-containers.containers = { refinery = { - image = "ghcr.io/graphs4value/refinery:latest"; + image = "ghcr.io/graphs4value/refinery:0.2.1-snapshot"; ports = [ "127.0.0.1:8888:8888" ]; environment = { REFINERY_PUBLIC_HOST = "deemz.org"; - #REFINERY_PUBLIC_PORT = ""; + REFINERY_WEBSOCKET_URL = "wss://deemz.org/refinery/xtext-service"; + REFINERY_API_BASE = "https://deemz.org/refinery/api/v1/"; + # Timeouts REFINERY_MODEL_GENERATION_TIMEOUT_SEC = "60"; REFINERY_MODEL_GENERATION_THREAD_COUNT = "10"; };