Graylog2 / graylog2-server

Free and open log management
https://www.graylog.org
Other
7.33k stars 1.05k forks source link

Allow customization of footer #2723

Open mikkolehtisalo opened 8 years ago

mikkolehtisalo commented 8 years ago

The present implementation

screenshot from 2016-08-19 21-34-06

The good

Issue 1:

Issue 2:

Add configuration options and/or change the default behaviour. For example show the current information to administrator, but show non-admin users a configurable disclaimer.

Probably also the login screen should be able to show the same disclaimer?

mibesr commented 8 years ago

+1

pimpampeter commented 6 years ago

This is likely a requirement for a lot of organisations, any idea when/if this choice in footer text will be implemented ? @mikkolehtisalo : you would make me happy if you could you share how you implemented the mod_substitute rule .

mikkolehtisalo commented 6 years ago

Yes, showing a legal disclaimer is a typical mandatory thing for all systems for many organisations.

@pimpampeter I went for a popup because it has to be acknowledged. However the same trick can be used to just add text to the footer.

Popup javascript file on web server (/var/www/html/eula-popup.js, will be found at http://server/eula-popup.js):

if (!localStorage.getItem("runEulaOnce")) {
 // Could probably also refer to the same Javascript libraries the UI is using to get a nicer popup
 alert("Big scary EULA");
 localStorage.setItem("runEulaOnce", true);
}

Then in the Apache httpd's configuration:

# This causes the /eula-popup.js to be served from local files instead of proxying to backend service
RewriteRule ^/eula-popup.js$ /eula-popup.js [L]
# These require at least mod_filter
FilterDeclare replace
FilterProvider replace SUBSTITUTE "{Content_Type} = 'text/html'"
FilterChain +replace
# Find the last tag from the page, inject our javacsript file right before that
# If you wanted to add the footer text, you'd have to find a good tag from the source to attach your stuff into
# Relying to javascript is probably more reliable in any case, because changes in the UI doesn't break it so easily
Substitute "s|</body>|<script src=\"/eula-popup.js\"></script><\body>|ni"

Nginx probably has something similar. This all depends on how you set up your web server. Please never ever run any service without having a full blown web server at front....