This commit is contained in:
Andras Bacsai 2022-10-21 22:34:27 +02:00
parent a267ee40d2
commit 17badf95dc
2 changed files with 14 additions and 9 deletions

View File

@ -137,6 +137,7 @@ export async function parseAndFindServiceTemplates(service: any, workdir?: strin
const extras = variable?.extras
if (envValue.startsWith('$$config') || extras?.isVisibleOnUI) {
if (envValue.startsWith('$$config_coolify')) {
continue
console.log({ envValue, envKey })
}
parsedTemplate[realKey].environment.push(
@ -180,6 +181,9 @@ export async function parseAndFindServiceTemplates(service: any, workdir?: strin
if (service.serviceSetting.length > 0) {
for (const setting of service.serviceSetting) {
const { value, variableName } = setting
if (variableName.startsWith('$$config_coolify')) {
continue;
}
if (service.fqdn && value === '$$generate_fqdn') {
strParsedTemplate = strParsedTemplate.replaceAll(variableName, service.fqdn)
} else if (service.fqdn && value === '$$generate_domain') {

View File

@ -54,7 +54,9 @@
let nonWWWDomain = service.fqdn && getDomain(service.fqdn).replace(/^www\./, '');
let isNonWWWDomainOK = false;
let isWWWDomainOK = false;
let secondaryFQDNs = service.serviceSetting.filter((setting) =>
setting.name.startsWith('COOLIFY_FQDN')
);
async function isDNSValid(domain: any, isWWW: any) {
try {
await get(`/services/${id}/check?domain=${domain}`);
@ -308,14 +310,13 @@
required
/>
</div>
{#each Object.keys(template) as oneService}
{#each template[oneService].environment.filter( (a) => a.name.startsWith('COOLIFY_FQDN_') ) as variable}
{#each secondaryFQDNs as fqdn}
{JSON.stringify(fqdn)}
<div class="grid grid-cols-2 items-center">
<label class="h-10" for={variable.name}>{variable.label || variable.name}</label>
<input class="w-full" name={variable.name} id={variable.name} value={variable.value} />
<label class="h-10" for={fqdn.name}>{fqdn.label || fqdn.name}</label>
<input class="w-full" name={fqdn.name} id={fqdn.name} value={fqdn.value} />
</div>
{/each}
{/each}
</div>
{#if forceSave}
<div class="flex-col space-y-2 pt-4 text-center">
@ -399,7 +400,7 @@
</div>
<div class="grid grid-flow-row gap-2 px-4">
{#if template[oneService].environment.length > 0}
{#each template[oneService].environment.filter((a) => !a.name.startsWith('COOLIFY_FQDN_')) as variable}
{#each template[oneService].environment as variable}
<div class="grid grid-cols-2 items-center gap-2">
<label class="h-10" for={variable.name}>{variable.label || variable.name}</label>
{#if variable.defaultValue === '$$generate_fqdn'}