security/tailscale: style sweep

This commit is contained in:
Franco Fichtner
2024-12-06 17:14:35 +01:00
parent cadc03aebd
commit 80ef988989
10 changed files with 17 additions and 21 deletions
+1
View File
@@ -63,6 +63,7 @@ Copyright (c) 2022 Robbert Rijkse
Copyright (c) 2023 sattamjh
Copyright (c) 2004-2012 Scott Ullrich <sullrich@gmail.com>
Copyright (c) 2010 Seth Mos <seth.mos@dds.nl>
Copyright (c) 2024 Sheridan Computers
Copyright (c) 2008 Shrew Soft Inc. <mgrooms@shrew.net>
Copyright (c) 2017-2019 Smart-Soft
Copyright (c) 2013 Stanley P. Miller \ stan-qaz
+1
View File
@@ -88,6 +88,7 @@ security/maltrail -- Malicious traffic detection system
security/openconnect -- OpenConnect Client
security/softether -- Cross-platform Multi-protocol VPN Program (development only)
security/stunnel -- Stunnel TLS proxy
security/tailscale -- Tailscale makes creating software-defined networks easy (development only)
security/tinc -- Tinc VPN
security/tor -- The Onion Router
security/wazuh-agent -- Agent for the open source security platform Wazuh
@@ -48,7 +48,7 @@ function tailscale_services()
'stop' => ['tailscale stop'],
],
'name' => 'tailscale',
];
];
return $services;
}
@@ -62,4 +62,3 @@ function tailscale_devices()
'volatile' => true,
]];
}
@@ -36,4 +36,3 @@ class AuthenticationController extends ApiMutableModelControllerBase
protected static $internalModelName = 'authentication';
protected static $internalModelClass = '\OPNsense\Tailscale\Authentication';
}
@@ -42,4 +42,3 @@ class ServiceController extends ApiMutableServiceControllerBase
protected static $internalServiceTemplate = 'OPNsense/Tailscale';
protected static $internalServiceName = 'tailscale';
}
@@ -62,8 +62,8 @@ class SettingsController extends ApiMutableModelControllerBase
public function reloadAction()
{
$mdl = $this->getModel();
$enabled = $mdl->enabled->__toString() === '1';
$response = $this->toggleTailScaleService($enabled);
$enabled = $mdl->enabled->__toString() === '1';
$response = $this->toggleTailScaleService($enabled);
return ['result ' => $response];
}
@@ -42,22 +42,23 @@ class StatusController extends ApiMutableModelControllerBase
if ($response !== null) {
return $response;
}
return ['error' => 'Unable to determine Tailscale status, is the service running?'];
return ['error' => 'Unable to determine Tailscale status, is the service running?'];
}
public function ipAction()
{
$response = trim((new Backend())->configdRun('tailscale tailscale-ip'));
return ['result' => $response];
return ['result' => $response];
}
public function netAction()
{
$response = trim((new Backend())->configdRun('tailscale tailscale-netcheck'));
return ['result' => $response];
return ['result' => $response];
}
private function isJson($string) {
private function isJson($string)
{
return is_string($string)
&& (is_object(json_decode($string))
|| is_array(json_decode($string)));
@@ -29,10 +29,10 @@
$.each(peers, function(peer, data) {
let tailscaleIp = '';
if (data.TailscaleIPs !== null && data.TailscaleIPs !== undefined) {
tailscaleIp = data.TailscaleIPs.join(', ');
tailscaleIp = data.TailscaleIPs.join(', ');
console.log(tailscaleIp);
}
}
let row = '<tr><td>' + data.HostName;
row += '</td><td>' + tailscaleIp;
@@ -44,7 +44,7 @@
});
}
function updateStatusInfo() {
ajaxGet(url = "/api/tailscale/status/status/", sendData={},
callback = function (data, status) {
@@ -56,9 +56,9 @@
let skipKeys = [
'CertDomains',
'ClientVersion',
'CurrentTailnet',
'CurrentTailnet',
'Health',
'Self',
'Self',
'User'
];
@@ -42,6 +42,3 @@ message: request tailscale version
command:/usr/local/bin/tailscale netcheck; exit 0
type:script_output
message: request tailscale netcheck
@@ -3,8 +3,8 @@
#
{% if not helpers.empty('OPNsense.tailscale.settings.enabled') %}
tailscaled_enable="YES"
# Uncommenting the below breaks being able to access subnets
# see - https://github.com/tailscale/tailscale/issues/5573#issuecomment-1584695981
# Uncommenting the below breaks being able to access subnets
# see - https://github.com/tailscale/tailscale/issues/5573#issuecomment-1584695981
# tailscaled_env="TS_DEBUG_NETSTACK_SUBNETS=0"
{% if helpers.exists('OPNsense.tailscale.settings.listenPort') %}
tailscaled_port="{{ OPNsense.tailscale.settings.listenPort }}"
@@ -46,4 +46,3 @@ tailscaled_up_args="{{ up_args|join(' ') }}"
{% else %}
tailscaled_enable=NO
{% endif %}