tabixio / tabix

Tabix.io UI
https://tabix.io
Other
2.14k stars 265 forks source link

Add feature to resolve host in defaults #233

Closed gebi closed 2 years ago

gebi commented 2 years ago

I found it annoying to always search for the IP to use in tabix for the started clickhouse container via docker-compose (which produces random IP's here)

Thus i implemented the feature to resolve a hostname from the tabix docker container to always have the right clickhouse ip as default host in the configuration.

I've integrated it the following in the docker/start.sh script

   if CH_HOST is not set, then
    -> if CH_RESOLVE_HOST is defined
      -> CH_RESOLVE_HOST is resolved via DNS
        -> connection string is build with
        -> CH_RESOLVE_PROTO + $(dig +short CH_RESOLVE_HOST) + CH_RESOLVE_PORT

Example docker-compose:

      tabix:
        build: tabix/
        restart: always
        ports:
          - 8080:80
        environment:
          CH_NAME: logs
          CH_RESOLVE_PROTO: "http://"
          CH_RESOLVE_HOST: "clickhouse"
          CH_RESOLVE_PORT: ":8123"
          CH_LOGIN: default

ps.: this branch is based on my PR https://github.com/tabixio/tabix/pull/232

isublimity commented 2 years ago

Tabix update to new engine, Thx you work!

isublimity commented 2 years ago

Tabix update to new engine, Thx you work