mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2024-11-27 03:07:04 +00:00
79966e36e3
The /admin/munin routes used the same Authorization: header logic as the other API routes, but they are browsed directly in the browser because they are handled as static pages or as a proxy to a CGI script. This required users to enter their email username/password for HTTP basic authentication in the standard browser auth prompt, which wasn't ideal (and may leak the password in browser storage). It also stopped working when MFA was enabled for user accounts. A token is now set in a cookie when visiting /admin/munin which is then checked in the routes that proxy the Munin pages. The cookie's lifetime is kept limited to limit the opportunity for any unknown CSRF attacks via the Munin CGI script.
21 lines
336 B
HTML
21 lines
336 B
HTML
<h2>Munin Monitoring</h2>
|
|
|
|
<style>
|
|
</style>
|
|
|
|
<p>Opening munin in a new tab... You may need to allow pop-ups for this site.</p>
|
|
|
|
<script>
|
|
function show_munin() {
|
|
// Set the cookie.
|
|
api(
|
|
"/munin",
|
|
"GET",
|
|
{ },
|
|
function(r) {
|
|
// Redirect.
|
|
window.open("/admin/munin/index.html", "_blank");
|
|
});
|
|
}
|
|
</script>
|