enforce --auth-key param in template preventing prompt for auth on boot (#4395)

This commit is contained in:
Sam Sheridan 2024-12-13 19:30:42 +00:00 committed by GitHub
parent b8c07d4a62
commit eb044ee895
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 4 deletions

View file

@ -1,5 +1,6 @@
PLUGIN_NAME= tailscale
PLUGIN_VERSION= 1.0.d
PLUGIN_REVISION= 1
PLUGIN_DEVEL= yes
PLUGIN_COMMENT= Tailscale makes creating software-defined networks easy
PLUGIN_DEPENDS= tailscale

View file

@ -9,3 +9,8 @@ Plugin Changelog
1.0
* initial development release
1.0_1
* fixes to template to prevent auth key prompt when empty

View file

@ -8,7 +8,6 @@
return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2');
}
function updateNetInfo() {
ajaxGet(url = "/api/tailscale/status/net/", sendData={},
callback = function (data, status) {
@ -44,7 +43,6 @@
});
}
function updateStatusInfo() {
ajaxGet(url = "/api/tailscale/status/status/", sendData={},
callback = function (data, status) {
@ -78,14 +76,14 @@
} else {
$('#statusList > tbody').append('<tr><td colspan=2>Unable to fetch status, is Tailscale running?</td></tr>');
}
updateServiceControlUI('tailscale');
}
);
}
updateNetInfo();
updateStatusInfo();
});
</script>

View file

@ -30,6 +30,8 @@ tailscaled_port="{{ OPNsense.tailscale.settings.listenPort }}"
{% endif %}
{% if helpers.exists('OPNsense.tailscale.authentication.preAuthKey') %}
{% do up_args.append("--auth-key=" + OPNsense.tailscale.authentication.preAuthKey) %}
{% else %}
{% do up_args.append("--auth-key=non-specified") %}
{% endif %}
{# loop through subnets to build list #}
{% if helpers.exists('OPNsense.tailscale.settings.subnets.subnet4') %}