Giter VIP home page Giter VIP logo

Comments (12)

benphelps avatar benphelps commented on May 18, 2024 3

Fantastic, hopefully this will be in the latest tag soon.

from homepage.

benphelps avatar benphelps commented on May 18, 2024 2

This has been released now :)

from homepage.

benphelps avatar benphelps commented on May 18, 2024 1

It's a good idea and has been suggested before, it'll just take some careful planning to make sure it's reliable and flexible enough.

from homepage.

benphelps avatar benphelps commented on May 18, 2024 1

Yeah, you'll need to pull the main tag, as it hasn't been released yet on the latest tag.

from homepage.

benphelps avatar benphelps commented on May 18, 2024 1

@benphelps This is great!! Still missing documentation though on https://gethomepage.dev correct? I only accidentally stumbled over this feature.

https://gethomepage.dev/en/configs/docker/#automatic-service-discovery

from homepage.

benphelps avatar benphelps commented on May 18, 2024

So I've made some progress on this, and it seems to be working :)

As an example, here are the labels for my Emby docker compose entry:

emby:
  labels:
    - traefik.enable=true
    - traefik.http.routers.emby.rule=Host(`emby.media.home`)
    - traefik.http.routers.emby.entrypoints=web
    - homepage.group=Media
    - homepage.name=Emby
    - homepage.icon=emby.png
    - homepage.href=http://emby.media.home
    - homepage.description=Media server
    - homepage.widget.type=emby
    - homepage.widget.url=http://emby.media.home
    - homepage.widget.key=myembyapikeywashere

This essentially defines a services.yaml entry equivalent to:

- Media:
    - Emby:
        icon: emby.png
        href:
        description: Media server
        server: phelpsrv-b
        container: emby
        widget:
          type: emby
          url: http://emby.media.home
          key: myembyapikeywashere

But... and theres always a but.

This needs to work alongside entries in services.yaml, and with that, you lose support for strictly defined ordering. You're basically leaving this up to the Docker API and the order that it sends back the containers. The current logic is to place discovered entries above the hard configured entries. But ordering between discovered entries in the same group comes down to the Docker APIs response.

Adding support for configured positions could be done, but would require even more refactoring, so if it is done, it'll be done at a later time.

from homepage.

modem7 avatar modem7 commented on May 18, 2024

Hell yea! Great job!

Tbf, at least for me, but I know I don't speak for the larger userbase, the automated ordering (maybe a way to do it alphabetically would be the simplest choice, rather than some custom solution), can certainly be done at a later date, and wouldn't/couldn't be considered critical by any means.

from homepage.

benphelps avatar benphelps commented on May 18, 2024

Just pushed the changes, I wanted to do a latest release before this bigger change to allow for some end-user testing before releasing it.

You can check out the commit here: d66326b

from homepage.

just5ky avatar just5ky commented on May 18, 2024

I noticed that :latest does not have this feature, so i pulled :main and it worked

i don't know what i am doing wrong with Portainer API.

image

if i enable Portainer API label, I'm getting NextJS error when checked from console.

    labels:
      - "homepage.group=Admin"
      - "homepage.name=portainer"
      - "homepage.icon=portainer.png"
      - "homepage.href=http://192.168.0.151:9000"
      - "homepage.description=Docker management"
      - "homepage.widget.type=portainer"
      - "homepage.widget.url=http://192.168.0.151:9000"
      - "homepage.widget.key=API_KEY"
    Listening on port 3000
    (node:1) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
    (Use `node --trace-warnings ...` to show where the warning was created)
    [
      500,
      Error: socket hang up
          at connResetException (node:internal/errors:711:14)
          at Socket.socketOnEnd (node:_http_client:518:23)
          at Socket.emit (node:events:525:35)
          at endReadableNT (node:internal/streams/readable:1359:12)
          at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
        code: 'ECONNRESET'
      }
    ]

image

EDIT: Got portainer to work.

had to pass
- "homepage.widget.env=1" label

from homepage.

just5ky avatar just5ky commented on May 18, 2024

Yeah, you'll need to pull the main tag, as it hasn't been released yet on the latest tag.

Yeah i got it working.
Everything is working as expected

from homepage.

croneter avatar croneter commented on May 18, 2024

@benphelps This is great!! Still missing documentation though on https://gethomepage.dev correct? I only accidentally stumbled over this feature.

from homepage.

chrisguen avatar chrisguen commented on May 18, 2024

Is there a way to automatically get the IP from the docker API and define the port manually in the config? That would be great for internal services.

from homepage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.