aboutsummaryrefslogtreecommitdiff
path: root/modules/private/websites/tools/tools/default.nix
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2020-04-25 03:01:39 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2020-04-25 03:01:39 +0200
commit251c0a135a4153453030dc0e2c132e57934c0095 (patch)
treee7ab615568cdfe2526b508e483b2a6c6cad4350e /modules/private/websites/tools/tools/default.nix
parentc54f73c385dcdb7458759b36b62fa0e6895a30d7 (diff)
downloadNix-251c0a135a4153453030dc0e2c132e57934c0095.tar.gz
Nix-251c0a135a4153453030dc0e2c132e57934c0095.tar.zst
Nix-251c0a135a4153453030dc0e2c132e57934c0095.zip
Migrate manual scripts from tools.immae.eu
Landing page BIP39 ldap/myip scripts webhooks
Diffstat (limited to 'modules/private/websites/tools/tools/default.nix')
-rw-r--r--modules/private/websites/tools/tools/default.nix51
1 files changed, 46 insertions, 5 deletions
diff --git a/modules/private/websites/tools/tools/default.nix b/modules/private/websites/tools/tools/default.nix
index 2fe4775..dbd65e6 100644
--- a/modules/private/websites/tools/tools/default.nix
+++ b/modules/private/websites/tools/tools/default.nix
@@ -38,6 +38,11 @@ let
38 grocy = pkgs.callPackage ./grocy.nix { 38 grocy = pkgs.callPackage ./grocy.nix {
39 inherit (pkgs.webapps) grocy; 39 inherit (pkgs.webapps) grocy;
40 }; 40 };
41 webhooks = pkgs.callPackage ./webhooks.nix {
42 env = config.myEnv.tools.webhooks;
43 };
44
45 landing = pkgs.callPackage ./landing.nix {};
41 46
42 cfg = config.myServices.websites.tools.tools; 47 cfg = config.myServices.websites.tools.tools;
43 pcfg = config.services.phpfpm.pools; 48 pcfg = config.services.phpfpm.pools;
@@ -53,7 +58,8 @@ in {
53 ++ shaarli.keys 58 ++ shaarli.keys
54 ++ ttrss.keys 59 ++ ttrss.keys
55 ++ wallabag.keys 60 ++ wallabag.keys
56 ++ yourls.keys; 61 ++ yourls.keys
62 ++ webhooks.keys;
57 63
58 services.duplyBackup.profiles = { 64 services.duplyBackup.profiles = {
59 dokuwiki = dokuwiki.backups; 65 dokuwiki = dokuwiki.backups;
@@ -111,9 +117,16 @@ in {
111 RedirectMatch 301 ^/roundcube(.*)$ https://mail.immae.eu/roundcube$1 117 RedirectMatch 301 ^/roundcube(.*)$ https://mail.immae.eu/roundcube$1
112 RedirectMatch 301 ^/jappix(.*)$ https://im.immae.fr/converse 118 RedirectMatch 301 ^/jappix(.*)$ https://im.immae.fr/converse
113 119
114 RewriteEngine On 120 Alias /landing ${landing}
115 RewriteCond %{DOCUMENT_ROOT}/homer%{REQUEST_URI} -f 121 <Directory "${landing}">
116 RewriteRule ^(.*)$ /homer$1 [QSA,L] 122 DirectoryIndex index.html
123 AllowOverride None
124 Require all granted
125
126 <FilesMatch "\.php$">
127 SetHandler "proxy:unix:${pcfg.tools.socket}|fcgi://localhost"
128 </FilesMatch>
129 </Directory>
117 130
118 <Directory "/var/lib/ftp/tools.immae.eu"> 131 <Directory "/var/lib/ftp/tools.immae.eu">
119 DirectoryIndex index.php index.htm index.html 132 DirectoryIndex index.php index.htm index.html
@@ -122,6 +135,11 @@ in {
122 <FilesMatch "\.php$"> 135 <FilesMatch "\.php$">
123 SetHandler "proxy:unix:${pcfg.tools.socket}|fcgi://localhost" 136 SetHandler "proxy:unix:${pcfg.tools.socket}|fcgi://localhost"
124 </FilesMatch> 137 </FilesMatch>
138
139 RewriteEngine On
140 RewriteCond ${landing}%{REQUEST_URI} -f
141 RewriteRule ^(.*)$ /landing/$1 [L]
142 RewriteRule ^$ /landing/ [L]
125 </Directory> 143 </Directory>
126 '' 144 ''
127 (adminer.apache.vhostConf pcfg.adminer.socket) 145 (adminer.apache.vhostConf pcfg.adminer.socket)
@@ -143,6 +161,23 @@ in {
143 Require all granted 161 Require all granted
144 Options -Indexes 162 Options -Indexes
145 </Directory> 163 </Directory>
164
165 Alias /BIP39 /var/lib/buildbot/outputs/bip39
166 <Directory "/var/lib/buildbot/outputs/bip39">
167 DirectoryIndex index.html
168 AllowOverride None
169 Require all granted
170 </Directory>
171
172 Alias /webhooks ${config.secrets.location}/webapps/webhooks
173 <Directory "${config.secrets.location}/webapps/webhooks">
174 Options -Indexes
175 Require all granted
176 AllowOverride None
177 <FilesMatch "\.php$">
178 SetHandler "proxy:unix:${pcfg.tools.socket}|fcgi://localhost"
179 </FilesMatch>
180 </Directory>
146 '' 181 ''
147 ]; 182 ];
148 }; 183 };
@@ -253,7 +288,13 @@ in {
253 288
254 # Needed to avoid clashes in browser cookies (same domain) 289 # Needed to avoid clashes in browser cookies (same domain)
255 "php_value[session.name]" = "ToolsPHPSESSID"; 290 "php_value[session.name]" = "ToolsPHPSESSID";
256 "php_admin_value[open_basedir]" = "/run/wrappers/bin/sendmail:/var/lib/ftp/tools.immae.eu:/tmp"; 291 "php_admin_value[open_basedir]" = builtins.concatStringsSep ":" [
292 "/run/wrappers/bin/sendmail" "/var/lib/ftp/tools.immae.eu"
293 landing "/tmp" "${config.secrets.location}/webapps/webhooks"
294 ];
295 };
296 phpEnv = {
297 CONTACT_EMAIL = config.myEnv.tools.contact;
257 }; 298 };
258 }; 299 };
259 devtools = { 300 devtools = {