Skip to content

Commit 25b4d65

Browse files
committed
security/netbird: fix selectpicker and unbreak migration
The auth key may be required but not giving a default for obvious reasons just makes it end up without a required value anyway until user contact. This can probably be made more robust in the future, but requires a bit of thought on what we validate/enforce here anyway like an "enbable" checkbox being checked requires filling this value, but it's also not on the same page or model even making constraints tricky.
1 parent 59762b0 commit 25b4d65

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

security/netbird/src/opnsense/mvc/app/models/OPNsense/Netbird/Authentication.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<Default>https://api.netbird.io:443</Default>
99
</managementUrl>
1010
<setupKey type="TextField">
11-
<Required>Y</Required>
11+
<!-- XXX fails migration for obvious reasons <Required>Y</Required> -->
1212
<Mask>/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i</Mask>
1313
<ValidationMessage>Please specify a valid setup key.</ValidationMessage>
1414
</setupKey>

security/netbird/src/opnsense/mvc/app/views/OPNsense/Netbird/settings.volt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@
2929

3030
<script>
3131
$(document).ready(() => {
32-
mapDataToFormUI({
33-
'frmSettings': "/api/netbird/settings/get"
34-
}).done(() => {
32+
mapDataToFormUI({'frmSettings': '/api/netbird/settings/get'}).done(() => {
33+
$('.selectpicker').selectpicker('refresh');
3534
updateServiceControlUI('netbird');
3635
});
3736

0 commit comments

Comments
 (0)