eduardolat / pgbackweb

🐘 Effortless PostgreSQL backups with a user-friendly web interface! 🌐💾
MIT License
555 stars 21 forks source link

Special character "@" interpretation within the database connection string #3

Closed GhaithKhmili closed 1 month ago

GhaithKhmili commented 1 month ago

As my first issue report in this repo, I would like to congratulate you for the handy tool @eduardolat . I've been playing with the tool in the last day in which I was able to integrate MinIO (latest) with container volumes mapped to my local storage and a custom bucket region.

Issue :

So far so good up to this moments yet I came across an issue with database passwords that contain the special character "@" within.

How to reproduce :

Use a database password containing an "@" character. Example : postgresql://username:p@ssword@hostname/database

Workaround :

A colleague of mine @scratchskinned succeeded to overcome the issue by implementing URL percent encoding and passing the character @ as %40.

eduardolat commented 1 month ago

@GhaithKhmili Thanks a lot for your comment, I hope you are enjoying the tool as much as I am.

Regarding your problem you are totally correct, according to the PostgreSQL documentation it works like this:

The connection URI needs to be encoded with percent-encoding if it includes symbols with special meaning in any of its parts.

This is how PostgreSQL works, I think it is outside the scope of PG Back Web, so it would be a bit irresponsible to alter the connection strings provided by the people who use the tool.

Rather, it is the user's responsibility to provide a valid connection string to the tool, which you can encode as you are already doing. You can also change your database password.

References: