stop minio proxy on restart

This commit is contained in:
Andras Bacsai 2022-11-04 21:07:19 +01:00
parent 1ece37ec3c
commit 60e7922734
4 changed files with 16 additions and 15 deletions

View File

@ -389,17 +389,17 @@ async function checkProxies() {
} }
// HTTP Proxies // HTTP Proxies
// const minioInstances = await prisma.minio.findMany({ const minioInstances = await prisma.minio.findMany({
// where: { publicPort: { not: null } }, where: { publicPort: { not: null } },
// include: { service: { include: { destinationDocker: true } } } include: { service: { include: { destinationDocker: true } } }
// }); });
// for (const minio of minioInstances) { for (const minio of minioInstances) {
// const { service, publicPort } = minio; const { service, publicPort } = minio;
// const { destinationDockerId, destinationDocker, id } = service; const { destinationDockerId, destinationDocker, id } = service;
// if (destinationDockerId && destinationDocker.isCoolifyProxyUsed) { if (destinationDockerId && destinationDocker.isCoolifyProxyUsed) {
// await startTraefikTCPProxy(destinationDocker, id, publicPort, 9000); await startTraefikTCPProxy(destinationDocker, id, publicPort, 9000);
// } }
// } }
} catch (error) { } catch (error) {
} }

View File

@ -356,7 +356,6 @@ async function vscodeserver(service: any, template: any) {
} }
async function minio(service: any, template: any) { async function minio(service: any, template: any) {
const { rootUser, rootUserPassword, apiFqdn } = service.minio const { rootUser, rootUserPassword, apiFqdn } = service.minio
console.log(apiFqdn)
const secrets = [ const secrets = [
`MINIO_ROOT_PASSWORD@@@${rootUserPassword}`, `MINIO_ROOT_PASSWORD@@@${rootUserPassword}`,
] ]
@ -432,7 +431,6 @@ async function plausibleAnalytics(service: any, template: any) {
async function migrateSettings(settings: any[], service: any, template: any) { async function migrateSettings(settings: any[], service: any, template: any) {
for (const setting of settings) { for (const setting of settings) {
if (!setting) continue; if (!setting) continue;
console.log(setting)
let [name, value] = setting.split('@@@') let [name, value] = setting.split('@@@')
let minio = name let minio = name
if (name === 'MINIO_SERVER_URL') { if (name === 'MINIO_SERVER_URL') {

View File

@ -2,7 +2,7 @@ import type { FastifyReply, FastifyRequest } from 'fastify';
import fs from 'fs/promises'; import fs from 'fs/promises';
import yaml from 'js-yaml'; import yaml from 'js-yaml';
import path from 'path'; import path from 'path';
import { asyncSleep, ComposeFile, createDirectories, decrypt, defaultComposeConfiguration, errorHandler, executeDockerCmd, getServiceFromDB, isARM, makeLabelForServices, persistentVolumes, prisma } from '../common'; import { asyncSleep, ComposeFile, createDirectories, decrypt, defaultComposeConfiguration, errorHandler, executeDockerCmd, getServiceFromDB, isARM, makeLabelForServices, persistentVolumes, prisma, stopTcpHttpProxy } from '../common';
import { parseAndFindServiceTemplates } from '../../routes/api/v1/services/handlers'; import { parseAndFindServiceTemplates } from '../../routes/api/v1/services/handlers';
import { ServiceStartStop } from '../../routes/api/v1/services/types'; import { ServiceStartStop } from '../../routes/api/v1/services/types';
@ -139,6 +139,9 @@ export async function startService(request: FastifyRequest<ServiceStartStop>, fa
const composeFileDestination = `${workdir}/docker-compose.yaml`; const composeFileDestination = `${workdir}/docker-compose.yaml`;
await fs.writeFile(composeFileDestination, yaml.dump(composeFile)); await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
await startServiceContainers(fastify, id, teamId, destinationDocker.id, composeFileDestination) await startServiceContainers(fastify, id, teamId, destinationDocker.id, composeFileDestination)
if (service.type === 'minio') {
await stopTcpHttpProxy(id, destinationDocker, 9000);
}
return {} return {}
} catch ({ status, message }) { } catch ({ status, message }) {
return errorHandler({ status, message }) return errorHandler({ status, message })

File diff suppressed because one or more lines are too long