1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gogs_ynh.git synced 2024-09-03 20:36:23 +02:00
This commit is contained in:
ericgaspar 2021-05-17 09:45:06 +02:00
parent b9c6ab427f
commit d81f42a5be
No known key found for this signature in database
GPG key ID: 574F281483054D44
5 changed files with 28 additions and 14 deletions

View file

@ -1,9 +1,9 @@
;; General
; Manifest
domain="domain.tld" (DOMAIN)
path="/path" (PATH)
admin="john" (USER)
is_public=1 (PUBLIC|public=1|private=0)
domain="domain.tld"
path="/path"
admin="john"
is_public=1
; Checks
pkg_linter=1
setup_sub_dir=1

View file

@ -23,7 +23,7 @@
"mysql"
],
"requirements": {
"yunohost": ">= 4.1.7"
"yunohost": ">= 4.2.4"
},
"arguments": {
"install" : [

View file

@ -45,8 +45,8 @@ config_gogs() {
fi
ynh_replace_string "__REPOS_PATH__" "$REPO_PATH" "$final_path/custom/conf/app.ini"
ynh_replace_string "__DB_PWD__" "$dbpass" "$final_path/custom/conf/app.ini"
ynh_replace_string "__DB_NAME__" "$dbuser" "$final_path/custom/conf/app.ini"
ynh_replace_string "__DB_PWD__" "$db_pwd" "$final_path/custom/conf/app.ini"
ynh_replace_string "__DB_NAME__" "$db_name" "$final_path/custom/conf/app.ini"
ynh_replace_string "__DOMAIN__" "$domain" "$final_path/custom/conf/app.ini"
ynh_replace_string "__KEY__" "$key" "$final_path/custom/conf/app.ini"
ynh_replace_string "__DATA_PATH__" "$DATA_PATH" "$final_path/custom/conf/app.ini"
@ -75,9 +75,9 @@ set_permission() {
}
set_access_settings() {
if [ "$is_public" = '1' ]
if [ $is_public -eq 1 ]
then
ynh_app_setting_set $app unprotected_uris "/"
ynh_permission_update --permission="main" --add="visitors"
else
# For an access to the git server by https in private mode we need to allow the access to theses URL :
# - "DOMAIN/PATH/USER/REPOSITORY/info/refs"

View file

@ -203,11 +203,13 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap
#=================================================
ynh_script_progression --message="Configuring SSOwat..." --weight=1
# Make app public if necessary or protect it
if [ $is_public -eq 1 ]
then
ynh_permission_update --permission="main" --add="visitors"
fi
set_access_settings
# # Make app public if necessary or protect it
# if [ $is_public -eq 1 ]
# then
# ynh_permission_update --permission="main" --add="visitors"
# fi
#=================================================
# RELOAD NGINX

View file

@ -34,6 +34,18 @@ architecture=$(ynh_detect_arch)
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================