This commit is contained in:
LukeGus
2025-07-26 21:33:39 -05:00
parent 073e9a969b
commit abeba66432
5 changed files with 12 additions and 39 deletions

View File

@@ -18,20 +18,7 @@ http {
index index.html index.htm;
}
location /database.io/ {
proxy_pass http://127.0.0.1:8081;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /ssh.io/ {
location /ssh/websocket {
proxy_pass http://127.0.0.1:8082;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
@@ -44,7 +31,7 @@ http {
proxy_set_header X-Forwarded-Proto $scheme;
}
location /rdp.io/ {
location /ssh_tunnel/websocket {
proxy_pass http://127.0.0.1:8083;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
@@ -57,7 +44,7 @@ http {
proxy_set_header X-Forwarded-Proto $scheme;
}
location /vnc.io/ {
location /config_editor/websocket {
proxy_pass http://127.0.0.1:8084;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
@@ -70,19 +57,6 @@ http {
proxy_set_header X-Forwarded-Proto $scheme;
}
location /sftp.io/ {
proxy_pass http://127.0.0.1:8085;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;

View File

@@ -30,7 +30,7 @@ interface SSHHost {
folder: string;
tags: string[];
pin: boolean;
authType: 'password' | 'key';
authType: string;
password?: string;
key?: string;
keyPassword?: string;
@@ -171,7 +171,7 @@ export function SSHManagerHostEditor({ editingHost, onFormSubmit }: SSHManagerHo
type FormData = z.infer<typeof formSchema>;
const form = useForm<FormData>({
resolver: zodResolver(formSchema),
resolver: zodResolver(formSchema) as any,
defaultValues: {
name: editingHost?.name || "",
ip: editingHost?.ip || "",

View File

@@ -99,7 +99,12 @@ export const SSHTerminal = forwardRef<any, SSHTerminalProps>(function SSHTermina
const cols = terminal.cols + 1;
const rows = terminal.rows;
const ws = new WebSocket('ws://localhost:8082');
const wsUrl = window.location.hostname === 'localhost'
? 'ws://localhost:8082'
: `${window.location.protocol === 'https:' ? 'wss' : 'ws'}://${window.location.host}/ssh/websocket/`;
const ws = new WebSocket(wsUrl);
webSocketRef.current = ws;
ws.addEventListener('open', () => {

View File

@@ -53,9 +53,4 @@ app.use((err: unknown, req: express.Request, res: express.Response, next: expres
});
const PORT = 8081;
app.listen(PORT, () => {
logger.success(`Database server started on port ${PORT}`);
}).on('error', (err) => {
logger.error(`Failed to start database server:`, err);
process.exit(1);
});
app.listen(PORT, () => {});