From 8f904d0d982684e8e66dfc5d9123712eb96bf16e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sun, 12 May 2019 17:57:20 +0200 Subject: Refactor a bit httpd/webapps configuration: - alias private to pkgs - move default apache vhost to pkgs --- pkgs/default.nix | 2 +- pkgs/private/webapps/apache-default/default.nix | 21 ++++++++ .../apache-default/www/googleb6d69446ff4ca3e5.html | 1 + pkgs/private/webapps/apache-default/www/index.htm | 9 ++++ .../apache-default/www/maintenance_immae.html | 58 ++++++++++++++++++++++ pkgs/private/webapps/apache-default/www/nossl.html | 11 ++++ pkgs/private/webapps/default.nix | 2 + pkgs/webapps/apache-theme/default.nix | 8 +-- pkgs/webapps/default.nix | 4 +- 9 files changed, 110 insertions(+), 6 deletions(-) create mode 100644 pkgs/private/webapps/apache-default/default.nix create mode 100644 pkgs/private/webapps/apache-default/www/googleb6d69446ff4ca3e5.html create mode 100644 pkgs/private/webapps/apache-default/www/index.htm create mode 100644 pkgs/private/webapps/apache-default/www/maintenance_immae.html create mode 100644 pkgs/private/webapps/apache-default/www/nossl.html (limited to 'pkgs') 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 { bitlbee-mastodon = callPackage ./bitlbee-mastodon {}; composerEnv = callPackage ./composer-env {}; - webapps = callPackage ./webapps { inherit mylibs composerEnv; }; + webapps = callPackage ./webapps { inherit mylibs composerEnv private; }; private = if builtins.pathExists (./. + "/private") 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 @@ +{ www_root ? null }: +rec { + www = ./www; + apacheConfig = let + www_root' = if isNull www_root then www else www_root; + in '' + ErrorDocument 500 /maintenance_immae.html + ErrorDocument 501 /maintenance_immae.html + ErrorDocument 502 /maintenance_immae.html + ErrorDocument 503 /maintenance_immae.html + ErrorDocument 504 /maintenance_immae.html + Alias /maintenance_immae.html ${www_root'}/maintenance_immae.html + ProxyPass /maintenance_immae.html ! + + AliasMatch "(.*)/googleb6d69446ff4ca3e5.html" ${www_root'}/googleb6d69446ff4ca3e5.html + + AllowOverride None + Require all granted + + ''; +} 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 @@ + + + + Hello World HTML + + +

It works!

+ + 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 @@ + + + + Maintenance + + + + + +
+

Erreur serveur ou maintenance en cours !

+
+

Une mise à jour ou une opération de maintenance est en cours sur le site. Retentez dans quelques instants ou patientez, la page se rechargera automatiquement.

+
+
+ +
+

Server error or website in maintenance!

+
+

An update or a maintenance is on track on the website. Please try again in a few seconds or wait, the page will reload automatically.

+
+
+ + 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 @@ + + + + No SSL site + + +

No SSL on this site

+

Use for wifi networks with login page that doesn't work well with + https.

+ + 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 @@ { callPackage, mylibs, composerEnv, lib, spip }: rec { + apache-default = callPackage ./apache-default {}; + aten = callPackage ./aten { inherit composerEnv mylibs; }; chloe = callPackage ./chloe { inherit mylibs spip; }; 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 @@ { theme_root ? null }: rec { theme = ./theme; - apacheConfig = '' + apacheConfig = let + theme_root' = if isNull theme_root then theme else theme_root; + in '' - Alias /theme ${if isNull theme_root then theme else theme_root} - + Alias /theme ${theme_root'} + Options -Indexes AllowOverride None 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 @@ -{ callPackage, mylibs, composerEnv, lib }: +{ callPackage, mylibs, composerEnv, lib, private }: rec { adminer = callPackage ./adminer {}; apache-theme = callPackage ./apache-theme {}; @@ -111,4 +111,4 @@ rec { in lib.attrsets.genAttrs names (name: callPackage (./yourls/plugins + "/${name}") { inherit mylibs; }); -} +} // private.webapps -- cgit v1.2.3