Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configuration issue #93 #1024

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
7 changes: 7 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ axios
createVueApp();
});

const faviconPath = process.env.DT_FAVICON_PATH || '/default/favicon.ico';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fear this won't work.

Certain environment variables defined at build-time can be statically embedded, but DT_FAVICON_PATH doesn't fall under any of them. Also, even if it was, it would mean that users would have to re-compile the project if they want to change the favicon, which is not what we want.

Is there another way to achieve this?

app.get('/', (req, res) => {
res.render('index', { favicon_path: faviconPath });
});



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