move refinery config to separate module + add msdl server config

This commit is contained in:
Joeri Exelmans 2025-10-02 15:01:05 +02:00
parent 6b42696aee
commit ada952bbba
4 changed files with 197 additions and 30 deletions

View file

@ -300,18 +300,18 @@ let secrets = import ../secrets.nix; in
'';
};
locations."/refinery/" = {
proxyPass = "http://127.0.0.1:8888/";
proxyWebsockets = true;
};
locations."/refinery/api/" = {
proxyPass = "http://127.0.0.1:8888/api/";
extraConfig = ''
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
'';
};
# locations."/refinery/" = {
# proxyPass = "http://127.0.0.1:8888/";
# proxyWebsockets = true;
# };
# locations."/refinery/api/" = {
# proxyPass = "http://127.0.0.1:8888/api/";
# extraConfig = ''
# chunked_transfer_encoding off;
# proxy_buffering off;
# proxy_cache off;
# '';
# };
locations."/git/" = {
basicAuth = {};
@ -392,23 +392,9 @@ let secrets = import ../secrets.nix; in
# UPnP media playback (local network only)
services.gnome.rygel.enable = true;
virtualisation.docker = {
enable = true;
};
virtualisation.oci-containers.containers = {
refinery = {
image = "ghcr.io/graphs4value/refinery:0.2.1-snapshot";
ports = [ "127.0.0.1:8888:8888" ];
environment = {
REFINERY_PUBLIC_HOST = "deemz.org";
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";
};
};
};
# virtualisation.docker = {
# enable = true;
# };
# This value determines the NixOS release from which the default

47
deemz.org/refinery.nix Normal file
View file

@ -0,0 +1,47 @@
# Example configuration:
# host: deemz.org
# refineryBaseUrl: /refinery
{ config, pkgs, refineryHost, refineryBaseUrl, ... }:
{
# reverse proxy
services.nginx = {
enable = true;
virtualHosts.${refineryHost} = {
locations."${refineryBaseUrl}/" = {
proxyPass = "http://127.0.0.1:8888/";
proxyWebsockets = true;
};
locations."${refineryBaseUrl}/api/" = {
proxyPass = "http://127.0.0.1:8888/api/";
extraConfig = ''
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
'';
};
serverName = refineryHost;
};
};
# run refinery container as a systemd service
virtualisation.oci-containers.containers = {
refinery = {
image = "ghcr.io/graphs4value/refinery:0.2.1-snapshot";
ports = [ "127.0.0.1:8888:8888" ];
environment = rec {
REFINERY_PUBLIC_HOST = refineryHost;
REFINERY_WEBSOCKET_URL = "wss://${refineryHost}${refineryBaseUrl}/xtext-service";
REFINERY_API_BASE = "https://${refineryHost}${refineryBaseUrl}/api/v1/";
# Timeouts
REFINERY_MODEL_GENERATION_TIMEOUT_SEC = "60";
REFINERY_MODEL_GENERATION_THREAD_COUNT = "10";
};
};
};
}