diff --git a/check_process b/check_process index 4e5524c..62d0f52 100755 --- a/check_process +++ b/check_process @@ -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& diff --git a/manifest.json b/manifest.json index cf7bd7a..ceecd28 100755 --- a/manifest.json +++ b/manifest.json @@ -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 n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." }, "default": true + }, + { + "name": "password", + "type": "password", + "example": "Choose a password" } ] } diff --git a/scripts/install b/scripts/install index c1dd1b8..44120f3 100755 --- a/scripts/install +++ b/scripts/install @@ -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 #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 9c9e238..d1073cd 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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 #=================================================