updates
This commit is contained in:
@@ -1892,8 +1892,8 @@
|
|||||||
- '9001'
|
- '9001'
|
||||||
proxy:
|
proxy:
|
||||||
- port: '9000'
|
- port: '9000'
|
||||||
- port: '9001'
|
|
||||||
domain: $$coolify_fqdn_minio_console
|
domain: $$coolify_fqdn_minio_console
|
||||||
|
- port: '9001'
|
||||||
variables:
|
variables:
|
||||||
- id: $$coolify_fqdn_minio_console
|
- id: $$coolify_fqdn_minio_console
|
||||||
name: MINIO_SERVER_URL
|
name: MINIO_SERVER_URL
|
||||||
|
@@ -41,10 +41,14 @@ export async function cleanupManually(request: FastifyRequest) {
|
|||||||
export async function refreshTemplates() {
|
export async function refreshTemplates() {
|
||||||
try {
|
try {
|
||||||
const { default: got } = await import('got')
|
const { default: got } = await import('got')
|
||||||
let templates = {}
|
|
||||||
try {
|
try {
|
||||||
const response = await got.get('https://get.coollabs.io/coolify/service-templates.yaml').text()
|
if (isDev) {
|
||||||
templates = yaml.load(response)
|
const response = await fs.readFile('./devTemplates.yaml', 'utf8')
|
||||||
|
await fs.writeFile('./template.json', JSON.stringify(yaml.load(response), null, 2))
|
||||||
|
} else {
|
||||||
|
const response = await got.get('https://get.coollabs.io/coolify/service-templates.yaml').text()
|
||||||
|
await fs.writeFile('/app/template.json', JSON.stringify(yaml.load(response), null, 2))
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw {
|
throw {
|
||||||
status: 500,
|
status: 500,
|
||||||
@@ -52,11 +56,6 @@ export async function refreshTemplates() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isDev) {
|
|
||||||
await fs.writeFile('./template.json', JSON.stringify(templates, null, 2))
|
|
||||||
} else {
|
|
||||||
await fs.writeFile('/app/template.json', JSON.stringify(templates, null, 2))
|
|
||||||
}
|
|
||||||
return {};
|
return {};
|
||||||
} catch ({ status, message }) {
|
} catch ({ status, message }) {
|
||||||
return errorHandler({ status, message });
|
return errorHandler({ status, message });
|
||||||
|
@@ -20,7 +20,7 @@ function generateLoadBalancerService(id, port) {
|
|||||||
function generateHttpRouter(id, nakedDomain, pathPrefix) {
|
function generateHttpRouter(id, nakedDomain, pathPrefix) {
|
||||||
return {
|
return {
|
||||||
entrypoints: ['web'],
|
entrypoints: ['web'],
|
||||||
rule: `(Host(\`${nakedDomain}\`) || Host(\`www.${nakedDomain}\`)) && PathPrefix(\`${pathPrefix}\`)`,
|
rule: `(Host(\`${nakedDomain}\`) || Host(\`www.${nakedDomain}\`))${pathPrefix ? `&& PathPrefix(\`${pathPrefix}\`)` : ''}`,
|
||||||
service: `${id}`,
|
service: `${id}`,
|
||||||
middlewares: []
|
middlewares: []
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,7 @@ function generateProtocolRedirectRouter(id, nakedDomain, pathPrefix, fromTo) {
|
|||||||
if (fromTo === 'https-to-http') {
|
if (fromTo === 'https-to-http') {
|
||||||
return {
|
return {
|
||||||
entrypoints: ['websecure'],
|
entrypoints: ['websecure'],
|
||||||
rule: `(Host(\`${nakedDomain}\`) || Host(\`www.${nakedDomain}\`)) && PathPrefix(\`${pathPrefix}\`)`,
|
rule: `(Host(\`${nakedDomain}\`) || Host(\`www.${nakedDomain}\`))${pathPrefix ? `&& PathPrefix(\`${pathPrefix}\`)` : ''}`,
|
||||||
service: `${id}`,
|
service: `${id}`,
|
||||||
tls: {
|
tls: {
|
||||||
domains: {
|
domains: {
|
||||||
@@ -41,7 +41,7 @@ function generateProtocolRedirectRouter(id, nakedDomain, pathPrefix, fromTo) {
|
|||||||
} else if (fromTo === 'http-to-https') {
|
} else if (fromTo === 'http-to-https') {
|
||||||
return {
|
return {
|
||||||
entrypoints: ['web'],
|
entrypoints: ['web'],
|
||||||
rule: `(Host(\`${nakedDomain}\`) || Host(\`www.${nakedDomain}\`)) && PathPrefix(\`${pathPrefix}\`)`,
|
rule: `(Host(\`${nakedDomain}\`) || Host(\`www.${nakedDomain}\`))${pathPrefix ? `&& PathPrefix(\`${pathPrefix}\`)` : ''}`,
|
||||||
service: `${id}`,
|
service: `${id}`,
|
||||||
middlewares: ['redirect-to-https']
|
middlewares: ['redirect-to-https']
|
||||||
};
|
};
|
||||||
@@ -409,7 +409,7 @@ export async function traefikConfiguration(request, reply) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const service of data.services) {
|
for (const service of data.services) {
|
||||||
let { id, fqdn, dualCerts, configuration: { port, pathPrefix = '/', domain: customDomain }, isCustomSSL = false } = service
|
let { id, fqdn, dualCerts, configuration: { port, pathPrefix, domain: customDomain }, isCustomSSL = false } = service
|
||||||
if (customDomain) {
|
if (customDomain) {
|
||||||
fqdn = customDomain
|
fqdn = customDomain
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user