What Grafana version and what operating system are you using?
R: 7.4.0 Ubuntu // Docker Container
What are you trying to achieve?
R: Edit certain images such as the Grafana Logo, Background Image, Page Title, Login Screen Titles, etc.
How are you trying to achieve it?
R: So far I’ve tried both docker-compose.yaml and Dockerfile, and a combination of both.
What happened?
R: Didn’t work following instructions scattered all over the forum and documentation.
What did you expect to happen?
R: For it to work with the suggested methods around the forum and documentation.
Can you copy/paste the configuration(s) that you are having problems with?
R:
version: "3.8"
services:
grafana:
image: grafanacustom
volumes:
- ./data/grafana-data/datasources:/etc/grafana/provisioning/datasources
- ./data/grafana-data/dashboards-provisioning:/etc/grafana/provisioning/dashboards
- ./data/grafana-data/dashboards:/var/lib/grafana/dashboards
- ./img/grafana_icon.svg:/usr/share/grafana/public/img/grafana_icon.svg:rw
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_DISABLE_LOGIN_FORM=true
- GF_USERS_DEFAULT_THEME=light
ports:
- "3000:3000"
FROM grafana/grafana:7.4.0-ubuntu
# Auth
ENV GF_AUTH_ANONYMOUS_ENABLED=true
ENV GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
ENV GF_AUTH_DISABLE_LOGIN_FORM=true
###### Customization ########################################
USER root
# Replace Favicon
COPY img/fav32.png /usr/share/grafana/public/img
# Replace Logo
COPY img/grafana_icon.svg /usr/share/grafana/public/img
# Replace Background
COPY img/login_background_light.svg /usr/share/grafana/public/img
# Update Title
RUN sed -i 's|<title>\[\[.AppTitle\]\]</title>|<title>REDACTED Application</title>|g' /usr/share/grafana/public/views/index.html
# Update Javascript
RUN find /usr/share/grafana/public/build/ -name *.js -exec sed -i 's|o(l,"AppTitle","Grafana")|o(l,"AppTitle","Interface Grafana do REDACTED")|g' {} \;
RUN find /usr/share/grafana/public/build/ -name *.js -exec sed -i 's|o(l,"LoginTitle","Welcome to Grafana")|o(l,"LoginTitle","Bem-vindo(a) a Interface Grafana do REDACTED")|g' {} \;
RUN find /usr/share/grafana/public/build/ -name *.js -exec sed -i 's|{text:"Documentation",icon:"document-info",url:"https://grafana.com/docs/grafana/latest/?utm_source=grafana_footer",target:"_blank"},{text:"Support",icon:"question-circle",url:"https://grafana.com/products/enterprise/?utm_source=grafana_footer",target:"_blank"},{text:"Community",icon:"comments-alt",url:"https://community.grafana.com/?utm_source=grafana_footer",target:"_blank"}||g' {} \;
RUN find /usr/share/grafana/public/build/ -name *.js -exec sed -i 's|{text:`${e.edition}${a}`,url:t.licenseUrl}||g' {} \;
RUN find /usr/share/grafana/public/build/ -name *.js -exec sed -i 's|{text:`v${e.version} (${e.commit})`}||g' {} \;
RUN find /usr/share/grafana/public/build/ -name *.js -exec sed -i 's|{id:"updateVersion",text:"New version available!",icon:"download-alt",url:"https://grafana.com/grafana/download?utm_source=grafana_footer",target:"_blank"}||g' {} \;
^^ I run this Dockerfile as: docker build -t grafanacustom .
Then I put it up as docker-compose up -d
as any other normal container.
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
R: No.
Did you follow any online instructions? If so, what are the URLs?
R:
https://community.grafana.com/t/how-can-i-customize-login-page/17441/8
https://community.grafana.com/t/replace-logo-in-ui/6126
https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/configure-custom-branding/
https://community.grafana.com/t/how-to-change-title-of-website-grafana/500?page=2
https://mohitshrestha02.medium.com/grafana-103-customizing-login-screen-for-grafana-playing-with-white-labels-and-many-more-1d63c23a138c
https://www.youtube.com/watch?v=3GRoa8TzIxY
Tried versions 7.4.0, 9.1.7, latest, all to no avail. Every version returns the same issue: the files simply don’t change.