fix(panel-access): correctly match reverse proxy container images
This commit is contained in:
1 parent
4507640e8f
commit
338e08753e
1 file changed
+6
-6
@@ -508,13 +508,13 @@ function emptyDockerProxyProbe(error: string | null): DockerProxyProbe {
|
||||
};
|
||||
}
|
||||
|
||||
function proxyMatchesContainer(type: PanelProxyType, name: string, image: string) {
|
||||
const haystack = `${name} ${image}`.toLowerCase();
|
||||
return type === "NGINX"
|
||||
? /(^|[/:_-])nginx(?:[/:_-]|$)/.test(haystack)
|
||||
export function proxyMatchesContainer(type: PanelProxyType, name: string, image: string) {
|
||||
const pattern = type === "NGINX"
|
||||
? /(^|[/:_-])nginx(?:[/:_-]|$)/
|
||||
: type === "CADDY"
|
||||
? /(^|[/:_-])caddy(?:[/:_-]|$)/.test(haystack)
|
||||
: /(^|[/:_-])traefik(?:[/:_-]|$)/.test(haystack);
|
||||
? /(^|[/:_-])caddy(?:[/:_-]|$)/
|
||||
: /(^|[/:_-])traefik(?:[/:_-]|$)/;
|
||||
return [name, image].some((value) => pattern.test(value.toLowerCase()));
|
||||
}
|
||||
|
||||
function proxyConfigMounts(type: PanelProxyType, mounts: Array<{ Destination?: string }>) {
|
||||
|
||||
Reference in new issue
Block a user