fix wh again

This commit is contained in:
Andras Bacsai 2022-11-03 13:50:04 +01:00
parent 0ecf86d8a3
commit 274d3fe679

View File

@ -120,7 +120,7 @@ async function applicationConfiguration(traefik: any, remoteId: string | null =
if (dualCerts) { if (dualCerts) {
traefik.http.routers[`${id}-${port || 'default'}-secure`] = { traefik.http.routers[`${id}-${port || 'default'}-secure`] = {
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: isCustomSSL ? true : { tls: isCustomSSL ? true : {
certresolver: 'letsencrypt' certresolver: 'letsencrypt'
@ -131,7 +131,7 @@ async function applicationConfiguration(traefik: any, remoteId: string | null =
if (isWWW) { if (isWWW) {
traefik.http.routers[`${id}-${port || 'default'}-secure-www`] = { traefik.http.routers[`${id}-${port || 'default'}-secure-www`] = {
entrypoints: ['websecure'], entrypoints: ['websecure'],
rule: `Host(\`www.${nakedDomain}\`) && PathPrefix(\`${pathPrefix}\`)`, rule: `Host(\`www.${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,
service: `${id}`, service: `${id}`,
tls: isCustomSSL ? true : { tls: isCustomSSL ? true : {
certresolver: 'letsencrypt' certresolver: 'letsencrypt'
@ -140,7 +140,7 @@ async function applicationConfiguration(traefik: any, remoteId: string | null =
}; };
traefik.http.routers[`${id}-${port || 'default'}-secure`] = { traefik.http.routers[`${id}-${port || 'default'}-secure`] = {
entrypoints: ['websecure'], entrypoints: ['websecure'],
rule: `Host(\`${nakedDomain}\`) && PathPrefix(\`${pathPrefix}\`)`, rule: `Host(\`${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,
service: `${id}`, service: `${id}`,
tls: { tls: {
domains: { domains: {
@ -153,7 +153,7 @@ async function applicationConfiguration(traefik: any, remoteId: string | null =
} else { } else {
traefik.http.routers[`${id}-${port || 'default'}-secure-www`] = { traefik.http.routers[`${id}-${port || 'default'}-secure-www`] = {
entrypoints: ['websecure'], entrypoints: ['websecure'],
rule: `Host(\`www.${nakedDomain}\`) && PathPrefix(\`${pathPrefix}\`)`, rule: `Host(\`www.${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,
service: `${id}`, service: `${id}`,
tls: { tls: {
domains: { domains: {
@ -164,7 +164,7 @@ async function applicationConfiguration(traefik: any, remoteId: string | null =
}; };
traefik.http.routers[`${id}-${port || 'default'}-secure`] = { traefik.http.routers[`${id}-${port || 'default'}-secure`] = {
entrypoints: ['websecure'], entrypoints: ['websecure'],
rule: `Host(\`${domain}\`) && PathPrefix(\`${pathPrefix}\`)`, rule: `Host(\`${domain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,
service: `${id}`, service: `${id}`,
tls: isCustomSSL ? true : { tls: isCustomSSL ? true : {
certresolver: 'letsencrypt' certresolver: 'letsencrypt'
@ -304,7 +304,7 @@ async function serviceConfiguration(traefik: any, remoteId: string | null = null
if (dualCerts) { if (dualCerts) {
traefik.http.routers[`${id}-${port || 'default'}-secure`] = { traefik.http.routers[`${id}-${port || 'default'}-secure`] = {
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: isCustomSSL ? true : { tls: isCustomSSL ? true : {
certresolver: 'letsencrypt' certresolver: 'letsencrypt'
@ -315,7 +315,7 @@ async function serviceConfiguration(traefik: any, remoteId: string | null = null
if (isWWW) { if (isWWW) {
traefik.http.routers[`${id}-${port || 'default'}-secure-www`] = { traefik.http.routers[`${id}-${port || 'default'}-secure-www`] = {
entrypoints: ['websecure'], entrypoints: ['websecure'],
rule: `Host(\`www.${nakedDomain}\`) && PathPrefix(\`${pathPrefix}\`)`, rule: `Host(\`www.${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,
service: `${id}`, service: `${id}`,
tls: isCustomSSL ? true : { tls: isCustomSSL ? true : {
certresolver: 'letsencrypt' certresolver: 'letsencrypt'
@ -324,7 +324,7 @@ async function serviceConfiguration(traefik: any, remoteId: string | null = null
}; };
traefik.http.routers[`${id}-${port || 'default'}-secure`] = { traefik.http.routers[`${id}-${port || 'default'}-secure`] = {
entrypoints: ['websecure'], entrypoints: ['websecure'],
rule: `Host(\`${nakedDomain}\`) && PathPrefix(\`${pathPrefix}\`)`, rule: `Host(\`${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,
service: `${id}`, service: `${id}`,
tls: { tls: {
domains: { domains: {
@ -337,7 +337,7 @@ async function serviceConfiguration(traefik: any, remoteId: string | null = null
} else { } else {
traefik.http.routers[`${id}-${port || 'default'}-secure-www`] = { traefik.http.routers[`${id}-${port || 'default'}-secure-www`] = {
entrypoints: ['websecure'], entrypoints: ['websecure'],
rule: `Host(\`www.${nakedDomain}\`) && PathPrefix(\`${pathPrefix}\`)`, rule: `Host(\`www.${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,
service: `${id}`, service: `${id}`,
tls: { tls: {
domains: { domains: {
@ -348,7 +348,7 @@ async function serviceConfiguration(traefik: any, remoteId: string | null = null
}; };
traefik.http.routers[`${id}-${port || 'default'}-secure`] = { traefik.http.routers[`${id}-${port || 'default'}-secure`] = {
entrypoints: ['websecure'], entrypoints: ['websecure'],
rule: `Host(\`${domain}\`) && PathPrefix(\`${pathPrefix}\`)`, rule: `Host(\`${domain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,
service: `${id}`, service: `${id}`,
tls: isCustomSSL ? true : { tls: isCustomSSL ? true : {
certresolver: 'letsencrypt' certresolver: 'letsencrypt'
@ -407,7 +407,7 @@ async function coolifyConfiguration(traefik: any) {
if (dualCerts) { if (dualCerts) {
traefik.http.routers[`${id}-${port || 'default'}-secure`] = { traefik.http.routers[`${id}-${port || 'default'}-secure`] = {
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: isCustomSSL ? true : { tls: isCustomSSL ? true : {
certresolver: 'letsencrypt' certresolver: 'letsencrypt'
@ -418,7 +418,7 @@ async function coolifyConfiguration(traefik: any) {
if (isWWW) { if (isWWW) {
traefik.http.routers[`${id}-${port || 'default'}-secure-www`] = { traefik.http.routers[`${id}-${port || 'default'}-secure-www`] = {
entrypoints: ['websecure'], entrypoints: ['websecure'],
rule: `Host(\`www.${nakedDomain}\`) && PathPrefix(\`${pathPrefix}\`)`, rule: `Host(\`www.${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,
service: `${id}`, service: `${id}`,
tls: isCustomSSL ? true : { tls: isCustomSSL ? true : {
certresolver: 'letsencrypt' certresolver: 'letsencrypt'
@ -427,7 +427,7 @@ async function coolifyConfiguration(traefik: any) {
}; };
traefik.http.routers[`${id}-${port || 'default'}-secure`] = { traefik.http.routers[`${id}-${port || 'default'}-secure`] = {
entrypoints: ['websecure'], entrypoints: ['websecure'],
rule: `Host(\`${nakedDomain}\`) && PathPrefix(\`${pathPrefix}\`)`, rule: `Host(\`${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,
service: `${id}`, service: `${id}`,
tls: { tls: {
domains: { domains: {
@ -440,7 +440,7 @@ async function coolifyConfiguration(traefik: any) {
} else { } else {
traefik.http.routers[`${id}-${port || 'default'}-secure-www`] = { traefik.http.routers[`${id}-${port || 'default'}-secure-www`] = {
entrypoints: ['websecure'], entrypoints: ['websecure'],
rule: `Host(\`www.${nakedDomain}\`) && PathPrefix(\`${pathPrefix}\`)`, rule: `Host(\`www.${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,
service: `${id}`, service: `${id}`,
tls: { tls: {
domains: { domains: {
@ -451,7 +451,7 @@ async function coolifyConfiguration(traefik: any) {
}; };
traefik.http.routers[`${id}-${port || 'default'}-secure`] = { traefik.http.routers[`${id}-${port || 'default'}-secure`] = {
entrypoints: ['websecure'], entrypoints: ['websecure'],
rule: `Host(\`${domain}\`) && PathPrefix(\`${pathPrefix}\`)`, rule: `Host(\`${domain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,
service: `${id}`, service: `${id}`,
tls: isCustomSSL ? true : { tls: isCustomSSL ? true : {
certresolver: 'letsencrypt' certresolver: 'letsencrypt'
@ -492,7 +492,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(\`${pathPrefix}\`)` : ''}`, rule: `(Host(\`${nakedDomain}\`) || Host(\`www.${nakedDomain}\`))${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,
service: `${id}`, service: `${id}`,
middlewares: [] middlewares: []
} }
@ -501,7 +501,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(\`${pathPrefix}\`)` : ''}`, rule: `(Host(\`${nakedDomain}\`) || Host(\`www.${nakedDomain}\`))${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,
service: `${id}`, service: `${id}`,
tls: { tls: {
domains: { domains: {
@ -513,7 +513,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(\`${pathPrefix}\`)` : ''}`, rule: `(Host(\`${nakedDomain}\`) || Host(\`www.${nakedDomain}\`))${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,
service: `${id}`, service: `${id}`,
middlewares: ['redirect-to-https'] middlewares: ['redirect-to-https']
}; };