diff --git a/manifest.toml b/manifest.toml index c36851f..b93f08b 100644 --- a/manifest.toml +++ b/manifest.toml @@ -40,7 +40,7 @@ ram.runtime = "50M" [install.password] type = "password" - [install.name] + [install.instance_name] ask.en = "Choose a name for your Plume instance" ask.fr = "Choisissez un nom pour votre instance Plume" type = "string" diff --git a/scripts/install b/scripts/install index f82c096..9d64131 100755 --- a/scripts/install +++ b/scripts/install @@ -81,10 +81,10 @@ chown $app:$app "$install_dir/$app/.env" #================================================= ynh_script_progression --message="Making setup..." -# Set right permissions +# Set right permissions chown -R "$app":"$app" $install_dir -export PATH="$PATH:$install_dir/.cargo/bin:$install_dir/.local/bin:/usr/local/sbin" +export PATH="$PATH:$install_dir/.cargo/bin:$install_dir/.local/bin:/usr/local/sbin" pushd $install_dir/$app sudo -u "$app" env PATH=$PATH plm migration run @@ -92,7 +92,7 @@ pushd $install_dir/$app # Add new instance if [ $registration -eq 1 ] then - sudo -u "$app" env PATH=$PATH plm instance new --domain "$domain" --name "$name" -l 'CC-BY' + sudo -u "$app" env PATH=$PATH plm instance new --domain "$domain" --name "$instance_name" -l 'CC-BY' else sudo -u "$app" env PATH=$PATH plm instance new --private --domain "$domain" --name "$name" -l 'CC-BY' fi diff --git a/scripts/upgrade b/scripts/upgrade index 3879f8a..c655f0c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,6 +24,15 @@ ynh_script_progression --message="Stopping a systemd service..." ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped plume" +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 + +if [ -z "$instance_name" ]; then + ynh_app_setting_set --app="$app" --key="instance_name" --value="$name" +fi + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -79,11 +88,11 @@ chown $app:$app "$install_dir/$app/.env" #================================================= ynh_script_progression --message="Making setup..." -export PATH="$PATH:$install_dir/.cargo/bin:$install_dir/.local/bin:/usr/local/sbin" +export PATH="$PATH:$install_dir/.cargo/bin:$install_dir/.local/bin:/usr/local/sbin" pushd $install_dir/$app sudo -u "$app" env PATH=$PATH plm migration run -popd +popd #================================================= # SETUP SYSTEMD diff --git a/tests.toml b/tests.toml index 27e3dbb..a60c24c 100644 --- a/tests.toml +++ b/tests.toml @@ -6,8 +6,8 @@ test_format = 1.0 # Default args to use for install # ------------------------------- - args.name="my blog" - args.registration=0 + args.instance_name="my blog" + args.registration=0 # ------------------------------- # Commits to test upgrade from