uptime-kuma
uptime-kuma copied to clipboard
iFrame integration not working for status page
⚠️ Please verify that this bug has NOT been raised before.
- [X] I checked and didn't find similar issue
🛡️ Security Policy
- [X] I agree to have read this project Security Policy
Description
iFrame integration not working for status page when providing -e UPTIME_KUMA_DISABLE_FRAME_SAMEORIGIN=1
as an environment variable to the docker container.
This is problematic because the status page provides a structured overview, instead of the alphabetically sorted list.
👟 Reproduction steps
When using an iFrame to integrate uptime-kuma to another page, this works for the /list
, but not the /status
page
Working example:
<html>
<head></head>
<body><iframe style="width:25%; height:99%; border:0" scrolling="no" src="http://_example.com_/list">test</iframe></body>
</html>
Nonfunctional example:
<html>
<head></head>
<body><iframe style="width:25%; height:99%; border:0" scrolling="no" src="http://_example.com_/status">test</iframe>/body>
</html>
👀 Expected behavior
iFrame should display (same as with /list).
😓 Actual Behavior
Web console shows error
Refused to display 'http://example.com/' in a frame because it set 'x-Frame-Options' to 'sameorigin'
🐻 Uptime-Kuma Version
1.11.3
💻 Operating System and Arch
Raspbian Linux 5.10.89-v7l+
🌐 Browser
Google Chrome 97.0.4692.71 x64
🐋 Docker Version
20.10.12
🟩 NodeJS Version
v10.24.0
📝 Relevant log output
No response
having this same issue - i want to embed the status page into my error pages :P
Having same problem. I want to embed the /status page into a MagicMirror project. Getting the same refused to display error.
Edit: This -e UPTIME_KUMA_DISABLE_FRAME_SAMEORIGIN=1 worked for me in a plain html page. I was able to get the iframe to load. Next for me, work in MagicMirror to see if I can get it to load in there. Cheers.
I'd be interested in this but running it through pm2 and not a docker instance.
@jareau - can you specify how you added the fix to uptime kuma? I am running it in docker on my unraid box and want to embed it into my magic mirror, but not sure how to apply the fix. I can see it being adding something to the docker config for the app, but not sure if it was in magic mirror that you did this.
Edit - Added a variable to the template and set UPTIME_KUMA_DISABLE_FRAME_SAMEORIGIN to true
@KRider92
The correct envionment variable value is true
(not 1
).
This might have changed in the last 1.5 years, idk.
Here are the relevant wiki pages:
- setting up iframes: https://github.com/louislam/uptime-kuma/wiki/Status-Page#custom-subdirectory--custom-html-on-status-pages
- environment variables: https://github.com/louislam/uptime-kuma/wiki/Environment-Variables#server-environment-variables
Closing as resolved