Rabbit-Company / Passky-Server

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

PASSKY on Synology DSM #25

Open virgo77 opened 1 year ago

virgo77 commented 1 year ago

Hi! How are you! Hope fine :)

With the latest posts we replied each other, I found that you Passky-Server is available on Docker Hub, which is used by Synology on DSM. So, I'm trying to install it on my NAS Synology with DSM 7.1 up-to-date, instead of a dedicated Linux Server.

I don't know if you use Synology but I hope I can find some help here.

So, here are the Passky-Server packages on Docker Hub: https://hub.docker.com/search?q=passky I installed these 3 packages under my Synology Docker:

Passky API and Passky Web are working. But about the DB, i had to add some variables following the MariaDB official website. After adding the variables, all 3 packages are running well and I can get on the Start Page correctly. But when I try to create a user, I got an error about the DB, telling me that "Something went wrong while connecting to the database!"

I'm sure it's a pb with the API in which I have to give some informations. But, on DSM, we don't have much settings to do. So, maybe I have to edit a config file somewhere, but I didn't find it. If you know what to change, I'll be glad ^^

Thanks a lot and see you later

V.

zigazajc007 commented 1 year ago

Hello,

Passky Server includes .env.example file, here you can find all env variables.

.env.example -> https://github.com/Rabbit-Company/Passky-Server/blob/main/.env.example

I have never used Synology, but I bet there should be an option to set env variables.

In .env.example file you can see section for database settings. This needs to be changed so Passky API will know how to connect to the database.

Passky Server uses docker compose for easier deployment, so if you have option to use docker compose to deploy Passky Server on Synology the process will be a lot easier. As docker compose will auto create virtual network and put both Passky API and Passky Database containers in the same network, so they can communicate between each other, so we don't need to open any port for Passky Database container (This improves security) as then we can't just avoid Passky API and connect right to the database.

virgo77 commented 1 year ago

Thanks for your reply. On Synology DSM, when installing Docker, Docker Compose is included. I took a look on the .env variables and I tried to adapt to my installation, but still not working.

I will try to ask on Reddit or somewhere else for some help. I'm sure this is not too hard to configure. Maybe I'm doing something wrong ^^

I'll be back! (damn, so good! :D)

See you

V.

zigazajc007 commented 1 year ago

As soon as you have deployed Passky Database container then folder /passky will be created that includes database files.

So even if you change env variables the database will still use the user with old creditions.

Try deleting /passky folder and redeploy all containers.

virgo77 commented 1 year ago

I really thank you for your advices! It works :) But not with the Docker Packages available via the Synology DSM. What I did:

Here are the variables I added:

The server works. I can create new accounts and credentials. But the password issue (with backslash, and new character) is still here. Maybe it is not fixed yet :) And I can't connect with admin account as I did not install the nginx proxy manager (and maybe because I did not add the variables too. I don't know where to add these 2 lines (db or api)).

So, now, I have to wish you an Happy New Year! And most important: health! Be good, and take care! ;)

V.

zigazajc007 commented 1 year ago

Secure Cookies are set to true, this means Admin Panel will only work on a secure connection (SSL / TLS / HTTPS).

In next Passky Server update you will be able to disable secure cookies by providing another env variable and Admin Panel will work.

I'm currently sick so I will start working on Passky again when I get better (Hopefully in few days).

Yes, backslashes have not been "fixed" yet. The best and safest option would be to prevent user from using it. Backslashes are reserved for escaping. So every time user will input backslash, Passky Client will probably show that this character is illegal and shouldn't be used.

Another option would be to escape the escape character (backslash), but this can bring a lot of security vulnerabilities, so I don't think it is worth it.

Test if Github comments escape characters: \ \@

Edited: As you can see I have used 2 backslashes in this test and Github comments only showed 1 backslash.

So it is normal behaviour. Backslash should not be used anywhere except if you want to escape characters.

virgo77 commented 1 year ago

Ha! I hope it's not Covid. I had it about less than 3 months ago... and I was sick again for X-Mas. Just a flu. So, take care. Have rest. And take your time!

About backslash, we discuss about it weeks ago so I knew about this issue as you explained me why. So don't worry about that ;)

See you later ;)

V.

zigazajc007 commented 1 year ago

In the middle of Covid I got another virus, so now I don't know if I still have Covid or it's just another virus.

And happy new year to you too.