Rabbit-Company / Passky-Server

Server for Passky (password manager)
https://passky.org
GNU General Public License v3.0
166 stars 22 forks source link

Make database name selectable and configurable #9

Closed vzool closed 2 years ago

zigazajc007 commented 2 years ago

It's a little more than just that as database name in database.sql file is currently hard codded.

https://github.com/Rabbit-Company/Passky-Server/blob/main/database/database.sql

vzool commented 2 years ago

It's a little more than just that as database name in database.sql file is currently hard codded.

https://github.com/Rabbit-Company/Passky-Server/blob/main/database/database.sql

Ah, I missed that, but we can ignore creating and mention the database in that file, SQL will still works as expected.

zigazajc007 commented 2 years ago

The problem is that this is needed for docker. As everything from this file will be auto executed when docker container starts.

zigazajc007 commented 2 years ago

I would need to perform some tests, to see if everything will still work as expected in MariaDB docker container.

vzool commented 2 years ago

I think I did it 🤣✌️

vzool commented 2 years ago

The problem is that this is needed for docker. As everything from this file will be auto executed when docker container starts.

Yes, I didn't realized that, but with last commit in this PR the application database name now is updateable for docker containers according to MYSQL_DATABASE in .env

vzool commented 2 years ago

I would need to perform some tests, to see if everything will still work as expected in MariaDB docker container.

I think we need test units to cover all API calls, so we can make a big jumps in development cycles.

zigazajc007 commented 2 years ago

I would need to perform some tests, to see if everything will still work as expected in MariaDB docker container.

I think we need test units to cover all API calls, so we can make a big jumps in development cycles.

I want to keep code for the Passky Server as clean as possible.

You can use PasskyAPI-JS to perform API calls. https://github.com/Rabbit-Company/PasskyAPI-JS/blob/main/example/index.html

zigazajc007 commented 2 years ago

MYSQL_DATABASE placeholder in database.sql file will now be replaced only when docker container starts and with duplicated file inside the container. So installers wouldn't interact with your system in any way except creating .env file. This also means if you just change database name in .env file without running installer it would work.

zigazajc007 commented 2 years ago

Thanks for your contribution, I will now Merge pull request and make more tests before it goes to production.