diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-02-16 14:09:27 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-02-16 14:09:27 +0100 |
commit | e5073addbe397afd596613af469f3308a07c1801 (patch) | |
tree | 943148dbdbfb9aeeccf9c5a5d945a7398205f03d /nixops/modules/websites/chloe | |
parent | a556c4b01a536afd90042dad95e7cc09f37d4056 (diff) | |
download | Nix-e5073addbe397afd596613af469f3308a07c1801.tar.gz Nix-e5073addbe397afd596613af469f3308a07c1801.tar.zst Nix-e5073addbe397afd596613af469f3308a07c1801.zip |
Move integration websites to use stable web directory
This permits to avoir having to restart httpd at each application
deployment
Diffstat (limited to 'nixops/modules/websites/chloe')
-rw-r--r-- | nixops/modules/websites/chloe/chloe.nix | 10 | ||||
-rw-r--r-- | nixops/modules/websites/chloe/default.nix | 10 |
2 files changed, 15 insertions, 5 deletions
diff --git a/nixops/modules/websites/chloe/chloe.nix b/nixops/modules/websites/chloe/chloe.nix index 9752db6..3b92af3 100644 --- a/nixops/modules/websites/chloe/chloe.nix +++ b/nixops/modules/websites/chloe/chloe.nix | |||
@@ -40,10 +40,12 @@ let | |||
40 | pm.max_spare_servers = 3 | 40 | pm.max_spare_servers = 3 |
41 | ''}''; | 41 | ''}''; |
42 | }; | 42 | }; |
43 | apache = { | 43 | apache = rec { |
44 | user = "wwwrun"; | 44 | user = "wwwrun"; |
45 | group = "wwwrun"; | 45 | group = "wwwrun"; |
46 | modules = [ "proxy_fcgi" ]; | 46 | modules = [ "proxy_fcgi" ]; |
47 | webappName = "chloe_${environment}"; | ||
48 | root = "/run/current-system/webapps/${webappName}"; | ||
47 | vhostConf = '' | 49 | vhostConf = '' |
48 | RewriteEngine On | 50 | RewriteEngine On |
49 | ${if environment == "prod" then '' | 51 | ${if environment == "prod" then '' |
@@ -54,16 +56,16 @@ let | |||
54 | SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost" | 56 | SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost" |
55 | </FilesMatch> | 57 | </FilesMatch> |
56 | 58 | ||
57 | <Directory ${webRoot}> | 59 | <Directory ${if environment == "dev" then root else webRoot}> |
58 | DirectoryIndex index.php index.htm index.html | 60 | DirectoryIndex index.php index.htm index.html |
59 | Options -Indexes +FollowSymLinks +MultiViews +Includes | 61 | Options -Indexes +FollowSymLinks +MultiViews +Includes |
60 | Include ${webRoot}/htaccess.txt | 62 | Include ${if environment == "dev" then root else webRoot}/htaccess.txt |
61 | 63 | ||
62 | AllowOverride AuthConfig FileInfo Limit | 64 | AllowOverride AuthConfig FileInfo Limit |
63 | Require all granted | 65 | Require all granted |
64 | </Directory> | 66 | </Directory> |
65 | 67 | ||
66 | <DirectoryMatch "${webRoot}/squelettes"> | 68 | <DirectoryMatch "${if environment == "dev" then root else webRoot}/squelettes"> |
67 | Require all denied | 69 | Require all denied |
68 | </DirectoryMatch> | 70 | </DirectoryMatch> |
69 | 71 | ||
diff --git a/nixops/modules/websites/chloe/default.nix b/nixops/modules/websites/chloe/default.nix index 94cd4be..d647eb9 100644 --- a/nixops/modules/websites/chloe/default.nix +++ b/nixops/modules/websites/chloe/default.nix | |||
@@ -45,6 +45,10 @@ in { | |||
45 | extension=${pkgs.php}/lib/php/extensions/mysqli.so | 45 | extension=${pkgs.php}/lib/php/extensions/mysqli.so |
46 | ''; | 46 | ''; |
47 | system.activationScripts.chloe_prod = chloe_prod.activationScript; | 47 | system.activationScripts.chloe_prod = chloe_prod.activationScript; |
48 | system.extraSystemBuilderCmds = '' | ||
49 | mkdir -p $out/webapps | ||
50 | ln -s ${chloe_prod.webRoot} $out/webapps/${chloe_prod.apache.webappName} | ||
51 | ''; | ||
48 | services.myWebsites.production.modules = chloe_prod.apache.modules; | 52 | services.myWebsites.production.modules = chloe_prod.apache.modules; |
49 | services.myWebsites.production.vhostConfs.chloe = { | 53 | services.myWebsites.production.vhostConfs.chloe = { |
50 | certName = "chloe"; | 54 | certName = "chloe"; |
@@ -60,11 +64,15 @@ in { | |||
60 | extension=${pkgs.php}/lib/php/extensions/mysqli.so | 64 | extension=${pkgs.php}/lib/php/extensions/mysqli.so |
61 | ''; | 65 | ''; |
62 | system.activationScripts.chloe_dev = chloe_dev.activationScript; | 66 | system.activationScripts.chloe_dev = chloe_dev.activationScript; |
67 | system.extraSystemBuilderCmds = '' | ||
68 | mkdir -p $out/webapps | ||
69 | ln -s ${chloe_dev.webRoot} $out/webapps/${chloe_dev.apache.webappName} | ||
70 | ''; | ||
63 | services.myWebsites.integration.modules = chloe_dev.apache.modules; | 71 | services.myWebsites.integration.modules = chloe_dev.apache.modules; |
64 | services.myWebsites.integration.vhostConfs.chloe = { | 72 | services.myWebsites.integration.vhostConfs.chloe = { |
65 | certName = "eldiron"; | 73 | certName = "eldiron"; |
66 | hosts = ["chloe.immae.eu" ]; | 74 | hosts = ["chloe.immae.eu" ]; |
67 | root = chloe_dev.webRoot; | 75 | root = chloe_dev.apache.root; |
68 | extraConfig = [ chloe_dev.apache.vhostConf ]; | 76 | extraConfig = [ chloe_dev.apache.vhostConf ]; |
69 | }; | 77 | }; |
70 | }) | 78 | }) |