diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2021-06-26 10:07:40 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2021-06-26 10:07:40 +0200 |
commit | ecd9a3060bdcc4309e4fad6c046b72b880618774 (patch) | |
tree | 9e0771cb91b52a90e250a518e1efafcba0493d03 /modules/private/websites/denise | |
parent | c20a589de267dded1c096e1c1339b5efe5156f1f (diff) | |
download | Nix-ecd9a3060bdcc4309e4fad6c046b72b880618774.tar.gz Nix-ecd9a3060bdcc4309e4fad6c046b72b880618774.tar.zst Nix-ecd9a3060bdcc4309e4fad6c046b72b880618774.zip |
Make wwwrun run the python application
Diffstat (limited to 'modules/private/websites/denise')
-rw-r--r-- | modules/private/websites/denise/oms.nix | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/modules/private/websites/denise/oms.nix b/modules/private/websites/denise/oms.nix index 18773ae..2f18037 100644 --- a/modules/private/websites/denise/oms.nix +++ b/modules/private/websites/denise/oms.nix | |||
@@ -38,7 +38,7 @@ in { | |||
38 | python = pkgs.python3.withPackages (p: [ p.gunicorn p.flask p.matplotlib p.unidecode ]); | 38 | python = pkgs.python3.withPackages (p: [ p.gunicorn p.flask p.matplotlib p.unidecode ]); |
39 | in | 39 | in |
40 | "${python}/bin/gunicorn -w4 -p /run/denise_oms/gunicorn.pid --bind unix:${socket} app:app"; | 40 | "${python}/bin/gunicorn -w4 -p /run/denise_oms/gunicorn.pid --bind unix:${socket} app:app"; |
41 | User = "buildbot"; | 41 | User = "wwwrun"; |
42 | Restart = "always"; | 42 | Restart = "always"; |
43 | RestartSec = "5s"; | 43 | RestartSec = "5s"; |
44 | PIDFile = "/run/denise_oms/gunicorn.pid"; | 44 | PIDFile = "/run/denise_oms/gunicorn.pid"; |
@@ -48,6 +48,16 @@ in { | |||
48 | }; | 48 | }; |
49 | }; | 49 | }; |
50 | 50 | ||
51 | security.sudo.extraRules = [ | ||
52 | { | ||
53 | commands = [ | ||
54 | { options = [ "NOPASSWD" ]; command = "${pkgs.systemd}/bin/systemctl restart denise-oms-beta.service"; } | ||
55 | { options = [ "NOPASSWD" ]; command = "${pkgs.systemd}/bin/systemctl restart denise-oms.service"; } | ||
56 | ]; | ||
57 | users = ["buildbot"]; | ||
58 | runAs = "root"; | ||
59 | } | ||
60 | ]; | ||
51 | services.websites.env.integration.vhostConfs.denise_oms_beta = { | 61 | services.websites.env.integration.vhostConfs.denise_oms_beta = { |
52 | certName = "denise"; | 62 | certName = "denise"; |
53 | addToCerts = true; | 63 | addToCerts = true; |
@@ -77,7 +87,7 @@ in { | |||
77 | python = pkgs.python3.withPackages (p: [ p.gunicorn p.flask p.matplotlib p.unidecode ]); | 87 | python = pkgs.python3.withPackages (p: [ p.gunicorn p.flask p.matplotlib p.unidecode ]); |
78 | in | 88 | in |
79 | "${python}/bin/gunicorn -w4 -p /run/denise_oms_beta/gunicorn.pid --bind unix:${socket_beta} app:app"; | 89 | "${python}/bin/gunicorn -w4 -p /run/denise_oms_beta/gunicorn.pid --bind unix:${socket_beta} app:app"; |
80 | User = "buildbot"; | 90 | User = "wwwrun"; |
81 | Restart = "always"; | 91 | Restart = "always"; |
82 | RestartSec = "5s"; | 92 | RestartSec = "5s"; |
83 | PIDFile = "/run/denise_oms_beta/gunicorn.pid"; | 93 | PIDFile = "/run/denise_oms_beta/gunicorn.pid"; |