mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-30 23:25:24 +00:00
fix: harden plugin sockets, public routes, prebuilt binaries and login fallback
This commit is contained in:
1 parent
efb4259438
commit
5e54d95e71
16 files changed
+318
-23
No files matched your search
@@ -34,7 +34,19 @@ vi.mock("../../plugins/permissions.js", () => ({
|
||||
invalidatePluginPermissionCache: vi.fn(),
|
||||
}));
|
||||
|
||||
const CONSOLE_PORT = 39109;
|
||||
// A fixed port can land in a range Windows reserves for Hyper-V or Docker.
|
||||
function freePort(): Promise<number> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const server = net.createServer();
|
||||
server.once("error", reject);
|
||||
server.listen(0, "127.0.0.1", () => {
|
||||
const { port } = server.address() as net.AddressInfo;
|
||||
server.close(() => resolve(port));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const CONSOLE_PORT = await freePort();
|
||||
const cleanups: Array<() => void> = [];
|
||||
|
||||
function tempRoot(prefix: string): string {
|
||||
|
||||
Reference in new issue
Block a user