fix: multiplex ssh connections
This commit is contained in:
@@ -529,6 +529,14 @@ export async function createRemoteEngineConfiguration(id: string) {
|
|||||||
} catch (error) { }
|
} catch (error) { }
|
||||||
}
|
}
|
||||||
const config = sshConfig.parse('');
|
const config = sshConfig.parse('');
|
||||||
|
const foundWildcard = config.find({ Host: '*' });
|
||||||
|
if (!foundWildcard) {
|
||||||
|
config.append({
|
||||||
|
Host: '*',
|
||||||
|
ControlMaster: 'auto',
|
||||||
|
ControlPath: `${homedir}/.ssh/coolify-%r@%h:%p`,
|
||||||
|
})
|
||||||
|
}
|
||||||
const found = config.find({ Host: remoteIpAddress });
|
const found = config.find({ Host: remoteIpAddress });
|
||||||
if (!found) {
|
if (!found) {
|
||||||
config.append({
|
config.append({
|
||||||
@@ -540,6 +548,7 @@ export async function createRemoteEngineConfiguration(id: string) {
|
|||||||
StrictHostKeyChecking: 'no'
|
StrictHostKeyChecking: 'no'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await fs.stat(`${homedir}/.ssh/`);
|
await fs.stat(`${homedir}/.ssh/`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -919,8 +928,7 @@ export function generateDatabaseConfiguration(database: any, arch: string): Data
|
|||||||
};
|
};
|
||||||
if (isARM(arch)) {
|
if (isARM(arch)) {
|
||||||
configuration.volume = `${id}-${type}-data:/data`;
|
configuration.volume = `${id}-${type}-data:/data`;
|
||||||
configuration.command = `/usr/local/bin/redis-server --appendonly ${
|
configuration.command = `/usr/local/bin/redis-server --appendonly ${appendOnly ? 'yes' : 'no'
|
||||||
appendOnly ? 'yes' : 'no'
|
|
||||||
} --requirepass ${dbUserPassword}`;
|
} --requirepass ${dbUserPassword}`;
|
||||||
}
|
}
|
||||||
return configuration;
|
return configuration;
|
||||||
@@ -1428,6 +1436,9 @@ export async function getServiceFromDB({
|
|||||||
where: { id, teams: { some: { id: teamId === '0' ? undefined : teamId } } },
|
where: { id, teams: { some: { id: teamId === '0' ? undefined : teamId } } },
|
||||||
include: includeServices
|
include: includeServices
|
||||||
});
|
});
|
||||||
|
if (!body) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
let { type } = body;
|
let { type } = body;
|
||||||
type = fixType(type);
|
type = fixType(type);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user