Merge branch testing into 7.1

This commit is contained in:
Josué Tille 2020-12-10 23:26:36 +01:00
commit 49534d5afa
No known key found for this signature in database
GPG key ID: 716A6C99B04194EF
4 changed files with 33 additions and 33 deletions

View file

@ -72,14 +72,7 @@ Seafile don't distribute binary for generic armhf architectures but rpi binary g
Additional informations
-----------------------
### Change URL
Since now it's possible to change domain or the url of seafile.
To do this run : `yunohost app change-url seafile -d new_domain.tld -p PATH new_path`
Links
-----
### Links
* Report a bug: https://github.com/YunoHost-Apps/seafile_ynh/issues
* App website: https://www.seafile.com
@ -87,44 +80,45 @@ Links
---
Install
-------
### Install
From command line:
`sudo yunohost app install -l seafile https://github.com/YunoHost-Apps/seafile_ynh`
`yunohost app install seafile`
Upgrade
-------
### Upgrade
From command line:
`sudo yunohost app upgrade seafile -u https://github.com/YunoHost-Apps/seafile_ynh`
`yunohost app upgrade seafile`
Backup
------
### Backup
This app use now the core-only feature of the backup. To keep the integrity of the data and to have a better guarantee of the restoration is recommended to proceed like this:
- Stop seafile service with theses following command:
```
systemctl stop seafile.service seahub.service
```
- Launch the backup of seafile with this following command:
```
yunohost backup create --app seafile
```
- Do a backup of your data with your specific strategy (could be with rsync, borg backup or just cp).
- Restart the seafile service with theses command:
```
systemctl start seafile.service seahub.service
```
Remove
------
`systemctl stop seafile.service seahub.service`
- Launch the backup of seafile with this following command:
`yunohost backup create --app seafile`
- Do a backup of your data with your specific strategy (could be with rsync, borg backup or just cp). The data is stored in `/home/yunohost.app/seafile-data`.
- Restart the seafile service with theses command:
`systemctl start seafile.service seahub.service`
### Remove
Due of the backup core only feature the data directory in `/home/yunohost.app/seafile-data` **is not removed**. It need to be removed manually to purge app user data.
### Change URL
Since now it's possible to change domain or the url of seafile.
To do this run : `yunohost app change-url seafile -d new_domain.tld -p PATH new_path`
Developers infos
----------------

View file

@ -22,8 +22,8 @@ db_pwd=$(ynh_app_setting_get --app $app --key mysqlpwd)
final_path=$(ynh_app_setting_get --app $app --key final_path)
seafile_user=$app
if [ ! "$(systemctl status seafile)" =~ "Active: stoped" ] || [ ! "$(systemctl status seahub)" =~ "Active: stoped" ]; then
ynh_print_warn --message="It's hightly recommended to make your backup when the service is stoped. Please seafile service and seahub service with this command before to run the backup 'systemctl stop seafile.service seahub.service'"
if [[ ! "$(systemctl status seafile)" =~ "Active: inactive (dead)" ]] || [[ ! "$(systemctl status seahub)" =~ "Active: inactive (dead)" ]]; then
ynh_print_warn --message="It's hightly recommended to make your backup when the service is stopped. Please stop seafile service and seahub service with this command before to run the backup 'systemctl stop seafile.service seahub.service'"
fi
#=================================================
@ -34,7 +34,7 @@ fi
ynh_script_progression --message="Backing up code..." --weight=3
ynh_backup --src_path $final_path
ynh_script_progression --message="Backing up user data..." --weight=10
ynh_backup --src_path /home/yunohost.app/seafile-data --dest_path "data" --is_big 1
ynh_backup --src_path=/home/yunohost.app/seafile-data --dest_path="data" --is_big=1
ynh_script_progression --message="Backing up configuration..."
ynh_backup --src_path /etc/nginx/conf.d/$domain.d/${app}.conf
ynh_backup --src_path /etc/systemd/system/seafile.service

View file

@ -40,6 +40,11 @@ ynh_webpath_register --app $app --domain $domain --path_url $path_url
# Check Final Path availability
test ! -e "$final_path" || ynh_die --message "This path already contains a folder"
if [ -e "$seafile_data" ]; then
old_data_dir_path="$seafile_data$(date '+%Y%m%d.%H%M%S')"
ynh_print_warn "A data directory already exist. Data was renamed to $old_data_dir_path"
mv "$seafile_data" "$old_data_dir_path"
fi
# Find available ports
ynh_script_progression --message="Finding available ports..."

View file

@ -83,3 +83,4 @@ yunohost service remove seahub
ynh_print_info --message="Due of the backup core only feature the data directory in '/home/yunohost.app/seafile-data' was not removed. It need to be removed manually to purge app user data."
ynh_script_progression --message="Removal of $app completed" --last
sleep 1