diff --git a/manifest.toml b/manifest.toml index 0dc33d2..ef2aa79 100644 --- a/manifest.toml +++ b/manifest.toml @@ -63,11 +63,9 @@ ram.runtime = "500M" [resources] [resources.system_user] allow_email = true - home = "/opt/yunohost/__APP__" [resources.install_dir] group = "www-data:r-x" - dir = "/opt/yunohost/__APP__" owner = "__APP__:rwx" group = "www-data:rx" diff --git a/scripts/install b/scripts/install index 57a7176..603894b 100644 --- a/scripts/install +++ b/scripts/install @@ -80,9 +80,9 @@ ynh_config_add --template=seafevents.conf --destination="$install_dir"/conf/seaf # Configure admin info # It will be used the first start admin_email=$(ynh_user_get_info --username="$admin" --key='mail') -cp ../conf/create_admin.json $install_dir/conf/admin.txt -ynh_replace --match=__ADMIN__ --replace="$admin_email" --file=$install_dir/conf/admin.txt -ynh_replace_regex --match=__PASSWORD__ --replace="$admin_password" --file=$install_dir/conf/admin.txt +cp ../conf/create_admin.json "$install_dir"/conf/admin.txt +ynh_replace --match=__ADMIN__ --replace="$admin_email" --file="$install_dir"/conf/admin.txt +ynh_replace_regex --match=__PASSWORD__ --replace="$admin_password" --file="$install_dir"/conf/admin.txt # Use symlink to store data if [ -e "$install_dir"/seafile-data ]; then diff --git a/scripts/upgrade b/scripts/upgrade index 102c636..9915cbb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -47,11 +47,7 @@ if mysqlshow | grep -q seafiledb; then fi # Set missing settings -# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=seahub_secret_key --value="$(grep -P 'SECRET_KEY\s*=\s*".+"' "$install_dir"/conf/seahub_settings.py | cut -d'"' -f2)" -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 --key=seahub_secret_key --value="$seahub_secret_key" -fi +ynh_app_setting_set_default --key=seahub_secret_key --value="$(grep -P 'SECRET_KEY\s*=\s*".+"' "$install_dir"/conf/seahub_settings.py | cut -d'"' -f2)" # # Update data dir if needed diff --git a/tests.toml b/tests.toml index 88b42ba..fe49775 100644 --- a/tests.toml +++ b/tests.toml @@ -24,3 +24,4 @@ test_format = 1.0 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)" test_upgrade_from.7a4d00a.name = "Version 9.x" + test_upgrade_from.5a4717a.name = "Before helper 2.1"