l: fix nginx path traversal

This commit is contained in:
lassulus 2019-10-10 14:27:52 +02:00
parent ee36de2973
commit 7fb3248a6c
3 changed files with 11 additions and 8 deletions

View File

@ -184,7 +184,7 @@ with import <stockholm/lib>;
imports = [ imports = [
<stockholm/lass/2configs/realwallpaper.nix> <stockholm/lass/2configs/realwallpaper.nix>
]; ];
services.nginx.virtualHosts."lassul.us".locations."/wallpaper.png".extraConfig = '' services.nginx.virtualHosts."lassul.us".locations."= /wallpaper.png".extraConfig = ''
alias /var/realwallpaper/realwallpaper.png; alias /var/realwallpaper/realwallpaper.png;
''; '';
} }

View File

@ -230,11 +230,11 @@ in {
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://localhost:8000; proxy_pass http://localhost:8000;
''; '';
locations."/recent".extraConfig = '' locations."= /recent".extraConfig = ''
alias /tmp/played; alias /tmp/played;
''; '';
}; };
virtualHosts."lassul.us".locations."/the_playlist".extraConfig = let virtualHosts."lassul.us".locations."= /the_playlist".extraConfig = let
html = pkgs.writeText "index.html" '' html = pkgs.writeText "index.html" ''
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">

View File

@ -37,30 +37,33 @@ in {
locations."= /retiolum-hosts.tar.bz2".extraConfig = '' locations."= /retiolum-hosts.tar.bz2".extraConfig = ''
alias ${config.krebs.tinc.retiolum.hostsArchive}; alias ${config.krebs.tinc.retiolum.hostsArchive};
''; '';
locations."= /hosts".extraConfig = ''
alias ${pkgs.krebs-hosts_combined};
'';
locations."= /retiolum.hosts".extraConfig = '' locations."= /retiolum.hosts".extraConfig = ''
alias ${pkgs.krebs-hosts-retiolum}; alias ${pkgs.krebs-hosts-retiolum};
''; '';
locations."= /wireguard-key".extraConfig = '' locations."= /wireguard-key".extraConfig = ''
alias ${pkgs.writeText "prism.wg" config.krebs.hosts.prism.nets.wiregrill.wireguard.pubkey}; alias ${pkgs.writeText "prism.wg" config.krebs.hosts.prism.nets.wiregrill.wireguard.pubkey};
''; '';
locations."/tinc".extraConfig = '' locations."/tinc/".extraConfig = ''
alias ${config.krebs.tinc_graphs.workingDir}/external; alias ${config.krebs.tinc_graphs.workingDir}/external;
''; '';
locations."/krebspage".extraConfig = '' locations."= /krebspage".extraConfig = ''
default_type "text/html"; default_type "text/html";
alias ${pkgs.krebspage}/index.html; alias ${pkgs.krebspage}/index.html;
''; '';
locations."/init".extraConfig = let locations."= /init".extraConfig = let
initscript = pkgs.init.override { initscript = pkgs.init.override {
pubkey = config.krebs.users.lass.pubkey; pubkey = config.krebs.users.lass.pubkey;
}; };
in '' in ''
alias ${initscript}; alias ${initscript};
''; '';
locations."/pub".extraConfig = '' locations."= /pub".extraConfig = ''
alias ${pkgs.writeText "pub" config.krebs.users.lass.pubkey}; alias ${pkgs.writeText "pub" config.krebs.users.lass.pubkey};
''; '';
locations."/pub1".extraConfig = '' locations."= /pub1".extraConfig = ''
alias ${pkgs.writeText "pub" config.krebs.users.lass-mors.pubkey}; alias ${pkgs.writeText "pub" config.krebs.users.lass-mors.pubkey};
''; '';
}; };