YunoHost-Apps / mastodon_ynh

Free, open-source social network for YunoHost
https://joinmastodon.org/
GNU Affero General Public License v3.0
85 stars 36 forks source link

"There is already a directory: /var/www/mastodon" when restoring #462

Open kuba-orlik opened 3 months ago

kuba-orlik commented 3 months ago

Describe the bug

I have a volume mounted at /var/www/mastodon so I can easily scale it and keep up with the absurd amount of disk space that Mastodon uses. Thus, the directory /var/www/mastodon always exists. This makes the restore script fail:

https://paste.yunohost.org/raw/ibeyujacem

WARNING - There is already a directory: /var/www/mastodon

Context

Steps to reproduce

Expected behavior

Restore works

Current workaround

I'm trying to see if

sed -i 's/test ! -d $final_path/test   -d $final_path/' mastodon-pre-upgrade1.tar

will do the trick for me and bring my instance up.

I think a good fix would be throwing an error not if the directory just exists, but if it exists and is not empty