Skip to content

Commit

Permalink
v8.0
Browse files Browse the repository at this point in the history
+ DietPi-Software | Pi-hole: Pro-actively add API QR code X-Frame-Options header
  • Loading branch information
MichaIng committed Dec 16, 2021
1 parent e36f7b8 commit 9605674
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .conf/dps_93/apache.pihole.conf
Expand Up @@ -12,13 +12,13 @@
Header set X-Pi-hole "The Pi-hole Web interface is working!"
Header set X-Frame-Options "DENY"

# Allow teleporter iframe on settings page
<Files teleporter.php>
# Allow teleporter and API QR code iframes on settings page
<FilesMatch "^(teleporter|api_token)\.php$">
Header set X-Frame-Options "SAMEORIGIN" "expr=%{HTTP_REFERER} =~ m#/admin/settings\.php#"
</Files>

# Block . files from being served, such as .git, .github, .gitignore
<Files ~ "^\.">
<FilesMatch "^\.">
Require all denied
</Files>

Expand Down
4 changes: 2 additions & 2 deletions .conf/dps_93/lighttpd.pihole.conf
Expand Up @@ -8,8 +8,8 @@ $HTTP["url"] =~ "^(/html)?/admin/" {
"X-Frame-Options" => "DENY"
)

# Allow teleporter iframe on settings page
$HTTP["url"] =~ "/teleporter\.php$" {
# Allow teleporter and API QR code iframes on settings page
$HTTP["url"] =~ "/(teleporter|api_token)\.php$" {
$HTTP["referer"] =~ "/admin/settings\.php" {
setenv.add-response-header = ( "X-Frame-Options" => "SAMEORIGIN" )
}
Expand Down
4 changes: 2 additions & 2 deletions .conf/dps_93/nginx.pihole.conf
@@ -1,7 +1,7 @@
# Based on: https://github.com/pi-hole/pi-hole/blob/master/advanced/lighttpd.conf.debian

# Allow teleporter iframe on settings page
location ~ ^(?:/html|)/admin/scripts/pi-hole/php/teleporter\.php$ {
# Allow teleporter and API QR code iframes on settings page
location ~ ^(?:/html|)/admin/scripts/pi-hole/php/(?:teleporter|api_token)\.php$ {
# PHP handler block
fastcgi_pass php;
include snippets/fastcgi-php.conf;
Expand Down

0 comments on commit 9605674

Please sign in to comment.