summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/vncserver.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2023-07-28 22:24:15 +0200
committermakefu <github@syntax-fehler.de>2023-07-28 22:24:15 +0200
commit060a8f28fa1fc648bdf66afb31a5d1efac868837 (patch)
tree2b354eacc7897365ee45244fe7a51720e0d0333f /makefu/2configs/vncserver.nix
parentcbfcc890e3b76d942b927809bf981a5fa7289e6a (diff)
makefu: move out to own repo, add vacation-note
Diffstat (limited to 'makefu/2configs/vncserver.nix')
-rw-r--r--makefu/2configs/vncserver.nix61
1 files changed, 0 insertions, 61 deletions
diff --git a/makefu/2configs/vncserver.nix b/makefu/2configs/vncserver.nix
deleted file mode 100644
index e62a3f748..000000000
--- a/makefu/2configs/vncserver.nix
+++ /dev/null
@@ -1,61 +0,0 @@
-{config,lib,pkgs, ...}:
-with lib;
-let
- pwfile = (toString <secrets>)+ "/vnc-password"; # create with `vncpasswd`
- pwtmp = "/tmp/vnc-password";
- user = config.makefu.gui.user;
- vnc_port = 5900;
- web_port = 6080;
-in {
- networking.firewall.allowedTCPPorts = [ 80 vnc_port web_port ];
- systemd.services = {
- # TODO: terminal-server without a real gui and virtual display manager
- terminal-server = {
- description = "VNC Terminal Server";
- after = [ "display-manager.service" "graphical.target" ];
- wantedBy = [ "multi-user.target" ];
- serviceConfig = {
- User = user;
- Restart = "always";
- ExecStartPre = pkgs.writeDash "terminal-pre" ''
- sleep 5
- install -m0700 -o ${user} ${pwfile} ${pwtmp}
- '';
- ExecStart = "${pkgs.tigervnc}/bin/x0vncserver -display :0 -rfbport ${toString vnc_port} -passwordfile ${pwtmp}";
- PermissionsStartOnly = true;
- PrivateTmp = true;
- };
- };
- terminal-web = {
- description = "noVNC Web Server";
- after = [ "terminal-server.service" "graphical.target" "network.target" ];
- wantedBy = [ "multi-user.target" ];
- serviceConfig = {
- User = "nobody";
- ExecStart = "${pkgs.novnc}/bin/launch-novnc.sh --listen ${toString web_port} --vnc localhost:${toString vnc_port}";
- PrivateTmp = true;
- };
- };
- };
- services.nginx.enable = true;
- services.nginx.virtualHosts._.locations = {
- "/" = {
- root = "${pkgs.novnc}";
- index = "vnc_auto.html";
- };
- "/websockify" = {
- proxyPass = "http://127.0.0.1:6080/";
- extraConfig = ''
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
-
- # VNC connection timeout
- proxy_read_timeout 61s;
-
- # Disable cache
- proxy_buffering off;
- '';
- };
- };
-}