From 69b2a5a876f995a3f2d4b23fbba44bcded0a161d Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Wed, 17 Oct 2018 06:23:34 -0400 Subject: [PATCH 1/2] lighttpd: use file glob for optional external.conf lighttpd 1.4.50 config parse will error if include_shell exits non-zero and pi-hole sample config: include_shell "cat external.conf 2>/dev/null" is an error if external.conf does not exist Replace with: include "external*.conf" file glob supported since lighttpd 1.4.40 and is not an error if there is no file which matches the file glob Signed-off-by: Glenn Strauss --- advanced/lighttpd.conf.debian | 3 ++- advanced/lighttpd.conf.fedora | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/advanced/lighttpd.conf.debian b/advanced/lighttpd.conf.debian index b5bece72..50eebce7 100644 --- a/advanced/lighttpd.conf.debian +++ b/advanced/lighttpd.conf.debian @@ -72,4 +72,5 @@ $HTTP["url"] =~ "^/admin/\.(.*)" { } # Add user chosen options held in external file -include_shell "cat external.conf 2>/dev/null" +# (use file glob for optional file) +include "external*.conf" diff --git a/advanced/lighttpd.conf.fedora b/advanced/lighttpd.conf.fedora index 43d94d84..605bfb58 100644 --- a/advanced/lighttpd.conf.fedora +++ b/advanced/lighttpd.conf.fedora @@ -90,4 +90,5 @@ $HTTP["url"] =~ "^/admin/\.(.*)" { } # Add user chosen options held in external file -include_shell "cat external.conf 2>/dev/null" +# (use file glob for optional file) +include "external*.conf" From 67bdcbcf19b0ccce34cdfff405861cc428fa8f59 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Wed, 17 Oct 2018 06:42:54 -0400 Subject: [PATCH 2/2] lighttpd: slightly more efficient sample config Signed-off-by: Glenn Strauss --- advanced/lighttpd.conf.debian | 8 ++++---- advanced/lighttpd.conf.fedora | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/advanced/lighttpd.conf.debian b/advanced/lighttpd.conf.debian index 50eebce7..8b04be71 100644 --- a/advanced/lighttpd.conf.debian +++ b/advanced/lighttpd.conf.debian @@ -64,11 +64,11 @@ $HTTP["url"] =~ "^/admin/" { # Allow Block Page access to local fonts setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" ) } -} -# Block . files from being served, such as .git, .github, .gitignore -$HTTP["url"] =~ "^/admin/\.(.*)" { - url.access-deny = ("") + # Block . files from being served, such as .git, .github, .gitignore + $HTTP["url"] =~ "^/admin/\." { + url.access-deny = ("") + } } # Add user chosen options held in external file diff --git a/advanced/lighttpd.conf.fedora b/advanced/lighttpd.conf.fedora index 605bfb58..4a782060 100644 --- a/advanced/lighttpd.conf.fedora +++ b/advanced/lighttpd.conf.fedora @@ -82,11 +82,11 @@ $HTTP["url"] =~ "^/admin/" { # Allow Block Page access to local fonts setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" ) } -} -# Block . files from being served, such as .git, .github, .gitignore -$HTTP["url"] =~ "^/admin/\.(.*)" { - url.access-deny = ("") + # Block . files from being served, such as .git, .github, .gitignore + $HTTP["url"] =~ "^/admin/\." { + url.access-deny = ("") + } } # Add user chosen options held in external file