aboutsummaryrefslogtreecommitdiff
path: root/modules/private/websites/isabelle/aten_integration.nix
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2020-04-18 16:10:56 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2020-04-20 01:51:48 +0200
commitd3452fc59b9839846225fd254926c64a9c71f071 (patch)
treea98a0958b826ac4b2ab137720edf0195c65dd958 /modules/private/websites/isabelle/aten_integration.nix
parent514f9ec3beec470c4445be690673a0ceab9115b4 (diff)
downloadNix-d3452fc59b9839846225fd254926c64a9c71f071.tar.gz
Nix-d3452fc59b9839846225fd254926c64a9c71f071.tar.zst
Nix-d3452fc59b9839846225fd254926c64a9c71f071.zip
Refactor websites
Diffstat (limited to 'modules/private/websites/isabelle/aten_integration.nix')
-rw-r--r--modules/private/websites/isabelle/aten_integration.nix25
1 files changed, 14 insertions, 11 deletions
diff --git a/modules/private/websites/isabelle/aten_integration.nix b/modules/private/websites/isabelle/aten_integration.nix
index fb6eda9..61c35cc 100644
--- a/modules/private/websites/isabelle/aten_integration.nix
+++ b/modules/private/websites/isabelle/aten_integration.nix
@@ -1,20 +1,23 @@
1{ lib, pkgs, config, ... }: 1{ lib, pkgs, config, ... }:
2let 2let
3 secrets = config.myEnv.websites.isabelle.aten_integration; 3 secrets = config.myEnv.websites.isabelle.aten_integration;
4 app = pkgs.webapps.aten.override { environment = secrets.environment; }; 4 app = pkgs.callPackage ./aten_app {
5 environment = secrets.environment;
6 varDir = "/var/lib/isabelle_aten_integration";
7 };
5 cfg = config.myServices.websites.isabelle.aten_integration; 8 cfg = config.myServices.websites.isabelle.aten_integration;
6 pcfg = config.services.phpApplication; 9 pcfg = config.services.phpApplication;
7in { 10in {
8 options.myServices.websites.isabelle.aten_integration.enable = lib.mkEnableOption "enable Aten's website in integration"; 11 options.myServices.websites.isabelle.aten_integration.enable = lib.mkEnableOption "enable Aten's website in integration";
9 12
10 config = lib.mkIf cfg.enable { 13 config = lib.mkIf cfg.enable {
11 services.duplyBackup.profiles.aten_dev.rootDir = app.varDir; 14 services.duplyBackup.profiles.isabelle_aten_integration.rootDir = app.varDir;
12 services.phpApplication.apps.aten_dev = { 15 services.phpApplication.apps.isabelle_aten_integration = {
13 websiteEnv = "integration"; 16 websiteEnv = "integration";
14 httpdUser = config.services.httpd.Inte.user; 17 httpdUser = config.services.httpd.Inte.user;
15 httpdGroup = config.services.httpd.Inte.group; 18 httpdGroup = config.services.httpd.Inte.group;
16 httpdWatchFiles = [ 19 httpdWatchFiles = [
17 config.secrets.fullPaths."webapps/${app.environment}-aten" 20 config.secrets.fullPaths."websites/isabelle/aten_integration"
18 ]; 21 ];
19 inherit (app) webRoot varDir; 22 inherit (app) webRoot varDir;
20 inherit app; 23 inherit app;
@@ -32,12 +35,12 @@ in {
32 "pm.process_idle_timeout" = "60"; 35 "pm.process_idle_timeout" = "60";
33 }; 36 };
34 phpEnv = { 37 phpEnv = {
35 SYMFONY_DEBUG_MODE = "yes"; 38 SYMFONY_DEBUG_MODE = "\"yes\"";
36 }; 39 };
37 }; 40 };
38 41
39 secrets.keys = [{ 42 secrets.keys = [{
40 dest = "webapps/${app.environment}-aten"; 43 dest = "websites/isabelle/aten_integration";
41 user = config.services.httpd.Inte.user; 44 user = config.services.httpd.Inte.user;
42 group = config.services.httpd.Inte.group; 45 group = config.services.httpd.Inte.group;
43 permissions = "0400"; 46 permissions = "0400";
@@ -52,18 +55,18 @@ in {
52 SetEnv DATABASE_URL "${psql_url}" 55 SetEnv DATABASE_URL "${psql_url}"
53 ''; 56 '';
54 }]; 57 }];
55 services.websites.env.integration.vhostConfs.aten_dev = { 58 services.websites.env.integration.vhostConfs.isabelle_aten_integration = {
56 certName = "integration"; 59 certName = "integration";
57 addToCerts = true; 60 addToCerts = true;
58 hosts = [ "dev.aten.pro" ]; 61 hosts = [ "dev.aten.pro" ];
59 root = pcfg.webappDirs.aten_dev; 62 root = pcfg.webappDirs.isabelle_aten_integration;
60 extraConfig = [ 63 extraConfig = [
61 '' 64 ''
62 <FilesMatch "\.php$"> 65 <FilesMatch "\.php$">
63 SetHandler "proxy:unix:${pcfg.phpListenPaths.aten_dev}|fcgi://localhost" 66 SetHandler "proxy:unix:${pcfg.phpListenPaths.isabelle_aten_integration}|fcgi://localhost"
64 </FilesMatch> 67 </FilesMatch>
65 68
66 Include ${config.secrets.fullPaths."webapps/${app.environment}-aten"} 69 Include ${config.secrets.fullPaths."websites/isabelle/aten_integration"}
67 70
68 <Location /> 71 <Location />
69 Use LDAPConnect 72 Use LDAPConnect
@@ -77,7 +80,7 @@ in {
77 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://aten.pro\"></html>" 80 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://aten.pro\"></html>"
78 </Location> 81 </Location>
79 82
80 <Directory ${pcfg.webappDirs.aten_dev}> 83 <Directory ${pcfg.webappDirs.isabelle_aten_integration}>
81 Options Indexes FollowSymLinks MultiViews Includes 84 Options Indexes FollowSymLinks MultiViews Includes
82 AllowOverride All 85 AllowOverride All
83 Require all granted 86 Require all granted