A while ago Portainer added Business Edition branding all over their Community Edition, urging upgrades and greying out options. It was very annoying for an open source product so I decided to fix it. This is based on portainer-ce-clean-layout but uses an actual script to do this for all users and not just those with a Stylus script.
Regular Portainer | Fix Applied |
---|---|
The easiest method is to run Portainer by cloning this repo and using the compose file or the proxy image which serves the script locally.
This works by using Nginx's sub_filter
which is able to replace sections of certain pages with preprocessing before sending the page to the user, this means that it will be able to be used in a non-invasive way that will continue to work even if portainer updates.
Here's an example of how this could be used in an Nginx config.
location / {
proxy_pass http://localhost:9000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header Accept-Encoding "";
sub_filter_once off;
sub_filter '<base id="base"/>' '<base id="base"/><script src="https://cdn.jsdelivr.net/gh/JSH32/portainer-remove-be-branding@latest/remove_be.js"></script>';
}
If using Nginx Proxy Manager you can create a custom location with the same settings and paste the relevant configuration into the advanced config section
proxy_set_header Accept-Encoding "";
sub_filter_once off;
sub_filter '<base id="base"/>' '<base id="base"/><script src="https://cdn.jsdelivr.net/gh/JSH32/portainer-remove-be-branding@latest/remove_be.js"></script>';