Merge pull request #452 from coollabsio/next

Fixes for v2.9.7
This commit is contained in:
Andras Bacsai 2022-06-09 14:01:20 +02:00 committed by GitHub
commit cf88885c94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,7 @@ import { checkContainer } from '$lib/haproxy';
import type { RequestHandler } from '@sveltejs/kit';
function configureMiddleware(
{ id, container, port, domain, nakedDomain, isHttps, isWWW, isDualCerts, scriptName },
{ id, container, port, domain, nakedDomain, isHttps, isWWW, isDualCerts, scriptName, type },
traefik
) {
if (isHttps) {
@ -125,7 +125,8 @@ function configureMiddleware(
}
}
}
if (scriptName !== 'plausible.js') {
if (type === 'plausibleanalytics' && scriptName !== 'plausible.js') {
if (!traefik.http.routers[`${id}`].middlewares.includes(`${id}-redir`)) {
traefik.http.routers[`${id}`].middlewares.push(`${id}-redir`);
}
@ -343,11 +344,6 @@ export const get: RequestHandler = async (event) => {
replacement: '/js/plausible.js'
}
};
if (traefik.http.routers[id].middlewares.length > 0) {
traefik.http.routers[id].middlewares.push(`${id}-redir`);
} else {
traefik.http.routers[id].middlewares = [`${id}-redir`];
}
}
}
for (const coolify of data.coolify) {