{tsuki/dosei}: set up wstunnel
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
./services/avahi.nix
|
||||
./services/docker.nix
|
||||
./services/jenkins.nix
|
||||
./services/wstunnel.nix
|
||||
];
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
|
27
hosts/dosei/services/wstunnel.nix
Normal file
27
hosts/dosei/services/wstunnel.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
imports = [
|
||||
../../../modules/wstunnel.nix
|
||||
];
|
||||
disabledModules = [
|
||||
"services/networking/wstunnel.nix"
|
||||
];
|
||||
|
||||
# NOTE: Contains
|
||||
# - WSTUNNEL_HTTP_UPGRADE_PATH_PREFIX
|
||||
# - WSTUNNEL_RESTRICT_HTTP_UPGRADE_PATH_PREFIX
|
||||
sops.secrets."wstunnel/http-upgrade-path-prefix-envvars" = {
|
||||
sopsFile = ../../../secrets/common.yaml;
|
||||
};
|
||||
|
||||
services.wstunnel = {
|
||||
enable = true;
|
||||
clients."ws-tsuki" = {
|
||||
connectTo = "wss://ws.nani.wtf";
|
||||
localToRemote = [
|
||||
"tcp://10022:localhost:22"
|
||||
];
|
||||
environmentFile = config.sops.secrets."wstunnel/http-upgrade-path-prefix-envvars".path;
|
||||
};
|
||||
};
|
||||
}
|
@@ -20,6 +20,7 @@
|
||||
./services/taskserver.nix
|
||||
./services/vaultwarden.nix
|
||||
./services/vscode-server.nix
|
||||
./services/wstunnel.nix
|
||||
|
||||
./services/scrapers/nhk-easy-news/default.nix
|
||||
];
|
||||
|
@@ -51,6 +51,11 @@
|
||||
"osuchan".servers."localhost:${s ports.osuchan}" = { };
|
||||
"plex".servers."localhost:${s ports.plex}" = { };
|
||||
"vaultwarden".servers."unix:${sa.vaultwarden.newSocketAddress}" = { };
|
||||
"wstunnel".servers = let
|
||||
inherit (config.services.wstunnel.servers."ws-tsuki".listen) host port;
|
||||
in {
|
||||
"${host}:${s port}" = { };
|
||||
};
|
||||
};
|
||||
|
||||
virtualHosts = let
|
||||
@@ -189,6 +194,8 @@
|
||||
# };
|
||||
# })
|
||||
|
||||
(proxy ["ws"] "http://wstunnel" enableWebsockets)
|
||||
|
||||
(host ["h7x4-stickers"] {})
|
||||
(host ["pingu-stickers"] {})
|
||||
]));
|
||||
|
28
hosts/tsuki/services/wstunnel.nix
Normal file
28
hosts/tsuki/services/wstunnel.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
imports = [
|
||||
../../../modules/wstunnel.nix
|
||||
];
|
||||
disabledModules = [
|
||||
"services/networking/wstunnel.nix"
|
||||
];
|
||||
|
||||
# NOTE: Contains
|
||||
# - WSTUNNEL_HTTP_UPGRADE_PATH_PREFIX
|
||||
# - WSTUNNEL_RESTRICT_HTTP_UPGRADE_PATH_PREFIX
|
||||
sops.secrets."wstunnel/http-upgrade-path-prefix-envvars" = {
|
||||
sopsFile = ../../../secrets/common.yaml;
|
||||
};
|
||||
|
||||
services.wstunnel = {
|
||||
enable = true;
|
||||
servers."ws-tsuki" = {
|
||||
listen = {
|
||||
host = "127.0.0.1";
|
||||
port = 8789;
|
||||
};
|
||||
enableHTTPS = false;
|
||||
environmentFile = config.sops.secrets."wstunnel/http-upgrade-path-prefix-envvars".path;
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user