10up / wp-local-docker-v2

ARCHIVED: A simple Docker based development environment for WordPress.
MIT License
484 stars 81 forks source link

phpMyAdmin Shortcut #20

Open ChaosExAnima opened 5 years ago

ChaosExAnima commented 5 years ago

I believe it would be useful to allow a way to jump to the relevant phpMyAdmin page using the /__dbadmin / URL like is done for memcache and ES.

The approach that could work:

  1. Write a proxypass rule in nginx for the appropriate host.
  2. Add header using proxy_set_header to set auto-login.
  3. Write a PHP file to check for header and automatically logs in using wordpress credentials.
  4. Set up custom configuration for the main DB container to use the PHP file.
  5. Profit?

Bonus: If the system can detect the correct DB name, you can automagically only display the site's DB with the config. You'll need to find a way to pass that to nginx, however.

ChaosExAnima commented 5 years ago

@tlovett1 @cmmarslender - Thoughts? Happy to write a PR if you'd like!

tlovett1 commented 5 years ago

If we need phpMyAdmin, I totally agree. This is what we do with Elasticsearch.

ChaosExAnima commented 5 years ago

It's a pretty useful tool for complex SQL operations, and already bundled in the package anyway? I just find it mildly inconvenient to remember the localhost port and enter credentials when I don't have to.

tlovett1 commented 5 years ago

I'm onboard then.