aboutsummaryrefslogtreecommitdiff
path: root/nixops/modules/websites/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixops/modules/websites/default.nix')
-rw-r--r--nixops/modules/websites/default.nix122
1 files changed, 108 insertions, 14 deletions
diff --git a/nixops/modules/websites/default.nix b/nixops/modules/websites/default.nix
index 4c9c7fe..8c4380c 100644
--- a/nixops/modules/websites/default.nix
+++ b/nixops/modules/websites/default.nix
@@ -98,6 +98,8 @@ in
98 ./ftp/florian.nix 98 ./ftp/florian.nix
99 ./ftp/denisejerome.nix 99 ./ftp/denisejerome.nix
100 ./ftp/immae.nix 100 ./ftp/immae.nix
101 ./ftp/release.nix
102 ./ftp/temp.nix
101 ./tools/db 103 ./tools/db
102 ./tools/tools 104 ./tools/tools
103 ./tools/dav 105 ./tools/dav
@@ -201,6 +203,8 @@ in
201 services.myWebsites.Emilia.production.enable = cfg.production.enable; 203 services.myWebsites.Emilia.production.enable = cfg.production.enable;
202 services.myWebsites.Capitaines.production.enable = cfg.production.enable; 204 services.myWebsites.Capitaines.production.enable = cfg.production.enable;
203 services.myWebsites.Immae.production.enable = cfg.production.enable; 205 services.myWebsites.Immae.production.enable = cfg.production.enable;
206 services.myWebsites.Release.production.enable = cfg.production.enable;
207 services.myWebsites.Temp.production.enable = cfg.production.enable;
204 208
205 services.myWebsites.Chloe.integration.enable = cfg.integration.enable; 209 services.myWebsites.Chloe.integration.enable = cfg.integration.enable;
206 services.myWebsites.Ludivine.integration.enable = cfg.integration.enable; 210 services.myWebsites.Ludivine.integration.enable = cfg.integration.enable;
@@ -220,6 +224,22 @@ in
220 macros = { 224 macros = {
221 modules = [ "macro" ]; 225 modules = [ "macro" ];
222 }; 226 };
227 stats = {
228 extraConfig = ''
229 <Macro Stats %{domain}>
230 Alias /awstats /var/lib/goaccess/%{domain}
231 <Directory /var/lib/goaccess/%{domain}>
232 DirectoryIndex index.html
233 AllowOverride None
234 Require all granted
235 </Directory>
236 <Location /awstats>
237 Use LDAPConnect
238 Require ldap-group cn=%{domain},ou=stats,cn=httpd,ou=services,dc=immae,dc=eu
239 </Location>
240 </Macro>
241 '';
242 };
223 ldap = { 243 ldap = {
224 modules = [ "ldap" "authnz_ldap" ]; 244 modules = [ "ldap" "authnz_ldap" ];
225 extraConfig = '' 245 extraConfig = ''
@@ -241,20 +261,10 @@ in
241 AuthBasicProvider ldap 261 AuthBasicProvider ldap
242 </IfModule> 262 </IfModule>
243 </Macro> 263 </Macro>
244 264 '';
245 <Macro Stats %{domain}> 265 };
246 Alias /awstats /var/lib/goaccess/%{domain} 266 global = {
247 <Directory /var/lib/goaccess/%{domain}> 267 extraConfig = ''
248 DirectoryIndex index.html
249 AllowOverride None
250 Require all granted
251 </Directory>
252 <Location /awstats>
253 Use LDAPConnect
254 Require ldap-group cn=%{domain},ou=stats,cn=httpd,ou=services,dc=immae,dc=eu
255 </Location>
256 </Macro>
257
258 ErrorDocument 500 /maintenance_immae.html 268 ErrorDocument 500 /maintenance_immae.html
259 ErrorDocument 501 /maintenance_immae.html 269 ErrorDocument 501 /maintenance_immae.html
260 ErrorDocument 502 /maintenance_immae.html 270 ErrorDocument 502 /maintenance_immae.html
@@ -266,6 +276,90 @@ in
266 AliasMatch "(.*)/googleb6d69446ff4ca3e5.html" ${../../www}/googleb6d69446ff4ca3e5.html 276 AliasMatch "(.*)/googleb6d69446ff4ca3e5.html" ${../../www}/googleb6d69446ff4ca3e5.html
267 ''; 277 '';
268 }; 278 };
279 apaxy = {
280 extraConfig = ''
281 <Macro Apaxy %{folder} %{ignored}>
282 Alias /theme ${./apache/theme}
283 <Directory ${./apache/theme}>
284 Options -Indexes
285 AllowOverride None
286 Require all granted
287 </Directory>
288
289 # mod_autoindex
290 <Directory %{folder}>
291 Options Indexes
292 AllowOverride None
293 Require all granted
294
295 # Inspired from Apaxy by @adamwhitcroft
296
297 IndexOptions +Charset=UTF-8 +FancyIndexing +IgnoreCase +FoldersFirst +XHTML +HTMLTable +SuppressRules +SuppressDescription +NameWidth=* +IconsAreLinks +ShowForbidden
298
299 IndexHeadInsert "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />"
300
301 IndexIgnoreReset ON
302 IndexIgnore /theme .htaccess %{ignored}
303
304 AddIcon /theme/icons/blank.png ^^BLANKICON^^
305 AddIcon /theme/icons/folder.png ^^DIRECTORY^^
306 AddIcon /theme/icons/folder-home.png ..
307
308 AddIconByType (TXT,/theme/icons/text.png) text/*
309 AddIconByType (IMG,/theme/icons/image.png) image/*
310 AddIconByType (SND,/theme/icons/audio.png) audio/*
311 AddIconByType (VID,/theme/icons/video.png) video/*
312
313 AddIcon /theme/icons/archive.png .7z .bz2 .cab .gz .tar
314 AddIcon /theme/icons/audio.png .aac .aif .aifc .aiff .ape .au .flac .iff .m4a .mid .mp3 .mpa .ra .wav .wma .f4a .f4b .oga .ogg .xm .it .s3m .mod
315 AddIcon /theme/icons/bin.png .bin .hex
316 AddIcon /theme/icons/bmp.png .bmp
317 AddIcon /theme/icons/c.png .c
318 AddIcon /theme/icons/calc.png .xlsx .xlsm .xltx .xltm .xlam .xlr .xls .csv
319 AddIcon /theme/icons/cd.png .iso
320 AddIcon /theme/icons/cpp.png .cpp
321 AddIcon /theme/icons/css.png .css .sass .scss
322 AddIcon /theme/icons/deb.png .deb
323 AddIcon /theme/icons/doc.png .doc .docx .docm .dot .dotx .dotm .log .msg .odt .pages .rtf .tex .wpd .wps
324 AddIcon /theme/icons/draw.png .svg .svgz
325 AddIcon /theme/icons/eps.png .ai .eps
326 AddIcon /theme/icons/exe.png .exe
327 AddIcon /theme/icons/gif.png .gif
328 AddIcon /theme/icons/h.png .h
329 AddIcon /theme/icons/html.png .html .xhtml .shtml .htm .URL .url
330 AddIcon /theme/icons/ico.png .ico
331 AddIcon /theme/icons/java.png .jar
332 AddIcon /theme/icons/jpg.png .jpg .jpeg .jpe
333 AddIcon /theme/icons/js.png .js .json
334 AddIcon /theme/icons/markdown.png .md
335 AddIcon /theme/icons/package.png .pkg .dmg
336 AddIcon /theme/icons/pdf.png .pdf
337 AddIcon /theme/icons/php.png .php .phtml
338 AddIcon /theme/icons/playlist.png .m3u .m3u8 .pls .pls8
339 AddIcon /theme/icons/png.png .png
340 AddIcon /theme/icons/ps.png .ps
341 AddIcon /theme/icons/psd.png .psd
342 AddIcon /theme/icons/py.png .py
343 AddIcon /theme/icons/rar.png .rar
344 AddIcon /theme/icons/rb.png .rb
345 AddIcon /theme/icons/rpm.png .rpm
346 AddIcon /theme/icons/rss.png .rss
347 AddIcon /theme/icons/script.png .bat .cmd .sh
348 AddIcon /theme/icons/sql.png .sql
349 AddIcon /theme/icons/tiff.png .tiff .tif
350 AddIcon /theme/icons/text.png .txt .nfo
351 AddIcon /theme/icons/video.png .asf .asx .avi .flv .mkv .mov .mp4 .mpg .rm .srt .swf .vob .wmv .m4v .f4v .f4p .ogv
352 AddIcon /theme/icons/xml.png .xml
353 AddIcon /theme/icons/zip.png .zip
354 DefaultIcon /theme/icons/default.png
355
356 HeaderName /theme/header.html
357 ReadmeName /theme/footer.html
358 IndexStyleSheet /theme/style.css
359 </Directory>
360 </Macro>
361 '';
362 };
269 http2 = { 363 http2 = {
270 modules = [ "http2" ]; 364 modules = [ "http2" ];
271 extraConfig = '' 365 extraConfig = ''