This commit is contained in:
Andras Bacsai
2022-11-02 21:31:16 +01:00
parent a22f26c4c8
commit 845c40d23c
5 changed files with 13 additions and 10 deletions

View File

@@ -217,9 +217,6 @@ export async function parseAndFindServiceTemplates(service: any, workdir?: strin
for (const setting of service.serviceSetting) {
const { value, variableName } = setting
const regex = new RegExp(`\\$\\$config_${variableName.replace('$$config_','')}\\"`, 'gi')
if (variableName.startsWith('$$config_coolify')) {
continue;
}
if (value === '$$generate_fqdn') {
strParsedTemplate = strParsedTemplate.replaceAll(regex, service.fqdn + "\"" || '' + "\"")
} else if (value === '$$generate_domain') {
@@ -323,7 +320,7 @@ export async function saveServiceType(request: FastifyRequest<SaveServiceType>,
}
}
if (variable.id.startsWith('$$config_') || variable.id.startsWith('$$coolify_fqdn_')) {
if (variable.id.startsWith('$$config_')) {
const found = await prisma.serviceSetting.findFirst({ where: { name: variable.name, serviceId: id } })
if (!found) {
await prisma.serviceSetting.create({
@@ -483,7 +480,7 @@ export async function checkService(request: FastifyRequest<CheckService>) {
const { id } = request.params;
let { fqdn, exposePort, forceSave, dualCerts, otherFqdn = false } = request.body;
const domainsList = await prisma.serviceSetting.findMany({ where: { variableName: { startsWith: '$$coolify_fqdn' } } })
const domainsList = await prisma.serviceSetting.findMany({ where: { variableName: { startsWith: '$$config_coolify_fqdn' } } })
if (fqdn) fqdn = fqdn.toLowerCase();
if (exposePort) exposePort = Number(exposePort);