phpmyadmin / docker

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

Support adding custom configurations in `/etc/phpmyadmin/conf.d` #401

Closed pigochu closed 1 year ago

pigochu commented 1 year ago

319

ibennetch commented 1 year ago

Good idea

williamdes commented 1 year ago

You may be interested to translate phpMyAdmin in your language: https://hosted.weblate.org/projects/phpmyadmin/5-2/th/

Did I get it right?

pigochu commented 1 year ago

You may be interested to translate phpMyAdmin in your language: https://hosted.weblate.org/projects/phpmyadmin/5-2/th/

Did I get it right? I am from Taiwan. My English is not good.

pigochu commented 1 year ago

Awesome, can you add some documentation on the README for that? @williamdes

I use google translate to translate my thoughts into English, what do you think?


Adding Custom Configuration into /etc/phpmyadmin/conf.d

Instead of using /etc/phpmyadmin/config.user.inc.php, you can also consider storing your custom configuration files in /etc/phpmyadmin/conf.d, which is very suitable for managing multiple MySQL Container uses different file names to distinguish settings.

On the docker run line like this:

docker run --name phpmyadmin -d --link mysql_db_server:db -p 8080:80 -v /some/local/directory/conf.d:/etc/phpmyadmin/conf.d phpmyadmin:latest

Then you can create db1.php , db2.php , or any file name you want, and store them in the conf.d directory on the host.

williamdes commented 1 year ago

I use google translate to translate my thoughts into English, what do you think?

Okay, It's doing well. Do you speak other languages ?


You can change the line from

- /some/local/directory/conf.d:/etc/phpmyadmin/conf.d
+ /some/local/directory/conf.d:/etc/phpmyadmin/conf.d:ro

To make the mount read-only.

you can also consider storing your custom configuration files in /etc/phpmyadmin/conf.d

you can also consider storing your custom configuration files in the folder /etc/phpmyadmin/conf.d

which is very suitable for managing multiple MySQL Container

which is very suitable for managing multiple phpMyAdmin configuration files for different hosts

Then you can create db1.php , db2.php , or any file name you want, and store them in the conf.d directory on the host.

Then you can create server-1.php , server-2.php , or any file name you want, and store them in the conf.d directory mounted on the host.

pigochu commented 1 year ago

Okay, It's doing well. Do you speak other languages ?

Sorry, I only speak Chinese and poor English

williamdes commented 1 year ago

Sorry, I only speak Chinese and poor English

Okay, if you are interested (no obligation at all) you can help with translations in Chinese:

williamdes commented 1 year ago

let me know when it's okay for the README. I can improve it while I merge your work

pigochu commented 1 year ago

One line you could add is about permissions, the folder and files should be readable from the phpMyAdmin container. Or it will not work at all.

I have a question, is it necessary to use ro? In fact, I have another project that wants to automatically discovers mysql service and automatically modify or add the files in conf.d . So I need write permission.

williamdes commented 1 year ago

I have a question, is it necessary to use ro? In fact, I have another project that wants to automatically discovers mysql service and automatically modify or add the files in conf.d . So I need write permission.

From a security point of view, it's better to say to the user we do not need write access. If you need write access, feel free to use rw or nothing :)