1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/castopod_ynh.git synced 2024-09-03 18:16:14 +02:00

Merge branch 'post-install' into testing

This commit is contained in:
ericgaspar 2021-04-20 12:09:50 +02:00
commit b05435b5ef
No known key found for this signature in database
GPG key ID: 574F281483054D44
4 changed files with 39 additions and 7 deletions

View file

@ -6,8 +6,10 @@
;; Test complet
; Manifest
domain="domain.tld" (DOMAIN)
path="/cp-install" (PATH)
path="/path" (PATH)
is_public=1 (PUBLIC|public=1|private=0)
admin="john" (USER)
password="pass"
; Checks
pkg_linter=1
setup_sub_dir=0
@ -16,8 +18,6 @@
setup_private=1
setup_public=1
upgrade=1
#1.0.0 alpha.40
upgrade=1 from_commit=ac00b520875beed49bb138e795562e1f74700ab9
#1.0.0 alpha.41
upgrade=1 from_commit=9c603f6b659e4191028cc909311a0cbde9955155
backup_restore=1
@ -27,8 +27,6 @@
Email=
Notification=none
;;; Upgrade options
; commit=ac00b520875beed49bb138e795562e1f74700ab9
name=1.0.0 alpha.40
; commit=9c603f6b659e4191028cc909311a0cbde9955155
name=1.0.0 alpha.41
manifest_arg=domain=DOMAIN&path=PATH&is_public=1&
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&

View file

@ -33,6 +33,11 @@
},
"example": "podcast.example.com"
},
{
"name": "admin",
"type": "user",
"example": "johndoe"
},
{
"name": "is_public",
"type": "boolean",
@ -41,6 +46,11 @@
"fr": "Si cette case est cochée, Castopod sera accessible aux personnes nayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin."
},
"default": true
},
{
"name": "password",
"type": "password",
"example": "Choose a password"
}
]
}

View file

@ -23,6 +23,9 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN
path_url="/"
is_public=$YNH_APP_ARG_IS_PUBLIC
admin=$YNH_APP_ARG_ADMIN
password=$YNH_APP_ARG_PASSWORD
email=$(ynh_user_get_info --username=$admin --key=mail)
app=$YNH_APP_INSTANCE_NAME
@ -44,6 +47,7 @@ ynh_script_progression --message="Storing installation settings..." --weight=1
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=admin --value=$admin
#=================================================
# CREATE A MYSQL DATABASE
@ -105,6 +109,27 @@ ynh_script_progression --message="Setuping a cron..."
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
#=================================================
# SETUP APPLICATION WITH CURL
#=================================================
# Set the app as temporarily public for curl call
ynh_script_progression --message="Configuring SSOwat..." --weight=1
# Making the app public for curl
ynh_permission_update --permission="main" --add="visitors"
# Reload NGINX
ynh_systemd_action --service_name=nginx --action=reload
# Installation with curl
ynh_script_progression --message="Finalizing installation..." --weight=1
ynh_local_curl "/cp-install"
ynh_local_curl "/cp-install/create-superadmin" "email=$email" "username=$admin" "password=$password"
ynh_permission_update --permission="main" --remove="visitors"
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -109,7 +109,6 @@ ynh_add_fpm_config --package="$extra_php_dependencies"
# Set permissions to app files
chown -R $app:$app $final_path
#chmod o-rwx $final_path
chmod 600 $final_path/.env
#=================================================