diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-12 17:57:20 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-12 17:58:22 +0200 |
commit | 8f904d0d982684e8e66dfc5d9123712eb96bf16e (patch) | |
tree | 4574838fb67902680f41754d73af8f5d33ce35f6 /pkgs/private | |
parent | 9129f327844ca58af61a20582b04e35762c63e35 (diff) | |
download | Nix-8f904d0d982684e8e66dfc5d9123712eb96bf16e.tar.gz Nix-8f904d0d982684e8e66dfc5d9123712eb96bf16e.tar.zst Nix-8f904d0d982684e8e66dfc5d9123712eb96bf16e.zip |
Refactor a bit httpd/webapps configuration:
- alias private to pkgs
- move default apache vhost to pkgs
Diffstat (limited to 'pkgs/private')
6 files changed, 102 insertions, 0 deletions
diff --git a/pkgs/private/webapps/apache-default/default.nix b/pkgs/private/webapps/apache-default/default.nix new file mode 100644 index 0000000..92f558e --- /dev/null +++ b/pkgs/private/webapps/apache-default/default.nix | |||
@@ -0,0 +1,21 @@ | |||
1 | { www_root ? null }: | ||
2 | rec { | ||
3 | www = ./www; | ||
4 | apacheConfig = let | ||
5 | www_root' = if isNull www_root then www else www_root; | ||
6 | in '' | ||
7 | ErrorDocument 500 /maintenance_immae.html | ||
8 | ErrorDocument 501 /maintenance_immae.html | ||
9 | ErrorDocument 502 /maintenance_immae.html | ||
10 | ErrorDocument 503 /maintenance_immae.html | ||
11 | ErrorDocument 504 /maintenance_immae.html | ||
12 | Alias /maintenance_immae.html ${www_root'}/maintenance_immae.html | ||
13 | ProxyPass /maintenance_immae.html ! | ||
14 | |||
15 | AliasMatch "(.*)/googleb6d69446ff4ca3e5.html" ${www_root'}/googleb6d69446ff4ca3e5.html | ||
16 | <Directory ${www_root'}> | ||
17 | AllowOverride None | ||
18 | Require all granted | ||
19 | </Directory> | ||
20 | ''; | ||
21 | } | ||
diff --git a/pkgs/private/webapps/apache-default/www/googleb6d69446ff4ca3e5.html b/pkgs/private/webapps/apache-default/www/googleb6d69446ff4ca3e5.html new file mode 100644 index 0000000..ff6dbf3 --- /dev/null +++ b/pkgs/private/webapps/apache-default/www/googleb6d69446ff4ca3e5.html | |||
@@ -0,0 +1 @@ | |||
google-site-verification: googleb6d69446ff4ca3e5.html \ No newline at end of file | |||
diff --git a/pkgs/private/webapps/apache-default/www/index.htm b/pkgs/private/webapps/apache-default/www/index.htm new file mode 100644 index 0000000..0274251 --- /dev/null +++ b/pkgs/private/webapps/apache-default/www/index.htm | |||
@@ -0,0 +1,9 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <html> | ||
3 | <head> | ||
4 | <title>Hello World HTML</title> | ||
5 | </head> | ||
6 | <body> | ||
7 | <h1>It works!</h1> | ||
8 | </body> | ||
9 | </html> | ||
diff --git a/pkgs/private/webapps/apache-default/www/maintenance_immae.html b/pkgs/private/webapps/apache-default/www/maintenance_immae.html new file mode 100644 index 0000000..90f265f --- /dev/null +++ b/pkgs/private/webapps/apache-default/www/maintenance_immae.html | |||
@@ -0,0 +1,58 @@ | |||
1 | <!doctype html> | ||
2 | <html> | ||
3 | <head> | ||
4 | <title>Maintenance</title> | ||
5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
6 | <style> | ||
7 | body { | ||
8 | padding-left: 5px; | ||
9 | padding-right: 5px; | ||
10 | text-align: center; | ||
11 | margin: auto; | ||
12 | font: 20px Helvetica, sans-serif; | ||
13 | color: #333; | ||
14 | } | ||
15 | h1 { | ||
16 | margin: 0px; | ||
17 | font-size: 40px; | ||
18 | } | ||
19 | article { | ||
20 | display: block; | ||
21 | max-width: 650px; | ||
22 | margin: 0 auto; | ||
23 | padding-top: 30px; | ||
24 | } | ||
25 | article + article { | ||
26 | border-top: 1px solid lightgrey; | ||
27 | } | ||
28 | article div { | ||
29 | text-align: justify; | ||
30 | } | ||
31 | a { | ||
32 | color: #dc8100; | ||
33 | text-decoration: none; | ||
34 | } | ||
35 | a:hover { | ||
36 | color: #333; | ||
37 | } | ||
38 | </style> | ||
39 | <script type="text/javascript"> | ||
40 | setTimeout(function () { location.reload(true); }, 5000); | ||
41 | </script> | ||
42 | </head> | ||
43 | <body> | ||
44 | <article> | ||
45 | <h1>Erreur serveur ou maintenance en cours !</h1> | ||
46 | <div> | ||
47 | <p>Une mise à jour ou une opération de maintenance est en cours sur le site. <a href="">Retentez</a> dans quelques instants ou patientez, la page se rechargera automatiquement.</p> | ||
48 | </div> | ||
49 | </article> | ||
50 | |||
51 | <article> | ||
52 | <h1>Server error or website in maintenance!</h1> | ||
53 | <div> | ||
54 | <p>An update or a maintenance is on track on the website. Please try <a href="">again</a> in a few seconds or wait, the page will reload automatically.</p> | ||
55 | </div> | ||
56 | </article> | ||
57 | </body> | ||
58 | </html> | ||
diff --git a/pkgs/private/webapps/apache-default/www/nossl.html b/pkgs/private/webapps/apache-default/www/nossl.html new file mode 100644 index 0000000..4401a80 --- /dev/null +++ b/pkgs/private/webapps/apache-default/www/nossl.html | |||
@@ -0,0 +1,11 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <html> | ||
3 | <head> | ||
4 | <title>No SSL site</title> | ||
5 | </head> | ||
6 | <body> | ||
7 | <h1>No SSL on this site</h1> | ||
8 | <p>Use for wifi networks with login page that doesn't work well with | ||
9 | https.</p> | ||
10 | </body> | ||
11 | </html> | ||
diff --git a/pkgs/private/webapps/default.nix b/pkgs/private/webapps/default.nix index 14fd544..e9aa13c 100644 --- a/pkgs/private/webapps/default.nix +++ b/pkgs/private/webapps/default.nix | |||
@@ -1,5 +1,7 @@ | |||
1 | { callPackage, mylibs, composerEnv, lib, spip }: | 1 | { callPackage, mylibs, composerEnv, lib, spip }: |
2 | rec { | 2 | rec { |
3 | apache-default = callPackage ./apache-default {}; | ||
4 | |||
3 | aten = callPackage ./aten { inherit composerEnv mylibs; }; | 5 | aten = callPackage ./aten { inherit composerEnv mylibs; }; |
4 | chloe = callPackage ./chloe { inherit mylibs spip; }; | 6 | chloe = callPackage ./chloe { inherit mylibs spip; }; |
5 | connexionswing = callPackage ./connexionswing { inherit composerEnv mylibs;}; | 7 | connexionswing = callPackage ./connexionswing { inherit composerEnv mylibs;}; |