fixes
This commit is contained in:
parent
4b35db6291
commit
bdc62a007e
@ -2059,7 +2059,7 @@
|
|||||||
name: DATABASE_URL
|
name: DATABASE_URL
|
||||||
label: Database URL for PostgreSQL
|
label: Database URL for PostgreSQL
|
||||||
defaultValue: >-
|
defaultValue: >-
|
||||||
postgresql://$$config_postgres_user:$$secret_postgres_password@$$id-postgresql:5432/$$config_postgres_db
|
postgresql://$$config_postgres_user:$$secret_postgres_password@$$id-postgresql:5432/$$config_postgres_db?sslmode=disable
|
||||||
description: ''
|
description: ''
|
||||||
- id: $$secret_jwt_secret
|
- id: $$secret_jwt_secret
|
||||||
name: JWT_SECRET
|
name: JWT_SECRET
|
||||||
@ -2076,6 +2076,7 @@
|
|||||||
label: Mailgun API Key
|
label: Mailgun API Key
|
||||||
defaultValue: ''
|
defaultValue: ''
|
||||||
description: ''
|
description: ''
|
||||||
|
showOnConfiguration: true
|
||||||
- id: $$config_email_mailgun_region
|
- id: $$config_email_mailgun_region
|
||||||
name: EMAIL_MAILGUN_REGION
|
name: EMAIL_MAILGUN_REGION
|
||||||
label: Mailgun Region
|
label: Mailgun Region
|
||||||
@ -2106,6 +2107,7 @@
|
|||||||
label: SMTP Password
|
label: SMTP Password
|
||||||
defaultValue: ''
|
defaultValue: ''
|
||||||
description: ''
|
description: ''
|
||||||
|
showOnConfiguration: true
|
||||||
- id: $$config_email_smtp_enable_starttls
|
- id: $$config_email_smtp_enable_starttls
|
||||||
name: EMAIL_SMTP_ENABLE_STARTTLS
|
name: EMAIL_SMTP_ENABLE_STARTTLS
|
||||||
label: SMTP Enable StartTLS
|
label: SMTP Enable StartTLS
|
||||||
|
@ -47,7 +47,8 @@ export async function startService(request: FastifyRequest<ServiceStartStop>, fa
|
|||||||
if (arm) {
|
if (arm) {
|
||||||
if (template.services[s]?.environmentArm?.length > 0) {
|
if (template.services[s]?.environmentArm?.length > 0) {
|
||||||
for (const environment of template.services[s].environmentArm) {
|
for (const environment of template.services[s].environmentArm) {
|
||||||
const [env, value] = environment.split("=");
|
let [env, ...value] = environment.split("=");
|
||||||
|
value = value.join("=")
|
||||||
if (!value.startsWith('$$secret') && value !== '') {
|
if (!value.startsWith('$$secret') && value !== '') {
|
||||||
newEnvironments.push(`${env}=${value}`)
|
newEnvironments.push(`${env}=${value}`)
|
||||||
}
|
}
|
||||||
@ -56,7 +57,8 @@ export async function startService(request: FastifyRequest<ServiceStartStop>, fa
|
|||||||
} else {
|
} else {
|
||||||
if (template.services[s]?.environment?.length > 0) {
|
if (template.services[s]?.environment?.length > 0) {
|
||||||
for (const environment of template.services[s].environment) {
|
for (const environment of template.services[s].environment) {
|
||||||
const [env, value] = environment.split("=");
|
let [env, ...value] = environment.split("=");
|
||||||
|
value = value.join("=")
|
||||||
if (!value.startsWith('$$secret') && value !== '') {
|
if (!value.startsWith('$$secret') && value !== '') {
|
||||||
newEnvironments.push(`${env}=${value}`)
|
newEnvironments.push(`${env}=${value}`)
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,8 @@ export async function parseAndFindServiceTemplates(service: any, workdir?: strin
|
|||||||
}
|
}
|
||||||
if (value.environment?.length > 0) {
|
if (value.environment?.length > 0) {
|
||||||
for (const env of value.environment) {
|
for (const env of value.environment) {
|
||||||
const [envKey, envValue] = env.split('=')
|
let [envKey, ...envValue] = env.split('=')
|
||||||
|
envValue = envValue.join("=")
|
||||||
const variable = foundTemplate.variables.find(v => v.name === envKey) || foundTemplate.variables.find(v => v.id === envValue)
|
const variable = foundTemplate.variables.find(v => v.name === envKey) || foundTemplate.variables.find(v => v.id === envValue)
|
||||||
const id = variable.id.replaceAll('$$', '')
|
const id = variable.id.replaceAll('$$', '')
|
||||||
const label = variable?.label
|
const label = variable?.label
|
||||||
@ -495,6 +496,7 @@ export async function saveService(request: FastifyRequest<SaveService>, reply: F
|
|||||||
const foundTemplate = templates.find(t => fixType(t.type) === fixType(service.type))
|
const foundTemplate = templates.find(t => fixType(t.type) === fixType(service.type))
|
||||||
for (const setting of serviceSetting) {
|
for (const setting of serviceSetting) {
|
||||||
let { id: settingId, name, value, changed = false, isNew = false, variableName } = setting
|
let { id: settingId, name, value, changed = false, isNew = false, variableName } = setting
|
||||||
|
if (value) {
|
||||||
if (changed) {
|
if (changed) {
|
||||||
await prisma.serviceSetting.update({ where: { id: settingId }, data: { value } })
|
await prisma.serviceSetting.update({ where: { id: settingId }, data: { value } })
|
||||||
}
|
}
|
||||||
@ -505,6 +507,7 @@ export async function saveService(request: FastifyRequest<SaveService>, reply: F
|
|||||||
await prisma.serviceSetting.create({ data: { name, value, variableName, service: { connect: { id } } } })
|
await prisma.serviceSetting.create({ data: { name, value, variableName, service: { connect: { id } } } })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
await prisma.service.update({
|
await prisma.service.update({
|
||||||
where: { id }, data
|
where: { id }, data
|
||||||
});
|
});
|
||||||
@ -547,7 +550,6 @@ export async function saveServiceSecret(request: FastifyRequest<SaveServiceSecre
|
|||||||
try {
|
try {
|
||||||
const { id } = request.params
|
const { id } = request.params
|
||||||
let { name, value, isNew } = request.body
|
let { name, value, isNew } = request.body
|
||||||
|
|
||||||
if (isNew) {
|
if (isNew) {
|
||||||
const found = await prisma.serviceSecret.findFirst({ where: { name, serviceId: id } });
|
const found = await prisma.serviceSecret.findFirst({ where: { name, serviceId: id } });
|
||||||
if (found) {
|
if (found) {
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,8 @@
|
|||||||
import { dev } from '$app/env';
|
import { dev } from '$app/env';
|
||||||
import cuid from 'cuid';
|
import cuid from 'cuid';
|
||||||
import Cookies from 'js-cookie';
|
import Cookies from 'js-cookie';
|
||||||
|
import {getAPIUrl} from '$lib/api';
|
||||||
|
import {getDomain} from '$lib/common'
|
||||||
import { writable, readable, type Writable } from 'svelte/store';
|
import { writable, readable, type Writable } from 'svelte/store';
|
||||||
|
|
||||||
interface AppSession {
|
interface AppSession {
|
||||||
@ -174,7 +176,8 @@ export const connect = () => {
|
|||||||
if (token) {
|
if (token) {
|
||||||
let url = `wss://${window.location.hostname}/realtime`
|
let url = `wss://${window.location.hostname}/realtime`
|
||||||
if (dev) {
|
if (dev) {
|
||||||
url = "ws://localhost:3001/realtime"
|
const apiUrl = getDomain(getAPIUrl())
|
||||||
|
url = `ws://${apiUrl}/realtime`
|
||||||
}
|
}
|
||||||
const ws = new WebSocket(url);
|
const ws = new WebSocket(url);
|
||||||
ws.addEventListener("message", (message: any) => {
|
ws.addEventListener("message", (message: any) => {
|
||||||
|
@ -47,7 +47,7 @@ export async function saveForm(formData: any, service: any) {
|
|||||||
const baseCoolifySetting = ['name', 'fqdn', 'exposePort', 'version'];
|
const baseCoolifySetting = ['name', 'fqdn', 'exposePort', 'version'];
|
||||||
for (let field of formData) {
|
for (let field of formData) {
|
||||||
const [key, value] = field;
|
const [key, value] = field;
|
||||||
if (secrets.includes(key)) {
|
if (secrets.includes(key) && value) {
|
||||||
await post(`/services/${service.id}/secrets`, {
|
await post(`/services/${service.id}/secrets`, {
|
||||||
name: key,
|
name: key,
|
||||||
value,
|
value,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user