diff options
author | lassulus <lassulus@lassul.us> | 2017-08-16 12:33:54 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2017-08-16 12:33:54 +0200 |
commit | 3b24a8306d0bb57924fcc64ec28c5b1aa3a4ac74 (patch) | |
tree | cbb9a36c1aa94eec48b6ce13c14e5c994df0f546 /makefu/2configs/deployment/gitlab.nix | |
parent | f8c0bcf1e9e4d4dd660e6fe82017e28dbbfd6024 (diff) | |
parent | a795766f3a881d43f92dcafcf26eeb765e993ed7 (diff) |
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'makefu/2configs/deployment/gitlab.nix')
-rw-r--r-- | makefu/2configs/deployment/gitlab.nix | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/makefu/2configs/deployment/gitlab.nix b/makefu/2configs/deployment/gitlab.nix new file mode 100644 index 000000000..d61f50c1d --- /dev/null +++ b/makefu/2configs/deployment/gitlab.nix @@ -0,0 +1,39 @@ +{ lib, config, ... }: +let + web-port = 19453; + hostn = "gitlab.makefu.r"; + internal-ip = config.krebs.build.host.nets.retiolum.ip4.addr; +in { + + services.gitlab = { + enable = true; + https = false; + port = web-port; + secrets = import <secrets/gitlab/secrets.nix>; + databasePassword = import <secrets/gitlab/dbpw.nix>; + initialRootEmail = "makefu@x.r"; + initialRootPassword = import <secrets/gitlab/rootpw.nix>; + host = hostn; + smtp = { + enable = true; + domain = "r"; + enableStartTLSAuto = false; + port = 25; + }; + }; + + services.nginx = { + enable = lib.mkDefault true; + virtualHosts."${hostn}".locations."/" = { + proxyPass = "http://localhost:${toString web-port}/"; + extraConfig = '' + if ( $server_addr != "${internal-ip}" ) { + return 403; + } + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + ''; + }; + }; +} |