add: cloudflared/Cloudflare Tunnel support

Fixes #949
This commit is contained in:
lollipopkit🏳️‍⚧️
2025-11-22 17:16:52 +08:00
parent 84921de7a7
commit c4c0fdf6ff
6 changed files with 23 additions and 15 deletions

View File

@@ -29,6 +29,7 @@ class ExecutableInfo {
/// Generic executable manager for downloading and managing external tools
abstract final class ExecutableManager {
static const String _executablesDirName = 'executables';
static const int _posixExecuteBitsMask = 0x49; // Equivalent to POSIX octal 0o111
static late final Directory _executablesDir;
static final Map<String, ExecutableInfo> _customExecutables = {};
static bool _customExecutablesLoaded = false;
@@ -137,7 +138,7 @@ abstract final class ExecutableManager {
return await getExecutablePath(name);
}
return await getExecutablePath(name);
throw ExecutableException('Executable "$name" not found and automatic installation is not implemented');
}
/// Remove a local executable
@@ -270,7 +271,7 @@ abstract final class ExecutableManager {
} else {
// Check file permissions
final stat = file.statSync();
return (stat.mode & 0x111) != 0; // Check execute bits
return (stat.mode & _posixExecuteBitsMask) != 0; // Check execute bits
}
}