plugsy / core

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

Agents keep overwriting each other #44

Closed juzim closed 2 years ago

juzim commented 2 years ago

Hi!

This is such a great project, I was looking for the perfect dashboard for years and this might be it. I'm looking forward to more features (home assistant!!) and hope to contribure in the future!

Right now I have one server and two agents. Everything works fine with one agent, but as soon as I start the second one, all services of one agent replace those of the other every few seconds.

Video: https://youtu.be/zXIaDZ1CSjA

I have tried to give the agent containers different names but it didn't help. I also can't get the graphql playground to work, so I can't check the data.

Do I have to add an unique identifier somewhere?

Cheers!

Inlustra commented 2 years ago

Hi, glad that plugsy is filling some sort of gap! I think you're the first person to use multiple agents!

I think what you're experiencing is the connectors themselves (IE docker connector) in this case is using the default id

What you'll want to do is override the default connector in your agents like so:

{
  "$schema": "https://github.com/plugsy/core/releases/download/v7.0.0/core-config-schema.json",
  "agent": {
    "endpoint": "http://localhost:3000/graphql"
  },
"connectors": [
    {
      "type": "DOCKER",
      "config": {
          id: "agent1MeaningfulName"
       }
    }
  ]
}

Obviously changing those params where needed.

I also haven't tested this and it's been written on my mobile so might be slightly out but let me know if that helps

Inlustra commented 2 years ago

As for the GraphQL playground, that's a good shout, it's currently disabled in production as you would a production website.

But perhaps I'll add an env var to enable it!

ma-karai commented 2 years ago

I was just about to post the same thing, Except i thought that there was not enough space to display more than 3 rows :) haha thanks for the pointer

juzim commented 2 years ago

Everything works now, thanks.

Since I'm trying to use a stacked compose deployment, it would be great if this would also be configurable by an environment variable, but I don't see how that would work with multiple DOCKER connectors.

While the playground would be nice, I can just see all data in the dev console, no idea why I didn't think about it.