fix: multiplex ssh connections

This commit is contained in:
Andras Bacsai
2022-09-22 09:02:53 +02:00
parent 550150d685
commit 510a748749

View File

@@ -529,6 +529,14 @@ export async function createRemoteEngineConfiguration(id: string) {
} catch (error) { }
}
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 });
if (!found) {
config.append({
@@ -540,6 +548,7 @@ export async function createRemoteEngineConfiguration(id: string) {
StrictHostKeyChecking: 'no'
});
}
try {
await fs.stat(`${homedir}/.ssh/`);
} catch (error) {
@@ -919,8 +928,7 @@ export function generateDatabaseConfiguration(database: any, arch: string): Data
};
if (isARM(arch)) {
configuration.volume = `${id}-${type}-data:/data`;
configuration.command = `/usr/local/bin/redis-server --appendonly ${
appendOnly ? 'yes' : 'no'
configuration.command = `/usr/local/bin/redis-server --appendonly ${appendOnly ? 'yes' : 'no'
} --requirepass ${dbUserPassword}`;
}
return configuration;
@@ -1428,6 +1436,9 @@ export async function getServiceFromDB({
where: { id, teams: { some: { id: teamId === '0' ? undefined : teamId } } },
include: includeServices
});
if (!body) {
return null
}
let { type } = body;
type = fixType(type);