diff --git a/scripts/install b/scripts/install index 9677141..7463851 100755 --- a/scripts/install +++ b/scripts/install @@ -14,17 +14,7 @@ source /usr/share/yunohost/helpers # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -#group_name=$YNH_APP_ARG_GROUP_NAME -#group_description=$YNH_APP_ARG_GROUP_DESCRIPTION password=$YNH_APP_ARG_PASSWORD - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= -ynh_script_progression --message="Storing installation settings..." --weight=4 - -#ynh_app_setting_set --app=$app --key=group_name --value="$group_name" -#ynh_app_setting_set --app=$app --key=group_description --value="$group_description" ynh_app_setting_set --app=$app --key=password --value="$password" #================================================= @@ -105,7 +95,6 @@ chown -R $app:www-data "$data_dir" #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 - password_hash=$(echo $($install_dir/galene-password-generator $password)) # Configure Galène diff --git a/scripts/upgrade b/scripts/upgrade index dee0530..f5f7a58 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -13,10 +13,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 -group_name=$(ynh_app_setting_get --app=$app --key=group_name) -group_description=$(ynh_app_setting_get --app=$app --key=group_description) password=$(ynh_app_setting_get --app=$app --key=password) #================================================= @@ -67,7 +64,7 @@ ynh_setup_source --dest_dir="$install_dir/build" ynh_setup_source --dest_dir="$install_dir/build_ldap" --source_id="ldap" mkdir -p "$install_dir/live/data" mkdir -p "$install_dir/live_ldap/data" -#REMOVEME? ynh_secure_remove --file="$install_dir/live/static/" +ynh_secure_remove --file="$install_dir/live/static/" cp -r "$install_dir/build/static/" "$install_dir/live/" ynh_replace_string --match_string="
Galène
" --replace_string="
Galène
" --target_file="$install_dir/live/static/galene.html" @@ -93,6 +90,9 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_exec_warn_less ynh_install_go --go_version=$go_version ynh_use_go + pushd $install_dir/build/galene-password-generator/ + ynh_exec_warn_less ynh_exec_as $app CGO_ENABLED=0 $ynh_go build -o $install_dir/ + popd pushd $install_dir/build/ ynh_exec_warn_less ynh_exec_as $app CGO_ENABLED=0 $ynh_go build -ldflags='-s -w' -o $install_dir/live/ popd @@ -105,6 +105,8 @@ then ynh_secure_remove --file="$install_dir/.cache/" ynh_secure_remove --file="$install_dir/go/" ynh_secure_remove --file="$install_dir/.go-version" + + chmod +x "$install_dir/galene-password-generator" fi #================================================= @@ -112,6 +114,8 @@ fi #================================================= ynh_script_progression --message="Updating a configuration file..." --weight=2 +password_hash=$(echo $($install_dir/galene-password-generator $password)) + # Configure Galène ynh_add_config --template="../conf/config.json" --destination="$install_dir/live/data/config.json" chmod 400 "$install_dir/live/data/config.json"