Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow non IP (hostname) as value for environment variable gifip #103

Open
bkleef opened this issue Mar 2, 2022 · 4 comments
Open

Allow non IP (hostname) as value for environment variable gifip #103

bkleef opened this issue Mar 2, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@bkleef
Copy link

bkleef commented Mar 2, 2022

When I set the environment variable gifip to influxdb in version 2.6.1g it shows the error:

Grott InfluxDB server IP address env invalid

In my Docker Compose the hostname influxdb is available as this is another service in the same file:

version: "3.4"
services:
  grott:
    container_name: grott
...
  influxdb:
    container_name: influxdb
...

Please allow hostnames in addition to IPs. InfluxDB client supports them as well like localhost.

@johanmeijer
Copy link
Owner

Thanks for the feedback. I check on valid ip address indeed.

Although it might introduce some unexpectec configuration errors but I do understand this is an improvement. I will implement it in one of the next releases.

@johanmeijer johanmeijer added the enhancement New feature or request label Mar 2, 2022
@mvysny
Copy link

mvysny commented Aug 3, 2023

Sorry for a ping kind of message, but any progress on this please? This basically blocks me from running grott+influxdb2 in docker-compose.

@mvysny
Copy link

mvysny commented Aug 3, 2023

Workaround is to patch grottconf.py and comment out line 500:

#ipaddress.ip_address(os.getenv('gifip'))

Also note that the hostname must contain at least one dot character, otherwise Python influxdb2 client will fail with a non-sensical error message No host specified..

Afterwards, you can include the patched grottconf.py file in your docker-compose.yaml file by mounting it as a volume.

I'm attaching the docker-compose.yaml file which works for me:

version: '2'
services:
  grott:
    image: ledidobe/grott:2.8.2
    environment:
      gnomqtt: "true"
      ginflux: "true"
      ginflux2: "true"
      gifip: "influxdb.dc"
      gifport: 8086
      giftoken: "xyz"
      giforg: "my_org"
      gifbucket: "grott"
    ports:
      - "5279:5279"
    volumes:
      - "./grottconf.py:/app/grottconf.py"
    restart: unless-stopped
  influxdb.dc:
    image: influxdb:2.7.1
    volumes:
      - "./db:/var/lib/influxdb2"
    ports:
      - "8086:8086"
    environment:
      DOCKER_INFLUXDB_INIT_MODE: "setup"
      DOCKER_INFLUXDB_INIT_USERNAME: "admin"
      DOCKER_INFLUXDB_INIT_PASSWORD: "admin"
      DOCKER_INFLUXDB_INIT_ORG: "my_org"
      DOCKER_INFLUXDB_INIT_BUCKET: "grott"
      DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: "xyz"

@patcher-ms
Copy link

I am having the same issue. Any chance this could be supported by Grott itself? Patching grottconf.py works but it's not great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants