diff options
47 files changed, 79 insertions, 226 deletions
diff --git a/modules/private/tasks/default.nix b/modules/private/tasks/default.nix index ac2aa21..26112dd 100644 --- a/modules/private/tasks/default.nix +++ b/modules/private/tasks/default.nix | |||
@@ -165,9 +165,9 @@ in { | |||
165 | certName = "eldiron"; | 165 | certName = "eldiron"; |
166 | addToCerts = true; | 166 | addToCerts = true; |
167 | hosts = [ "task.immae.eu" ]; | 167 | hosts = [ "task.immae.eu" ]; |
168 | root = "/run/current-system/webapps/_task"; | 168 | root = ./www; |
169 | extraConfig = [ '' | 169 | extraConfig = [ '' |
170 | <Directory /run/current-system/webapps/_task> | 170 | <Directory ${./www}> |
171 | DirectoryIndex index.php | 171 | DirectoryIndex index.php |
172 | Use LDAPConnect | 172 | Use LDAPConnect |
173 | Require ldap-group cn=users,cn=taskwarrior,ou=services,dc=immae,dc=eu | 173 | Require ldap-group cn=users,cn=taskwarrior,ou=services,dc=immae,dc=eu |
@@ -243,8 +243,6 @@ in { | |||
243 | }; | 243 | }; |
244 | }; | 244 | }; |
245 | 245 | ||
246 | services.websites.webappDirs._task = ./www; | ||
247 | |||
248 | security.acme.certs."task" = config.myServices.certificates.certConfig // { | 246 | security.acme.certs."task" = config.myServices.certificates.certConfig // { |
249 | inherit user group; | 247 | inherit user group; |
250 | domain = fqdn; | 248 | domain = fqdn; |
diff --git a/modules/private/websites/capitaines/landing_pages.nix b/modules/private/websites/capitaines/landing_pages.nix index b94a398..edba8b9 100644 --- a/modules/private/websites/capitaines/landing_pages.nix +++ b/modules/private/websites/capitaines/landing_pages.nix | |||
@@ -1,23 +1,21 @@ | |||
1 | { lib, config, ... }: | 1 | { lib, config, ... }: |
2 | let | 2 | let |
3 | cfg = config.myServices.websites.capitaines.landing_pages; | 3 | cfg = config.myServices.websites.capitaines.landing_pages; |
4 | webappdirs = config.services.websites.webappDirsPaths; | ||
5 | certName = "capitaines"; | 4 | certName = "capitaines"; |
6 | domain = "capitaines.fr"; | 5 | domain = "capitaines.fr"; |
7 | in { | 6 | in { |
8 | options.myServices.websites.capitaines.landing_pages.enable = lib.mkEnableOption "enable Capitaines's landing pages"; | 7 | options.myServices.websites.capitaines.landing_pages.enable = lib.mkEnableOption "enable Capitaines's landing pages"; |
9 | 8 | ||
10 | config = lib.mkIf cfg.enable { | 9 | config = lib.mkIf cfg.enable { |
11 | services.websites.webappDirs.capitaines_mastodon = ./mastodon_static; | ||
12 | services.websites.env.production.vhostConfs.capitaines_mastodon = rec { | 10 | services.websites.env.production.vhostConfs.capitaines_mastodon = rec { |
13 | inherit certName; | 11 | inherit certName; |
14 | certMainHost = "mastodon.${domain}"; | 12 | certMainHost = "mastodon.${domain}"; |
15 | hosts = [ certMainHost ]; | 13 | hosts = [ certMainHost ]; |
16 | root = webappdirs.capitaines_mastodon; | 14 | root = ./mastodon_static; |
17 | extraConfig = [ | 15 | extraConfig = [ |
18 | '' | 16 | '' |
19 | ErrorDocument 404 /index.html | 17 | ErrorDocument 404 /index.html |
20 | <Directory ${webappdirs.capitaines_mastodon}> | 18 | <Directory ${./mastodon_static}> |
21 | DirectoryIndex index.html | 19 | DirectoryIndex index.html |
22 | Options Indexes FollowSymLinks MultiViews Includes | 20 | Options Indexes FollowSymLinks MultiViews Includes |
23 | Require all granted | 21 | Require all granted |
@@ -26,16 +24,15 @@ in { | |||
26 | ]; | 24 | ]; |
27 | }; | 25 | }; |
28 | 26 | ||
29 | services.websites.webappDirs.capitaines_discourse = ./discourse_static; | ||
30 | services.websites.env.production.vhostConfs.capitaines_discourse = { | 27 | services.websites.env.production.vhostConfs.capitaines_discourse = { |
31 | inherit certName; | 28 | inherit certName; |
32 | addToCerts = true; | 29 | addToCerts = true; |
33 | hosts = [ "discourse.${domain}" ]; | 30 | hosts = [ "discourse.${domain}" ]; |
34 | root = webappdirs.capitaines_discourse; | 31 | root = ./discourse_static; |
35 | extraConfig = [ | 32 | extraConfig = [ |
36 | '' | 33 | '' |
37 | ErrorDocument 404 /index.html | 34 | ErrorDocument 404 /index.html |
38 | <Directory ${webappdirs.capitaines_discourse}> | 35 | <Directory ${./discourse_static}> |
39 | DirectoryIndex index.html | 36 | DirectoryIndex index.html |
40 | Options Indexes FollowSymLinks MultiViews Includes | 37 | Options Indexes FollowSymLinks MultiViews Includes |
41 | Require all granted | 38 | Require all granted |
@@ -48,9 +45,9 @@ in { | |||
48 | inherit certName; | 45 | inherit certName; |
49 | addToCerts = true; | 46 | addToCerts = true; |
50 | hosts = [ domain ]; | 47 | hosts = [ domain ]; |
51 | root = webappdirs._www; | 48 | root = ../_www; |
52 | extraConfig = [ '' | 49 | extraConfig = [ '' |
53 | <Directory ${webappdirs._www}> | 50 | <Directory ${../_www}> |
54 | DirectoryIndex index.htm | 51 | DirectoryIndex index.htm |
55 | Require all granted | 52 | Require all granted |
56 | </Directory> | 53 | </Directory> |
diff --git a/modules/private/websites/chloe/integration.nix b/modules/private/websites/chloe/integration.nix index c4b79f8..7ed3852 100644 --- a/modules/private/websites/chloe/integration.nix +++ b/modules/private/websites/chloe/integration.nix | |||
@@ -9,7 +9,6 @@ let | |||
9 | varDir = "/var/lib/chloe_integration"; | 9 | varDir = "/var/lib/chloe_integration"; |
10 | }; | 10 | }; |
11 | cfg = config.myServices.websites.chloe.integration; | 11 | cfg = config.myServices.websites.chloe.integration; |
12 | webappdir = config.services.websites.webappDirsPaths.chloe_integration; | ||
13 | in { | 12 | in { |
14 | options.myServices.websites.chloe.integration.enable = lib.mkEnableOption "enable Chloe's website in integration"; | 13 | options.myServices.websites.chloe.integration.enable = lib.mkEnableOption "enable Chloe's website in integration"; |
15 | 14 | ||
@@ -61,13 +60,12 @@ in { | |||
61 | install -m 0750 -o ${apacheUser} -g ${apacheGroup} -d ${app.varDir}/phpSessions | 60 | install -m 0750 -o ${apacheUser} -g ${apacheGroup} -d ${app.varDir}/phpSessions |
62 | ''; | 61 | ''; |
63 | }; | 62 | }; |
64 | services.websites.webappDirs.chloe_integration = app.webRoot; | ||
65 | services.websites.env.integration.modules = [ "proxy_fcgi" ]; | 63 | services.websites.env.integration.modules = [ "proxy_fcgi" ]; |
66 | services.websites.env.integration.vhostConfs.chloe_integration = { | 64 | services.websites.env.integration.vhostConfs.chloe_integration = { |
67 | certName = "integration"; | 65 | certName = "integration"; |
68 | addToCerts = true; | 66 | addToCerts = true; |
69 | hosts = ["chloe.immae.eu" ]; | 67 | hosts = ["chloe.immae.eu" ]; |
70 | root = webappdir; | 68 | root = app.webRoot; |
71 | extraConfig = [ | 69 | extraConfig = [ |
72 | '' | 70 | '' |
73 | Include ${config.secrets.fullPaths."websites/chloe/integration"} | 71 | Include ${config.secrets.fullPaths."websites/chloe/integration"} |
@@ -78,16 +76,16 @@ in { | |||
78 | SetHandler "proxy:unix:${config.services.phpfpm.pools.chloe_integration.socket}|fcgi://localhost" | 76 | SetHandler "proxy:unix:${config.services.phpfpm.pools.chloe_integration.socket}|fcgi://localhost" |
79 | </FilesMatch> | 77 | </FilesMatch> |
80 | 78 | ||
81 | <Directory ${webappdir}> | 79 | <Directory ${app.webRoot}> |
82 | DirectoryIndex index.php index.htm index.html | 80 | DirectoryIndex index.php index.htm index.html |
83 | Options -Indexes +FollowSymLinks +MultiViews +Includes | 81 | Options -Indexes +FollowSymLinks +MultiViews +Includes |
84 | Include ${webappdir}/htaccess.txt | 82 | Include ${app.webRoot}/htaccess.txt |
85 | 83 | ||
86 | AllowOverride AuthConfig FileInfo Limit | 84 | AllowOverride AuthConfig FileInfo Limit |
87 | Require all granted | 85 | Require all granted |
88 | </Directory> | 86 | </Directory> |
89 | 87 | ||
90 | <DirectoryMatch "${webappdir}/squelettes"> | 88 | <DirectoryMatch "${app.webRoot}/squelettes"> |
91 | Require all denied | 89 | Require all denied |
92 | </DirectoryMatch> | 90 | </DirectoryMatch> |
93 | 91 | ||
diff --git a/modules/private/websites/chloe/production.nix b/modules/private/websites/chloe/production.nix index 92ae05b..c3a5732 100644 --- a/modules/private/websites/chloe/production.nix +++ b/modules/private/websites/chloe/production.nix | |||
@@ -9,7 +9,6 @@ let | |||
9 | varDir = "/var/lib/chloe_production"; | 9 | varDir = "/var/lib/chloe_production"; |
10 | }; | 10 | }; |
11 | cfg = config.myServices.websites.chloe.production; | 11 | cfg = config.myServices.websites.chloe.production; |
12 | webappdir = config.services.websites.webappDirsPaths.chloe_production; | ||
13 | in { | 12 | in { |
14 | options.myServices.websites.chloe.production.enable = lib.mkEnableOption "enable Chloe's website in production"; | 13 | options.myServices.websites.chloe.production.enable = lib.mkEnableOption "enable Chloe's website in production"; |
15 | 14 | ||
@@ -66,13 +65,12 @@ in { | |||
66 | install -m 0750 -o ${apacheUser} -g ${apacheGroup} -d ${app.varDir}/phpSessions | 65 | install -m 0750 -o ${apacheUser} -g ${apacheGroup} -d ${app.varDir}/phpSessions |
67 | ''; | 66 | ''; |
68 | }; | 67 | }; |
69 | services.websites.webappDirs.chloe_production = app.webRoot; | ||
70 | services.websites.env.production.modules = [ "proxy_fcgi" ]; | 68 | services.websites.env.production.modules = [ "proxy_fcgi" ]; |
71 | services.websites.env.production.vhostConfs.chloe = { | 69 | services.websites.env.production.vhostConfs.chloe = { |
72 | certName = "chloe"; | 70 | certName = "chloe"; |
73 | certMainHost = "osteopathe-cc.fr"; | 71 | certMainHost = "osteopathe-cc.fr"; |
74 | hosts = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ]; | 72 | hosts = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ]; |
75 | root = webappdir; | 73 | root = app.webRoot; |
76 | extraConfig = [ | 74 | extraConfig = [ |
77 | '' | 75 | '' |
78 | Use Stats osteopathe-cc.fr | 76 | Use Stats osteopathe-cc.fr |
@@ -90,16 +88,16 @@ in { | |||
90 | SetHandler "proxy:unix:${config.services.phpfpm.pools.chloe_production.socket}|fcgi://localhost" | 88 | SetHandler "proxy:unix:${config.services.phpfpm.pools.chloe_production.socket}|fcgi://localhost" |
91 | </FilesMatch> | 89 | </FilesMatch> |
92 | 90 | ||
93 | <Directory ${webappdir}> | 91 | <Directory ${app.webRoot}> |
94 | DirectoryIndex index.php index.htm index.html | 92 | DirectoryIndex index.php index.htm index.html |
95 | Options -Indexes +FollowSymLinks +MultiViews +Includes | 93 | Options -Indexes +FollowSymLinks +MultiViews +Includes |
96 | Include ${webappdir}/htaccess.txt | 94 | Include ${app.webRoot}/htaccess.txt |
97 | 95 | ||
98 | AllowOverride AuthConfig FileInfo Limit | 96 | AllowOverride AuthConfig FileInfo Limit |
99 | Require all granted | 97 | Require all granted |
100 | </Directory> | 98 | </Directory> |
101 | 99 | ||
102 | <DirectoryMatch "${webappdir}/squelettes"> | 100 | <DirectoryMatch "${app.webRoot}/squelettes"> |
103 | Require all denied | 101 | Require all denied |
104 | </DirectoryMatch> | 102 | </DirectoryMatch> |
105 | 103 | ||
diff --git a/modules/private/websites/commons/adminer.nix b/modules/private/websites/commons/adminer.nix index 1803468..eae6a9a 100644 --- a/modules/private/websites/commons/adminer.nix +++ b/modules/private/websites/commons/adminer.nix | |||
@@ -1,5 +1,4 @@ | |||
1 | { config, callPackage }: | 1 | { config, callPackage }: |
2 | callPackage ../tools/tools/adminer.nix { | 2 | callPackage ../tools/tools/adminer.nix { |
3 | adminer = null; | ||
4 | forcePhpSocket = config.services.phpfpm.pools.adminer.socket; | 3 | forcePhpSocket = config.services.phpfpm.pools.adminer.socket; |
5 | } | 4 | } |
diff --git a/modules/private/websites/connexionswing/integration.nix b/modules/private/websites/connexionswing/integration.nix index 1b3587a..93cda00 100644 --- a/modules/private/websites/connexionswing/integration.nix +++ b/modules/private/websites/connexionswing/integration.nix | |||
@@ -74,7 +74,7 @@ in { | |||
74 | certName = "integration"; | 74 | certName = "integration"; |
75 | addToCerts = true; | 75 | addToCerts = true; |
76 | hosts = ["connexionswing.immae.eu" "sandetludo.immae.eu" ]; | 76 | hosts = ["connexionswing.immae.eu" "sandetludo.immae.eu" ]; |
77 | root = pcfg.webappDirs.connexionswing_integration; | 77 | root = app.webRoot; |
78 | extraConfig = [ | 78 | extraConfig = [ |
79 | '' | 79 | '' |
80 | <FilesMatch "\.php$"> | 80 | <FilesMatch "\.php$"> |
@@ -99,7 +99,7 @@ in { | |||
99 | ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://connexionswing.com\"></html>" | 99 | ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://connexionswing.com\"></html>" |
100 | </Location> | 100 | </Location> |
101 | 101 | ||
102 | <Directory ${pcfg.webappDirs.connexionswing_integration}> | 102 | <Directory ${app.webRoot}> |
103 | Options Indexes FollowSymLinks MultiViews Includes | 103 | Options Indexes FollowSymLinks MultiViews Includes |
104 | AllowOverride None | 104 | AllowOverride None |
105 | Require all granted | 105 | Require all granted |
diff --git a/modules/private/websites/connexionswing/production.nix b/modules/private/websites/connexionswing/production.nix index 981e95e..144093a 100644 --- a/modules/private/websites/connexionswing/production.nix +++ b/modules/private/websites/connexionswing/production.nix | |||
@@ -79,7 +79,7 @@ in { | |||
79 | certName = "connexionswing"; | 79 | certName = "connexionswing"; |
80 | certMainHost = "connexionswing.com"; | 80 | certMainHost = "connexionswing.com"; |
81 | hosts = ["connexionswing.com" "sandetludo.com" "www.connexionswing.com" "www.sandetludo.com" ]; | 81 | hosts = ["connexionswing.com" "sandetludo.com" "www.connexionswing.com" "www.sandetludo.com" ]; |
82 | root = pcfg.webappDirs.connexionswing_production; | 82 | root = app.webRoot; |
83 | extraConfig = [ | 83 | extraConfig = [ |
84 | '' | 84 | '' |
85 | <FilesMatch "\.php$"> | 85 | <FilesMatch "\.php$"> |
@@ -100,7 +100,7 @@ in { | |||
100 | 100 | ||
101 | Use Stats connexionswing.com | 101 | Use Stats connexionswing.com |
102 | 102 | ||
103 | <Directory ${pcfg.webappDirs.connexionswing_production}> | 103 | <Directory ${app.webRoot}> |
104 | Options Indexes FollowSymLinks MultiViews Includes | 104 | Options Indexes FollowSymLinks MultiViews Includes |
105 | AllowOverride All | 105 | AllowOverride All |
106 | Require all granted | 106 | Require all granted |
diff --git a/modules/private/websites/default.nix b/modules/private/websites/default.nix index e819324..08c9d79 100644 --- a/modules/private/websites/default.nix +++ b/modules/private/websites/default.nix | |||
@@ -1,7 +1,7 @@ | |||
1 | { lib, pkgs, config, ... }: | 1 | { lib, pkgs, config, ... }: |
2 | let | 2 | let |
3 | www_root = "/run/current-system/webapps/_www"; | 3 | www_root = ./_www; |
4 | theme_root = "/run/current-system/webapps/_theme"; | 4 | theme_root = pkgs.webapps.apache-theme.theme; |
5 | apacheConfig = { | 5 | apacheConfig = { |
6 | cache = { | 6 | cache = { |
7 | # This setting permits to ignore time-based cache for files in the | 7 | # This setting permits to ignore time-based cache for files in the |
@@ -216,10 +216,6 @@ in | |||
216 | }; | 216 | }; |
217 | }; | 217 | }; |
218 | 218 | ||
219 | services.websites.webappDirs = { | ||
220 | _www = ./_www; | ||
221 | _theme = pkgs.webapps.apache-theme.theme; | ||
222 | }; | ||
223 | myServices.websites = { | 219 | myServices.websites = { |
224 | bakeer.cloud.enable = true; | 220 | bakeer.cloud.enable = true; |
225 | capitaines.landing_pages.enable = true; | 221 | capitaines.landing_pages.enable = true; |
diff --git a/modules/private/websites/emilia/moodle.nix b/modules/private/websites/emilia/moodle.nix index d49faf5..f943502 100644 --- a/modules/private/websites/emilia/moodle.nix +++ b/modules/private/websites/emilia/moodle.nix | |||
@@ -4,8 +4,6 @@ let | |||
4 | env = config.myEnv.websites.emilia; | 4 | env = config.myEnv.websites.emilia; |
5 | varDir = "/var/lib/emilia_moodle"; | 5 | varDir = "/var/lib/emilia_moodle"; |
6 | siteDir = ./moodle; | 6 | siteDir = ./moodle; |
7 | webappName = "emilia_moodle"; | ||
8 | webappdir = config.services.websites.webappDirsPaths.emilia_moodle; | ||
9 | # php_admin_value[upload_max_filesize] = 50000000 | 7 | # php_admin_value[upload_max_filesize] = 50000000 |
10 | # php_admin_value[post_max_size] = 50000000 | 8 | # php_admin_value[post_max_size] = 50000000 |
11 | configFile = '' | 9 | configFile = '' |
@@ -49,15 +47,14 @@ in { | |||
49 | system.activationScripts.emilia_moodle = '' | 47 | system.activationScripts.emilia_moodle = '' |
50 | install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d ${varDir} | 48 | install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d ${varDir} |
51 | ''; | 49 | ''; |
52 | services.websites.webappDirs.emilia_moodle = siteDir; | ||
53 | services.websites.env.production.vhostConfs.emilia_moodle = { | 50 | services.websites.env.production.vhostConfs.emilia_moodle = { |
54 | certName = "emilia"; | 51 | certName = "emilia"; |
55 | certMainHost = "saison-photo.org"; | 52 | certMainHost = "saison-photo.org"; |
56 | hosts = [ "saison-photo.org" "www.saison-photo.org" ]; | 53 | hosts = [ "saison-photo.org" "www.saison-photo.org" ]; |
57 | root = webappdir; | 54 | root = siteDir; |
58 | extraConfig = [ | 55 | extraConfig = [ |
59 | '' | 56 | '' |
60 | <Directory ${webappdir}> | 57 | <Directory ${siteDir}> |
61 | DirectoryIndex pause.html | 58 | DirectoryIndex pause.html |
62 | Options Indexes FollowSymLinks MultiViews Includes | 59 | Options Indexes FollowSymLinks MultiViews Includes |
63 | Require all granted | 60 | Require all granted |
diff --git a/modules/private/websites/florian/app.nix b/modules/private/websites/florian/app.nix index 87e622a..5e6255c 100644 --- a/modules/private/websites/florian/app.nix +++ b/modules/private/websites/florian/app.nix | |||
@@ -81,7 +81,7 @@ in { | |||
81 | certName = "integration"; | 81 | certName = "integration"; |
82 | addToCerts = true; | 82 | addToCerts = true; |
83 | hosts = [ "app.tellesflorian.com" ]; | 83 | hosts = [ "app.tellesflorian.com" ]; |
84 | root = pcfg.webappDirs.florian_app; | 84 | root = app.webRoot; |
85 | extraConfig = [ | 85 | extraConfig = [ |
86 | '' | 86 | '' |
87 | <FilesMatch "\.php$"> | 87 | <FilesMatch "\.php$"> |
@@ -99,7 +99,7 @@ in { | |||
99 | ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://tellesflorian.com\"></html>" | 99 | ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://tellesflorian.com\"></html>" |
100 | </Location> | 100 | </Location> |
101 | 101 | ||
102 | <Directory ${pcfg.webappDirs.florian_app}> | 102 | <Directory ${app.webRoot}> |
103 | Options Indexes FollowSymLinks MultiViews Includes | 103 | Options Indexes FollowSymLinks MultiViews Includes |
104 | AllowOverride None | 104 | AllowOverride None |
105 | Require all granted | 105 | Require all granted |
diff --git a/modules/private/websites/isabelle/aten_integration.nix b/modules/private/websites/isabelle/aten_integration.nix index 899ee66..7e0aaf7 100644 --- a/modules/private/websites/isabelle/aten_integration.nix +++ b/modules/private/websites/isabelle/aten_integration.nix | |||
@@ -60,7 +60,7 @@ in { | |||
60 | certName = "integration"; | 60 | certName = "integration"; |
61 | addToCerts = true; | 61 | addToCerts = true; |
62 | hosts = [ "dev.aten.pro" ]; | 62 | hosts = [ "dev.aten.pro" ]; |
63 | root = pcfg.webappDirs.isabelle_aten_integration; | 63 | root = app.webRoot; |
64 | extraConfig = [ | 64 | extraConfig = [ |
65 | '' | 65 | '' |
66 | <FilesMatch "\.php$"> | 66 | <FilesMatch "\.php$"> |
@@ -81,7 +81,7 @@ in { | |||
81 | ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://aten.pro\"></html>" | 81 | ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://aten.pro\"></html>" |
82 | </Location> | 82 | </Location> |
83 | 83 | ||
84 | <Directory ${pcfg.webappDirs.isabelle_aten_integration}> | 84 | <Directory ${app.webRoot}> |
85 | Options Indexes FollowSymLinks MultiViews Includes | 85 | Options Indexes FollowSymLinks MultiViews Includes |
86 | AllowOverride All | 86 | AllowOverride All |
87 | Require all granted | 87 | Require all granted |
diff --git a/modules/private/websites/isabelle/aten_production.nix b/modules/private/websites/isabelle/aten_production.nix index b8d12b9..6a04710 100644 --- a/modules/private/websites/isabelle/aten_production.nix +++ b/modules/private/websites/isabelle/aten_production.nix | |||
@@ -61,7 +61,7 @@ in { | |||
61 | certName = "isabelle"; | 61 | certName = "isabelle"; |
62 | certMainHost = "aten.pro"; | 62 | certMainHost = "aten.pro"; |
63 | hosts = [ "aten.pro" "www.aten.pro" ]; | 63 | hosts = [ "aten.pro" "www.aten.pro" ]; |
64 | root = pcfg.webappDirs.isabelle_aten_production; | 64 | root = app.webRoot; |
65 | extraConfig = [ | 65 | extraConfig = [ |
66 | '' | 66 | '' |
67 | <FilesMatch "\.php$"> | 67 | <FilesMatch "\.php$"> |
@@ -78,7 +78,7 @@ in { | |||
78 | ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://aten.pro\"></html>" | 78 | ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://aten.pro\"></html>" |
79 | </Location> | 79 | </Location> |
80 | 80 | ||
81 | <Directory ${pcfg.webappDirs.isabelle_aten_production}> | 81 | <Directory ${app.webRoot}> |
82 | Options Indexes FollowSymLinks MultiViews Includes | 82 | Options Indexes FollowSymLinks MultiViews Includes |
83 | AllowOverride All | 83 | AllowOverride All |
84 | Require all granted | 84 | Require all granted |
diff --git a/modules/private/websites/isabelle/iridologie.nix b/modules/private/websites/isabelle/iridologie.nix index decda36..88521fc 100644 --- a/modules/private/websites/isabelle/iridologie.nix +++ b/modules/private/websites/isabelle/iridologie.nix | |||
@@ -10,7 +10,6 @@ let | |||
10 | 10 | ||
11 | apacheUser = config.services.httpd.Prod.user; | 11 | apacheUser = config.services.httpd.Prod.user; |
12 | apacheGroup = config.services.httpd.Prod.group; | 12 | apacheGroup = config.services.httpd.Prod.group; |
13 | webappdir = config.services.websites.webappDirsPaths.isabelle_iridologie; | ||
14 | secretsPath = config.secrets.fullPaths."websites/isabelle/iridologie"; | 13 | secretsPath = config.secrets.fullPaths."websites/isabelle/iridologie"; |
15 | in { | 14 | in { |
16 | options.myServices.websites.isabelle.iridologie.enable = lib.mkEnableOption "enable Iridologie's website"; | 15 | options.myServices.websites.isabelle.iridologie.enable = lib.mkEnableOption "enable Iridologie's website"; |
@@ -68,13 +67,12 @@ in { | |||
68 | install -m 0750 -o ${apacheUser} -g ${apacheGroup} -d ${app.varDir}/phpSessions | 67 | install -m 0750 -o ${apacheUser} -g ${apacheGroup} -d ${app.varDir}/phpSessions |
69 | ''; | 68 | ''; |
70 | }; | 69 | }; |
71 | services.websites.webappDirs.isabelle_iridologie = app.webRoot; | ||
72 | services.websites.env.production.modules = [ "proxy_fcgi" ]; | 70 | services.websites.env.production.modules = [ "proxy_fcgi" ]; |
73 | services.websites.env.production.vhostConfs.isabelle_iridologie = { | 71 | services.websites.env.production.vhostConfs.isabelle_iridologie = { |
74 | certName = "isabelle"; | 72 | certName = "isabelle"; |
75 | addToCerts = true; | 73 | addToCerts = true; |
76 | hosts = [ "iridologie.icommandeur.org" "icommandeur.org" "www.icommandeur.org" ]; | 74 | hosts = [ "iridologie.icommandeur.org" "icommandeur.org" "www.icommandeur.org" ]; |
77 | root = webappdir; | 75 | root = app.webRoot; |
78 | extraConfig = [ | 76 | extraConfig = [ |
79 | '' | 77 | '' |
80 | RewriteEngine On | 78 | RewriteEngine On |
@@ -89,16 +87,16 @@ in { | |||
89 | SetHandler "proxy:unix:${config.services.phpfpm.pools.isabelle_iridologie.socket}|fcgi://localhost" | 87 | SetHandler "proxy:unix:${config.services.phpfpm.pools.isabelle_iridologie.socket}|fcgi://localhost" |
90 | </FilesMatch> | 88 | </FilesMatch> |
91 | 89 | ||
92 | <Directory ${webappdir}> | 90 | <Directory ${app.webRoot}> |
93 | DirectoryIndex index.php index.htm index.html | 91 | DirectoryIndex index.php index.htm index.html |
94 | Options -Indexes +FollowSymLinks +MultiViews +Includes | 92 | Options -Indexes +FollowSymLinks +MultiViews +Includes |
95 | Include ${webappdir}/htaccess.txt | 93 | Include ${app.webRoot}/htaccess.txt |
96 | 94 | ||
97 | AllowOverride AuthConfig FileInfo Limit | 95 | AllowOverride AuthConfig FileInfo Limit |
98 | Require all granted | 96 | Require all granted |
99 | </Directory> | 97 | </Directory> |
100 | 98 | ||
101 | <DirectoryMatch "${webappdir}/squelettes"> | 99 | <DirectoryMatch "${app.webRoot}/squelettes"> |
102 | Require all denied | 100 | Require all denied |
103 | </DirectoryMatch> | 101 | </DirectoryMatch> |
104 | 102 | ||
diff --git a/modules/private/websites/ludivine/integration.nix b/modules/private/websites/ludivine/integration.nix index cfef385..99c9acf 100644 --- a/modules/private/websites/ludivine/integration.nix +++ b/modules/private/websites/ludivine/integration.nix | |||
@@ -90,7 +90,7 @@ in { | |||
90 | certName = "integration"; | 90 | certName = "integration"; |
91 | addToCerts = true; | 91 | addToCerts = true; |
92 | hosts = [ "ludivine.immae.eu" ]; | 92 | hosts = [ "ludivine.immae.eu" ]; |
93 | root = pcfg.webappDirs.ludivine_integration; | 93 | root = app.webRoot; |
94 | extraConfig = [ | 94 | extraConfig = [ |
95 | '' | 95 | '' |
96 | <FilesMatch "\.php$"> | 96 | <FilesMatch "\.php$"> |
@@ -103,7 +103,7 @@ in { | |||
103 | ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://ludivinecassal.com\"></html>" | 103 | ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://ludivinecassal.com\"></html>" |
104 | </Location> | 104 | </Location> |
105 | 105 | ||
106 | <Directory ${pcfg.webappDirs.ludivine_integration}> | 106 | <Directory ${app.webRoot}> |
107 | Options Indexes FollowSymLinks MultiViews Includes | 107 | Options Indexes FollowSymLinks MultiViews Includes |
108 | AllowOverride None | 108 | AllowOverride None |
109 | Require all granted | 109 | Require all granted |
diff --git a/modules/private/websites/ludivine/production.nix b/modules/private/websites/ludivine/production.nix index 73b63a2..09bb3dc 100644 --- a/modules/private/websites/ludivine/production.nix +++ b/modules/private/websites/ludivine/production.nix | |||
@@ -93,7 +93,7 @@ in { | |||
93 | certName = "ludivine"; | 93 | certName = "ludivine"; |
94 | certMainHost = "ludivinecassal.com"; | 94 | certMainHost = "ludivinecassal.com"; |
95 | hosts = ["ludivinecassal.com" "www.ludivinecassal.com" ]; | 95 | hosts = ["ludivinecassal.com" "www.ludivinecassal.com" ]; |
96 | root = pcfg.webappDirs.ludivine_production; | 96 | root = app.webRoot; |
97 | extraConfig = [ | 97 | extraConfig = [ |
98 | '' | 98 | '' |
99 | RewriteEngine on | 99 | RewriteEngine on |
@@ -106,7 +106,7 @@ in { | |||
106 | 106 | ||
107 | Use Stats ludivinecassal.com | 107 | Use Stats ludivinecassal.com |
108 | 108 | ||
109 | <Directory ${pcfg.webappDirs.ludivine_production}> | 109 | <Directory ${app.webRoot}> |
110 | Options Indexes FollowSymLinks MultiViews Includes | 110 | Options Indexes FollowSymLinks MultiViews Includes |
111 | AllowOverride All | 111 | AllowOverride All |
112 | Require all granted | 112 | Require all granted |
diff --git a/modules/private/websites/papa/maison_bbc.nix b/modules/private/websites/papa/maison_bbc.nix index 528c832..3eb736e 100644 --- a/modules/private/websites/papa/maison_bbc.nix +++ b/modules/private/websites/papa/maison_bbc.nix | |||
@@ -1,23 +1,21 @@ | |||
1 | { lib, config, ... }: | 1 | { lib, config, ... }: |
2 | let | 2 | let |
3 | cfg = config.myServices.websites.papa.maison_bbc; | 3 | cfg = config.myServices.websites.papa.maison_bbc; |
4 | webappdirs = config.services.websites.webappDirsPaths; | ||
5 | in { | 4 | in { |
6 | options.myServices.websites.papa.maison_bbc.enable = lib.mkEnableOption "enable Papa Maison bbc website"; | 5 | options.myServices.websites.papa.maison_bbc.enable = lib.mkEnableOption "enable Papa Maison bbc website"; |
7 | 6 | ||
8 | config = lib.mkIf cfg.enable { | 7 | config = lib.mkIf cfg.enable { |
9 | services.webstats.sites = [ { name = "maison.bbc.bouya.org"; } ]; | 8 | services.webstats.sites = [ { name = "maison.bbc.bouya.org"; } ]; |
10 | 9 | ||
11 | services.websites.webappDirs.papa_maison_bbc = ./maison_bbc_static; | ||
12 | services.websites.env.production.vhostConfs.papa_maison_bbc = { | 10 | services.websites.env.production.vhostConfs.papa_maison_bbc = { |
13 | certName = "papa"; | 11 | certName = "papa"; |
14 | addToCerts = true; | 12 | addToCerts = true; |
15 | hosts = [ "maison.bbc.bouya.org" ]; | 13 | hosts = [ "maison.bbc.bouya.org" ]; |
16 | root = webappdirs.papa_maison_bbc; | 14 | root = ./maison_bbc_static; |
17 | extraConfig = [ | 15 | extraConfig = [ |
18 | '' | 16 | '' |
19 | ErrorDocument 404 /index.html | 17 | ErrorDocument 404 /index.html |
20 | <Directory ${webappdirs.papa_maison_bbc}> | 18 | <Directory ${./maison_bbc_static}> |
21 | DirectoryIndex index.htm index.html | 19 | DirectoryIndex index.htm index.html |
22 | AllowOverride None | 20 | AllowOverride None |
23 | Require all granted | 21 | Require all granted |
diff --git a/modules/private/websites/piedsjaloux/integration.nix b/modules/private/websites/piedsjaloux/integration.nix index f501eba..437b127 100644 --- a/modules/private/websites/piedsjaloux/integration.nix +++ b/modules/private/websites/piedsjaloux/integration.nix | |||
@@ -80,7 +80,7 @@ in { | |||
80 | certName = "integration"; | 80 | certName = "integration"; |
81 | addToCerts = true; | 81 | addToCerts = true; |
82 | hosts = [ "piedsjaloux.immae.eu" ]; | 82 | hosts = [ "piedsjaloux.immae.eu" ]; |
83 | root = pcfg.webappDirs.piedsjaloux_integration; | 83 | root = app.webRoot; |
84 | extraConfig = [ | 84 | extraConfig = [ |
85 | '' | 85 | '' |
86 | <FilesMatch "\.php$"> | 86 | <FilesMatch "\.php$"> |
@@ -93,7 +93,7 @@ in { | |||
93 | ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://piedsjaloux.fr\"></html>" | 93 | ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://piedsjaloux.fr\"></html>" |
94 | </Location> | 94 | </Location> |
95 | 95 | ||
96 | <Directory ${pcfg.webappDirs.piedsjaloux_integration}> | 96 | <Directory ${app.webRoot}> |
97 | Options Indexes FollowSymLinks MultiViews Includes | 97 | Options Indexes FollowSymLinks MultiViews Includes |
98 | AllowOverride None | 98 | AllowOverride None |
99 | Require all granted | 99 | Require all granted |
diff --git a/modules/private/websites/piedsjaloux/production.nix b/modules/private/websites/piedsjaloux/production.nix index fed5a0f..118846d 100644 --- a/modules/private/websites/piedsjaloux/production.nix +++ b/modules/private/websites/piedsjaloux/production.nix | |||
@@ -83,7 +83,7 @@ in { | |||
83 | certName = "piedsjaloux"; | 83 | certName = "piedsjaloux"; |
84 | certMainHost = "piedsjaloux.fr"; | 84 | certMainHost = "piedsjaloux.fr"; |
85 | hosts = [ "piedsjaloux.fr" "www.piedsjaloux.fr" ]; | 85 | hosts = [ "piedsjaloux.fr" "www.piedsjaloux.fr" ]; |
86 | root = pcfg.webappDirs.piedsjaloux_production; | 86 | root = app.webRoot; |
87 | extraConfig = [ | 87 | extraConfig = [ |
88 | '' | 88 | '' |
89 | RewriteEngine on | 89 | RewriteEngine on |
@@ -96,7 +96,7 @@ in { | |||
96 | 96 | ||
97 | Use Stats piedsjaloux.fr | 97 | Use Stats piedsjaloux.fr |
98 | 98 | ||
99 | <Directory ${pcfg.webappDirs.piedsjaloux_production}> | 99 | <Directory ${app.webRoot}> |
100 | Options Indexes FollowSymLinks MultiViews Includes | 100 | Options Indexes FollowSymLinks MultiViews Includes |
101 | AllowOverride All | 101 | AllowOverride All |
102 | Require all granted | 102 | Require all granted |
diff --git a/modules/private/websites/richie/production.nix b/modules/private/websites/richie/production.nix index 3efa9f0..e95df30 100644 --- a/modules/private/websites/richie/production.nix +++ b/modules/private/websites/richie/production.nix | |||
@@ -17,7 +17,6 @@ let | |||
17 | sed -i "s@localedef --list-archive@localedef --list-archive /run/current-system/sw/lib/locale/locale-archive@" $out/admin/parametres.php | 17 | sed -i "s@localedef --list-archive@localedef --list-archive /run/current-system/sw/lib/locale/locale-archive@" $out/admin/parametres.php |
18 | ''; | 18 | ''; |
19 | }; | 19 | }; |
20 | webappdir = config.services.websites.webappDirsPaths.richie_production; | ||
21 | secretPath = config.secrets.fullPaths."websites/richie/production"; | 20 | secretPath = config.secrets.fullPaths."websites/richie/production"; |
22 | apacheUser = config.services.httpd.Prod.user; | 21 | apacheUser = config.services.httpd.Prod.user; |
23 | apacheGroup = config.services.httpd.Prod.group; | 22 | apacheGroup = config.services.httpd.Prod.group; |
@@ -48,7 +47,6 @@ in | |||
48 | ?> | 47 | ?> |
49 | ''; | 48 | ''; |
50 | }; | 49 | }; |
51 | services.websites.webappDirs.richie_production = richieSrc; | ||
52 | system.activationScripts.richie_production = { | 50 | system.activationScripts.richie_production = { |
53 | deps = [ "httpd" ]; | 51 | deps = [ "httpd" ]; |
54 | text = '' | 52 | text = '' |
@@ -85,7 +83,7 @@ in | |||
85 | addToCerts = true; | 83 | addToCerts = true; |
86 | certMainHost = "europe-richie.org"; | 84 | certMainHost = "europe-richie.org"; |
87 | hosts = [ "europe-richie.org" "www.europe-richie.org" ]; | 85 | hosts = [ "europe-richie.org" "www.europe-richie.org" ]; |
88 | root = webappdir; | 86 | root = richieSrc; |
89 | extraConfig = [ | 87 | extraConfig = [ |
90 | '' | 88 | '' |
91 | Use Stats europe-richie.org | 89 | Use Stats europe-richie.org |
@@ -93,7 +91,7 @@ in | |||
93 | <LocationMatch "^/files/.*/admin/"> | 91 | <LocationMatch "^/files/.*/admin/"> |
94 | Require all denied | 92 | Require all denied |
95 | </LocationMatch> | 93 | </LocationMatch> |
96 | <Directory ${webappdir}> | 94 | <Directory ${richieSrc}> |
97 | DirectoryIndex index.php index.htm index.html | 95 | DirectoryIndex index.php index.htm index.html |
98 | Options Indexes FollowSymLinks MultiViews Includes | 96 | Options Indexes FollowSymLinks MultiViews Includes |
99 | AllowOverride None | 97 | AllowOverride None |
diff --git a/modules/private/websites/tools/cloud/default.nix b/modules/private/websites/tools/cloud/default.nix index fc0aae6..44163de 100644 --- a/modules/private/websites/tools/cloud/default.nix +++ b/modules/private/websites/tools/cloud/default.nix | |||
@@ -8,8 +8,6 @@ let | |||
8 | ]); | 8 | ]); |
9 | env = config.myEnv.tools.nextcloud; | 9 | env = config.myEnv.tools.nextcloud; |
10 | varDir = "/var/lib/nextcloud"; | 10 | varDir = "/var/lib/nextcloud"; |
11 | webappName = "tools_nextcloud"; | ||
12 | apacheRoot = "/run/current-system/webapps/${webappName}"; | ||
13 | cfg = config.myServices.websites.tools.cloud; | 11 | cfg = config.myServices.websites.tools.cloud; |
14 | phpFpm = rec { | 12 | phpFpm = rec { |
15 | basedir = builtins.concatStringsSep ":" ([ nextcloud varDir ] ++ nextcloud.apps); | 13 | basedir = builtins.concatStringsSep ":" ([ nextcloud varDir ] ++ nextcloud.apps); |
@@ -49,11 +47,11 @@ in { | |||
49 | certName = "eldiron"; | 47 | certName = "eldiron"; |
50 | addToCerts = true; | 48 | addToCerts = true; |
51 | hosts = ["cloud.immae.eu" ]; | 49 | hosts = ["cloud.immae.eu" ]; |
52 | root = apacheRoot; | 50 | root = nextcloud; |
53 | extraConfig = [ | 51 | extraConfig = [ |
54 | '' | 52 | '' |
55 | SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 | 53 | SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 |
56 | <Directory ${apacheRoot}> | 54 | <Directory ${nextcloud}> |
57 | AcceptPathInfo On | 55 | AcceptPathInfo On |
58 | DirectoryIndex index.php | 56 | DirectoryIndex index.php |
59 | Options FollowSymlinks | 57 | Options FollowSymlinks |
@@ -159,11 +157,6 @@ in { | |||
159 | #install -D -m 0600 -o wwwrun -g wwwrun -T ${config.secrets.fullPaths."webapps/tools-nextcloud"} ${varDir}/config/config.php | 157 | #install -D -m 0600 -o wwwrun -g wwwrun -T ${config.secrets.fullPaths."webapps/tools-nextcloud"} ${varDir}/config/config.php |
160 | ''; | 158 | ''; |
161 | }; | 159 | }; |
162 | # FIXME: add a warning when config.php changes | ||
163 | system.extraSystemBuilderCmds = '' | ||
164 | mkdir -p $out/webapps | ||
165 | ln -s ${nextcloud} $out/webapps/${webappName} | ||
166 | ''; | ||
167 | 160 | ||
168 | services.phpfpm.pools.nextcloud = { | 161 | services.phpfpm.pools.nextcloud = { |
169 | user = "wwwrun"; | 162 | user = "wwwrun"; |
diff --git a/modules/private/websites/tools/dav/davical.nix b/modules/private/websites/tools/dav/davical.nix index 9e4056a..bc5ecf6 100644 --- a/modules/private/websites/tools/dav/davical.nix +++ b/modules/private/websites/tools/dav/davical.nix | |||
@@ -70,8 +70,7 @@ rec { | |||
70 | user = "wwwrun"; | 70 | user = "wwwrun"; |
71 | group = "wwwrun"; | 71 | group = "wwwrun"; |
72 | modules = [ "proxy_fcgi" ]; | 72 | modules = [ "proxy_fcgi" ]; |
73 | webappName = "tools_davical"; | 73 | root = webRoot; |
74 | root = "/run/current-system/webapps/${webappName}"; | ||
75 | vhostConf = socket: '' | 74 | vhostConf = socket: '' |
76 | Alias /davical "${root}" | 75 | Alias /davical "${root}" |
77 | Alias /caldav.php "${root}/caldav.php" | 76 | Alias /caldav.php "${root}/caldav.php" |
diff --git a/modules/private/websites/tools/dav/default.nix b/modules/private/websites/tools/dav/default.nix index c54e152..b3aa03d 100644 --- a/modules/private/websites/tools/dav/default.nix +++ b/modules/private/websites/tools/dav/default.nix | |||
@@ -1,8 +1,7 @@ | |||
1 | { lib, pkgs, config, ... }: | 1 | { lib, pkgs, config, ... }: |
2 | let | 2 | let |
3 | infcloud = rec { | 3 | infcloud = rec { |
4 | webappName = "tools_infcloud"; | 4 | root = pkgs.webapps.infcloud; |
5 | root = "/run/current-system/webapps/${webappName}"; | ||
6 | vhostConf = '' | 5 | vhostConf = '' |
7 | Alias /carddavmate ${root} | 6 | Alias /carddavmate ${root} |
8 | Alias /caldavzap ${root} | 7 | Alias /caldavzap ${root} |
@@ -36,7 +35,7 @@ in { | |||
36 | certName = "eldiron"; | 35 | certName = "eldiron"; |
37 | addToCerts = true; | 36 | addToCerts = true; |
38 | hosts = ["dav.immae.eu" ]; | 37 | hosts = ["dav.immae.eu" ]; |
39 | root = "/run/current-system/webapps/_dav"; | 38 | root = ./www; |
40 | extraConfig = [ | 39 | extraConfig = [ |
41 | infcloud.vhostConf | 40 | infcloud.vhostConf |
42 | (davical.apache.vhostConf config.services.phpfpm.pools.davical.socket) | 41 | (davical.apache.vhostConf config.services.phpfpm.pools.davical.socket) |
@@ -51,10 +50,6 @@ in { | |||
51 | phpPackage = pkgs.php72; | 50 | phpPackage = pkgs.php72; |
52 | }; | 51 | }; |
53 | }; | 52 | }; |
54 | |||
55 | services.websites.webappDirs._dav = ./www; | ||
56 | services.websites.webappDirs."${davical.apache.webappName}" = davical.webRoot; | ||
57 | services.websites.webappDirs."${infcloud.webappName}" = pkgs.webapps.infcloud; | ||
58 | }; | 53 | }; |
59 | } | 54 | } |
60 | 55 | ||
diff --git a/modules/private/websites/tools/diaspora/default.nix b/modules/private/websites/tools/diaspora/default.nix index 9119ead..9afd5b9 100644 --- a/modules/private/websites/tools/diaspora/default.nix +++ b/modules/private/websites/tools/diaspora/default.nix | |||
@@ -1,7 +1,7 @@ | |||
1 | { lib, pkgs, config, ... }: | 1 | { lib, pkgs, config, ... }: |
2 | let | 2 | let |
3 | env = config.myEnv.tools.diaspora; | 3 | env = config.myEnv.tools.diaspora; |
4 | root = "/run/current-system/webapps/tools_diaspora"; | 4 | root = "${dcfg.workdir}/public/"; |
5 | cfg = config.myServices.websites.tools.diaspora; | 5 | cfg = config.myServices.websites.tools.diaspora; |
6 | dcfg = config.services.diaspora; | 6 | dcfg = config.services.diaspora; |
7 | in { | 7 | in { |
@@ -160,10 +160,6 @@ in { | |||
160 | services.websites.env.tools.modules = [ | 160 | services.websites.env.tools.modules = [ |
161 | "headers" "proxy" "proxy_http" | 161 | "headers" "proxy" "proxy_http" |
162 | ]; | 162 | ]; |
163 | system.extraSystemBuilderCmds = '' | ||
164 | mkdir -p $out/webapps | ||
165 | ln -s ${dcfg.workdir}/public/ $out/webapps/tools_diaspora | ||
166 | ''; | ||
167 | services.websites.env.tools.vhostConfs.diaspora = { | 163 | services.websites.env.tools.vhostConfs.diaspora = { |
168 | certName = "eldiron"; | 164 | certName = "eldiron"; |
169 | addToCerts = true; | 165 | addToCerts = true; |
diff --git a/modules/private/websites/tools/git/default.nix b/modules/private/websites/tools/git/default.nix index 755bab0..8f611ee 100644 --- a/modules/private/websites/tools/git/default.nix +++ b/modules/private/websites/tools/git/default.nix | |||
@@ -20,8 +20,6 @@ in { | |||
20 | services.websites.env.tools.modules = | 20 | services.websites.env.tools.modules = |
21 | gitweb.apache.modules ++ | 21 | gitweb.apache.modules ++ |
22 | mantisbt.apache.modules; | 22 | mantisbt.apache.modules; |
23 | services.websites.webappDirs."${gitweb.apache.webappName}" = gitweb.webRoot; | ||
24 | services.websites.webappDirs."${mantisbt.apache.webappName}" = mantisbt.webRoot; | ||
25 | 23 | ||
26 | system.activationScripts.mantisbt = mantisbt.activationScript; | 24 | system.activationScripts.mantisbt = mantisbt.activationScript; |
27 | services.websites.env.tools.vhostConfs.git = { | 25 | services.websites.env.tools.vhostConfs.git = { |
diff --git a/modules/private/websites/tools/git/gitweb.nix b/modules/private/websites/tools/git/gitweb.nix index dab0c9e..ff34da5 100644 --- a/modules/private/websites/tools/git/gitweb.nix +++ b/modules/private/websites/tools/git/gitweb.nix | |||
@@ -1,7 +1,6 @@ | |||
1 | { gitweb, writeText, stdenv, coreutils, writeScript, gitolite, git, cgit, gitoliteDir, mailcap, highlight }: | 1 | { gitweb, writeText, stdenv, coreutils, writeScript, gitolite, git, cgit, gitoliteDir, mailcap, highlight }: |
2 | rec { | 2 | rec { |
3 | varDir = gitoliteDir; | 3 | varDir = gitoliteDir; |
4 | webRoot = gitweb; | ||
5 | config = writeText "gitweb.conf" '' | 4 | config = writeText "gitweb.conf" '' |
6 | $git_temp = "/tmp"; | 5 | $git_temp = "/tmp"; |
7 | 6 | ||
@@ -77,8 +76,7 @@ rec { | |||
77 | user = "wwwrun"; | 76 | user = "wwwrun"; |
78 | group = "wwwrun"; | 77 | group = "wwwrun"; |
79 | modules = [ "cgid" ]; | 78 | modules = [ "cgid" ]; |
80 | webappName = "tools_gitweb"; | 79 | root = gitweb; |
81 | root = "/run/current-system/webapps/${webappName}"; | ||
82 | vhostConf = '' | 80 | vhostConf = '' |
83 | SetEnv GIT_PROJECT_ROOT ${varDir}/repositories/ | 81 | SetEnv GIT_PROJECT_ROOT ${varDir}/repositories/ |
84 | ScriptAliasMatch \ | 82 | ScriptAliasMatch \ |
diff --git a/modules/private/websites/tools/git/mantisbt.nix b/modules/private/websites/tools/git/mantisbt.nix index 033a651..2ef76af 100644 --- a/modules/private/websites/tools/git/mantisbt.nix +++ b/modules/private/websites/tools/git/mantisbt.nix | |||
@@ -50,8 +50,7 @@ rec { | |||
50 | user = "wwwrun"; | 50 | user = "wwwrun"; |
51 | group = "wwwrun"; | 51 | group = "wwwrun"; |
52 | modules = [ "proxy_fcgi" ]; | 52 | modules = [ "proxy_fcgi" ]; |
53 | webappName = "tools_mantisbt"; | 53 | root = webRoot; |
54 | root = "/run/current-system/webapps/${webappName}"; | ||
55 | vhostConf = socket: '' | 54 | vhostConf = socket: '' |
56 | Alias /mantisbt "${root}" | 55 | Alias /mantisbt "${root}" |
57 | <Directory "${root}"> | 56 | <Directory "${root}"> |
diff --git a/modules/private/websites/tools/mail/default.nix b/modules/private/websites/tools/mail/default.nix index 033a587..7bc3d2d 100644 --- a/modules/private/websites/tools/mail/default.nix +++ b/modules/private/websites/tools/mail/default.nix | |||
@@ -36,12 +36,12 @@ in | |||
36 | certName = "mail"; | 36 | certName = "mail"; |
37 | addToCerts = true; | 37 | addToCerts = true; |
38 | hosts = ["mail.immae.eu"]; | 38 | hosts = ["mail.immae.eu"]; |
39 | root = "/run/current-system/webapps/_mail"; | 39 | root = ./www; |
40 | extraConfig = [ | 40 | extraConfig = [ |
41 | (rainloop.apache.vhostConf pcfg.rainloop.socket) | 41 | (rainloop.apache.vhostConf pcfg.rainloop.socket) |
42 | (roundcubemail.apache.vhostConf pcfg.roundcubemail.socket) | 42 | (roundcubemail.apache.vhostConf pcfg.roundcubemail.socket) |
43 | '' | 43 | '' |
44 | <Directory /run/current-system/webapps/_mail> | 44 | <Directory ${./www}> |
45 | Require all granted | 45 | Require all granted |
46 | Options -Indexes | 46 | Options -Indexes |
47 | </Directory> | 47 | </Directory> |
@@ -78,13 +78,6 @@ in | |||
78 | roundcubemail = roundcubemail.activationScript; | 78 | roundcubemail = roundcubemail.activationScript; |
79 | rainloop = rainloop.activationScript; | 79 | rainloop = rainloop.activationScript; |
80 | }; | 80 | }; |
81 | |||
82 | services.websites.webappDirs = { | ||
83 | _mail = ./www; | ||
84 | "${roundcubemail.apache.webappName}" = roundcubemail.webRoot; | ||
85 | "${rainloop.apache.webappName}" = rainloop.webRoot; | ||
86 | }; | ||
87 | |||
88 | }; | 81 | }; |
89 | 82 | ||
90 | } | 83 | } |
diff --git a/modules/private/websites/tools/mail/mta-sts.nix b/modules/private/websites/tools/mail/mta-sts.nix index c5f71f0..77ba2d4 100644 --- a/modules/private/websites/tools/mail/mta-sts.nix +++ b/modules/private/websites/tools/mail/mta-sts.nix | |||
@@ -33,21 +33,17 @@ let | |||
33 | in | 33 | in |
34 | { | 34 | { |
35 | config = lib.mkIf cfg.enable { | 35 | config = lib.mkIf cfg.enable { |
36 | services.websites.webappDirs = { | ||
37 | _mta-sts = root; | ||
38 | }; | ||
39 | |||
40 | services.websites.env.tools.vhostConfs.mta_sts = { | 36 | services.websites.env.tools.vhostConfs.mta_sts = { |
41 | certName = "mail"; | 37 | certName = "mail"; |
42 | addToCerts = true; | 38 | addToCerts = true; |
43 | hosts = ["mta-sts.mail.immae.eu"] ++ map (v: "mta-sts.${v.domain}") domains; | 39 | hosts = ["mta-sts.mail.immae.eu"] ++ map (v: "mta-sts.${v.domain}") domains; |
44 | root = "/run/current-system/webapps/_mta-sts"; | 40 | root = root; |
45 | extraConfig = [ | 41 | extraConfig = [ |
46 | '' | 42 | '' |
47 | RewriteEngine on | 43 | RewriteEngine on |
48 | RewriteCond %{HTTP_HOST} ^mta-sts.(.*)$ | 44 | RewriteCond %{HTTP_HOST} ^mta-sts.(.*)$ |
49 | RewriteRule ^/.well-known/mta-sts.txt$ %{DOCUMENT_ROOT}/%1.txt [L] | 45 | RewriteRule ^/.well-known/mta-sts.txt$ %{DOCUMENT_ROOT}/%1.txt [L] |
50 | <Directory /run/current-system/webapps/_mta-sts> | 46 | <Directory ${root}> |
51 | Require all granted | 47 | Require all granted |
52 | Options -Indexes | 48 | Options -Indexes |
53 | </Directory> | 49 | </Directory> |
diff --git a/modules/private/websites/tools/mail/rainloop.nix b/modules/private/websites/tools/mail/rainloop.nix index 21de5eb..20e43a1 100644 --- a/modules/private/websites/tools/mail/rainloop.nix +++ b/modules/private/websites/tools/mail/rainloop.nix | |||
@@ -14,8 +14,7 @@ rec { | |||
14 | user = "wwwrun"; | 14 | user = "wwwrun"; |
15 | group = "wwwrun"; | 15 | group = "wwwrun"; |
16 | modules = [ "proxy_fcgi" ]; | 16 | modules = [ "proxy_fcgi" ]; |
17 | webappName = "tools_rainloop"; | 17 | root = webRoot; |
18 | root = "/run/current-system/webapps/${webappName}"; | ||
19 | vhostConf = socket: '' | 18 | vhostConf = socket: '' |
20 | Alias /rainloop "${root}" | 19 | Alias /rainloop "${root}" |
21 | <Directory "${root}"> | 20 | <Directory "${root}"> |
diff --git a/modules/private/websites/tools/mail/roundcubemail.nix b/modules/private/websites/tools/mail/roundcubemail.nix index 92de28e..2661b55 100644 --- a/modules/private/websites/tools/mail/roundcubemail.nix +++ b/modules/private/websites/tools/mail/roundcubemail.nix | |||
@@ -79,8 +79,7 @@ rec { | |||
79 | user = "wwwrun"; | 79 | user = "wwwrun"; |
80 | group = "wwwrun"; | 80 | group = "wwwrun"; |
81 | modules = [ "proxy_fcgi" ]; | 81 | modules = [ "proxy_fcgi" ]; |
82 | webappName = "tools_roundcubemail"; | 82 | root = webRoot; |
83 | root = "/run/current-system/webapps/${webappName}"; | ||
84 | vhostConf = socket: '' | 83 | vhostConf = socket: '' |
85 | Alias /roundcube "${root}" | 84 | Alias /roundcube "${root}" |
86 | <Directory "${root}"> | 85 | <Directory "${root}"> |
diff --git a/modules/private/websites/tools/mastodon/default.nix b/modules/private/websites/tools/mastodon/default.nix index 87e8d72..3512cf1 100644 --- a/modules/private/websites/tools/mastodon/default.nix +++ b/modules/private/websites/tools/mastodon/default.nix | |||
@@ -1,7 +1,7 @@ | |||
1 | { lib, pkgs, config, ... }: | 1 | { lib, pkgs, config, ... }: |
2 | let | 2 | let |
3 | env = config.myEnv.tools.mastodon; | 3 | env = config.myEnv.tools.mastodon; |
4 | root = "/run/current-system/webapps/tools_mastodon"; | 4 | root = "${mcfg.workdir}/public/"; |
5 | cfg = config.myServices.websites.tools.mastodon; | 5 | cfg = config.myServices.websites.tools.mastodon; |
6 | mcfg = config.services.mastodon; | 6 | mcfg = config.services.mastodon; |
7 | in { | 7 | in { |
@@ -82,10 +82,6 @@ in { | |||
82 | services.websites.env.tools.modules = [ | 82 | services.websites.env.tools.modules = [ |
83 | "headers" "proxy" "proxy_wstunnel" "proxy_http" | 83 | "headers" "proxy" "proxy_wstunnel" "proxy_http" |
84 | ]; | 84 | ]; |
85 | system.extraSystemBuilderCmds = '' | ||
86 | mkdir -p $out/webapps | ||
87 | ln -s ${mcfg.workdir}/public/ $out/webapps/tools_mastodon | ||
88 | ''; | ||
89 | services.websites.env.tools.vhostConfs.mastodon = { | 85 | services.websites.env.tools.vhostConfs.mastodon = { |
90 | certName = "eldiron"; | 86 | certName = "eldiron"; |
91 | addToCerts = true; | 87 | addToCerts = true; |
diff --git a/modules/private/websites/tools/tools/adminer.nix b/modules/private/websites/tools/tools/adminer.nix index a4ba344..c280684 100644 --- a/modules/private/websites/tools/tools/adminer.nix +++ b/modules/private/websites/tools/tools/adminer.nix | |||
@@ -1,4 +1,4 @@ | |||
1 | { adminer, php74, myPhpPackages, lib, forcePhpSocket ? null }: | 1 | { webapps, php74, myPhpPackages, lib, forcePhpSocket ? null }: |
2 | rec { | 2 | rec { |
3 | activationScript = { | 3 | activationScript = { |
4 | deps = [ "httpd" ]; | 4 | deps = [ "httpd" ]; |
@@ -6,7 +6,7 @@ rec { | |||
6 | install -m 0755 -o ${apache.user} -g ${apache.group} -d /var/lib/php/sessions/adminer | 6 | install -m 0755 -o ${apache.user} -g ${apache.group} -d /var/lib/php/sessions/adminer |
7 | ''; | 7 | ''; |
8 | }; | 8 | }; |
9 | webRoot = adminer; | 9 | webRoot = webapps.adminer; |
10 | phpFpm = rec { | 10 | phpFpm = rec { |
11 | user = apache.user; | 11 | user = apache.user; |
12 | group = apache.group; | 12 | group = apache.group; |
@@ -28,11 +28,10 @@ rec { | |||
28 | user = "wwwrun"; | 28 | user = "wwwrun"; |
29 | group = "wwwrun"; | 29 | group = "wwwrun"; |
30 | modules = [ "proxy_fcgi" ]; | 30 | modules = [ "proxy_fcgi" ]; |
31 | webappName = "_adminer"; | 31 | root = webRoot; |
32 | root = "/run/current-system/webapps/${webappName}"; | ||
33 | vhostConf = socket: '' | 32 | vhostConf = socket: '' |
34 | Alias /adminer ${root} | 33 | Alias /adminer ${webRoot} |
35 | <Directory ${root}> | 34 | <Directory ${webRoot}> |
36 | DirectoryIndex index.php | 35 | DirectoryIndex index.php |
37 | <FilesMatch "\.php$"> | 36 | <FilesMatch "\.php$"> |
38 | SetHandler "proxy:unix:${if forcePhpSocket != null then forcePhpSocket else socket}|fcgi://localhost" | 37 | SetHandler "proxy:unix:${if forcePhpSocket != null then forcePhpSocket else socket}|fcgi://localhost" |
diff --git a/modules/private/websites/tools/tools/default.nix b/modules/private/websites/tools/tools/default.nix index 1f499fb..499ef91 100644 --- a/modules/private/websites/tools/tools/default.nix +++ b/modules/private/websites/tools/tools/default.nix | |||
@@ -2,9 +2,7 @@ | |||
2 | let | 2 | let |
3 | flakeCompat = import ../../../../../lib/flake-compat.nix; | 3 | flakeCompat = import ../../../../../lib/flake-compat.nix; |
4 | 4 | ||
5 | adminer = pkgs.callPackage ./adminer.nix { | 5 | adminer = pkgs.callPackage ./adminer.nix {}; |
6 | inherit (pkgs.webapps) adminer; | ||
7 | }; | ||
8 | ympd = pkgs.callPackage ./ympd.nix { | 6 | ympd = pkgs.callPackage ./ympd.nix { |
9 | env = config.myEnv.tools.ympd; | 7 | env = config.myEnv.tools.ympd; |
10 | }; | 8 | }; |
@@ -429,21 +427,6 @@ in { | |||
429 | ldap = ldap.activationScript; | 427 | ldap = ldap.activationScript; |
430 | }; | 428 | }; |
431 | 429 | ||
432 | services.websites.webappDirs = { | ||
433 | _adminer = adminer.webRoot; | ||
434 | "${dmarc-reports.apache.webappName}" = dmarc-reports.webRoot; | ||
435 | "${dokuwiki.apache.webappName}" = dokuwiki.webRoot; | ||
436 | "${phpbb.apache.webappName}" = phpbb.webRoot; | ||
437 | "${ldap.apache.webappName}" = "${ldap.webRoot}/htdocs"; | ||
438 | "${rompr.apache.webappName}" = rompr.webRoot; | ||
439 | "${shaarli.apache.webappName}" = shaarli.webRoot; | ||
440 | "${ttrss.apache.webappName}" = ttrss.webRoot; | ||
441 | "${wallabag.apache.webappName}" = wallabag.webRoot; | ||
442 | "${yourls.apache.webappName}" = yourls.webRoot; | ||
443 | "${kanboard.apache.webappName}" = kanboard.webRoot; | ||
444 | "${grocy.apache.webappName}" = grocy.webRoot; | ||
445 | }; | ||
446 | |||
447 | services.websites.env.tools.watchPaths = [ | 430 | services.websites.env.tools.watchPaths = [ |
448 | config.secrets.fullPaths."webapps/tools-shaarli" | 431 | config.secrets.fullPaths."webapps/tools-shaarli" |
449 | ]; | 432 | ]; |
diff --git a/modules/private/websites/tools/tools/dmarc_reports.nix b/modules/private/websites/tools/tools/dmarc_reports.nix index 89da246..8a77b13 100644 --- a/modules/private/websites/tools/tools/dmarc_reports.nix +++ b/modules/private/websites/tools/tools/dmarc_reports.nix | |||
@@ -20,8 +20,7 @@ rec { | |||
20 | user = "wwwrun"; | 20 | user = "wwwrun"; |
21 | group = "wwwrun"; | 21 | group = "wwwrun"; |
22 | modules = [ "proxy_fcgi" ]; | 22 | modules = [ "proxy_fcgi" ]; |
23 | webappName = "tools_dmarc_reports"; | 23 | root = webRoot; |
24 | root = "/run/current-system/webapps/${webappName}"; | ||
25 | vhostConf = socket: '' | 24 | vhostConf = socket: '' |
26 | Alias /dmarc-reports "${root}" | 25 | Alias /dmarc-reports "${root}" |
27 | <Directory "${root}"> | 26 | <Directory "${root}"> |
diff --git a/modules/private/websites/tools/tools/dokuwiki.nix b/modules/private/websites/tools/tools/dokuwiki.nix index 6175a68..1bcd852 100644 --- a/modules/private/websites/tools/tools/dokuwiki.nix +++ b/modules/private/websites/tools/tools/dokuwiki.nix | |||
@@ -25,8 +25,7 @@ rec { | |||
25 | user = "wwwrun"; | 25 | user = "wwwrun"; |
26 | group = "wwwrun"; | 26 | group = "wwwrun"; |
27 | modules = [ "proxy_fcgi" ]; | 27 | modules = [ "proxy_fcgi" ]; |
28 | webappName = "tools_dokuwiki"; | 28 | root = webRoot; |
29 | root = "/run/current-system/webapps/${webappName}"; | ||
30 | vhostConf = socket: '' | 29 | vhostConf = socket: '' |
31 | Alias /dokuwiki "${root}" | 30 | Alias /dokuwiki "${root}" |
32 | <Directory "${root}"> | 31 | <Directory "${root}"> |
diff --git a/modules/private/websites/tools/tools/grocy.nix b/modules/private/websites/tools/tools/grocy.nix index a98d8ac..3c33170 100644 --- a/modules/private/websites/tools/tools/grocy.nix +++ b/modules/private/websites/tools/tools/grocy.nix | |||
@@ -16,8 +16,7 @@ rec { | |||
16 | user = "wwwrun"; | 16 | user = "wwwrun"; |
17 | group = "wwwrun"; | 17 | group = "wwwrun"; |
18 | modules = [ "proxy_fcgi" ]; | 18 | modules = [ "proxy_fcgi" ]; |
19 | webappName = "tools_grocy"; | 19 | root = webRoot; |
20 | root = "/run/current-system/webapps/${webappName}"; | ||
21 | vhostConf = socket: '' | 20 | vhostConf = socket: '' |
22 | Alias /grocy "${root}" | 21 | Alias /grocy "${root}" |
23 | <Directory "${root}"> | 22 | <Directory "${root}"> |
diff --git a/modules/private/websites/tools/tools/kanboard.nix b/modules/private/websites/tools/tools/kanboard.nix index b2e7b65..54bbe01 100644 --- a/modules/private/websites/tools/tools/kanboard.nix +++ b/modules/private/websites/tools/tools/kanboard.nix | |||
@@ -46,8 +46,7 @@ rec { | |||
46 | user = "wwwrun"; | 46 | user = "wwwrun"; |
47 | group = "wwwrun"; | 47 | group = "wwwrun"; |
48 | modules = [ "proxy_fcgi" ]; | 48 | modules = [ "proxy_fcgi" ]; |
49 | webappName = "tools_kanboard"; | 49 | root = webRoot; |
50 | root = "/run/current-system/webapps/${webappName}"; | ||
51 | vhostConf = socket: '' | 50 | vhostConf = socket: '' |
52 | Alias /kanboard "${root}" | 51 | Alias /kanboard "${root}" |
53 | <Directory "${root}"> | 52 | <Directory "${root}"> |
diff --git a/modules/private/websites/tools/tools/ldap.nix b/modules/private/websites/tools/tools/ldap.nix index 14920f4..2ca59f7 100644 --- a/modules/private/websites/tools/tools/ldap.nix +++ b/modules/private/websites/tools/tools/ldap.nix | |||
@@ -36,8 +36,7 @@ rec { | |||
36 | user = "wwwrun"; | 36 | user = "wwwrun"; |
37 | group = "wwwrun"; | 37 | group = "wwwrun"; |
38 | modules = [ "proxy_fcgi" ]; | 38 | modules = [ "proxy_fcgi" ]; |
39 | webappName = "tools_ldap"; | 39 | root = "${webRoot}/htdocs"; |
40 | root = "/run/current-system/webapps/${webappName}"; | ||
41 | vhostConf = socket: '' | 40 | vhostConf = socket: '' |
42 | Alias /ldap "${root}" | 41 | Alias /ldap "${root}" |
43 | <Directory "${root}"> | 42 | <Directory "${root}"> |
diff --git a/modules/private/websites/tools/tools/phpbb.nix b/modules/private/websites/tools/tools/phpbb.nix index fa26069..e341a64 100644 --- a/modules/private/websites/tools/tools/phpbb.nix +++ b/modules/private/websites/tools/tools/phpbb.nix | |||
@@ -20,8 +20,7 @@ rec { | |||
20 | user = "wwwrun"; | 20 | user = "wwwrun"; |
21 | group = "wwwrun"; | 21 | group = "wwwrun"; |
22 | modules = [ "proxy_fcgi" ]; | 22 | modules = [ "proxy_fcgi" ]; |
23 | webappName = "tools_phpbb"; | 23 | root = webRoot; |
24 | root = "/run/current-system/webapps/${webappName}"; | ||
25 | vhostConf = socket: '' | 24 | vhostConf = socket: '' |
26 | Alias /forum "${root}" | 25 | Alias /forum "${root}" |
27 | <Directory "${root}"> | 26 | <Directory "${root}"> |
diff --git a/modules/private/websites/tools/tools/rompr.nix b/modules/private/websites/tools/tools/rompr.nix index 106164c..9765df5 100644 --- a/modules/private/websites/tools/tools/rompr.nix +++ b/modules/private/websites/tools/tools/rompr.nix | |||
@@ -13,8 +13,7 @@ rec { | |||
13 | user = "wwwrun"; | 13 | user = "wwwrun"; |
14 | group = "wwwrun"; | 14 | group = "wwwrun"; |
15 | modules = [ "headers" "mime" "proxy_fcgi" ]; | 15 | modules = [ "headers" "mime" "proxy_fcgi" ]; |
16 | webappName = "tools_rompr"; | 16 | root = webRoot; |
17 | root = "/run/current-system/webapps/${webappName}"; | ||
18 | vhostConf = socket: '' | 17 | vhostConf = socket: '' |
19 | Alias /rompr ${root} | 18 | Alias /rompr ${root} |
20 | 19 | ||
diff --git a/modules/private/websites/tools/tools/shaarli.nix b/modules/private/websites/tools/tools/shaarli.nix index b7126cc..f63c722 100644 --- a/modules/private/websites/tools/tools/shaarli.nix +++ b/modules/private/websites/tools/tools/shaarli.nix | |||
@@ -16,8 +16,7 @@ in rec { | |||
16 | user = "wwwrun"; | 16 | user = "wwwrun"; |
17 | group = "wwwrun"; | 17 | group = "wwwrun"; |
18 | modules = [ "proxy_fcgi" "rewrite" "env" ]; | 18 | modules = [ "proxy_fcgi" "rewrite" "env" ]; |
19 | webappName = "tools_shaarli"; | 19 | root = webRoot; |
20 | root = "/run/current-system/webapps/${webappName}"; | ||
21 | vhostConf = socket: '' | 20 | vhostConf = socket: '' |
22 | Alias /Shaarli "${root}" | 21 | Alias /Shaarli "${root}" |
23 | 22 | ||
diff --git a/modules/private/websites/tools/tools/ttrss.nix b/modules/private/websites/tools/tools/ttrss.nix index f6abae9..bee26c8 100644 --- a/modules/private/websites/tools/tools/ttrss.nix +++ b/modules/private/websites/tools/tools/ttrss.nix | |||
@@ -96,8 +96,7 @@ rec { | |||
96 | user = "wwwrun"; | 96 | user = "wwwrun"; |
97 | group = "wwwrun"; | 97 | group = "wwwrun"; |
98 | modules = [ "proxy_fcgi" ]; | 98 | modules = [ "proxy_fcgi" ]; |
99 | webappName = "tools_ttrss"; | 99 | root = webRoot; |
100 | root = "/run/current-system/webapps/${webappName}"; | ||
101 | vhostConf = socket: '' | 100 | vhostConf = socket: '' |
102 | Alias /ttrss "${root}" | 101 | Alias /ttrss "${root}" |
103 | <Directory "${root}"> | 102 | <Directory "${root}"> |
diff --git a/modules/private/websites/tools/tools/wallabag.nix b/modules/private/websites/tools/tools/wallabag.nix index b6ad151..ceb061f 100644 --- a/modules/private/websites/tools/tools/wallabag.nix +++ b/modules/private/websites/tools/tools/wallabag.nix | |||
@@ -80,8 +80,7 @@ rec { | |||
80 | user = "wwwrun"; | 80 | user = "wwwrun"; |
81 | group = "wwwrun"; | 81 | group = "wwwrun"; |
82 | modules = [ "proxy_fcgi" ]; | 82 | modules = [ "proxy_fcgi" ]; |
83 | webappName = "tools_wallabag"; | 83 | root = webRoot; |
84 | root = "/run/current-system/webapps/${webappName}"; | ||
85 | vhostConf = socket: '' | 84 | vhostConf = socket: '' |
86 | Alias /wallabag "${root}" | 85 | Alias /wallabag "${root}" |
87 | <Directory "${root}"> | 86 | <Directory "${root}"> |
diff --git a/modules/private/websites/tools/tools/yourls.nix b/modules/private/websites/tools/tools/yourls.nix index 01ef548..3717520 100644 --- a/modules/private/websites/tools/tools/yourls.nix +++ b/modules/private/websites/tools/tools/yourls.nix | |||
@@ -44,8 +44,7 @@ rec { | |||
44 | user = "wwwrun"; | 44 | user = "wwwrun"; |
45 | group = "wwwrun"; | 45 | group = "wwwrun"; |
46 | modules = [ "proxy_fcgi" ]; | 46 | modules = [ "proxy_fcgi" ]; |
47 | webappName = "tools_yourls"; | 47 | root = webRoot; |
48 | root = "/run/current-system/webapps/${webappName}"; | ||
49 | vhostConf = socket: '' | 48 | vhostConf = socket: '' |
50 | Alias /url "${root}" | 49 | Alias /url "${root}" |
51 | <Directory "${root}"> | 50 | <Directory "${root}"> |
diff --git a/modules/private/websites/tools/vpn/default.nix b/modules/private/websites/tools/vpn/default.nix index 4398a60..9cd499b 100644 --- a/modules/private/websites/tools/vpn/default.nix +++ b/modules/private/websites/tools/vpn/default.nix | |||
@@ -7,9 +7,7 @@ in { | |||
7 | certName = "eldiron"; | 7 | certName = "eldiron"; |
8 | addToCerts = true; | 8 | addToCerts = true; |
9 | hosts = [ "vpn.immae.eu" ]; | 9 | hosts = [ "vpn.immae.eu" ]; |
10 | root = "/run/current-system/webapps/_vpn"; | 10 | root = ./www; |
11 | }; | 11 | }; |
12 | |||
13 | services.websites.webappDirs._vpn = ./www; | ||
14 | }; | 12 | }; |
15 | } | 13 | } |
diff --git a/modules/websites/default.nix b/modules/websites/default.nix index 0a78c13..6658c66 100644 --- a/modules/websites/default.nix +++ b/modules/websites/default.nix | |||
@@ -7,22 +7,6 @@ in | |||
7 | certs = mkOption { | 7 | certs = mkOption { |
8 | description = "Default websites configuration for certificates as accepted by acme"; | 8 | description = "Default websites configuration for certificates as accepted by acme"; |
9 | }; | 9 | }; |
10 | webappDirs = mkOption { | ||
11 | description = '' | ||
12 | Defines a symlink between /run/current-system/webapps and a store | ||
13 | app directory to be used in http configuration. Permits to avoid | ||
14 | restarting httpd when only the folder name changes. | ||
15 | ''; | ||
16 | type = types.attrsOf types.path; | ||
17 | default = {}; | ||
18 | }; | ||
19 | webappDirsName = mkOption { | ||
20 | type = str; | ||
21 | default = "webapps"; | ||
22 | description = '' | ||
23 | Name of the webapp dir to create in /run/current-system | ||
24 | ''; | ||
25 | }; | ||
26 | env = mkOption { | 10 | env = mkOption { |
27 | default = {}; | 11 | default = {}; |
28 | description = "Each type of website to enable will target a distinct httpd server"; | 12 | description = "Each type of website to enable will target a distinct httpd server"; |
@@ -145,17 +129,6 @@ in | |||
145 | }; | 129 | }; |
146 | }); | 130 | }); |
147 | }; | 131 | }; |
148 | # Readonly variables | ||
149 | webappDirsPaths = mkOption { | ||
150 | type = attrsOf path; | ||
151 | readOnly = true; | ||
152 | description = '' | ||
153 | Full paths of the webapp dir | ||
154 | ''; | ||
155 | default = attrsets.mapAttrs' (name: icfg: attrsets.nameValuePair | ||
156 | name "/run/current-system/${cfg.webappDirsName}/${name}" | ||
157 | ) cfg.webappDirs; | ||
158 | }; | ||
159 | }; | 132 | }; |
160 | 133 | ||
161 | config.services.httpd = let | 134 | config.services.httpd = let |
@@ -268,14 +241,6 @@ in | |||
268 | } | 241 | } |
269 | ) groupedCerts; | 242 | ) groupedCerts; |
270 | 243 | ||
271 | config.system.extraSystemBuilderCmds = lib.mkIf (builtins.length (builtins.attrValues cfg.webappDirs) > 0) '' | ||
272 | mkdir -p $out/${cfg.webappDirsName} | ||
273 | ${builtins.concatStringsSep "\n" | ||
274 | (attrsets.mapAttrsToList | ||
275 | (name: path: "ln -s ${path} $out/${cfg.webappDirsName}/${name}") cfg.webappDirs) | ||
276 | } | ||
277 | ''; | ||
278 | |||
279 | config.systemd.services = let | 244 | config.systemd.services = let |
280 | package = httpdName: config.services.httpd.${httpdName}.package.out; | 245 | package = httpdName: config.services.httpd.${httpdName}.package.out; |
281 | cfgFile = httpdName: config.services.httpd.${httpdName}.configFile; | 246 | cfgFile = httpdName: config.services.httpd.${httpdName}.configFile; |
diff --git a/modules/websites/php-application.nix b/modules/websites/php-application.nix index 23e2b23..3a43a45 100644 --- a/modules/websites/php-application.nix +++ b/modules/websites/php-application.nix | |||
@@ -110,13 +110,6 @@ in | |||
110 | Path to application root | 110 | Path to application root |
111 | ''; | 111 | ''; |
112 | }; | 112 | }; |
113 | webappName = mkOption { | ||
114 | type = nullOr str; | ||
115 | default = null; | ||
116 | description = '' | ||
117 | Alias name for the app, to be used in services.websites.webappDirs | ||
118 | ''; | ||
119 | }; | ||
120 | webRoot = mkOption { | 113 | webRoot = mkOption { |
121 | type = nullOr path; | 114 | type = nullOr path; |
122 | description = '' | 115 | description = '' |
@@ -152,14 +145,6 @@ in | |||
152 | Full paths to listen for php | 145 | Full paths to listen for php |
153 | ''; | 146 | ''; |
154 | }; | 147 | }; |
155 | services.phpApplication.webappDirs = mkOption { | ||
156 | type = attrsOf path; | ||
157 | default = attrsets.filterAttrs (n: v: builtins.hasAttr n cfg.apps) config.services.websites.webappDirsPaths; | ||
158 | readOnly = true; | ||
159 | description = '' | ||
160 | Stable name webapp dirs for httpd | ||
161 | ''; | ||
162 | }; | ||
163 | }; | 148 | }; |
164 | 149 | ||
165 | config = { | 150 | config = { |
@@ -186,10 +171,6 @@ in | |||
186 | } | 171 | } |
187 | ) cfg.apps; | 172 | ) cfg.apps; |
188 | 173 | ||
189 | services.websites.webappDirs = attrsets.mapAttrs' (name: icfg: attrsets.nameValuePair | ||
190 | (if icfg.webappName == null then name else icfg.webappName) icfg.webRoot | ||
191 | ) (attrsets.filterAttrs (n: v: !isNull v.webRoot) cfg.apps); | ||
192 | |||
193 | services.filesWatcher = attrsets.mapAttrs' (name: icfg: attrsets.nameValuePair | 174 | services.filesWatcher = attrsets.mapAttrs' (name: icfg: attrsets.nameValuePair |
194 | "phpfpm-${name}" { | 175 | "phpfpm-${name}" { |
195 | restart = true; | 176 | restart = true; |