YunoHost-Apps / vaultwarden_ynh

Open source password management solutions for YunoHost
https://bitwarden.com/
GNU General Public License v3.0
54 stars 17 forks source link

Fix datadir #165

Closed Tagadda closed 2 years ago

Tagadda commented 2 years ago

Problem

Solution

PR Status

Automatic tests

Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ after creating the PR, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)

Tagadda commented 2 years ago

!testme (restarted after c1e894a)

yunohost-bot commented 2 years ago

:v: Test Badge

nathanael-h commented 2 years ago

I did manually the modifications this PR brings (in unit file and rename the env file). And it fixes last upgrade. Even if I am not maintainer, LGTM :wink: Thanks for your work :clap: :clap: !

kriom commented 2 years ago

Many thanks @Tagadda. Like @nathanael-h I did it too and it works.

$ ssh <myyounohost>
admin@yuno:~$ sudo -i
root@yuno:~# vi /etc/systemd/system/vaultwarden.service

I replaced

ReadWriteDirectories=/var/www/vaultwarden/live
EnvironmentFile=/var/www/vaultwarden/live/vaultwarden.env

by

ReadWriteDirectories=/var/www/vaultwarden/live/web-vault
EnvironmentFile=/var/www/vaultwarden/live/.env

and (in the same file) :

   Loaded: loaded (/etc/systemd/system/vaultwarden.service; enabled; vendor preset: enabled)
   Active: **active** (running) since Mon 2022-01-24 13:38:56 UTC; 15min ago
ProtectHome=true

by

ProtectHome=false

then

root@yuno:~# systemctl daemon-reload
root@yuno:~# service vaultwarden start
root@yuno:~# service vaultwarden status
● vaultwarden.service - vaultwarden Server (Rust Edition)
   Loaded: loaded (/etc/systemd/system/vaultwarden.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2022-01-24 13:38:56 UTC; 15min ago
yalh76 commented 2 years ago

!testme

yunohost-bot commented 2 years ago

Meow :cat2: Test Badge

tytan652 commented 2 years ago

I did the same as kriom except that I let EnvironmentFile as it was and it works.

botagas commented 2 years ago

Many thanks @Tagadda. Like @nathanael-h I did it too and it works.

$ ssh <myyounohost>
admin@yuno:~$ sudo -i
root@yuno:~# vi /etc/systemd/system/vaultwarden.service

I replaced

ReadWriteDirectories=/var/www/vaultwarden/live
EnvironmentFile=/var/www/vaultwarden/live/vaultwarden.env

by

ReadWriteDirectories=/var/www/vaultwarden/live/web-vault
EnvironmentFile=/var/www/vaultwarden/live/.env

and (in the same file) :

   Loaded: loaded (/etc/systemd/system/vaultwarden.service; enabled; vendor preset: enabled)
   Active: **active** (running) since Mon 2022-01-24 13:38:56 UTC; 15min ago
ProtectHome=true

by

ProtectHome=false

then

root@yuno:~# systemctl daemon-reload
root@yuno:~# service vaultwarden start
root@yuno:~# service vaultwarden status
● vaultwarden.service - vaultwarden Server (Rust Edition)
   Loaded: loaded (/etc/systemd/system/vaultwarden.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2022-01-24 13:38:56 UTC; 15min ago

Did the exact same and it worked - Vaultwarden launches, no 502 error or anything. However, I cannot get new users because domain.tld/vaultwarden never loads - the circle just keeps spinning forever. Admin access is fine, it's just the bitwarden web-vault that doesn't work as I cannot get any invited users to load the page in order to accept the invitation.

EDIT: Fixed by a quick clean up on the web browser. EDIT2: Every time I login and try accessing the login page again, I must clear the page data in order to view it. Why?

Karnikel commented 2 years ago

I have to agree with @tytan652! If I change ReadWriteDirectories AND EnvironmentFile to the new value, vaultwarden doesn't start. If I leave EnvironmentFile as it is, vaultwarden starts.

My YNH-Version: 4.3.6.2 (stable)

semanticts commented 2 years ago

Hi same problem for me. The fix works, but spining forever prevents usage of the web interface.