diff --git a/docs/customservices.md b/docs/customservices.md index c1f0812..b41e5b3 100644 --- a/docs/customservices.md +++ b/docs/customservices.md @@ -706,11 +706,14 @@ for transcoding on your Tdarr instance as well as the number of errored items. This service displays a version string instead of a subtitle. Example configuration: ```yaml -- name: Traefik - type: Traefik - logo: assets/tools/sample.png - url: http://traefik.example.com +- name: "Traefik" + type: "Traefik" + logo: "assets/tools/sample.png" + url: "http://traefik.example.com" + basic_auth: "admin:password" ``` +- Authentication: If BasicAuth is set, credentials will be encoded in Base64 and sent as an Authorization header (Basic ). +- Format: The value must be formatted as "admin:password". ## Truenas Scale diff --git a/src/components/services/Traefik.vue b/src/components/services/Traefik.vue index 9d26bad..6d73779 100644 --- a/src/components/services/Traefik.vue +++ b/src/components/services/Traefik.vue @@ -42,7 +42,12 @@ export default { }, methods: { fetchStatus: async function () { - this.fetch("/api/version") + let headers = {}; + if (this.item.basic_auth) { + const encodedCredentials = btoa(this.item.basic_auth); + headers["Authorization"] = `Basic ${encodedCredentials}`; + } + this.fetch("/api/version", { headers }) .then((response) => { this.fetchOk = true; this.versionstring = response.Version;