Skip to content
This repository was archived by the owner on Jul 31, 2025. It is now read-only.

Commit e52ee66

Browse files
authored
chore: cleanup code from Unraid 6 (#39)
1 parent 2aa553f commit e52ee66

File tree

2 files changed

+0
-45
lines changed

2 files changed

+0
-45
lines changed

src/usr/local/emhttp/plugins/tailscale/include/Tailscale/System.php

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,6 @@ public static function fixLocalSubnetRoutes(): void
3434
}
3535
}
3636

37-
public static function patchSSH(Config $config): void
38-
{
39-
$version = parse_ini_file('/etc/unraid-version') ?: array();
40-
41-
if ($version['version'] == "6.12.0") {
42-
Utils::logmsg("Unraid 6.12.0: Checking SSH startup script");
43-
$ssh = file_get_contents('/etc/rc.d/rc.sshd') ?: "";
44-
45-
if (str_contains($ssh, '$family')) {
46-
Utils::logmsg("Unraid 6.12.0: Repairing SSH startup script");
47-
$ssh = str_replace('$family', 'any', $ssh);
48-
file_put_contents('/etc/rc.d/rc.sshd', $ssh);
49-
}
50-
} else {
51-
Utils::logmsg("Unraid 6.12.0: SSH startup script not applicable");
52-
}
53-
}
54-
5537
public static function checkWebgui(Config $config, string $tailscale_ipv4): void
5638
{
5739
// Make certain that the WebGUI is listening on the Tailscale interface
@@ -129,31 +111,6 @@ public static function enableIPForwarding(Config $config): void
129111
}
130112
}
131113

132-
public static function patchNginx(): void
133-
{
134-
$original = 'location ~ \.php$ {';
135-
$replace = <<<'END'
136-
location ~ ^(.+\.php)(.*)$ {
137-
fastcgi_split_path_info ^(.+\.php)(.*)$;
138-
fastcgi_param PATH_INFO $fastcgi_path_info;
139-
END;
140-
141-
$nginx = file_get_contents("/etc/rc.d/rc.nginx") ?: "";
142-
143-
if (strpos($nginx, $original) !== false) {
144-
// Patch the rc.nginx file
145-
Utils::logmsg("Detected original rc.nginx, applying patch.");
146-
147-
if ( ! file_exists("/etc/rc.d/rc.nginx.pre-tailscale")) {
148-
copy("/etc/rc.d/rc.nginx", "/etc/rc.d/rc.nginx.pre-tailscale");
149-
}
150-
$newFile = str_replace($original, $replace, $nginx);
151-
file_put_contents("/etc/rc.d/rc.nginx", $newFile);
152-
}
153-
154-
Utils::run_command("/etc/rc.d/rc.nginx reload 2>&1");
155-
}
156-
157114
public static function applyGRO(): void
158115
{
159116
/** @var array<int, array<string>> $ip_route */

src/usr/local/emhttp/plugins/tailscale/pre-startup.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
Utils::run_task('Tailscale\System::applyGRO');
1313
Utils::run_task('Tailscale\System::setExtraInterface', array($tailscaleConfig));
1414
Utils::run_task('Tailscale\System::enableIPForwarding', array($tailscaleConfig));
15-
Utils::run_task('Tailscale\System::patchNginx');
16-
Utils::run_task('Tailscale\System::patchSSH', array($tailscaleConfig));
1715

1816
if ($tailscaleConfig->Enable) {
1917
Utils::run_command('/etc/rc.d/rc.tailscale restart > /dev/null &');

0 commit comments

Comments
 (0)