1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/galene_ynh.git synced 2024-09-03 18:36:31 +02:00
This commit is contained in:
Éric Gaspar 2023-03-18 23:02:58 +01:00
parent e1523e976f
commit 3f052200c9
2 changed files with 8 additions and 15 deletions

View file

@ -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

View file

@ -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="<div class=\"galene-header\">Galène</div>" --replace_string="<div class=\"galene-header\" onclick=\"location.href=window.location.origin\" style=\"cursor:pointer\">Galène</div>" --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"