fix(terminal): Terminal through Cloudflare tunnel works?!
fix(dependencies): update realtime version to 1.0.9 and cloudflared version to 2025.5.0; enhance SSH argument parsing in terminal-server.js
This commit is contained in:
@@ -4,7 +4,7 @@ return [
|
|||||||
'coolify' => [
|
'coolify' => [
|
||||||
'version' => '4.0.0-beta.419',
|
'version' => '4.0.0-beta.419',
|
||||||
'helper_version' => '1.0.8',
|
'helper_version' => '1.0.8',
|
||||||
'realtime_version' => '1.0.8',
|
'realtime_version' => '1.0.9',
|
||||||
'self_hosted' => env('SELF_HOSTED', true),
|
'self_hosted' => env('SELF_HOSTED', true),
|
||||||
'autoupdate' => env('AUTOUPDATE'),
|
'autoupdate' => env('AUTOUPDATE'),
|
||||||
'base_config_path' => env('BASE_CONFIG_PATH', '/data/coolify'),
|
'base_config_path' => env('BASE_CONFIG_PATH', '/data/coolify'),
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
# https://github.com/soketi/soketi/releases
|
# https://github.com/soketi/soketi/releases
|
||||||
ARG SOKETI_VERSION=1.6-16-alpine
|
ARG SOKETI_VERSION=1.6-16-alpine
|
||||||
# https://github.com/cloudflare/cloudflared/releases
|
# https://github.com/cloudflare/cloudflared/releases
|
||||||
ARG CLOUDFLARED_VERSION=2025.2.0
|
ARG CLOUDFLARED_VERSION=2025.5.0
|
||||||
|
|
||||||
FROM quay.io/soketi/soketi:${SOKETI_VERSION}
|
FROM quay.io/soketi/soketi:${SOKETI_VERSION}
|
||||||
|
|
||||||
|
@@ -265,11 +265,57 @@ function extractTimeout(commandString) {
|
|||||||
|
|
||||||
function extractSshArgs(commandString) {
|
function extractSshArgs(commandString) {
|
||||||
const sshCommandMatch = commandString.match(/ssh (.+?) 'bash -se'/);
|
const sshCommandMatch = commandString.match(/ssh (.+?) 'bash -se'/);
|
||||||
let sshArgs = sshCommandMatch ? sshCommandMatch[1].split(' ') : [];
|
if (!sshCommandMatch) return [];
|
||||||
|
|
||||||
|
const argsString = sshCommandMatch[1];
|
||||||
|
let sshArgs = [];
|
||||||
|
|
||||||
|
// Parse shell arguments respecting quotes
|
||||||
|
let current = '';
|
||||||
|
let inQuotes = false;
|
||||||
|
let quoteChar = '';
|
||||||
|
let i = 0;
|
||||||
|
|
||||||
|
while (i < argsString.length) {
|
||||||
|
const char = argsString[i];
|
||||||
|
const nextChar = argsString[i + 1];
|
||||||
|
|
||||||
|
if (!inQuotes && (char === '"' || char === "'")) {
|
||||||
|
// Starting a quoted section
|
||||||
|
inQuotes = true;
|
||||||
|
quoteChar = char;
|
||||||
|
current += char;
|
||||||
|
} else if (inQuotes && char === quoteChar) {
|
||||||
|
// Ending a quoted section
|
||||||
|
inQuotes = false;
|
||||||
|
current += char;
|
||||||
|
quoteChar = '';
|
||||||
|
} else if (!inQuotes && char === ' ') {
|
||||||
|
// Space outside quotes - end of argument
|
||||||
|
if (current.trim()) {
|
||||||
|
sshArgs.push(current.trim());
|
||||||
|
current = '';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Regular character
|
||||||
|
current += char;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add final argument if exists
|
||||||
|
if (current.trim()) {
|
||||||
|
sshArgs.push(current.trim());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Replace RequestTTY=no with RequestTTY=yes
|
||||||
sshArgs = sshArgs.map(arg => arg === 'RequestTTY=no' ? 'RequestTTY=yes' : arg);
|
sshArgs = sshArgs.map(arg => arg === 'RequestTTY=no' ? 'RequestTTY=yes' : arg);
|
||||||
if (!sshArgs.includes('RequestTTY=yes')) {
|
|
||||||
|
// Add RequestTTY=yes if not present
|
||||||
|
if (!sshArgs.includes('RequestTTY=yes') && !sshArgs.some(arg => arg.includes('RequestTTY='))) {
|
||||||
sshArgs.push('-o', 'RequestTTY=yes');
|
sshArgs.push('-o', 'RequestTTY=yes');
|
||||||
}
|
}
|
||||||
|
|
||||||
return sshArgs;
|
return sshArgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user