summaryrefslogtreecommitdiffstats
path: root/makefu/2configs
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2017-04-11 21:35:49 +0200
committermakefu <github@syntax-fehler.de>2017-04-11 21:35:49 +0200
commit16b8fef4f59583d8fa8ef0e7806ef1b3175bce40 (patch)
treefb765bdc7cca097e736a837d4594fc2290287806 /makefu/2configs
parent79f36f6408052d8b83091036e342094de3ce1a32 (diff)
m 2 deployment: add graphs
Diffstat (limited to 'makefu/2configs')
-rw-r--r--makefu/2configs/deployment/graphs.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/makefu/2configs/deployment/graphs.nix b/makefu/2configs/deployment/graphs.nix
new file mode 100644
index 000000000..35a724f6a
--- /dev/null
+++ b/makefu/2configs/deployment/graphs.nix
@@ -0,0 +1,37 @@
+{ config, lib, pkgs, ... }:
+
+with import <stockholm/lib>;
+let
+ external-ip = config.krebs.build.host.nets.internet.ip4.addr;
+ internal-ip = config.krebs.build.host.nets.retiolum.ip4.addr;
+ hn = config.krebs.build.host.name;
+in {
+ krebs.bepasty.servers."paste.r".nginx.extraConfig = ''
+ if ( $server_addr = "${external-ip}" ) {
+ return 403;
+ }
+ '';
+ krebs.tinc_graphs = {
+ enable = true;
+ nginx = {
+ enable = true;
+ # TODO: remove hard-coded hostname
+ complete = {
+ extraConfig = ''
+ if ( $server_addr = "${external-ip}" ) {
+ return 403;
+ }
+ '';
+ serverAliases = [
+ "graphs.r" "graphs.retiolum"
+ "graphs.${hn}" "graphs.${hn}.retiolum"
+ ];
+ };
+ anonymous = {
+ enableSSL = true;
+ forceSSL = true;
+ enableACME = true;
+ };
+ };
+ };
+}