l paste: add imgur api under /image
This commit is contained in:
parent
7023f78054
commit
e998c4b789
|
@ -7,7 +7,17 @@ with import <stockholm/lib>;
|
|||
locations."/".extraConfig = ''
|
||||
client_max_body_size 4G;
|
||||
proxy_set_header Host $host;
|
||||
proxy_pass http://localhost:9081;
|
||||
proxy_pass http://127.0.0.1:${toString config.krebs.htgen.paste.port};
|
||||
'';
|
||||
locations."/image".extraConfig = /* nginx */ ''
|
||||
client_max_body_size 40M;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
proxy_pass http://127.0.0.1:${toString config.krebs.htgen.imgur.port};
|
||||
proxy_pass_header Server;
|
||||
'';
|
||||
};
|
||||
services.nginx.virtualHosts."p.krebsco.de" = {
|
||||
|
@ -19,21 +29,36 @@ with import <stockholm/lib>;
|
|||
return 403;
|
||||
}
|
||||
proxy_set_header Host $host;
|
||||
proxy_pass http://localhost:9081;
|
||||
proxy_pass http://127.0.0.1:${toString config.krebs.htgen.paste.port};
|
||||
'';
|
||||
locations."/image".extraConfig = ''
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
proxy_pass http://127.0.0.1:${toString config.krebs.htgen.imgur.port};
|
||||
proxy_pass_header Server;
|
||||
'';
|
||||
};
|
||||
|
||||
krebs.htgen.paste = {
|
||||
port = 9081;
|
||||
script = toString [
|
||||
"PATH=${makeBinPath [
|
||||
pkgs.nix
|
||||
pkgs.file
|
||||
]}:$PATH"
|
||||
"STATEDIR=$HOME"
|
||||
". ${pkgs.htgen}/examples/paste"
|
||||
];
|
||||
};
|
||||
krebs.htgen.imgur = {
|
||||
port = 7771;
|
||||
script = /* sh */ ''
|
||||
(. ${pkgs.htgen-imgur}/bin/htgen-imgur)
|
||||
'';
|
||||
};
|
||||
krebs.iptables.tables.filter.INPUT.rules = [
|
||||
{ predicate = "-i retiolum -p tcp --dport 80"; target = "ACCEPT";}
|
||||
{ predicate = "-i retiolum -p tcp --dport 9081"; target = "ACCEPT";}
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue