This PR contains the following updates: | Package | Update | Change | |---|---|---| | [traefik](https://github.com/containous/traefik) | patch | `v3.7.5` → `v3.7.6` | --- > ⚠️ **Warning** > > Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/12) for more information. --- ### Release Notes <details> <summary>containous/traefik (traefik)</summary> ### [`v3.7.6`](https://github.com/containous/traefik/blob/HEAD/CHANGELOG.md#v376-2026-06-30) [Compare Source](https://github.com/containous/traefik/compare/v3.7.6...v3.7.6) [All Commits](https://github.com/traefik/traefik/compare/v3.7.5...v3.7.6) **Bug fixes:** - **\[acme, logs]** Bump github.com/go-acme/lego/v5 ([#​13154](https://github.com/traefik/traefik/pull/13154) [@​ldez](https://github.com/ldez)) - **\[acme]** Bump github.com/go-acme/lego/v5 ([#​13359](https://github.com/traefik/traefik/pull/13359) [@​juliens](https://github.com/juliens)) - **\[k8s, k8s/ingress-nginx]** Fix ingress-nginx ssl passthrough status updates ([#​13212](https://github.com/traefik/traefik/pull/13212) [@​nickmnt](https://github.com/nickmnt)) - **\[k8s/gatewayapi]** Add missing Gateway API features in conformance tests ([#​13356](https://github.com/traefik/traefik/pull/13356) [@​AnatoleLucet](https://github.com/AnatoleLucet)) - **\[k8s/gatewayapi]** Avoid collisions for Gateway API services names ([#​13367](https://github.com/traefik/traefik/pull/13367) [@​rtribotte](https://github.com/rtribotte)) - **\[k8s/gatewayapi]** Ignore other gateways parentRefs and update route parent statuses only for managed gateways ([#​13397](https://github.com/traefik/traefik/pull/13397) [@​rtribotte](https://github.com/rtribotte)) - **\[k8s/ingress-nginx]** Configure retry according to buffering configuration ([#​13039](https://github.com/traefik/traefik/pull/13039) [@​rtribotte](https://github.com/rtribotte)) - **\[k8s/ingress-nginx]** Fix force-ssl-redirect routing 418 when TLS is terminated upstream ([#​13386](https://github.com/traefik/traefik/pull/13386) [@​carloslima](https://github.com/carloslima)) - **\[k8s]** Detect EndpointSlice condition changes ([#​13405](https://github.com/traefik/traefik/pull/13405) [@​kevinpollet](https://github.com/kevinpollet)) - **\[k8s]** Index Kubernetes EndpointSlice by service name ([#​13395](https://github.com/traefik/traefik/pull/13395) [@​kevinpollet](https://github.com/kevinpollet)) - **\[k8s]** Sort endpointslices to keep backend IPs consistent across rebuilds ([#​13406](https://github.com/traefik/traefik/pull/13406) [@​kevinpollet](https://github.com/kevinpollet)) - **\[kv]** Bump kvtools/redis to v1.2.1 ([#​13403](https://github.com/traefik/traefik/pull/13403) [@​ldez](https://github.com/ldez)) - **\[middleware, authentication]** Fix x-forwarded-port in forward-auth ([#​13344](https://github.com/traefik/traefik/pull/13344) [@​juliens](https://github.com/juliens)) - **\[middleware, k8s/gatewayapi]** Fix Gateway API redirect missing statuses ([#​13360](https://github.com/traefik/traefik/pull/13360) [@​AnatoleLucet](https://github.com/AnatoleLucet)) - **\[middleware, k8s/gatewayapi]** Fix Host header not being modified by RequestHeaderModifier ([#​12805](https://github.com/traefik/traefik/pull/12805) [@​mihuross](https://github.com/mihuross)) - **\[middleware, k8s/gatewayapi]** Fix request scheme derivation when Gateway API RequestRedirect omits scheme ([#​13347](https://github.com/traefik/traefik/pull/13347) [@​gndz07](https://github.com/gndz07)) - **\[middleware]** Fix CORS Max-Age set to 0 by default ([#​13371](https://github.com/traefik/traefik/pull/13371) [@​AnatoleLucet](https://github.com/AnatoleLucet)) - **\[middleware]** Fix CORS wildcard when allow-credentials is true ([#​13368](https://github.com/traefik/traefik/pull/13368) [@​AnatoleLucet](https://github.com/AnatoleLucet)) - **\[server]** Add an option to remove request headers with underscores ([#​13262](https://github.com/traefik/traefik/pull/13262) [@​youkoulayley](https://github.com/youkoulayley)) - **\[server]** Configurable max request header size ([#​13353](https://github.com/traefik/traefik/pull/13353) [@​juliens](https://github.com/juliens)) - **\[tls]** Fix nondeterministic TLS certificate selection on shared SAN ([#​13348](https://github.com/traefik/traefik/pull/13348) [@​rtribotte](https://github.com/rtribotte)) - **\[webui]** Bump axios to v1.18.0 ([#​13380](https://github.com/traefik/traefik/pull/13380) [@​gndz07](https://github.com/gndz07)) - **\[websocket]** Fix connection upgrades when backend server is using h2c scheme ([#​12967](https://github.com/traefik/traefik/pull/12967) [@​stffabi](https://github.com/stffabi)) **Documentation:** - **\[k8s/crd]** Fix broken CRD reference links in IngressRoute page ([#​13375](https://github.com/traefik/traefik/pull/13375) [@​s3onghyun](https://github.com/s3onghyun)) - **\[k8s/gatewayapi]** Remove experimental note for Gateway API/TLSRoute documentation ([#​13392](https://github.com/traefik/traefik/pull/13392) [@​jnoordsij](https://github.com/jnoordsij)) - **\[k8s/ingress-nginx]** Add Kubernetes Ingress NGINX to the providers list ([#​13372](https://github.com/traefik/traefik/pull/13372) [@​nmengin](https://github.com/nmengin)) - **\[k8s]** Align Helm chart documented values with chart v41 ([#​13366](https://github.com/traefik/traefik/pull/13366) [@​mloiseleur](https://github.com/mloiseleur)) - **\[middleware, authentication, k8s/ingress-nginx]** Clarify intentional auth-response-headers gating and absence of stripping incoming X-Forwarded-\* headers ([#​13342](https://github.com/traefik/traefik/pull/13342) [@​rtribotte](https://github.com/rtribotte)) - **\[middleware]** Clarify entryPoint middleware reference format ([#​13364](https://github.com/traefik/traefik/pull/13364) [@​mloiseleur](https://github.com/mloiseleur)) - **\[security]** Add HTTP/2 header memory exhaustion security documentation ([#​13381](https://github.com/traefik/traefik/pull/13381) [@​emilevauge](https://github.com/emilevauge)) - Adds documentations on maxHeaderBytes ([#​13363](https://github.com/traefik/traefik/pull/13363) [@​juliens](https://github.com/juliens)) - Fix inaccuracies in reference documentation ([#​13304](https://github.com/traefik/traefik/pull/13304) [@​sheddy-traefik](https://github.com/sheddy-traefik)) ### [`v3.7.6`](https://github.com/containous/traefik/blob/HEAD/CHANGELOG.md#v376-2026-06-30) [Compare Source](https://github.com/containous/traefik/compare/v3.7.5...v3.7.6) [All Commits](https://github.com/traefik/traefik/compare/v3.7.5...v3.7.6) **Bug fixes:** - **\[acme, logs]** Bump github.com/go-acme/lego/v5 ([#​13154](https://github.com/traefik/traefik/pull/13154) [@​ldez](https://github.com/ldez)) - **\[acme]** Bump github.com/go-acme/lego/v5 ([#​13359](https://github.com/traefik/traefik/pull/13359) [@​juliens](https://github.com/juliens)) - **\[k8s, k8s/ingress-nginx]** Fix ingress-nginx ssl passthrough status updates ([#​13212](https://github.com/traefik/traefik/pull/13212) [@​nickmnt](https://github.com/nickmnt)) - **\[k8s/gatewayapi]** Add missing Gateway API features in conformance tests ([#​13356](https://github.com/traefik/traefik/pull/13356) [@​AnatoleLucet](https://github.com/AnatoleLucet)) - **\[k8s/gatewayapi]** Avoid collisions for Gateway API services names ([#​13367](https://github.com/traefik/traefik/pull/13367) [@​rtribotte](https://github.com/rtribotte)) - **\[k8s/gatewayapi]** Ignore other gateways parentRefs and update route parent statuses only for managed gateways ([#​13397](https://github.com/traefik/traefik/pull/13397) [@​rtribotte](https://github.com/rtribotte)) - **\[k8s/ingress-nginx]** Configure retry according to buffering configuration ([#​13039](https://github.com/traefik/traefik/pull/13039) [@​rtribotte](https://github.com/rtribotte)) - **\[k8s/ingress-nginx]** Fix force-ssl-redirect routing 418 when TLS is terminated upstream ([#​13386](https://github.com/traefik/traefik/pull/13386) [@​carloslima](https://github.com/carloslima)) - **\[k8s]** Detect EndpointSlice condition changes ([#​13405](https://github.com/traefik/traefik/pull/13405) [@​kevinpollet](https://github.com/kevinpollet)) - **\[k8s]** Index Kubernetes EndpointSlice by service name ([#​13395](https://github.com/traefik/traefik/pull/13395) [@​kevinpollet](https://github.com/kevinpollet)) - **\[k8s]** Sort endpointslices to keep backend IPs consistent across rebuilds ([#​13406](https://github.com/traefik/traefik/pull/13406) [@​kevinpollet](https://github.com/kevinpollet)) - **\[kv]** Bump kvtools/redis to v1.2.1 ([#​13403](https://github.com/traefik/traefik/pull/13403) [@​ldez](https://github.com/ldez)) - **\[middleware, authentication]** Fix x-forwarded-port in forward-auth ([#​13344](https://github.com/traefik/traefik/pull/13344) [@​juliens](https://github.com/juliens)) - **\[middleware, k8s/gatewayapi]** Fix Gateway API redirect missing statuses ([#​13360](https://github.com/traefik/traefik/pull/13360) [@​AnatoleLucet](https://github.com/AnatoleLucet)) - **\[middleware, k8s/gatewayapi]** Fix Host header not being modified by RequestHeaderModifier ([#​12805](https://github.com/traefik/traefik/pull/12805) [@​mihuross](https://github.com/mihuross)) - **\[middleware, k8s/gatewayapi]** Fix request scheme derivation when Gateway API RequestRedirect omits scheme ([#​13347](https://github.com/traefik/traefik/pull/13347) [@​gndz07](https://github.com/gndz07)) - **\[middleware]** Fix CORS Max-Age set to 0 by default ([#​13371](https://github.com/traefik/traefik/pull/13371) [@​AnatoleLucet](https://github.com/AnatoleLucet)) - **\[middleware]** Fix CORS wildcard when allow-credentials is true ([#​13368](https://github.com/traefik/traefik/pull/13368) [@​AnatoleLucet](https://github.com/AnatoleLucet)) - **\[server]** Add an option to remove request headers with underscores ([#​13262](https://github.com/traefik/traefik/pull/13262) [@​youkoulayley](https://github.com/youkoulayley)) - **\[server]** Configurable max request header size ([#​13353](https://github.com/traefik/traefik/pull/13353) [@​juliens](https://github.com/juliens)) - **\[tls]** Fix nondeterministic TLS certificate selection on shared SAN ([#​13348](https://github.com/traefik/traefik/pull/13348) [@​rtribotte](https://github.com/rtribotte)) - **\[webui]** Bump axios to v1.18.0 ([#​13380](https://github.com/traefik/traefik/pull/13380) [@​gndz07](https://github.com/gndz07)) - **\[websocket]** Fix connection upgrades when backend server is using h2c scheme ([#​12967](https://github.com/traefik/traefik/pull/12967) [@​stffabi](https://github.com/stffabi)) **Documentation:** - **\[k8s/crd]** Fix broken CRD reference links in IngressRoute page ([#​13375](https://github.com/traefik/traefik/pull/13375) [@​s3onghyun](https://github.com/s3onghyun)) - **\[k8s/gatewayapi]** Remove experimental note for Gateway API/TLSRoute documentation ([#​13392](https://github.com/traefik/traefik/pull/13392) [@​jnoordsij](https://github.com/jnoordsij)) - **\[k8s/ingress-nginx]** Add Kubernetes Ingress NGINX to the providers list ([#​13372](https://github.com/traefik/traefik/pull/13372) [@​nmengin](https://github.com/nmengin)) - **\[k8s]** Align Helm chart documented values with chart v41 ([#​13366](https://github.com/traefik/traefik/pull/13366) [@​mloiseleur](https://github.com/mloiseleur)) - **\[middleware, authentication, k8s/ingress-nginx]** Clarify intentional auth-response-headers gating and absence of stripping incoming X-Forwarded-\* headers ([#​13342](https://github.com/traefik/traefik/pull/13342) [@​rtribotte](https://github.com/rtribotte)) - **\[middleware]** Clarify entryPoint middleware reference format ([#​13364](https://github.com/traefik/traefik/pull/13364) [@​mloiseleur](https://github.com/mloiseleur)) - **\[security]** Add HTTP/2 header memory exhaustion security documentation ([#​13381](https://github.com/traefik/traefik/pull/13381) [@​emilevauge](https://github.com/emilevauge)) - Adds documentations on maxHeaderBytes ([#​13363](https://github.com/traefik/traefik/pull/13363) [@​juliens](https://github.com/juliens)) - Fix inaccuracies in reference documentation ([#​13304](https://github.com/traefik/traefik/pull/13304) [@​sheddy-traefik](https://github.com/sheddy-traefik)) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNTAuMSIsInVwZGF0ZWRJblZlciI6IjQzLjE1MC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Reviewed-on: #16 Co-authored-by: Renovate Bot <renovate@jfreudenberger.de> Co-committed-by: Renovate Bot <renovate@jfreudenberger.de>
221 lines
9.4 KiB
Nix
221 lines
9.4 KiB
Nix
{
|
|
pkgs,
|
|
config,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
|
|
cfg = config.services.traefik-docker;
|
|
|
|
mapOidcClientNameToEnv = stringToReplace: lib.replaceString "-" "_" (lib.toUpper stringToReplace);
|
|
|
|
traefik-mtls-config = (pkgs.formats.yaml { }).generate "traefik-mtls-config" {
|
|
tls.options.default.clientAuth = {
|
|
caFiles = "caFiles/root_ca.crt";
|
|
clientAuthType = "VerifyClientCertIfGiven";
|
|
};
|
|
};
|
|
|
|
in {
|
|
|
|
options.services.traefik-docker = {
|
|
enable = lib.mkEnableOption "traefik web server hosted as OCI container";
|
|
dashboardUrl = lib.mkOption {
|
|
description = "External URL the traefik dashboard will be reachable from, without protocol";
|
|
type = lib.types.str;
|
|
};
|
|
dnsSecrets = lib.mkOption {
|
|
description = "Secrets for DNS providers.";
|
|
type = lib.types.listOf lib.types.anything;
|
|
};
|
|
mTLSCaCertSecret = lib.mkOption {
|
|
description = "Agenix secret containing the CA file to verify client certificates against.";
|
|
};
|
|
oidcAuthProviderUrl = lib.mkOption {
|
|
description = "Provider URL of OIDC auth provider.";
|
|
type = lib.types.str;
|
|
};
|
|
oidcClients = lib.mkOption {
|
|
example = ''
|
|
immich = {
|
|
scopes = [
|
|
"openid"
|
|
"email"
|
|
"profile"
|
|
];
|
|
enableBypassUsingClientCertificate = true;
|
|
usePkce = true;
|
|
};
|
|
'';
|
|
description = "Attribute set of OIDC clients with their configurations.";
|
|
type = lib.types.attrsOf (
|
|
lib.types.submodule {
|
|
options = {
|
|
secret = lib.mkOption {
|
|
description = ''Agenix secret containing the following needed environment variables in dotenv notation:
|
|
- <clientName>_OIDC_AUTH_SECRET
|
|
- <clientName>_OIDC_AUTH_PROVIDER_CLIENT_ID
|
|
- <clientName>_OIDC_CLIENT_SECRET
|
|
'';
|
|
};
|
|
scopes = lib.mkOption {
|
|
default = [ "openid" ];
|
|
example = [ "openid" "email" "profile" "groups" ];
|
|
description = "OIDC scopes to request from auth provider.";
|
|
type = lib.types.listOf lib.types.str;
|
|
};
|
|
usePkce = lib.mkOption {
|
|
default = true;
|
|
description = "Whether to enable PKCE for this provider.";
|
|
type = lib.types.bool;
|
|
};
|
|
enableBypassUsingClientCertificate = lib.mkOption {
|
|
default = false;
|
|
description = "Whether to allow bypassing OIDC protection when a verified client certificate is presented.";
|
|
type = lib.types.bool;
|
|
};
|
|
useClaimsFromUserInfo = lib.mkOption {
|
|
default = false;
|
|
description = "When enabled, an additional request to the provider's userinfo_endpoint is made to validate the token and to retrieve additional claims. The userinfo claims are merged directly into the token claims, with userinfo values overriding token values for non-security-critical claims.";
|
|
type = lib.types.bool;
|
|
};
|
|
headers = lib.mkOption {
|
|
default = [];
|
|
description = "Headers to be added to the upstream request. Templating is possible. Documentation can be found here: https://traefik-oidc-auth.sevensolutions.cc/docs/getting-started/middleware-configuration";
|
|
type = lib.types.listOf (lib.types.submodule {
|
|
options = {
|
|
Name = lib.mkOption {
|
|
description = "The name of the header which should be added to the upstream request.";
|
|
type = lib.types.str;
|
|
};
|
|
Value = lib.mkOption {
|
|
description = "The value of the header, which can use Go-Templates.";
|
|
type = lib.types.str;
|
|
};
|
|
};
|
|
});
|
|
};
|
|
};
|
|
}
|
|
);
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
virtualisation.oci-containers.containers = {
|
|
traefik = {
|
|
image = "traefik:v3.7.6@sha256:21a3d83696379bac6434bb32e1dde0aff0e84ef2abd053ed3db87d3f45e749b2";
|
|
cmd = [
|
|
"--providers.docker=true"
|
|
"--providers.docker.exposedByDefault=false"
|
|
"--providers.docker.network=traefik"
|
|
"--providers.file.directory=/dynamic-config"
|
|
"--log.level=INFO"
|
|
"--api=true"
|
|
"--ping=true"
|
|
"--entrypoints.web.address=:80"
|
|
"--entrypoints.websecure.address=:443"
|
|
"--entrypoints.websecure.transport.respondingTimeouts.readTimeout=600s"
|
|
"--entrypoints.websecure.transport.respondingTimeouts.idleTimeout=600s"
|
|
"--entrypoints.websecure.transport.respondingTimeouts.writeTimeout=600s"
|
|
"--entrypoints.web.http.redirections.entrypoint.to=websecure"
|
|
"--entrypoints.websecure.asDefault=true"
|
|
"--entrypoints.websecure.http.middlewares=strip-mtls-headers@docker,pass-tls-client-cert@docker"
|
|
"--entrypoints.websecure.http.tls.certresolver=letsencrypt"
|
|
"--certificatesresolvers.letsencrypt.acme.storage=/certs/acme.json"
|
|
"--certificatesresolvers.letsencrypt.acme.dnschallenge=true"
|
|
"--certificatesresolvers.letsencrypt.acme.dnschallenge.provider=netcup"
|
|
"--experimental.plugins.traefik-oidc-auth.modulename=github.com/sevensolutions/traefik-oidc-auth"
|
|
"--experimental.plugins.traefik-oidc-auth.version=v0.17.0"
|
|
];
|
|
autoStart = true;
|
|
ports = [
|
|
"80:80"
|
|
"443:443"
|
|
];
|
|
networks = [
|
|
"traefik"
|
|
];
|
|
environment = {
|
|
OIDC_AUTH_PROVIDER_URL = cfg.oidcAuthProviderUrl;
|
|
};
|
|
environmentFiles = lib.forEach cfg.dnsSecrets (secret: secret.path) ++ (lib.mapAttrsToList (oidcClientName: oidcClientConfig: oidcClientConfig.secret.path) cfg.oidcClients);
|
|
labels = {
|
|
"traefik.enable" = "true";
|
|
"traefik.http.routers.dashboard.rule" = "Host(`${cfg.dashboardUrl}`)";
|
|
"traefik.http.routers.dashboard.service" = "dashboard@internal";
|
|
"traefik.http.routers.dashboard.middlewares" = "traefik-dashboard-oidc-auth@file";
|
|
"traefik.http.routers.api.rule" = "Host(`${cfg.dashboardUrl}`) && (PathPrefix(`/api`) || PathPrefix(`/oidc/callback`))";
|
|
"traefik.http.routers.api.service" = "api@internal";
|
|
"traefik.http.routers.api.middlewares" = "traefik-dashboard-oidc-auth@file";
|
|
"traefik.http.middlewares.strip-mtls-headers.headers.customrequestheaders.X-Forwarded-Tls-Client-Cert" = "";
|
|
"traefik.http.middlewares.pass-tls-client-cert.passtlsclientcert.pem" = "true";
|
|
};
|
|
volumes = let
|
|
oidc-config = lib.mapAttrs' (
|
|
oidcClientName: oidcClientConfig:
|
|
lib.nameValuePair "${oidcClientName}-oidc-auth" {
|
|
plugin.traefik-oidc-auth = {
|
|
LogLevel = "INFO";
|
|
Secret = ''{{ env "${mapOidcClientNameToEnv oidcClientName}_OIDC_AUTH_SECRET" }}'';
|
|
Provider = {
|
|
Url = ''{{ env "OIDC_AUTH_PROVIDER_URL" }}'';
|
|
ClientId = ''{{ env "${mapOidcClientNameToEnv oidcClientName}_OIDC_AUTH_PROVIDER_CLIENT_ID" }}'';
|
|
ClientSecret = ''{{ env "${mapOidcClientNameToEnv oidcClientName}_OIDC_AUTH_PROVIDER_CLIENT_SECRET" }}'';
|
|
UsePkce = oidcClientConfig.usePkce;
|
|
UseClaimsFromUserInfo = oidcClientConfig.useClaimsFromUserInfo;
|
|
};
|
|
Scopes = oidcClientConfig.scopes;
|
|
LoginUrl = ''{{ env "OIDC_AUTH_PROVIDER_URL" }}'';
|
|
} // (lib.attrsets.optionalAttrs oidcClientConfig.enableBypassUsingClientCertificate {
|
|
BypassAuthenticationRule = "HeaderRegexp(`X-Forwarded-Tls-Client-Cert`, `.+`)";
|
|
}) // (lib.attrsets.optionalAttrs ((lib.length oidcClientConfig.headers) > 0) {
|
|
Headers = oidcClientConfig.headers;
|
|
});
|
|
}
|
|
) cfg.oidcClients;
|
|
traefik-oidc-authentication-config = (pkgs.formats.yaml {}).generate "traefik-oidc-auth" {
|
|
http.middlewares = oidc-config;
|
|
};
|
|
in [
|
|
"/var/run/docker.sock:/var/run/docker.sock"
|
|
"${traefik-oidc-authentication-config}:/dynamic-config/traefik-oidc-auth.yaml:ro"
|
|
"${traefik-mtls-config}:/dynamic-config/traefik-mtls.yaml:ro"
|
|
"${cfg.mTLSCaCertSecret.path}:/caFiles/root_ca.crt:ro"
|
|
];
|
|
extraOptions = [
|
|
''--mount=type=volume,source=certs,target=/certs,volume-driver=local''
|
|
"--add-host=host.docker.internal:host-gateway"
|
|
"--health-cmd=wget --spider --quiet http://localhost:8080/ping"
|
|
"--health-interval=10s"
|
|
"--health-timeout=5s"
|
|
"--health-retries=3"
|
|
"--health-start-period=5s"
|
|
];
|
|
};
|
|
};
|
|
|
|
systemd.services."docker-traefik" = {
|
|
after = [
|
|
"docker-network-traefik.service"
|
|
];
|
|
requires = [
|
|
"docker-network-traefik.service"
|
|
];
|
|
};
|
|
|
|
systemd.services."docker-network-traefik" = {
|
|
path = [ pkgs.docker_29 ];
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
};
|
|
script = ''
|
|
docker network inspect traefik || docker network create traefik --ipv4 --ipv6 --subnet=172.18.0.0/16 --gateway=172.18.0.1
|
|
'';
|
|
};
|
|
|
|
networking.firewall.extraCommands = "iptables -t nat -I PREROUTING -s 172.18.0.0/16 -d 172.18.0.0/16 -j MASQUERADE";
|
|
|
|
};
|
|
}
|