This commit is contained in:
Andras Bacsai
2022-02-28 16:06:44 +01:00
parent 02abd038fa
commit f340ca9d05
14 changed files with 445 additions and 320 deletions

View File

@@ -24,7 +24,7 @@ export const post: RequestHandler = async (event) => {
const { id } = event.params;
try {
await checkHAProxy();
// await checkHAProxy();
const service = await db.getService({ id, teamId });
const {
type,
@@ -96,16 +96,16 @@ export const post: RequestHandler = async (event) => {
}
try {
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
await checkProxyConfigurations();
await configureSimpleServiceProxyOn({ id, domain, port: consolePort });
// await checkProxyConfigurations();
// await configureSimpleServiceProxyOn({ id, domain, port: consolePort });
await db.updateMinioService({ id, publicPort });
await startHttpProxy(destinationDocker, id, publicPort, apiPort);
if (isHttps) {
await letsEncrypt({ domain, id });
}
await setWwwRedirection(fqdn);
await reloadHaproxy(destinationDocker.engine);
// if (isHttps) {
// await letsEncrypt({ domain, id });
// }
// await setWwwRedirection(fqdn);
// await reloadHaproxy(destinationDocker.engine);
return {
status: 200
};

View File

@@ -35,7 +35,7 @@ export const post: RequestHandler = async (event) => {
}
try {
await stopTcpHttpProxy(destinationDocker, publicPort);
await configureSimpleServiceProxyOff(fqdn);
// await configureSimpleServiceProxyOff(fqdn);
} catch (error) {
console.log(error);
}

View File

@@ -56,14 +56,14 @@ export const post: RequestHandler = async (event) => {
try {
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
await checkProxyConfigurations();
await configureSimpleServiceProxyOn({ id, domain, port: 8080 });
// await checkProxyConfigurations();
// await configureSimpleServiceProxyOn({ id, domain, port: 8080 });
if (isHttps) {
await letsEncrypt({ domain, id });
}
await setWwwRedirection(fqdn);
await reloadHaproxy(destinationDocker.engine);
// if (isHttps) {
// await letsEncrypt({ domain, id });
// }
// await setWwwRedirection(fqdn);
// await reloadHaproxy(destinationDocker.engine);
return {
status: 200
};

View File

@@ -187,14 +187,14 @@ COPY ./init-db.sh /docker-entrypoint-initdb.d/init-db.sh`;
await asyncExecShell(
`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up --build -d`
);
await checkProxyConfigurations();
await configureSimpleServiceProxyOn({ id, domain, port: 8000 });
// await checkProxyConfigurations();
// await configureSimpleServiceProxyOn({ id, domain, port: 8000 });
if (isHttps) {
await letsEncrypt({ domain, id });
}
await setWwwRedirection(fqdn);
await reloadHaproxy(destinationDocker.engine);
// if (isHttps) {
// await letsEncrypt({ domain, id });
// }
// await setWwwRedirection(fqdn);
// await reloadHaproxy(destinationDocker.engine);
return {
status: 200
};

View File

@@ -74,14 +74,14 @@ export const post: RequestHandler = async (event) => {
}
try {
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
await checkProxyConfigurations();
await configureSimpleServiceProxyOn({ id, domain, port: 80 });
// await checkProxyConfigurations();
// await configureSimpleServiceProxyOn({ id, domain, port: 80 });
if (isHttps) {
await letsEncrypt({ domain, id });
}
await setWwwRedirection(fqdn);
await reloadHaproxy(destinationDocker.engine);
// if (isHttps) {
// await letsEncrypt({ domain, id });
// }
// await setWwwRedirection(fqdn);
// await reloadHaproxy(destinationDocker.engine);
return {
status: 200
};

View File

@@ -84,14 +84,14 @@ export const post: RequestHandler = async (event) => {
try {
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
await checkProxyConfigurations();
await configureSimpleServiceProxyOn({ id, domain, port: 8080 });
// await checkProxyConfigurations();
// await configureSimpleServiceProxyOn({ id, domain, port: 8080 });
if (isHttps) {
await letsEncrypt({ domain, id });
}
await setWwwRedirection(fqdn);
await reloadHaproxy(destinationDocker.engine);
// if (isHttps) {
// await letsEncrypt({ domain, id });
// }
// await setWwwRedirection(fqdn);
// await reloadHaproxy(destinationDocker.engine);
return {
status: 200
};

View File

@@ -121,14 +121,14 @@ export const post: RequestHandler = async (event) => {
try {
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
await checkProxyConfigurations();
await configureSimpleServiceProxyOn({ id, domain, port: 80 });
// await checkProxyConfigurations();
// await configureSimpleServiceProxyOn({ id, domain, port: 80 });
if (isHttps) {
await letsEncrypt({ domain, id });
}
await setWwwRedirection(fqdn);
await reloadHaproxy(destinationDocker.engine);
// if (isHttps) {
// await letsEncrypt({ domain, id });
// }
// await setWwwRedirection(fqdn);
// await reloadHaproxy(destinationDocker.engine);
return {
status: 200
};