From fa4be60b7d0516b768a2209a06d742c4d5044e63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Wed, 13 Dec 2023 10:13:25 +0100 Subject: [PATCH 01/23] Use localhost for mail host --- conf/seahub_settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/seahub_settings.py b/conf/seahub_settings.py index ee43935..7f6e0f7 100644 --- a/conf/seahub_settings.py +++ b/conf/seahub_settings.py @@ -22,7 +22,7 @@ MEDIA_URL = "__PATH2__media/" COMPRESS_URL = MEDIA_URL STATIC_URL = MEDIA_URL + 'assets/' EMAIL_USE_TLS = True -EMAIL_HOST = "__DOMAIN__" +EMAIL_HOST = "localhost" EMAIL_HOST_USER = "__APP__" EMAIL_HOST_PASSWORD = "__MAIL_PWD__" EMAIL_PORT = "587" From 5bc7abe7797263b652e564187a80a4fc878a0a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Mon, 18 Dec 2023 14:34:09 +0100 Subject: [PATCH 02/23] Use $app instead of $YNH_APP_ID --- scripts/_common.sh | 8 ++++---- scripts/install | 2 +- scripts/upgrade | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 8db757b..94a4ed2 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -59,7 +59,7 @@ install_dependance() { } set_permission() { - chown -R $YNH_APP_ID:$YNH_APP_ID $install_dir + chown -R $app:$app $install_dir chmod -R u+rwX,g-wx,o= $install_dir setfacl -m user:www-data:rX $install_dir setfacl -m user:www-data:rX $install_dir/seafile-server-$seafile_version @@ -69,9 +69,9 @@ set_permission() { test -e $install_dir/seahub-data && setfacl -R -m user:www-data:rX $install_dir/seahub-data find $data_dir \( \! -perm -o= \ - -o \! -user $YNH_APP_ID \ - -o \! -group $YNH_APP_ID \) \ - -exec chown $YNH_APP_ID:$YNH_APP_ID {} \; \ + -o \! -user $app \ + -o \! -group $app \) \ + -exec chown $app:$app {} \; \ -exec chmod o= {} \; } diff --git a/scripts/install b/scripts/install index e4f59c9..11cee59 100644 --- a/scripts/install +++ b/scripts/install @@ -57,7 +57,7 @@ set_permission ynh_replace_special_string --match_string 'seafile_config.seafile_dir = seafile_config.validate_seafile_dir(seafile_dir)' \ --replace_string 'seafile_config.seafile_dir = seafile_dir' \ --target_file $install_dir/seafile-server-$seafile_version/setup-seafile-mysql.py -sudo -u $YNH_APP_ID bash $install_dir/seafile-server-$seafile_version/setup-seafile-mysql.sh auto \ +sudo -u $app bash $install_dir/seafile-server-$seafile_version/setup-seafile-mysql.sh auto \ --server-name "$server_name" \ --server-ip $domain \ --fileserver-port $port_fileserver \ diff --git a/scripts/upgrade b/scripts/upgrade index 082aa56..d8cac23 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -109,12 +109,12 @@ case $installed_version in "7.0"* ) # Fix file comment pushd $install_dir/seafile-server-$seafile_version - sudo -u $YNH_APP_ID $install_dir/seafile-server-$seafile_version/seahub.sh python-env python3 seahub/manage.py migrate_file_comment + sudo -u $app $install_dir/seafile-server-$seafile_version/seahub.sh python-env python3 seahub/manage.py migrate_file_comment popd # Update seafile by script ynh_replace_string --match_string='read dummy' --replace_string='# patched' --target_file=$install_dir/seafile-server-$seafile_version/upgrade/upgrade_7.0_7.1.sh - sudo -u $YNH_APP_ID bash $install_dir/seafile-server-$seafile_version/upgrade/upgrade_7.0_7.1.sh + sudo -u $app bash $install_dir/seafile-server-$seafile_version/upgrade/upgrade_7.0_7.1.sh # Fix seafile data link. Look like that the upgrade script of seafile don't always work correctly if [ -e $install_dir/seafile-data ]; then @@ -125,16 +125,16 @@ case $installed_version in ;& "7.1."* ) ynh_replace_string --match_string='read dummy' --replace_string='# patched' --target_file=$install_dir/seafile-server-$seafile_version/upgrade/upgrade_8.0_9.0.sh - sudo -u $YNH_APP_ID bash $install_dir/seafile-server-$seafile_version/upgrade/upgrade_8.0_9.0.sh + sudo -u $app bash $install_dir/seafile-server-$seafile_version/upgrade/upgrade_8.0_9.0.sh ;& "8.0."* ) ynh_replace_string --match_string='read dummy' --replace_string='# patched' --target_file=$install_dir/seafile-server-$seafile_version/upgrade/upgrade_7.1_8.0.sh - sudo -u $YNH_APP_ID bash $install_dir/seafile-server-$seafile_version/upgrade/upgrade_7.1_8.0.sh + sudo -u $app bash $install_dir/seafile-server-$seafile_version/upgrade/upgrade_7.1_8.0.sh ;& esac ynh_replace_string --match_string='read dummy' --replace_string='# patched' --target_file=$install_dir/seafile-server-$seafile_version/upgrade/minor-upgrade.sh -sudo -u $YNH_APP_ID bash $install_dir/seafile-server-$seafile_version/upgrade/minor-upgrade.sh +sudo -u $app bash $install_dir/seafile-server-$seafile_version/upgrade/minor-upgrade.sh # Clean url in config in DB clean_url_in_db_config From 0e596d43eff14abb2d1c5a1c016c85e3413572e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Tue, 20 Feb 2024 21:28:59 +0100 Subject: [PATCH 03/23] Add missing description for yunohost service --- scripts/install | 4 ++-- scripts/restore | 4 ++-- scripts/upgrade | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 11cee59..ed21b97 100644 --- a/scripts/install +++ b/scripts/install @@ -97,8 +97,8 @@ ynh_add_systemd_config --service seafile --template seafile.service ynh_add_systemd_config --service seahub --template seahub.service # register yunohost service -yunohost service add seafile -yunohost service add seahub +yunohost service add seafile --description 'Main service for seafile server.' +yunohost service add seahub --description 'Seafile server web interface.' # Config nginx ynh_script_progression --message="Configuring nginx..." diff --git a/scripts/restore b/scripts/restore index b88f319..082a938 100644 --- a/scripts/restore +++ b/scripts/restore @@ -54,8 +54,8 @@ systemctl enable seahub --quiet # Add Seafile to YunoHost's monitored services ynh_script_progression --message="Register seafile service..." -yunohost service add seafile -yunohost service add seahub +yunohost service add seafile --description 'Main service for seafile server.' +yunohost service add seahub --description 'Seafile server web interface.' ynh_script_progression --message="Reloading services..." diff --git a/scripts/upgrade b/scripts/upgrade index d8cac23..ae56198 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -179,8 +179,8 @@ ynh_add_fail2ban_config --use_template # register yunohost service ynh_script_progression --message="Register seafile service..." -yunohost service add seafile -yunohost service add seahub +yunohost service add seafile --description 'Main service for seafile server.' +yunohost service add seahub --description 'Seafile server web interface.' # delete seafile cache From 1da96bb7f343e61f0561af36ace07173a44ad688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 23 Feb 2024 20:43:47 +0100 Subject: [PATCH 04/23] Revert "Use localhost for mail host" This reverts commit fa4be60b7d0516b768a2209a06d742c4d5044e63. --- conf/seahub_settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/seahub_settings.py b/conf/seahub_settings.py index 7f6e0f7..ee43935 100644 --- a/conf/seahub_settings.py +++ b/conf/seahub_settings.py @@ -22,7 +22,7 @@ MEDIA_URL = "__PATH2__media/" COMPRESS_URL = MEDIA_URL STATIC_URL = MEDIA_URL + 'assets/' EMAIL_USE_TLS = True -EMAIL_HOST = "localhost" +EMAIL_HOST = "__DOMAIN__" EMAIL_HOST_USER = "__APP__" EMAIL_HOST_PASSWORD = "__MAIL_PWD__" EMAIL_PORT = "587" From 8d0ba4748a8fb2f8e93c76451c05ce1f722c2057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Thu, 28 Mar 2024 00:06:54 +0100 Subject: [PATCH 05/23] Cleanup gitignore --- .gitignore | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.gitignore b/.gitignore index c539227..da8f598 100644 --- a/.gitignore +++ b/.gitignore @@ -129,10 +129,6 @@ publish/ *.pubxml *.publishproj -# NuGet Packages Directory -## TODO: If you have NuGet Package Restore enabled, uncomment the next line -#packages/ - # Windows Azure Build Output csx *.build.csdef From a73097649cafe73f5152c71257e3ece2aae07465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Thu, 28 Mar 2024 00:07:03 +0100 Subject: [PATCH 06/23] Cleanup nginx config --- conf/nginx.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 4c1959a..5c8f248 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,5 +1,4 @@ location __PATH__ { - proxy_redirect http:// https://; proxy_pass http://127.0.0.1:__PORT_SEAHUB__; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; From 0c75e0676869b98a9883ad0e2af20bc192a4b945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Mon, 8 Apr 2024 00:30:00 +0200 Subject: [PATCH 07/23] Use systemd is-active instead of systemd status --- scripts/backup | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/backup b/scripts/backup index b5a8e07..91a88cc 100644 --- a/scripts/backup +++ b/scripts/backup @@ -11,10 +11,7 @@ source ../settings/scripts/_common.sh # Source YunoHost helpers source /usr/share/yunohost/helpers -# retrieve useful param -seafile_version=$(ynh_app_upstream_version) - -if [[ ! "$(systemctl status seafile)" =~ "Active: inactive (dead)" ]] || [[ ! "$(systemctl status seahub)" =~ "Active: failed (Result: signal)" ]]; then +if systemctl is-active seafile --quiet || systemctl is-active seahub --quiet; 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 From ba9717b8f8ceedf85c1af202a8347bdbbe82d935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 12 Apr 2024 22:19:27 +0200 Subject: [PATCH 08/23] Improve data storage management and improve scripts --- manifest.toml | 2 +- scripts/_common.sh | 8 +++++ scripts/backup | 2 ++ scripts/change_url | 2 ++ scripts/install | 62 ++++++++++++++++++--------------- scripts/remove | 2 ++ scripts/restore | 2 ++ scripts/upgrade | 85 +++++++++++++++++++++++++++------------------- 8 files changed, 102 insertions(+), 63 deletions(-) diff --git a/manifest.toml b/manifest.toml index 825e155..6483e63 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Seafile" description.en = "Open Source Cloud Storage" description.fr = "Stockage Cloud Open Source" -version = "9.0.9~ynh2" +version = "9.0.9~ynh3" maintainers = ["Josué Tille"] diff --git a/scripts/_common.sh b/scripts/_common.sh index 94a4ed2..0a7a129 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,6 +5,14 @@ time_zone=$(cat /etc/timezone) python_version="$(python3 -V | cut -d' ' -f2 | cut -d. -f1-2)" +# Create special path with / at the end +if [[ $path == '/' ]] +then + path2="$path" +else + path2="$path/" +fi + #================================================= # DEFINE ALL COMMON FONCTIONS #================================================= diff --git a/scripts/backup b/scripts/backup index 91a88cc..3c09f25 100644 --- a/scripts/backup +++ b/scripts/backup @@ -11,6 +11,8 @@ source ../settings/scripts/_common.sh # Source YunoHost helpers source /usr/share/yunohost/helpers +seafile_version=$(ynh_app_upstream_version) + if systemctl is-active seafile --quiet || systemctl is-active seahub --quiet; 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 diff --git a/scripts/change_url b/scripts/change_url index d5834ae..5e38c3c 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -11,6 +11,8 @@ source ./_common.sh # Source YunoHost helpers source /usr/share/yunohost/helpers +seafile_version=$(ynh_app_upstream_version) + # Create special path with / at the end if [[ $path == '/' ]] then diff --git a/scripts/install b/scripts/install index ed21b97..c8d737d 100644 --- a/scripts/install +++ b/scripts/install @@ -13,29 +13,22 @@ source /usr/share/yunohost/helpers seafile_version=$(ynh_app_upstream_version) -# Create special path with / at the end -if [[ $path == '/' ]] -then - path2=$path -else - path2=$path"/" -fi - #================================================= # STANDARD MODIFICATIONS #================================================= ynh_script_progression --message="Creating base directory..." -ln -s $data_dir $install_dir/seafile-data -mkdir -p $install_dir/logs -if [ -n "$(ls -A $data_dir)" ]; then +if [ -n "$(ls -A "$data_dir")" ]; then old_data_dir_path="${data_dir}_$(date '+%Y%m%d.%H%M%S')" ynh_print_warn "Data directory was not empty. Data was moved to $old_data_dir_path" - mkdir -p $old_data_dir_path + mkdir -p "$old_data_dir_path" mv -t "$old_data_dir_path" "$data_dir"/* fi +mkdir -p /var/log/"$app" +mkdir -p "$data_dir"/{seafile-data,seahub-data} + # Download new version from sources ynh_script_progression --message="Installing sources files..." --weight=7 ynh_setup_source --dest_dir=$install_dir/seafile-server-$seafile_version @@ -46,9 +39,8 @@ install_dependance # init databases ynh_script_progression --message="Configuring MySQL database..." db_user=seafile -db_helper=ynh_"mysql"_setup_db -$db_helper --db_user $db_user --db_name ccnetdb --db_pwd "$db_pwd" -$db_helper --db_user $db_user --db_name seahubdb --db_pwd "$db_pwd" +ynh_''mysql_setup_db --db_user "$db_user" --db_name ccnetdb --db_pwd "$db_pwd" +ynh_''mysql_setup_db --db_user "$db_user" --db_name seahubdb --db_pwd "$db_pwd" ynh_script_progression --message="Configuring application..." --weight=3 @@ -56,23 +48,23 @@ ynh_script_progression --message="Configuring application..." --weight=3 set_permission ynh_replace_special_string --match_string 'seafile_config.seafile_dir = seafile_config.validate_seafile_dir(seafile_dir)' \ --replace_string 'seafile_config.seafile_dir = seafile_dir' \ - --target_file $install_dir/seafile-server-$seafile_version/setup-seafile-mysql.py -sudo -u $app bash $install_dir/seafile-server-$seafile_version/setup-seafile-mysql.sh auto \ + --target_file "$install_dir/seafile-server-$seafile_version/setup-seafile-mysql.py" +sudo -u "$app" bash "$install_dir/seafile-server-$seafile_version/setup-seafile-mysql.sh" auto \ --server-name "$server_name" \ - --server-ip $domain \ - --fileserver-port $port_fileserver \ + --server-ip "$domain" \ + --fileserver-port "$port_fileserver" \ --use-existing-db 1 \ --mysql-host localhost \ --mysql-port 3306 \ - --mysql-user $db_user \ + --mysql-user "$db_user" \ --mysql-user-passwd "$db_pwd" \ --seafile-db "$db_name" \ --ccnet-db ccnetdb \ --seahub-db seahubdb # Retrive values from auto generated config file -seahub_secret_key=$(grep -P 'SECRET_KEY\s*=\s*".+"' $install_dir/conf/seahub_settings.py | cut -d'"' -f2) -ynh_app_setting_set --app $app --key seahub_secret_key --value $seahub_secret_key +seahub_secret_key=$(grep -P 'SECRET_KEY\s*=\s*".+"' "$install_dir"/conf/seahub_settings.py | cut -d'"' -f2) +ynh_app_setting_set --app "$app" --key seahub_secret_key --value "$seahub_secret_key" # Update seafile config files ynh_add_config --template=seahub_settings.py --destination=$install_dir/conf/seahub_settings.py @@ -83,10 +75,27 @@ ynh_add_config --template=seafdav.conf --destination=$install_dir/conf/seafdav.c # Configure admin info # It will be used the first start -admin_email=$(ynh_user_get_info --username $admin --key 'mail') +admin_email=$(ynh_user_get_info --username "$admin" --key 'mail') cp ../conf/create_admin.json $install_dir/conf/admin.txt -ynh_replace_string --match_string __ADMIN__ --replace_string $admin_email --target_file $install_dir/conf/admin.txt -ynh_replace_special_string --match_string __PASSWORD__ --replace_string $admin_password --target_file $install_dir/conf/admin.txt +ynh_replace_string --match_string __ADMIN__ --replace_string "$admin_email" --target_file $install_dir/conf/admin.txt +ynh_replace_special_string --match_string __PASSWORD__ --replace_string "$admin_password" --target_file $install_dir/conf/admin.txt + +# Use symlink to store data +if [ -e "$install_dir"/seafile-data ]; then + mv -t "$data_dir"/seafile-data "$install_dir"/seafile-data/* + ynh_secure_remove --file="$install_dir"/seafile-data +fi +if [ -e "$install_dir"/seahub-data ]; then + mv -t "$data_dir"/seahub-data "$install_dir"/seahub-data/* + ynh_secure_remove --file="$install_dir"/seahub-data +fi +if [ -e "$install_dir"/logs ]; then + mv -t /var/log/"$app" "$install_dir"/logs/* + ynh_secure_remove --file="$install_dir"/logs +fi +ln -s "$data_dir"/seafile-data "$install_dir"/seafile-data +ln -s "$data_dir"/seahub-data "$install_dir"/seahub-data +ln -s /var/log/"$app" "$install_dir"/logs # Fix local warning ynh_replace_string --match_string en_US.UTF-8 --replace_string ${LANG:-'en_US.UTF-8'} --target_file $install_dir/seafile-server-$seafile_version/seahub.sh @@ -106,8 +115,7 @@ ynh_add_nginx_config # Add logrotate ynh_script_progression --message="Configuring log rotation..." -ynh_use_logrotate --logfile $install_dir/logs -ln -s $install_dir/logs /var/log/seafile +ynh_use_logrotate --logfile=/var/log/"$app" # Add fail2ban ynh_script_progression --message="Configuring fail2ban..." diff --git a/scripts/remove b/scripts/remove index aafe721..73e8632 100644 --- a/scripts/remove +++ b/scripts/remove @@ -11,6 +11,8 @@ source ./_common.sh # Source YunoHost helpers source /usr/share/yunohost/helpers +seafile_version=$(ynh_app_upstream_version) + #================================================= # STANDARD REMOVE #================================================= diff --git a/scripts/restore b/scripts/restore index 082a938..ed8d95d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -11,6 +11,8 @@ source ../settings/scripts/_common.sh # Source YunoHost helpers source /usr/share/yunohost/helpers +seafile_version=$(ynh_app_upstream_version) + ynh_script_progression --message="Loading settings..." # Retrieve arguments diff --git a/scripts/upgrade b/scripts/upgrade index ae56198..29cd6ef 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -11,36 +11,19 @@ source ./_common.sh # Source YunoHost helpers source /usr/share/yunohost/helpers -# Retrieve arguments -installed_version=${YNH_APP_CURRENT_VERSION/~ynh*/} seafile_version=$(ynh_app_upstream_version) -# Create special path with / at the end -if [[ $path == '/' ]] -then - path2=$path -else - path2=$path"/" -fi +# Retrieve arguments +installed_version=${YNH_APP_CURRENT_VERSION/~ynh*/} -if [ "$YNH_APP_CURRENT_VERSION" == '-' ]; then +if [ "$YNH_APP_CURRENT_VERSION" == '-' ] || ynh_compare_current_package_version --comparison=le --version='7.0~ynh1'; then ynh_die "Upgrade from this version not supported" fi ynh_script_progression --message="Stoping services..." -# stop seafile server -if [ -e /etc/init.d/seafile-server ] -then - # Old init script support - systemctl stop seafile-server --quiet - systemctl disable seafile-server --quiet - ynh_secure_remove --file=/etc/init.d/seafile-server - yunohost service remove seafile-server -else - ynh_systemd_action --service_name seafile --action stop - ynh_systemd_action --service_name seahub --action stop -fi +ynh_systemd_action --service_name seafile --action stop +ynh_systemd_action --service_name seahub --action stop sleep 5 pkill -f seafile-controller || true pkill -f seaf-server || true @@ -56,34 +39,66 @@ if mysqlshow | grep -q seafiledb; then $mysqlconn -e "RENAME TABLE seafiledb.$name to $db_name.$name"; done; $mysqlconn -e "DROP DATABASE seafiledb" - ynh_replace_string --match_string='db_name = seafiledb' --replace_string='db_name = seafile' --target_file=$install_dir/conf/seafile.conf - sed -i "s|password\s*=\s*.*^|password = $db_pwd|g" $install_dir/conf/seafile.conf + ynh_replace_string --match_string='db_name = seafiledb' --replace_string='db_name = seafile' --target_file="$install_dir"/conf/seafile.conf + sed -i "s|password\s*=\s*.*^|password = $db_pwd|g" "$install_dir"/conf/seafile.conf fi # Set missing settings -if [ -z ${seahub_secret_key:-} ]; then - seahub_secret_key=$(grep -P 'SECRET_KEY\s*=\s*".+"' $install_dir/conf/seahub_settings.py | cut -d'"' -f2) - ynh_app_setting_set --app $app --key seahub_secret_key --value $seahub_secret_key +if [ -z "${seahub_secret_key:-}" ]; then + seahub_secret_key=$(grep -P 'SECRET_KEY\s*=\s*".+"' "$install_dir"/conf/seahub_settings.py | cut -d'"' -f2) + ynh_app_setting_set --app "$app" --key seahub_secret_key --value "$seahub_secret_key" fi +# # Update data dir if needed +# + +# Create link to /home/yunohost.app/seafile/seafile-data in case of old install with data dir defined in config instead of symlink +# Also update link if not pointing to correct path if [ ! -L /home/yunohost.app/seafile-data ] || \ - [ $(readlink $install_dir/seafile-data) = '/home/yunohost.app/seafile-data' ]; then - mv $install_dir/seafile-data $install_dir/seafile-data$(date '+%Y%m%d.%H%M%S') - ln -s $data_dir $install_dir/seafile-data + [ "$(readlink "$install_dir"/seafile-data)" != "$data_dir/seafile-data" ]; then + mv "$install_dir"/seafile-data "$install_dir/seafile-data_$(date '+%Y%m%d.%H%M%S')" + ln -s "$data_dir"/seafile-data "$install_dir"/seafile-data fi + +# Move if needed old /home/yunohost.app/seafile-data dir to /home/yunohost.app/seafile/seafile-data if [ -e /home/yunohost.app/seafile-data ]; then - if [ -e $data_dir ]; then - mv $data_dir $data_dir$(date '+%Y%m%d.%H%M%S') + if [ -e "$data_dir" ]; then + mv "$data_dir" "${data_dir}_$(date '+%Y%m%d.%H%M%S')" fi - mv /home/yunohost.app/seafile-data $data_dir + mkdir -p "$data_dir" + mv /home/yunohost.app/seafile-data "$data_dir"/ +fi + +# In case of seafile-data content was directly stored in /home/yunohost.app/seafile +if [ -e "$data_dir"/storage ]; then + mkdir -p "$data_dir"/seafile-data + mv -t "$data_dir"/seafile-data "$data_dir"/{commits,fs,httptemp,library-template,storage,tmpfiles,webdavtmp} || true # In case of some of dir don't exist +fi + +# Move seahub data to /home/yunohost.app/seafile/seahub-data +if [ ! -L "$install_dir"/seahub-data ]; then + if [ -e "$data_dir"/seahub-data ]; then + mv "$data_dir"/seahub-data "$data_dir/seahub-data_$(date '+%Y%m%d.%H%M%S')" + fi + mv "$install_dir"/seahub-data "$data_dir"/ + ln -s "$data_dir"/seahub-data "$install_dir"/seahub-data +fi + +# Move logs storage to /var/log/seafile +if [ ! -L "$install_dir"/logs ]; then + if [ -e /var/log/"$app" ]; then + mv /var/log/"$app" /var/log/"${app}_$(date '+%Y%m%d.%H%M%S')" + fi + mv "$install_dir"/logs /var/log/"${app}" + ln -s /var/log/"${app}" "$install_dir"/logs fi ynh_script_progression --message="Upgrading source files..." --weight=6 # Download new version from sources ynh_script_progression --message="Installing sources files..." --weight=7 -ynh_setup_source --dest_dir=$install_dir/seafile-server-$seafile_version +ynh_setup_source --dest_dir="$install_dir"/seafile-server-$seafile_version ynh_script_progression --message="Installing python dependancies..." install_dependance @@ -171,7 +186,7 @@ set_permission # Add logrotate ynh_script_progression --message="Configuring log rotation..." -ynh_use_logrotate --logfile $install_dir/logs --nonappend +ynh_use_logrotate --logfile=/var/log/"$app" --nonappend # Add fail2ban ynh_script_progression --message="Configuring fail2ban..." --weight=10 From 97b03cd6fc973ae13042e08349dc5ea3ae9419f2 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 16 Apr 2024 22:33:23 +0000 Subject: [PATCH 09/23] Auto-update READMEs --- ALL_README.md | 7 ++++++ README.md | 28 +++++++++++----------- README_eu.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++ README_fr.md | 32 ++++++++++++------------- README_gl.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++ README_zh_Hans.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 214 insertions(+), 30 deletions(-) create mode 100644 ALL_README.md create mode 100644 README_eu.md create mode 100644 README_gl.md create mode 100644 README_zh_Hans.md diff --git a/ALL_README.md b/ALL_README.md new file mode 100644 index 0000000..a01b345 --- /dev/null +++ b/ALL_README.md @@ -0,0 +1,7 @@ +# All available README files by language + +- [Read the README in English](README.md) +- [Irakurri README euskaraz](README_eu.md) +- [Lire le README en français](README_fr.md) +- [Le o README en galego](README_gl.md) +- [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README.md b/README.md index 917d640..c3b9816 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ @@ -9,10 +9,10 @@ It shall NOT be edited by hand. [![Install Seafile with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=seafile) -*[Lire ce readme en français.](./README_fr.md)* +*[Read this README in other languages.](./ALL_README.md)* -> *This package allows you to install Seafile quickly and simply on a YunoHost server. -If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* +> *This package allows you to install Seafile quickly and simply on a YunoHost server.* +> *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.* ## Overview @@ -21,9 +21,9 @@ Seafile is an open Source Cloud Storage application. It's a Enterprise file sync and share platform with high reliability and performance. It's a file hosting platform with high reliability and performance. Put files on your own server. Sync and share files across different devices, or access all the files as a virtual disk. -**Shipped version:** 9.0.9~ynh2 +**Shipped version:** 9.0.9~ynh3 -**Demo:** https://demo.seafile.com +**Demo:** ## Screenshots @@ -38,19 +38,19 @@ It's a Enterprise file sync and share platform with high reliability and perform ## Documentation and resources -* Official app website: -* Official admin documentation: -* Upstream app code repository: -* YunoHost Store: -* Report a bug: +- Official app website: +- Official admin documentation: +- Upstream app code repository: +- YunoHost Store: +- Report a bug: ## Developer info -Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/seafile_ynh/tree/testing). +Please send your pull request to the [`testing` branch](https://github.com/YunoHost-Apps/seafile_ynh/tree/testing). -To try the testing branch, please proceed like that. +To try the `testing` branch, please proceed like that: -``` bash +```bash sudo yunohost app install https://github.com/YunoHost-Apps/seafile_ynh/tree/testing --debug or sudo yunohost app upgrade seafile -u https://github.com/YunoHost-Apps/seafile_ynh/tree/testing --debug diff --git a/README_eu.md b/README_eu.md new file mode 100644 index 0000000..d4ff6c0 --- /dev/null +++ b/README_eu.md @@ -0,0 +1,59 @@ + + +# Seafile YunoHost-erako + +[![Integrazio maila](https://dash.yunohost.org/integration/seafile.svg)](https://dash.yunohost.org/appci/app/seafile) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/seafile.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/seafile.maintain.svg) + +[![Instalatu Seafile YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=seafile) + +*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)* + +> *Pakete honek Seafile YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.* +> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.* + +## Aurreikuspena + +Seafile is an open Source Cloud Storage application. + +It's a Enterprise file sync and share platform with high reliability and performance. It's a file hosting platform with high reliability and performance. Put files on your own server. Sync and share files across different devices, or access all the files as a virtual disk. + + +**Paketatutako bertsioa:** 9.0.9~ynh3 + +**Demoa:** + +## Pantaila-argazkiak + +![Seafile(r)en pantaila-argazkia](./doc/screenshots/mobile-ios-client.jpg) +![Seafile(r)en pantaila-argazkia](./doc/screenshots/drive-client.png) +![Seafile(r)en pantaila-argazkia](./doc/screenshots/file-locking.jpg) +![Seafile(r)en pantaila-argazkia](./doc/screenshots/access-logs.jpg) +![Seafile(r)en pantaila-argazkia](./doc/screenshots/file-history.png) +![Seafile(r)en pantaila-argazkia](./doc/screenshots/wiki_en.png) +![Seafile(r)en pantaila-argazkia](./doc/screenshots/sharing-dialog.png) +![Seafile(r)en pantaila-argazkia](./doc/screenshots/sync-client.jpg) + +## Dokumentazioa eta baliabideak + +- Aplikazioaren webgune ofiziala: +- Administratzaileen dokumentazio ofiziala: +- Jatorrizko aplikazioaren kode-gordailua: +- YunoHost Denda: +- Eman errore baten berri: + +## Garatzaileentzako informazioa + +Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/seafile_ynh/tree/testing). + +`testing` abarra probatzeko, ondorengoa egin: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/seafile_ynh/tree/testing --debug +edo +sudo yunohost app upgrade seafile -u https://github.com/YunoHost-Apps/seafile_ynh/tree/testing --debug +``` + +**Informazio gehiago aplikazioaren paketatzeari buruz:** diff --git a/README_fr.md b/README_fr.md index 554eb20..cda0d15 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,6 +1,6 @@ # Seafile pour YunoHost @@ -9,10 +9,10 @@ It shall NOT be edited by hand. [![Installer Seafile avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=seafile) -*[Read this readme in english.](./README.md)* +*[Lire le README dans d'autres langues.](./ALL_README.md)* -> *Ce package vous permet d’installer Seafile rapidement et simplement sur un serveur YunoHost. -Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* +> *Ce package vous permet d’installer Seafile rapidement et simplement sur un serveur YunoHost.* +> *Si vous n’avez pas YunoHost, consultez [ce guide](https://yunohost.org/install) pour savoir comment l’installer et en profiter.* ## Vue d’ensemble @@ -21,9 +21,9 @@ Seafile is an open Source Cloud Storage application. It's a Enterprise file sync and share platform with high reliability and performance. It's a file hosting platform with high reliability and performance. Put files on your own server. Sync and share files across different devices, or access all the files as a virtual disk. -**Version incluse :** 9.0.9~ynh2 +**Version incluse :** 9.0.9~ynh3 -**Démo :** https://demo.seafile.com +**Démo :** ## Captures d’écran @@ -38,22 +38,22 @@ It's a Enterprise file sync and share platform with high reliability and perform ## Documentations et ressources -* Site officiel de l’app : -* Documentation officielle de l’admin : -* Dépôt de code officiel de l’app : -* YunoHost Store: -* Signaler un bug : +- Site officiel de l’app : +- Documentation officielle de l’admin : +- Dépôt de code officiel de l’app : +- YunoHost Store : +- Signaler un bug : ## Informations pour les développeurs -Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/seafile_ynh/tree/testing). +Merci de faire vos pull request sur la [branche `testing`](https://github.com/YunoHost-Apps/seafile_ynh/tree/testing). -Pour essayer la branche testing, procédez comme suit. +Pour essayer la branche `testing`, procédez comme suit : -``` bash +```bash sudo yunohost app install https://github.com/YunoHost-Apps/seafile_ynh/tree/testing --debug ou sudo yunohost app upgrade seafile -u https://github.com/YunoHost-Apps/seafile_ynh/tree/testing --debug ``` -**Plus d’infos sur le packaging d’applications :** \ No newline at end of file +**Plus d’infos sur le packaging d’applications :** diff --git a/README_gl.md b/README_gl.md new file mode 100644 index 0000000..38504bc --- /dev/null +++ b/README_gl.md @@ -0,0 +1,59 @@ + + +# Seafile para YunoHost + +[![Nivel de integración](https://dash.yunohost.org/integration/seafile.svg)](https://dash.yunohost.org/appci/app/seafile) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/seafile.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/seafile.maintain.svg) + +[![Instalar Seafile con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=seafile) + +*[Le este README en outros idiomas.](./ALL_README.md)* + +> *Este paquete permíteche instalar Seafile de xeito rápido e doado nun servidor YunoHost.* +> *Se non usas YunoHost, le a [documentación](https://yunohost.org/install) para saber como instalalo.* + +## Vista xeral + +Seafile is an open Source Cloud Storage application. + +It's a Enterprise file sync and share platform with high reliability and performance. It's a file hosting platform with high reliability and performance. Put files on your own server. Sync and share files across different devices, or access all the files as a virtual disk. + + +**Versión proporcionada:** 9.0.9~ynh3 + +**Demo:** + +## Capturas de pantalla + +![Captura de pantalla de Seafile](./doc/screenshots/mobile-ios-client.jpg) +![Captura de pantalla de Seafile](./doc/screenshots/drive-client.png) +![Captura de pantalla de Seafile](./doc/screenshots/file-locking.jpg) +![Captura de pantalla de Seafile](./doc/screenshots/access-logs.jpg) +![Captura de pantalla de Seafile](./doc/screenshots/file-history.png) +![Captura de pantalla de Seafile](./doc/screenshots/wiki_en.png) +![Captura de pantalla de Seafile](./doc/screenshots/sharing-dialog.png) +![Captura de pantalla de Seafile](./doc/screenshots/sync-client.jpg) + +## Documentación e recursos + +- Web oficial da app: +- Documentación oficial para admin: +- Repositorio de orixe do código: +- Tenda YunoHost: +- Informar dun problema: + +## Info de desenvolvemento + +Envía a túa colaboración á [rama `testing`](https://github.com/YunoHost-Apps/seafile_ynh/tree/testing). + +Para probar a rama `testing`, procede deste xeito: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/seafile_ynh/tree/testing --debug +ou +sudo yunohost app upgrade seafile -u https://github.com/YunoHost-Apps/seafile_ynh/tree/testing --debug +``` + +**Máis info sobre o empaquetado da app:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md new file mode 100644 index 0000000..8eed69f --- /dev/null +++ b/README_zh_Hans.md @@ -0,0 +1,59 @@ + + +# YunoHost 的 Seafile + +[![集成程度](https://dash.yunohost.org/integration/seafile.svg)](https://dash.yunohost.org/appci/app/seafile) ![工作状态](https://ci-apps.yunohost.org/ci/badges/seafile.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/seafile.maintain.svg) + +[![使用 YunoHost 安装 Seafile](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=seafile) + +*[阅读此 README 的其它语言版本。](./ALL_README.md)* + +> *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 Seafile。* +> *如果您还没有 YunoHost,请参阅[指南](https://yunohost.org/install)了解如何安装它。* + +## 概况 + +Seafile is an open Source Cloud Storage application. + +It's a Enterprise file sync and share platform with high reliability and performance. It's a file hosting platform with high reliability and performance. Put files on your own server. Sync and share files across different devices, or access all the files as a virtual disk. + + +**分发版本:** 9.0.9~ynh3 + +**演示:** + +## 截图 + +![Seafile 的截图](./doc/screenshots/mobile-ios-client.jpg) +![Seafile 的截图](./doc/screenshots/drive-client.png) +![Seafile 的截图](./doc/screenshots/file-locking.jpg) +![Seafile 的截图](./doc/screenshots/access-logs.jpg) +![Seafile 的截图](./doc/screenshots/file-history.png) +![Seafile 的截图](./doc/screenshots/wiki_en.png) +![Seafile 的截图](./doc/screenshots/sharing-dialog.png) +![Seafile 的截图](./doc/screenshots/sync-client.jpg) + +## 文档与资源 + +- 官方应用网站: +- 官方管理文档: +- 上游应用代码库: +- YunoHost 商店: +- 报告 bug: + +## 开发者信息 + +请向 [`testing` 分支](https://github.com/YunoHost-Apps/seafile_ynh/tree/testing) 发送拉取请求。 + +如要尝试 `testing` 分支,请这样操作: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/seafile_ynh/tree/testing --debug +或 +sudo yunohost app upgrade seafile -u https://github.com/YunoHost-Apps/seafile_ynh/tree/testing --debug +``` + +**有关应用打包的更多信息:** From f85f6ef626b07be0e7d7813dfb50b0762847e6ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sat, 20 Apr 2024 23:17:25 +0200 Subject: [PATCH 10/23] Install pkgconf manually to fix mysql error --- scripts/install | 6 ++++++ scripts/upgrade | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/scripts/install b/scripts/install index c8d737d..461bc81 100644 --- a/scripts/install +++ b/scripts/install @@ -13,6 +13,12 @@ source /usr/share/yunohost/helpers seafile_version=$(ynh_app_upstream_version) +# Install manually pkgconf +# WARNING don't move this to dependencies +# We install this manually because we have an issue between pkgconf and pkg-config. +# If pkg-config is already installed on the system we can't declare pkgconf as dependency as pkg-config need to be removed to install pkgconf (note that pkgconf replace pkg-config and both can't be installed) +ynh_apt install pkgconf + #================================================= # STANDARD MODIFICATIONS #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 29cd6ef..33eceb6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,6 +20,12 @@ if [ "$YNH_APP_CURRENT_VERSION" == '-' ] || ynh_compare_current_package_version ynh_die "Upgrade from this version not supported" fi +# Install manually pkgconf +# WARNING don't move this to dependencies +# We install this manually because we have an issue between pkgconf and pkg-config. +# If pkg-config is already installed on the system we can't declare pkgconf as dependency as pkg-config need to be removed to install pkgconf (note that pkgconf replace pkg-config and both can't be installed) +ynh_apt install pkgconf + ynh_script_progression --message="Stoping services..." ynh_systemd_action --service_name seafile --action stop From 3773e691678e47db9c52eef47567208feef2f2cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sun, 21 Apr 2024 01:50:52 +0200 Subject: [PATCH 11/23] Bypass linter error --- scripts/_common.sh | 8 ++++++++ scripts/install | 6 +----- scripts/upgrade | 6 +----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 0a7a129..4ad3168 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -17,6 +17,14 @@ fi # DEFINE ALL COMMON FONCTIONS #================================================= +install_pkg_conf() { + # Install manually pkgconf + # WARNING don't move this to dependencies + # We install this manually because we have an issue between pkgconf and pkg-config. + # If pkg-config is already installed on the system we can't declare pkgconf as dependency as pkg-config need to be removed to install pkgconf (note that pkgconf replace pkg-config and both can't be installed) + ynh_apt install pkgconf +} + install_dependance() { ynh_add_swap --size=2000 diff --git a/scripts/install b/scripts/install index 461bc81..ad85c79 100644 --- a/scripts/install +++ b/scripts/install @@ -13,11 +13,7 @@ source /usr/share/yunohost/helpers seafile_version=$(ynh_app_upstream_version) -# Install manually pkgconf -# WARNING don't move this to dependencies -# We install this manually because we have an issue between pkgconf and pkg-config. -# If pkg-config is already installed on the system we can't declare pkgconf as dependency as pkg-config need to be removed to install pkgconf (note that pkgconf replace pkg-config and both can't be installed) -ynh_apt install pkgconf +install_pkg_conf #================================================= # STANDARD MODIFICATIONS diff --git a/scripts/upgrade b/scripts/upgrade index 33eceb6..ce218d4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,11 +20,7 @@ if [ "$YNH_APP_CURRENT_VERSION" == '-' ] || ynh_compare_current_package_version ynh_die "Upgrade from this version not supported" fi -# Install manually pkgconf -# WARNING don't move this to dependencies -# We install this manually because we have an issue between pkgconf and pkg-config. -# If pkg-config is already installed on the system we can't declare pkgconf as dependency as pkg-config need to be removed to install pkgconf (note that pkgconf replace pkg-config and both can't be installed) -ynh_apt install pkgconf +install_pkg_conf ynh_script_progression --message="Stoping services..." From d6f66dfb7e71724a7f045f90993568a2ab7dd89f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sun, 21 Apr 2024 01:58:30 +0200 Subject: [PATCH 12/23] Fix restore script --- scripts/restore | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/restore b/scripts/restore index ed8d95d..19a50cc 100644 --- a/scripts/restore +++ b/scripts/restore @@ -29,8 +29,8 @@ ynh_restore # Restore mysql dump ynh_script_progression --message="Restoring database..." --weight=3 db_helper=ynh_"mysql"_setup_db -$db_helper --db_user $db_user --db_name ccnetdb --db_pwd "$db_pwd" -$db_helper --db_user $db_user --db_name seahubdb --db_pwd "$db_pwd" +$db_helper --db_user "$db_user" --db_name ccnetdb --db_pwd "$db_pwd" +$db_helper --db_user "$db_user" --db_name seahubdb --db_pwd "$db_pwd" su -c "mysql -u ${app} -p$db_pwd $db_name < ${YNH_CWD}/seafiledb.dmp" su -c "mysql -u ${app} -p$db_pwd ccnetdb < ${YNH_CWD}/ccnetdb.dmp" su -c "mysql -u ${app} -p$db_pwd seahubdb < ${YNH_CWD}/seahubdb.dmp" @@ -41,8 +41,8 @@ su -c "mysql -u ${app} -p$db_pwd seahubdb < ${YNH_CWD}/seahubdb.dmp" # Add logrotate ynh_script_progression --message="Configuring log rotation..." -ynh_use_logrotate --logfile $install_dir/logs -ln -s $install_dir/logs /var/log/seafile +mkdir -p /var/log/"$app" +ynh_use_logrotate --logfile "$install_dir"/logs # Set all permissions ynh_script_progression --message="Protecting directory..." From 1044767a8900a6824433b033284a7caefd0979ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sun, 21 Apr 2024 12:07:55 +0200 Subject: [PATCH 13/23] Remove log only if purge are enabled --- scripts/remove | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/remove b/scripts/remove index 73e8632..6020846 100644 --- a/scripts/remove +++ b/scripts/remove @@ -29,8 +29,10 @@ pkill -f seaf-server || true pkill -f ccnet-server || true pkill -f seahub || true -ynh_script_progression --message="Removing logs..." -ynh_secure_remove --file=/var/log/seafile +if [ "$YNH_APP_PURGE" -eq 1 ]; then + ynh_script_progression --message="Removing logs..." + ynh_secure_remove --file=/var/log/"$app" +fi ynh_script_progression --message="Removing code..." ynh_secure_remove --file=/var/www/$app ynh_secure_remove --file=/opt/yunohost/$app From 31256eb7652c9f2bace68b7c5baf8e7cd42abbe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sun, 21 Apr 2024 12:08:10 +0200 Subject: [PATCH 14/23] Add missing quote --- scripts/backup | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/backup b/scripts/backup index 3c09f25..666d3b9 100644 --- a/scripts/backup +++ b/scripts/backup @@ -23,20 +23,20 @@ fi # # Backup app files ynh_print_info --message="Backing up code..." -ynh_backup --src_path $install_dir +ynh_backup --src_path "$install_dir" ynh_print_info --message="Backing up user data..." -ynh_backup --src_path=$data_dir --dest_path="data" --is_big=1 +ynh_backup --src_path="$data_dir" --dest_path="data" --is_big=1 ynh_print_info --message="Backing up configuration..." -ynh_backup --src_path /etc/nginx/conf.d/$domain.d/${app}.conf +ynh_backup --src_path "/etc/nginx/conf.d/$domain.d/${app}.conf" ynh_backup --src_path /etc/systemd/system/seafile.service ynh_backup --src_path /etc/systemd/system/seahub.service -ynh_backup --src_path /etc/fail2ban/jail.d/$app.conf -ynh_backup --src_path /etc/fail2ban/filter.d/$app.conf +ynh_backup --src_path /etc/fail2ban/jail.d/"$app".conf +ynh_backup --src_path /etc/fail2ban/filter.d/"$app".conf # Backup mysql ynh_print_info --message="Backing up database" -ynh_mysql_dump_db --database $db_name > ${YNH_CWD}/seafiledb.dmp -ynh_mysql_dump_db --database ccnetdb > ${YNH_CWD}/ccnetdb.dmp -ynh_mysql_dump_db --database seahubdb > ${YNH_CWD}/seahubdb.dmp +ynh_mysql_dump_db --database "$db_name" > "${YNH_CWD}"/seafiledb.dmp +ynh_mysql_dump_db --database ccnetdb > "${YNH_CWD}"/ccnetdb.dmp +ynh_mysql_dump_db --database seahubdb > "${YNH_CWD}"/seahubdb.dmp ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." From dfd03a987a66ba36a6c7531c918db6b83f7226f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sun, 21 Apr 2024 12:26:32 +0200 Subject: [PATCH 15/23] Also backup logs --- scripts/backup | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/backup b/scripts/backup index 666d3b9..eeb91e9 100644 --- a/scripts/backup +++ b/scripts/backup @@ -33,6 +33,9 @@ ynh_backup --src_path /etc/systemd/system/seahub.service ynh_backup --src_path /etc/fail2ban/jail.d/"$app".conf ynh_backup --src_path /etc/fail2ban/filter.d/"$app".conf +# Backup logs +ynh_backup --src_path="/var/log/$app" + # Backup mysql ynh_print_info --message="Backing up database" ynh_mysql_dump_db --database "$db_name" > "${YNH_CWD}"/seafiledb.dmp From 174fa19944787e2452c664181f4efb5a6ab12b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sun, 21 Apr 2024 15:20:12 +0200 Subject: [PATCH 16/23] Fix permission for seafile data --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 4ad3168..9c51635 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -82,7 +82,7 @@ set_permission() { # At install time theses directory are not available test -e $install_dir/seafile-server-$seafile_version/seahub && setfacl -m user:www-data:rX $install_dir/seafile-server-$seafile_version/seahub test -e $install_dir/seafile-server-$seafile_version/seahub/media && setfacl -R -m user:www-data:rX $install_dir/seafile-server-$seafile_version/seahub/media - test -e $install_dir/seahub-data && setfacl -R -m user:www-data:rX $install_dir/seahub-data + test -e $install_dir/seahub-data && setfacl -R -m user:www-data:rX $data_dir/seahub-data find $data_dir \( \! -perm -o= \ -o \! -user $app \ From 2dbb8fbe0220abe81618f1b0f603e03bb2dcf197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sun, 21 Apr 2024 15:23:01 +0200 Subject: [PATCH 17/23] Fix permission for data_dir for www-data --- scripts/_common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/_common.sh b/scripts/_common.sh index 9c51635..3ee6dfa 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -82,6 +82,7 @@ set_permission() { # At install time theses directory are not available test -e $install_dir/seafile-server-$seafile_version/seahub && setfacl -m user:www-data:rX $install_dir/seafile-server-$seafile_version/seahub test -e $install_dir/seafile-server-$seafile_version/seahub/media && setfacl -R -m user:www-data:rX $install_dir/seafile-server-$seafile_version/seahub/media + test -e $install_dir/seahub-data && setfacl -m user:www-data:rX $data_dir test -e $install_dir/seahub-data && setfacl -R -m user:www-data:rX $data_dir/seahub-data find $data_dir \( \! -perm -o= \ From 3103fcdc92d50564bedd9b6921b3e64899b791c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sun, 21 Apr 2024 20:47:47 +0200 Subject: [PATCH 18/23] Fix tests for bookworm --- tests.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests.toml b/tests.toml index b413fc7..22c8ede 100644 --- a/tests.toml +++ b/tests.toml @@ -20,6 +20,6 @@ test_format = 1.0 # Commits to test upgrade from # ------------------------------- - test_upgrade_from.b5fd940.name = "Pre packaging v2" - test_upgrade_from.3ce35d3.name = "Version 7.1 Old version for CI 4 branch" - test_upgrade_from.97c0b2f.name = "Version 8.x Old version for CI 5 branch" + test_upgrade_from.f5eecf0.name = "Pre packaging v2 (Old_version_for_CI_6 branch)" + test_upgrade_from.c71ab40.name = "Version 7.1 (Old_version_for_CI_4 branch)" + test_upgrade_from.1e23afe.name = "Version 8.x (Old_version_for_CI_5 branch)" From fc56fb10c91148256c3b510ad1b881ee4f69ac21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 26 Apr 2024 22:12:03 +0200 Subject: [PATCH 19/23] Fix CI --- tests.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests.toml b/tests.toml index 22c8ede..b4e1c30 100644 --- a/tests.toml +++ b/tests.toml @@ -20,6 +20,6 @@ test_format = 1.0 # Commits to test upgrade from # ------------------------------- - test_upgrade_from.f5eecf0.name = "Pre packaging v2 (Old_version_for_CI_6 branch)" - test_upgrade_from.c71ab40.name = "Version 7.1 (Old_version_for_CI_4 branch)" - test_upgrade_from.1e23afe.name = "Version 8.x (Old_version_for_CI_5 branch)" + test_upgrade_from.70087df.name = "Pre packaging v2 (Old_version_for_CI_6 branch)" + test_upgrade_from.d9381d3.name = "Version 7.1 (Old_version_for_CI_4 branch)" + test_upgrade_from.fb2a04e.name = "Version 8.x (Old_version_for_CI_5 branch)" From 043898afaa15ecb4cb06179006ee21acdfae28a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sat, 27 Apr 2024 02:08:20 +0200 Subject: [PATCH 20/23] Fix again CI --- tests.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests.toml b/tests.toml index b4e1c30..2996975 100644 --- a/tests.toml +++ b/tests.toml @@ -20,6 +20,6 @@ test_format = 1.0 # Commits to test upgrade from # ------------------------------- - test_upgrade_from.70087df.name = "Pre packaging v2 (Old_version_for_CI_6 branch)" + test_upgrade_from.b4ba63d.name = "Pre packaging v2 (Old_version_for_CI_6 branch)" test_upgrade_from.d9381d3.name = "Version 7.1 (Old_version_for_CI_4 branch)" test_upgrade_from.fb2a04e.name = "Version 8.x (Old_version_for_CI_5 branch)" From c8df32428087ed73bb3b9d85fd584c2427142bab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sat, 27 Apr 2024 10:17:47 +0200 Subject: [PATCH 21/23] Fix CI --- tests.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests.toml b/tests.toml index 2996975..a4bb49c 100644 --- a/tests.toml +++ b/tests.toml @@ -21,5 +21,5 @@ test_format = 1.0 # ------------------------------- test_upgrade_from.b4ba63d.name = "Pre packaging v2 (Old_version_for_CI_6 branch)" - test_upgrade_from.d9381d3.name = "Version 7.1 (Old_version_for_CI_4 branch)" - test_upgrade_from.fb2a04e.name = "Version 8.x (Old_version_for_CI_5 branch)" + test_upgrade_from.8d41482.name = "Version 7.1 (Old_version_for_CI_4 branch)" + test_upgrade_from.c11c24b.name = "Version 8.x (Old_version_for_CI_5 branch)" From 4c26396d6d3243220a894fddeac0a41faa077c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sat, 27 Apr 2024 22:17:41 +0200 Subject: [PATCH 22/23] Fix CI --- tests.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests.toml b/tests.toml index a4bb49c..9a2084d 100644 --- a/tests.toml +++ b/tests.toml @@ -20,6 +20,6 @@ test_format = 1.0 # Commits to test upgrade from # ------------------------------- - test_upgrade_from.b4ba63d.name = "Pre packaging v2 (Old_version_for_CI_6 branch)" + test_upgrade_from.051ddab.name = "Pre packaging v2 (Old_version_for_CI_6 branch)" test_upgrade_from.8d41482.name = "Version 7.1 (Old_version_for_CI_4 branch)" test_upgrade_from.c11c24b.name = "Version 8.x (Old_version_for_CI_5 branch)" From cf6622c7ec6008bdbf05aef7466fcc100663f54c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sun, 28 Apr 2024 00:56:47 +0200 Subject: [PATCH 23/23] Fix again CI --- tests.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests.toml b/tests.toml index 9a2084d..265631e 100644 --- a/tests.toml +++ b/tests.toml @@ -20,6 +20,6 @@ test_format = 1.0 # Commits to test upgrade from # ------------------------------- - test_upgrade_from.051ddab.name = "Pre packaging v2 (Old_version_for_CI_6 branch)" + test_upgrade_from.ef7eb6f.name = "Pre packaging v2 (Old_version_for_CI_6 branch)" test_upgrade_from.8d41482.name = "Version 7.1 (Old_version_for_CI_4 branch)" test_upgrade_from.c11c24b.name = "Version 8.x (Old_version_for_CI_5 branch)"