-
Notifications
You must be signed in to change notification settings - Fork 22
feat/trusted media build env var #133
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -25,6 +25,7 @@ export default defineConfig(({ mode }) => { | |||||||||||||||||
| '__DEFAULT_IRC_CHANNELS__': process.env.VITE_DEFAULT_IRC_CHANNELS ? process.env.VITE_DEFAULT_IRC_CHANNELS.replace(/^['"]|['"]$/g, '').split(',').map(ch => ch.trim()) : [], | ||||||||||||||||||
| '__HIDE_SERVER_LIST__': process.env.VITE_HIDE_SERVER_LIST === 'true', | ||||||||||||||||||
| '__BACKEND_URL__': JSON.stringify(process.env.VITE_BACKEND_URL || 'http://localhost:8080'), | ||||||||||||||||||
| '__TRUSTED_MEDIA_URLS__': process.env.VITE_TRUSTED_MEDIA_URLS ? process.env.VITE_TRUSTED_MEDIA_URLS.replace(/^['"]|['"]$/g, '').split(',').map(url => url.trim()) : [], | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Filter empty entries to avoid accidentally trusting all URLs. ✅ Suggested fix- '__TRUSTED_MEDIA_URLS__': process.env.VITE_TRUSTED_MEDIA_URLS ? process.env.VITE_TRUSTED_MEDIA_URLS.replace(/^['"]|['"]$/g, '').split(',').map(url => url.trim()) : [],
+ '__TRUSTED_MEDIA_URLS__': process.env.VITE_TRUSTED_MEDIA_URLS
+ ? process.env.VITE_TRUSTED_MEDIA_URLS
+ .replace(/^['"]|['"]$/g, '')
+ .split(',')
+ .map((url) => url.trim())
+ .filter(Boolean)
+ : [],📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| }, | ||||||||||||||||||
| // prevent vite from obscuring rust errors | ||||||||||||||||||
| clearScreen: false, | ||||||||||||||||||
|
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid quoted value to satisfy dotenv-linter and reduce copy/paste confusion.
The example value works without quotes; dropping them removes the lint warning.
🛠️ Suggested tweak
📝 Committable suggestion
🧰 Tools
🪛 dotenv-linter (4.0.0)
[warning] 10-10: [QuoteCharacter] The value has quote characters (', ")
(QuoteCharacter)
🤖 Prompt for AI Agents