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 | |
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')
-rw-r--r-- | pkgs/default.nix | 2 | ||||
-rw-r--r-- | pkgs/private/webapps/apache-default/default.nix | 21 | ||||
-rw-r--r-- | pkgs/private/webapps/apache-default/www/googleb6d69446ff4ca3e5.html | 1 | ||||
-rw-r--r-- | pkgs/private/webapps/apache-default/www/index.htm | 9 | ||||
-rw-r--r-- | pkgs/private/webapps/apache-default/www/maintenance_immae.html | 58 | ||||
-rw-r--r-- | pkgs/private/webapps/apache-default/www/nossl.html | 11 | ||||
-rw-r--r-- | pkgs/private/webapps/default.nix | 2 | ||||
-rw-r--r-- | pkgs/webapps/apache-theme/default.nix | 8 | ||||
-rw-r--r-- | pkgs/webapps/default.nix | 4 |
9 files changed, 110 insertions, 6 deletions
diff --git a/pkgs/default.nix b/pkgs/default.nix index 26b32e1..8ea65a5 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix | |||
@@ -38,7 +38,7 @@ rec { | |||
38 | bitlbee-mastodon = callPackage ./bitlbee-mastodon {}; | 38 | bitlbee-mastodon = callPackage ./bitlbee-mastodon {}; |
39 | 39 | ||
40 | composerEnv = callPackage ./composer-env {}; | 40 | composerEnv = callPackage ./composer-env {}; |
41 | webapps = callPackage ./webapps { inherit mylibs composerEnv; }; | 41 | webapps = callPackage ./webapps { inherit mylibs composerEnv private; }; |
42 | 42 | ||
43 | private = if builtins.pathExists (./. + "/private") | 43 | private = if builtins.pathExists (./. + "/private") |
44 | then import ./private { inherit pkgs; } | 44 | then import ./private { inherit pkgs; } |
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;}; |
diff --git a/pkgs/webapps/apache-theme/default.nix b/pkgs/webapps/apache-theme/default.nix index b679afe..4b5755a 100644 --- a/pkgs/webapps/apache-theme/default.nix +++ b/pkgs/webapps/apache-theme/default.nix | |||
@@ -1,10 +1,12 @@ | |||
1 | { theme_root ? null }: | 1 | { theme_root ? null }: |
2 | rec { | 2 | rec { |
3 | theme = ./theme; | 3 | theme = ./theme; |
4 | apacheConfig = '' | 4 | apacheConfig = let |
5 | theme_root' = if isNull theme_root then theme else theme_root; | ||
6 | in '' | ||
5 | <Macro Apaxy %{folder} %{ignored}> | 7 | <Macro Apaxy %{folder} %{ignored}> |
6 | Alias /theme ${if isNull theme_root then theme else theme_root} | 8 | Alias /theme ${theme_root'} |
7 | <Directory ${if isNull theme_root then theme else theme_root}> | 9 | <Directory ${theme_root'}> |
8 | Options -Indexes | 10 | Options -Indexes |
9 | AllowOverride None | 11 | AllowOverride None |
10 | Require all granted | 12 | Require all granted |
diff --git a/pkgs/webapps/default.nix b/pkgs/webapps/default.nix index 8151b8d..8c3eb0e 100644 --- a/pkgs/webapps/default.nix +++ b/pkgs/webapps/default.nix | |||
@@ -1,4 +1,4 @@ | |||
1 | { callPackage, mylibs, composerEnv, lib }: | 1 | { callPackage, mylibs, composerEnv, lib, private }: |
2 | rec { | 2 | rec { |
3 | adminer = callPackage ./adminer {}; | 3 | adminer = callPackage ./adminer {}; |
4 | apache-theme = callPackage ./apache-theme {}; | 4 | apache-theme = callPackage ./apache-theme {}; |
@@ -111,4 +111,4 @@ rec { | |||
111 | in | 111 | in |
112 | lib.attrsets.genAttrs names | 112 | lib.attrsets.genAttrs names |
113 | (name: callPackage (./yourls/plugins + "/${name}") { inherit mylibs; }); | 113 | (name: callPackage (./yourls/plugins + "/${name}") { inherit mylibs; }); |
114 | } | 114 | } // private.webapps |