mirror of
https://framagit.org/YunoHost-Apps/gitea_ynh.git
synced 2024-12-23 09:59:46 +01:00
Optimize upgrade: avoid to set premission on data dir to just call gitea command to generated keys
This commit is contained in:
parent
e096dda814
commit
d836db84d1
@ -55,12 +55,18 @@ fi
|
||||
|
||||
# Ensure secrets are defined
|
||||
ynh_setup_source --dest_dir="$install_dir" --source_id=main
|
||||
_set_permissions
|
||||
|
||||
#=================================================
|
||||
# MIGRATION STEP 2 (Set undefined Vars)
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message='Migrating missing settings...'
|
||||
|
||||
# Must set permission before to call gitea command
|
||||
chown -R "$app:$app" "$install_dir"
|
||||
chmod -R u=rwX,g=rX,o= "$install_dir"
|
||||
chmod +x "$install_dir/gitea"
|
||||
|
||||
if [[ -z "${internal_token:-}" ]]; then
|
||||
internal_token=$(ynh_exec_as "$app" "$install_dir/gitea" generate secret INTERNAL_TOKEN)
|
||||
ynh_app_setting_set --app "$app" --key internal_token --value="$internal_token"
|
||||
@ -106,6 +112,8 @@ ynh_secure_remove --file="$install_dir/templates"
|
||||
|
||||
# Configure gitea with app.ini file
|
||||
ynh_add_config --template=app.ini --destination="$install_dir/custom/conf/app.ini"
|
||||
|
||||
ynh_script_progression --message='Setting permissions...'
|
||||
_set_permissions
|
||||
|
||||
# Update ldap config
|
||||
|
Loading…
Reference in New Issue
Block a user