diff options
Diffstat (limited to 'modules/private/websites')
-rw-r--r-- | modules/private/websites/denise/oms.nix | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/modules/private/websites/denise/oms.nix b/modules/private/websites/denise/oms.nix index 2c5e90e..18773ae 100644 --- a/modules/private/websites/denise/oms.nix +++ b/modules/private/websites/denise/oms.nix | |||
@@ -2,7 +2,9 @@ | |||
2 | let | 2 | let |
3 | cfg = config.myServices.websites.denise.oms; | 3 | cfg = config.myServices.websites.denise.oms; |
4 | varDir = "/var/lib/buildbot/outputs/denise/oms"; | 4 | varDir = "/var/lib/buildbot/outputs/denise/oms"; |
5 | varDirBeta = "/var/lib/buildbot/outputs/denise/oms_beta"; | ||
5 | socket = "/run/denise_oms/socket.sock"; | 6 | socket = "/run/denise_oms/socket.sock"; |
7 | socket_beta = "/run/denise_oms_beta/socket.sock"; | ||
6 | in { | 8 | in { |
7 | options.myServices.websites.denise.oms.enable = lib.mkEnableOption "enable Denise's OMS website"; | 9 | options.myServices.websites.denise.oms.enable = lib.mkEnableOption "enable Denise's OMS website"; |
8 | 10 | ||
@@ -45,5 +47,44 @@ in { | |||
45 | StandardError = "inherit"; | 47 | StandardError = "inherit"; |
46 | }; | 48 | }; |
47 | }; | 49 | }; |
50 | |||
51 | services.websites.env.integration.vhostConfs.denise_oms_beta = { | ||
52 | certName = "denise"; | ||
53 | addToCerts = true; | ||
54 | hosts = [ "beta.oms.syanni.eu" ]; | ||
55 | root = null; | ||
56 | extraConfig = [ | ||
57 | '' | ||
58 | ProxyPreserveHost on | ||
59 | ProxyVia On | ||
60 | ProxyRequests Off | ||
61 | ProxyPassMatch ^/.well-known/acme-challenge ! | ||
62 | ProxyPass / unix://${socket_beta}|http://beta.oms.syanni.eu/ | ||
63 | ProxyPassReverse / unix://${socket_beta}|http://beta.oms.syanni.eu/ | ||
64 | '' | ||
65 | ]; | ||
66 | }; | ||
67 | |||
68 | systemd.services.denise-oms-beta = { | ||
69 | description = "Denise OMS beta website"; | ||
70 | after = [ "network.target" ]; | ||
71 | wantedBy = [ "multi-user.target" ]; | ||
72 | |||
73 | serviceConfig = { | ||
74 | Type = "simple"; | ||
75 | WorkingDirectory = varDirBeta; | ||
76 | ExecStart = let | ||
77 | python = pkgs.python3.withPackages (p: [ p.gunicorn p.flask p.matplotlib p.unidecode ]); | ||
78 | in | ||
79 | "${python}/bin/gunicorn -w4 -p /run/denise_oms_beta/gunicorn.pid --bind unix:${socket_beta} app:app"; | ||
80 | User = "buildbot"; | ||
81 | Restart = "always"; | ||
82 | RestartSec = "5s"; | ||
83 | PIDFile = "/run/denise_oms_beta/gunicorn.pid"; | ||
84 | RuntimeDirectory = "denise_oms_beta"; | ||
85 | StandardOutput = "journal"; | ||
86 | StandardError = "inherit"; | ||
87 | }; | ||
88 | }; | ||
48 | }; | 89 | }; |
49 | } | 90 | } |