Skip to content

Enhancement : way to integrate apps based on docker compose labels #559

Closed

Description

@lunarok

Hi,

In a world with things like traefik+authelia+cf-companion, the perfection will be to have a portal that allow to integrate by anyway a dynamic list of apps, those being pick up from the docker labels.
Exemple, adding a new container, with just exposing to traefik, we have the subdomain create, subdomain protected by sso with nothing to do. If it could go to the step of being added in heimdall ...

Activity

  1. Bockiii commented on Apr 15, 2021

    @Bockiii

    I came here to post the same exact feature request :). so +1 for this

  2. holblin commented on Sep 13, 2021

    @holblin

    Also interested 👍
    I personally use traefik + traefik-auth-forwarder + let's encrypt (through traefik dynamic configuration)

  3. francis-io commented on Jan 6, 2022

    @francis-io

    I also came here to request the same thing.

    My initial idea was to have labels be read on a Heimdall container. The label path can be used to get the explicit name of each entry.

    services:
      heimdall:
        image: linuxserver/heimdall:latest
        labels:
          - "application.mySonarr.applicationType=sonarr"
          - "application.mySonarr.url=https://sonarr.mydomain.com"
          - "application.LivingRoomKodi.applicationType=kodi"
          - "application.LivingRoomKodi.url=https://kodi.mydomain.com"
    

    The other option is to label the other containers.

    services:
      sonarr:
        image: linuxserver/sonarr
        labels:
          - "application.heimdall.applicationType=sonarr"
          - "application.heimdall.url=https://sonarr.mydomain.com"
    

    I guess this all comes down to the access you want to give Heimdall. Can a container read its own labels? I assume by default it can't read other container labels. I wouldn't really want to expose the docker socket to my heindall container unless I really needed to. Mounting as read-only is a way to limit risk here somewhat.

    I could also see labels on the heimdall container being used to set things in system settings and for users.

    The big difficulty I see is managing button layout. I guess that could be controlled by an "order" label. application.heimdall.layoutOrder=2. Any conflicting order labels could then go based off of alphabetical order.

    The big missing feature for me personally with heimdall is the ability to work without a local state at all. I think it's perfectly suited to doing this. As far as I can tell, it does not keep any state, just a config file.

    I'm tempted to experiment with adding a new entrypoint script to the Heimdall container image to render out a config file based on labels. It seems like it should be easy enough. You can just curl a mounted docker socket as explained here https://stackoverflow.com/a/39714741

  4. Bockiii commented on Jan 6, 2022

    @Bockiii

    It would need to be on the application container (like for traefik) and you would need to give heimdall socket access, but there are ways to mitigate the risks by using a socket proxy (i'm using this https://github.com/Tecnativa/docker-socket-proxy ). But I think it would be absolutely worth it and a true killer feature (like labeling is for traefik over other proxy solutions).

  5. francis-io commented on Jan 6, 2022

    @francis-io

    It would need to be on the application container (like for traefik) and you would need to give heimdall socket access, but there are ways to mitigate the risks by using a socket proxy (i'm using this https://github.com/Tecnativa/docker-socket-proxy ). But I think it would be absolutely worth it and a true killer feature (like labeling is for traefik over other proxy solutions).

    I wouldn't say it "needs" to be on other containers, but since I can't find any info about containers having access to it's own labels, I see no benefit in having all labels on the heimdall container. I might be thinking of EC2 metadata 😄

    I had a quick look at my heimdall config directory and it looks like heimdall uses a sqllite db and PHP. I'm not used to working with either of these techs. The only way I can think to approach this is to extend the heimdall container, install bash (if i need to) and a sqllite cli and on startup, run a script to read all labels from all containers and insert that info into the relevant tables in the database. It would definitely be a hacky way of doing it.

  6. Bockiii commented on Jan 6, 2022

    @Bockiii

    The reason i'm saying that it needs to be on the application containers is that you only need to start heimdall once and it will update itself by checking the labels (again, like traefik). You dont need a script that runs on start, you need a watcher for the socket (I'm not fluent in Go but I think this is the point where traefik does it)

  7. locked and limited conversation to collaborators on Mar 12, 2022
  8. converted this issue into a discussion #701 on Mar 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions