Skip to content

Commit

Permalink
Configurable Favicon #93
Browse files Browse the repository at this point in the history
  • Loading branch information
itzanway committed Oct 1, 2024
1 parent f216b60 commit 1654204
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ NODE_ENV=production
VUE_APP_I18N_LOCALE=en
VUE_APP_I18N_FALLBACK_LOCALE=en
VUE_APP_SERVER_URL=
DT_FAVICON_PATH=/path/to/favicon.ico
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@ To do this, hover over the _No Translation_ item of a language, and click the gl

![Machine translation in i18n Ally](.github/images/i18n_i18n-ally-translate.png)

# Custom Favicon Configuration
You can configure a custom favicon for your Dependency-Track instance by setting the `DT_FAVICON_PATH` environment variable.

# Example:
`bash
DT_FAVICON_PATH=/assets/favicon-production.ico


## Copyright & License

Dependency-Track is Copyright (c) OWASP Foundation. All Rights Reserved.
Expand Down
2 changes: 2 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>Dependency-Track</title>
<base href="/" />
<link rel="icon" href="{{favicon_path}}" type="image/x-icon">
</head>
<body class="sidebar-minimized">
<noscript>
Expand Down Expand Up @@ -43,6 +44,7 @@
}
});
})();

</script>
</body>
</html>
6 changes: 6 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ axios
createVueApp();
});

const faviconPath = process.env.DT_FAVICON_PATH || '/default/favicon.ico';
app.get('/', (req, res) => {
res.render('index', { favicon_path: faviconPath });
});


/**
* Removed finally block due to:
* https://github.com/DependencyTrack/frontend/issues/34
Expand Down

0 comments on commit 1654204

Please sign in to comment.