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

support list of predefined DB connections shown in the UI #22

Open
typekpb opened this issue Jun 2, 2016 · 3 comments
Open

support list of predefined DB connections shown in the UI #22

typekpb opened this issue Jun 2, 2016 · 3 comments

Comments

@typekpb
Copy link

typekpb commented Jun 2, 2016

It would be nice to have an option for predefined list of DB connections, specified via environment variables on container start (or somehow), later shown in the UI on the login screen.

Similar to:
adminer_logindefault

@clue
Copy link
Owner

clue commented Jun 7, 2016

I like the idea, does anybody feel like filing a PR? 👍 :)

Also, I suppose this is a duplicate of #1?

@mathroc
Copy link

mathroc commented Jun 8, 2016

It would be useful and yes I guess having #1 would solves this

however I have a few remarks: It's a bit of a PITA to parse those env variable if you don't know the name or type of service that are linked. It can be done ( eg: https://github.com/texthtml/docker-links ) but even then you'll still have to write heuristics to guess which database type it is ( so it might not work with non official database that could use different variable or defaults)

anyway I guess it would mean making a plugin for adminer (I've made a similar plugin at work to automatically connect to our databases but reading a configuration file instead of env vars)

do you think we could find some easier way to configure theses connections?

eg, using DSN like :

docker run \
  -e ADMINER_SOURCES=FIRST_DB,SECOND_DB \
  -e ADMINER_SOURCE_FIRST_DB=mysql:host=mysql;port=3307;dbname=testdb;username=root \
  -e ADMINER_SOURCE_SECOND_DB=pgsql:host=10.2.0.71;port=5432;dbname=testdb;user=bruce
  clue/adminer

note, here is the env vars availlable when linking a mysql container to adminer:

docker exec adminer env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=8d7fa8843d12
MYSQL_PORT=tcp://172.17.0.2:3306
MYSQL_PORT_3306_TCP=tcp://172.17.0.2:3306
MYSQL_PORT_3306_TCP_ADDR=172.17.0.2
MYSQL_PORT_3306_TCP_PORT=3306
MYSQL_PORT_3306_TCP_PROTO=tcp
MYSQL_NAME=/adminer/mysql
MYSQL_ENV_MYSQL_ALLOW_EMPTY_PASSWORD=true
MYSQL_ENV_GOSU_VERSION=1.7
MYSQL_ENV_MYSQL_MAJOR=5.7
MYSQL_ENV_MYSQL_VERSION=5.7.12-1debian8
HOME=/root

depending on the situation even harder than the database it could be difficult to guess the username, password and database to use

@f3l1x
Copy link

f3l1x commented Jan 24, 2017

I'm maybe wrong, but predefined connections are stored in session/cookie. Aren't they?

selection_002

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

No branches or pull requests

4 participants