aboutsummaryrefslogtreecommitdiff
path: root/modules/private/websites
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2021-02-18 19:58:44 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2021-02-18 21:04:24 +0100
commit485354e5289157cea4de521b5ff13aae9f85a02d (patch)
tree836d5eee77cde48763e375805171442fde9e5b75 /modules/private/websites
parent68ff82c61628212208bc339b9f91fd1dba6ade50 (diff)
downloadNix-485354e5289157cea4de521b5ff13aae9f85a02d.tar.gz
Nix-485354e5289157cea4de521b5ff13aae9f85a02d.tar.zst
Nix-485354e5289157cea4de521b5ff13aae9f85a02d.zip
Add beta for Denise OMS
Diffstat (limited to 'modules/private/websites')
-rw-r--r--modules/private/websites/denise/oms.nix41
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 @@
2let 2let
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";
6in { 8in {
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}