Skip to content

Commit 737e664

Browse files
committed
fix: improve environment variables config
1 parent 047c16a commit 737e664

File tree

4 files changed

+41
-8
lines changed

4 files changed

+41
-8
lines changed

backend/.vscode/settings.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
{
22
"python.analysis.typeCheckingMode": "basic",
3-
"rust-analyzer.linkedProjects": ["./windmill-common/Cargo.toml"],
4-
"rust-analyzer.showUnlinkedFileNotification": false
5-
}
3+
"rust-analyzer.linkedProjects": [
4+
"./windmill-common/Cargo.toml"
5+
],
6+
"rust-analyzer.showUnlinkedFileNotification": false,
7+
"remote.portsAttributes": {
8+
"8000": {
9+
"label": "Development Server",
10+
"onAutoForward": "openPreview"
11+
}
12+
},
13+
"remote.autoForwardPorts": true
14+
}

frontend/.vscode/settings.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
2-
"cSpell.words": ["semibold", "stylelint"],
3-
"deno.enable": true,
4-
"deno.unstable": true
5-
}
2+
"remote.portsAttributes": {
3+
"3000": {
4+
"label": "Development Server",
5+
"onAutoForward": "openPreview"
6+
}
7+
}
8+
}

frontend/src/lib/components/WorkerGroup.svelte

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,9 @@
668668
type="text"
669669
placeholder="ENV_VAR_NAME"
670670
bind:value={envvar.key}
671+
on:keypress={(e) => {
672+
dirty = true
673+
}}
671674
/>
672675
<ToggleButtonGroup
673676
disabled={!$superadmin}
@@ -859,6 +862,23 @@
859862
sendUserToast('Minimum alive workers alert threshold must be at least 1', true)
860863
return
861864
}
865+
// Remove duplicate env vars by keeping only the last occurrence of each key
866+
const seenKeys = new Set()
867+
customEnvVars = customEnvVars
868+
.reverse()
869+
.filter((envVar) => {
870+
if (envVar.key == '') {
871+
return false
872+
}
873+
if (seenKeys.has(envVar.key)) {
874+
return false
875+
}
876+
seenKeys.add(envVar.key)
877+
return true
878+
})
879+
.reverse()
880+
nconfig.env_vars_static = new Map()
881+
nconfig.env_vars_allowlist = []
862882
customEnvVars.forEach((envvar) => {
863883
if (
864884
nconfig.env_vars_static !== undefined &&
@@ -872,6 +892,7 @@
872892
}
873893
}
874894
})
895+
875896
await ConfigService.updateConfig({ name: 'worker__' + name, requestBody: nconfig })
876897
sendUserToast('Configuration set')
877898
dispatch('reload')

frontend/vite.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const version = JSON.parse(json)
1313
const config = {
1414
server: {
1515
https: false,
16-
port: 3006,
16+
port: 3000,
1717
proxy: {
1818
'^/api/.*': {
1919
target: process.env.REMOTE ?? 'https://app.windmill.dev/',

0 commit comments

Comments
 (0)