summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2019-04-13 21:54:23 +0200
committerlassulus <lassulus@lassul.us>2019-04-13 21:54:23 +0200
commit7083200810b4cca19b02550e1ec2a000aa686b63 (patch)
tree5f7a34d9b0c27df6e315b0e730aace40bc2fbebf
parent4ac7399b75e57bb33a10ed647c34ed64c7bc3877 (diff)
parenta224e77dfbb8dc88119891c492651458cfacd39a (diff)
Merge remote-tracking branch 'ni/master'
-rw-r--r--krebs/3modules/lass/default.nix1
-rw-r--r--krebs/5pkgs/simple/kpaste/default.nix5
-rw-r--r--lass/2configs/paste.nix10
3 files changed, 14 insertions, 2 deletions
diff --git a/krebs/3modules/lass/default.nix b/krebs/3modules/lass/default.nix
index a3b8cab39..a2548d6c1 100644
--- a/krebs/3modules/lass/default.nix
+++ b/krebs/3modules/lass/default.nix
@@ -38,6 +38,7 @@ in {
io 60 IN NS ions.lassul.us.
ions 60 IN A ${config.krebs.hosts.prism.nets.internet.ip4.addr}
lol 60 IN A ${config.krebs.hosts.prism.nets.internet.ip4.addr}
+ p 60 IN A ${config.krebs.hosts.prism.nets.internet.ip4.addr}
paste 60 IN A ${config.krebs.hosts.prism.nets.internet.ip4.addr}
radio 60 IN A ${config.krebs.hosts.prism.nets.internet.ip4.addr}
'';
diff --git a/krebs/5pkgs/simple/kpaste/default.nix b/krebs/5pkgs/simple/kpaste/default.nix
index d6823d584..217cb8a44 100644
--- a/krebs/5pkgs/simple/kpaste/default.nix
+++ b/krebs/5pkgs/simple/kpaste/default.nix
@@ -1,5 +1,6 @@
-{ curl, writeDashBin }:
+{ curl, gnused, writeDashBin }:
writeDashBin "kpaste" ''
- exec ${curl}/bin/curl -sS http://p.r --data-binary @-
+ ${curl}/bin/curl -sS http://p.r --data-binary @- |
+ ${gnused}/bin/sed '$ {p;s/\<r\>/krebsco.de/}'
''
diff --git a/lass/2configs/paste.nix b/lass/2configs/paste.nix
index 293691c0f..3c3d8e636 100644
--- a/lass/2configs/paste.nix
+++ b/lass/2configs/paste.nix
@@ -10,6 +10,16 @@ with import <stockholm/lib>;
proxy_pass http://localhost:9081;
'';
};
+ services.nginx.virtualHosts.paste-readonly = {
+ serverAliases = [ "p.krebsco.de" ];
+ locations."/".extraConfig = ''
+ if ($request_method != GET) {
+ return 403;
+ }
+ proxy_set_header Host $host;
+ proxy_pass http://localhost:9081;
+ '';
+ };
krebs.htgen.paste = {
port = 9081;
script = toString [