phpmyadmin / docker

Docker container for phpMyAdmin
https://hub.docker.com/_/phpmyadmin
GNU General Public License v3.0
675 stars 455 forks source link

Sub-URI support based on config option PMA_SUB_URI_BASE #353

Open fishermans opened 2 years ago

fishermans commented 2 years ago

To support docker container behind a reverse proxy I added a new optional config option to simply running PMA under a sub-URI based on approach posted on Stackoverflow: https://stackoverflow.com/questions/42035947/how-to-change-the-access-url-of-official-phpmyadmin-docker-image-to-http-local/68643939#68643939

It simply creates a symlink inside the www folder.

williamdes commented 2 years ago

Hi @fishermans I appreciate the effort for the feature, I can not agree with using the PMA prefix since this is not a phpMyAdmin setting but some virtual config trick only available in docker :) Could you find another name?

@J0WI what do you think about this PR? Will it be accepted in official Docker images?

fishermans commented 2 years ago

Hi @fishermans I appreciate the effort for the feature, I can not agree with using the PMA prefix since this is not a phpMyAdmin setting but some virtual config trick only available in docker :) Could you find another name?

@J0WI what do you think about this PR? Will it be accepted in official Docker images?

Hi @williamdes, It is of course possible to change this name as you like. Please just suggest a name and I will change the PR. I thought that the variable should be similar to the other variables, so that it can be distinguished from your own ones. But I personally don't care at all what it should be called. The main thing is that you can start a PMA in Docker under a sub-URI in no time without having to create your own images. BR

fishermans commented 2 years ago

Maybe it is also possible to support sub-URI in general in PMA, for Docker and for native installations. If you do not have a wildcard certificate for your domain and working at a company where you have to ask other people to help you... sub-URI is very welcome.

Something like https://www.php.net/manual/en/function.symlink.php should also work. But I am not an export in PHP as you know what I mean. The ENTRYPOINT "hack" was simple to implement and is easy to maintain.