Skip to content

Commit

Permalink
fix: allow config to force port 41641
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Kaser <[email protected]>
  • Loading branch information
dkaser committed Jul 12, 2024
1 parent 2deed24 commit 2fca805
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Tag="gears"
### <?= _tr("settings.services") ?>

<?= _tr("settings.wireguard") ?>
: <input type="number" name="WG_PORT" class="narrow" min="1" max="65535" value="<?=$tailscale_config['WG_PORT']?>" placeholder="41641">
: <input type="number" name="WG_PORT" class="narrow" min="0" max="65535" value="<?=$tailscale_config['WG_PORT']?>" placeholder="0">

> <?= _tr("settings.context.wireguard") ?>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

$custom_params = "";

if ($tailscale_config['WG_PORT'] != "41641") {
$wgport = intval($tailscale_config['WG_PORT']);
if ($wgport > 0 && $wgport < 65535) {
$custom_params .= "-port {$wgport} ";
}
$wgport = intval($tailscale_config['WG_PORT']);
if ($wgport > 0 && $wgport < 65535) {
$custom_params .= "-port {$wgport} ";
}

file_put_contents('/usr/local/emhttp/plugins/tailscale/custom-params.sh', 'TAILSCALE_CUSTOM_PARAMS="' . $custom_params . '"');
2 changes: 1 addition & 1 deletion src/usr/local/emhttp/plugins/tailscale/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"description": "Tailscale enabled"
},
"WG_PORT": {
"default": "41641",
"default": "0",
"description": "Port for Wireguard connections"
}
}

0 comments on commit 2fca805

Please sign in to comment.