mirror of
https://github.com/YunoHost-Apps/seafile_ynh.git
synced 2024-09-03 20:26:01 +02:00
Merge branch 'testing' into master
This commit is contained in:
commit
a7f3573f28
5 changed files with 54 additions and 25 deletions
55
README.md
55
README.md
|
@ -1,7 +1,7 @@
|
|||
Seafile For yunohost
|
||||
=================
|
||||
|
||||
[](https://ci-apps.yunohost.org/ci/apps/seafile%20%28Community%29/lastBuild/consoleFull)
|
||||
[](https://dash.yunohost.org/appci/app/seafile)  
|
||||
[](https://install-app.yunohost.org/?app=seafile)
|
||||
|
||||
> *This package allow you to install seafile quickly and simply on a YunoHost server.
|
||||
|
@ -59,11 +59,10 @@ for more information.
|
|||
|
||||
Since seafile 6.3 the i386 architecture is no more supported.
|
||||
|
||||
Seafile no longer distribute binary for generic armhf architectures but rpi binary could work.
|
||||
Seafile don't distribute binary for generic armhf architectures but rpi binary generally work on all arm board.
|
||||
|
||||
* x86-64b - [.svg)](https://ci-apps.yunohost.org/ci/apps/seafile/)
|
||||
* ARMv8-A - [.svg)](https://ci-apps-arm.yunohost.org/ci/apps/seafile/)
|
||||
* Jessie x86-64b - [.svg)](https://ci-stretch.nohost.me/jenkins/job/seafile/)
|
||||
* x86-64 - [](https://ci-apps.yunohost.org/ci/apps/seafile/)
|
||||
* ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/seafile/)
|
||||
|
||||
<!--Limitations
|
||||
------------
|
||||
|
@ -73,14 +72,7 @@ Seafile no longer distribute binary for generic armhf architectures but rpi bina
|
|||
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
|
||||
|
@ -88,19 +80,44 @@ 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
|
||||
|
||||
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). 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
|
||||
----------------
|
||||
|
|
|
@ -22,6 +22,10 @@ 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: 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
|
||||
|
||||
#=================================================
|
||||
# STANDARD BACKUP STEPS
|
||||
#=================================================
|
||||
|
@ -30,7 +34,7 @@ seafile_user=$app
|
|||
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"
|
||||
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
|
||||
|
|
|
@ -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..."
|
||||
|
@ -103,6 +108,8 @@ chmod +x expect_scripts/install.exp
|
|||
chmod +x $final_path/seafile-server-$seafile_version/setup-seafile-mysql.sh
|
||||
expect_scripts/install.exp "$final_path/seafile-server-$seafile_version" "$server_name" "$domain" "$seafile_data" "$fileserver_port" "$db_pwd"
|
||||
|
||||
sleep 3
|
||||
|
||||
# Update seafile config
|
||||
ynh_replace_string --match_string http:// --replace_string https:// --target_file $final_path/conf/ccnet.conf
|
||||
ynh_replace_string --match_string :8000 --replace_string $path_url --target_file $final_path/conf/ccnet.conf
|
||||
|
|
|
@ -44,8 +44,6 @@ ynh_secure_remove --file=/var/log/seafile
|
|||
ynh_script_progression --message="Removing code..."
|
||||
ynh_secure_remove --file=/var/www/$app
|
||||
ynh_secure_remove --file=/opt/yunohost/$app
|
||||
ynh_script_progression --message="Removing user data..."
|
||||
ynh_secure_remove --file=/home/yunohost.app/seafile-data
|
||||
ynh_secure_remove --file=/tmp/seahub_cache
|
||||
|
||||
# Remove databases
|
||||
|
@ -82,4 +80,7 @@ ynh_script_progression --message="Removing seafile service..."
|
|||
yunohost service remove seafile
|
||||
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
|
||||
|
|
|
@ -71,10 +71,10 @@ if [ $final_path == "/var/www/$app" ]; then
|
|||
ynh_app_setting_set --app $app --key final_path --value $final_path
|
||||
test -e /var/log/seafile && rm /var/log/$app
|
||||
if ! [ -z "$(ls -A $final_path/seafile_data)" ]; then
|
||||
# Data directory empty, so considere that all data are already in /home/yunohost.app/seafile
|
||||
mv /opt/yunohost/$app/seafile-data/* /home/yunohost.app/seafile-data/
|
||||
# Data directory NOT empty, transfer data to /home/yunohost.app/seafile
|
||||
mv $final_path/seafile_data/* /home/yunohost.app/seafile-data/
|
||||
ynh_secure_remove $final_path/seafile_data
|
||||
ln -s $seafile_data $final_path/seafile_data
|
||||
ln -s /home/yunohost.app/seafile-data $final_path/
|
||||
fi
|
||||
ln -s $final_path/logs /var/log/seafile
|
||||
set_permission
|
||||
|
|
Loading…
Add table
Reference in a new issue