Can you embed the Pi-hole Web-UI into an iframe?

Where can I set "X-Frame-Options" => "ALLOW" ??

as /etc/lighttpd/lighttpd.conf does not have "X-Frame-Options" => "DENY"

This seems to work->
Changed:
setenv.add-response-header = ( "X-Frame-Options" => "ALLOW")

in

/etc/lighttpd/conf-enabled/15-pihole-admin.conf

Note the disclaimer on top of that file, which actually is a link to:
/etc/lighttpd/conf-available/15-pihole-admin.conf

# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
(...)
###############################################################################
#     FILE AUTOMATICALLY OVERWRITTEN BY PI-HOLE INSTALL/UPDATE PROCEDURE.     #
# ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE #
###############################################################################

As mentioned in Pi-hole FTL v5.20.1, Web v5.18.1 and Core v5.15 released, custom configurations should go to /etc/lighttpd/conf-available/whatevername.conf, from where it should be linked to /etc/lighttpd/conf-enabled/whatevername.conf.

So I should just put
setenv.add-response-header = ( "X-Frame-Options" => "ALLOW")
into
/etc/lighttpd/conf-available/whatevername.conf

but then what do I put in /etc/lighttpd/conf-enabled/whatevername.conf to link it?

Thanks, as I didn't see that disclaimer...

You don't put anything into /etc/lighttpd/conf-enabled/whatevername.conf or even create that file. You create a symlink to ../conf-available/whatevername.conf IN /etc/lighttpd/conf-enabled and then restart lighttpd. The link is the way of activating various config fragments, as needed.

How do you do this with Docker?

Edit, found this:

FYI, you can add this to your external.conf to overwrite the default setting:

    $HTTP["url"] =~ "^/admin/" {
          # Allow framing  (for my home-assistant)
          setenv.set-response-header += (
             "X-Frame-Options" => "Allow"
          )
    }

Add that to external.conf and mount it on start:

volumes:
- ./external.conf:/etc/lighttpd/conf-enabled/20-pihole-external.conf

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.