vscode works now

This commit is contained in:
Vinzenz Schroeter 2024-03-02 13:05:41 +01:00
parent 3945a335b1
commit c94e085e66
2 changed files with 6 additions and 85 deletions

View file

@ -37,10 +37,9 @@
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
extraConfig = '' extraConfig = ''
#proxy_set_header Host vinzenz-lpt2.donkey-pentatonic.ts.net; proxy_bind 100.88.118.60;
proxy_ssl_verify = false;
''; '';
proxyPass = "https://vinzenz-lpt2.donkey-pentatonic.ts.net:8542/"; proxyPass = "http://vinzenz-lpt2:8542/";
proxyWebsockets = true; proxyWebsockets = true;
}; };
}; };

View file

@ -43,95 +43,17 @@
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key''
]; ];
# TODO: move to own module
services.openvscode-server = { services.openvscode-server = {
enable = true; enable = true;
telemetryLevel = "off"; telemetryLevel = "off";
port = 8542; port = 8542;
host = "127.0.0.1"; host = "100.103.93.126"; # tailscale
extraPackages = with pkgs; [nodejs]; extraPackages = with pkgs; [nodejs];
}; };
services.nginx = { networking.firewall = {
enable = true; checkReversePath = "loose";
virtualHosts = { allowedTCPPorts = [8542];
"vscode" = {
serverName = "vinzenz-lpt2";
locations = {
"/" = {
proxyPass = "http://127.0.0.1:8542";
extraConfig = ''
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
'';
};
};
listen = [
{
addr = "0.0.0.0";
port = 5000;
ssl = true;
}
];
serverAliases = ["localhost" "vinzenz-lpt2.lan"];
addSSL = true;
sslCertificateKey = "/etc/nginx-secrets/nginx-selfsigned.key";
sslCertificate = "/etc/nginx-secrets/nginx-selfsigned.crt";
};
"app" = {
serverName = "vinzenz-lpt2";
locations = {
"/" = {
proxyPass = "http://127.0.0.1:3000/";
};
};
listen = [
{
addr = "0.0.0.0";
port = 5001;
ssl = true;
}
];
serverAliases = ["localhost" "vinzenz-lpt2.lan"];
addSSL = true;
sslCertificateKey = "/etc/nginx-secrets/nginx-selfsigned.key";
sslCertificate = "/etc/nginx-secrets/nginx-selfsigned.crt";
};
"api" = {
serverName = "vinzenz-lpt2";
locations = {
"/" = {
proxyPass = "http://127.0.0.1:3002/";
};
};
listen = [
{
addr = "0.0.0.0";
port = 5002;
ssl = true;
}
];
serverAliases = ["localhost" "vinzenz-lpt2.lan"];
addSSL = true;
sslCertificateKey = "/etc/nginx-secrets/nginx-selfsigned.key";
sslCertificate = "/etc/nginx-secrets/nginx-selfsigned.crt";
};
};
}; };
networking.firewall.allowedTCPPortRanges = [
{
from = 5000;
to = 5005;
}
];
}; };
} }