plugsy / core

A simple, pluggable dashboard and status page
161 stars 4 forks source link

Possibility to use traefik label #4

Closed mattthhdp closed 3 years ago

mattthhdp commented 3 years ago

It would be pretty awesome to be able to use the traefik label. Do you think this is something possible without too much hassle ?

Inlustra commented 3 years ago

Actually all of the labels required are configurable through environment variables already! (Though I haven't tested that side of it just yet)

export const environment = () => ({
  nameLabel: process.env.DOCKER_DASH_NAME_LABEL ?? "dockerDash.name",
  categoryLabel:
    process.env.DOCKER_DASH_CATEGORY_LABEL ?? "dockerDash.category",
  iconLabel: process.env.DOCKER_DASH_ICON_LABEL ?? "dockerDash.icon",
  linkLabel: process.env.DOCKER_DASH_LINK_LABEL ?? "dockerDash.link",
  parentsLabel: process.env.DOCKER_DASH_PARENTS_LABEL ?? "dockerDash.parents",
  dockerSocket: process.env.DOCKER_SOCKET ?? "/var/run/docker.sock",
  dockerHost: process.env.DOCKER_HOST,
  dockerPort: process.env.DOCKER_PORT,
  dockerProtocol: process.env.DOCKER_PROTOCOL as
    | "https"
    | "http"
    | "ssh"
    | undefined,
  dockerVersion: process.env.DOCKER_VERSION,
  fileStoragePath: process.env.DOCKER_DASH_FILE_STORAGE_PATH,
});

Feel free to launch the container with whatever you'd like the labels to be, I suppose in your case it would be to override the name label?

In which case when launching the container change the env: DOCKER_DASH_NAME_LABEL

mattthhdp commented 3 years ago

Exactly, it would be easier to re-use the traefik label than recreate all of them


From: Thomas Nairn @.> Sent: Wednesday, June 16, 2021 1:14:29 PM To: Inlustra/auto-docker-dash @.> Cc: Jaune @.>; Author @.> Subject: Re: [Inlustra/auto-docker-dash] Possibility to use traefik label (#4)

Actually all of the labels required are configurable through environment variables already! (Though I haven't tested that side of it just yet)

export const environment = () => ({ nameLabel: process.env.DOCKER_DASH_NAME_LABEL ?? "dockerDash.name", categoryLabel: process.env.DOCKER_DASH_CATEGORY_LABEL ?? "dockerDash.category", iconLabel: process.env.DOCKER_DASH_ICON_LABEL ?? "dockerDash.icon", linkLabel: process.env.DOCKER_DASH_LINK_LABEL ?? "dockerDash.link", parentsLabel: process.env.DOCKER_DASH_PARENTS_LABEL ?? "dockerDash.parents", dockerSocket: process.env.DOCKER_SOCKET ?? "/var/run/docker.sock", dockerHost: process.env.DOCKER_HOST, dockerPort: process.env.DOCKER_PORT, dockerProtocol: process.env.DOCKER_PROTOCOL as | "https" | "http" | "ssh" | undefined, dockerVersion: process.env.DOCKER_VERSION, fileStoragePath: process.env.DOCKER_DASH_FILE_STORAGE_PATH, });

Feel free to launch the container with whatever you'd like the labels to be, I suppose in your case it would be to override the name label?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Inlustra/auto-docker-dash/issues/4#issuecomment-862560932, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACQ46JC3BVEHCBJCSO5VBPLTTDLXLANCNFSM46Z4EBZQ.

Inlustra commented 3 years ago

That's already implemented, can you give it a try?

mattthhdp commented 3 years ago

As soon as I come back from work !


From: Thomas Nairn @.> Sent: Wednesday, June 16, 2021 3:10:36 PM To: Inlustra/auto-docker-dash @.> Cc: Jaune @.>; Author @.> Subject: Re: [Inlustra/auto-docker-dash] Possibility to use traefik label (#4)

That's already implemented, can you give it a try?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Inlustra/auto-docker-dash/issues/4#issuecomment-862643079, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACQ46JGRXX7LSSJTJ2VIGNLTTDZKZANCNFSM46Z4EBZQ.

Inlustra commented 3 years ago

It's worth mentioning that as of v2, these options are no longer configured using environment variables. Instead you will have to use the config instead, an example config:

{
  "$schema": "https://github.com/Inlustra/auto-docker-dash/releases/download/v2.0.0/schema.json",
  "connectors": [
    {
      "type": "docker",
      "config": {
          "labelConfig": {
              "categoryLabel": "mycustomdockerlabel",
              "iconLabel": "mycustomdockerlabel",
              "linkLabel": "mycustomdockerlabel",
              "nameLabel": "mycustomdockerlabel",
              "parentsLabel": "mycustomdockerlabel"
          }
      }
    }
  ]
}
Inlustra commented 3 years ago

I'm going to close this, as the possibility to do such a thing does exist, if you have any other issues with this functionality, I'll re-open