From 3735ae2d2c41cf6233098a50a803c528703b2150 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 16 Apr 2021 13:20:01 +0200 Subject: [PATCH 1/7] Add post install process --- manifest.json | 14 ++++++++++++++ scripts/install | 21 ++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 1d08f05..30c509d 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,15 @@ "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", + "help": { + "en": "Use the help field to add an information for the admin about this question.", + "fr": "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question." + }, + "example": "Choose a password" } ] } diff --git a/scripts/install b/scripts/install index c1dd1b8..9d352db 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,21 @@ 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" + +installUrl="/cp-install" + +# Installation with curl +ynh_script_progression --message="Finalizing installation..." --weight=1 +ynh_local_curl $installUrl "email=$email" "username=$admin" "password=$password" + #================================================= # GENERIC FINALIZATION #================================================= @@ -123,7 +142,7 @@ ynh_script_progression --message="Configuring permissions..." --weight=10 # Make app public if necessary or protect it if [ $is_public -eq 1 ] then - ynh_permission_update --permission="main" --add="visitors" + ynh_permission_update --permission="main" --remove="visitors" fi #================================================= From dbf840de5ab2a99903d1319a3403102d8341811a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 16 Apr 2021 13:37:57 +0200 Subject: [PATCH 2/7] Update install --- scripts/install | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 9d352db..85929df 100755 --- a/scripts/install +++ b/scripts/install @@ -118,11 +118,14 @@ ynh_script_progression --message="Configuring SSOwat..." --weight=1 # Making the app public for curl ynh_permission_update --permission="main" --add="visitors" -installUrl="/cp-install" +# Reload NGINX +ynh_systemd_action --service_name=nginx --action=reload # Installation with curl ynh_script_progression --message="Finalizing installation..." --weight=1 -ynh_local_curl $installUrl "email=$email" "username=$admin" "password=$password" +ynh_local_curl "/cp-install" "email=$email" "username=$admin" "password=$password" + +ynh_permission_update --permission="main" --remove="visitors" #================================================= # GENERIC FINALIZATION @@ -142,7 +145,7 @@ ynh_script_progression --message="Configuring permissions..." --weight=10 # Make app public if necessary or protect it if [ $is_public -eq 1 ] then - ynh_permission_update --permission="main" --remove="visitors" + ynh_permission_update --permission="main" --add="visitors" fi #================================================= From b56d5eee5656eafff0ae85b4334344a6162481b7 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 16 Apr 2021 14:02:44 +0200 Subject: [PATCH 3/7] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 85929df..ee9f15a 100755 --- a/scripts/install +++ b/scripts/install @@ -123,7 +123,7 @@ ynh_systemd_action --service_name=nginx --action=reload # Installation with curl ynh_script_progression --message="Finalizing installation..." --weight=1 -ynh_local_curl "/cp-install" "email=$email" "username=$admin" "password=$password" +ynh_local_curl "/cp-install" "csrf_test_name=7b748827ae56137fb7c8abd7f7e4ea00" "email=$email" "username=$admin" "password=$password" ynh_permission_update --permission="main" --remove="visitors" From 7fe97ee09bf7a944d993b7a844d1d07a5171d171 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 19 Apr 2021 20:07:49 +0200 Subject: [PATCH 4/7] fix --- manifest.json | 4 ---- scripts/install | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/manifest.json b/manifest.json index 30c509d..71bbbcc 100755 --- a/manifest.json +++ b/manifest.json @@ -50,10 +50,6 @@ { "name": "password", "type": "password", - "help": { - "en": "Use the help field to add an information for the admin about this question.", - "fr": "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question." - }, "example": "Choose a password" } ] diff --git a/scripts/install b/scripts/install index ee9f15a..85929df 100755 --- a/scripts/install +++ b/scripts/install @@ -123,7 +123,7 @@ ynh_systemd_action --service_name=nginx --action=reload # Installation with curl ynh_script_progression --message="Finalizing installation..." --weight=1 -ynh_local_curl "/cp-install" "csrf_test_name=7b748827ae56137fb7c8abd7f7e4ea00" "email=$email" "username=$admin" "password=$password" +ynh_local_curl "/cp-install" "email=$email" "username=$admin" "password=$password" ynh_permission_update --permission="main" --remove="visitors" From 5ff2590cd60f580faadcfe29799d31b0f1a8361a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 20 Apr 2021 11:52:41 +0200 Subject: [PATCH 5/7] Fix post-install --- check_process | 10 ++++------ scripts/install | 5 ++++- 2 files changed, 8 insertions(+), 7 deletions(-) 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/scripts/install b/scripts/install index 85929df..44120f3 100755 --- a/scripts/install +++ b/scripts/install @@ -123,7 +123,10 @@ ynh_systemd_action --service_name=nginx --action=reload # Installation with curl ynh_script_progression --message="Finalizing installation..." --weight=1 -ynh_local_curl "/cp-install" "email=$email" "username=$admin" "password=$password" + +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" From 2bede8fe7c750c6280dc98cd6271b442b29d583d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 20 Apr 2021 12:05:27 +0200 Subject: [PATCH 6/7] Upgrade to 53 --- README.md | 2 +- README_fr.md | 2 +- scripts/_common.sh | 2 +- scripts/upgrade | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 88e49ba..1d678b8 100755 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview Castopod Server is an open-source hosting platform made for podcasters who want engage and interact with their audience. Please note that Castopod is still under heavy development: it may not be 100% stable and some features are still being developed. -**Shipped version:** 1.0.0 alpha.51 +**Shipped version:** 1.0.0 alpha.53 ## Screenshots diff --git a/README_fr.md b/README_fr.md index cdee4c5..ec564b0 100755 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install ## Vue d'ensemble Castopod Server est une plate-forme d'hébergement open source conçue pour les podcasteurs qui souhaitent s'engager et interagir avec leur public. Veuillez noter que Castopod est toujours en développement: il n'est peut-être pas stable à 100% et certaines fonctionnalités sont encore en développement. -**Version incluse :** 1.0.0 alpha.51 +**Version incluse :** 1.0.0 alpha.53 ## Captures d'écran diff --git a/scripts/_common.sh b/scripts/_common.sh index 0df3a87..dc4f14e 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,7 @@ YNH_PHP_VERSION="7.3" -extra_php_dependencies="php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mysqlnd" +extra_php_dependencies="php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mysqlnd" #================================================= # PERSONAL HELPERS 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 #================================================= From 28ebbe7076a13e8ed43980ebf99f9432bbf34d8a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 20 Apr 2021 12:06:01 +0200 Subject: [PATCH 7/7] Update app.src --- conf/app.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/app.src b/conf/app.src index 50996be..950563d 100755 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://code.podlibre.org/podlibre/castopod/uploads/68426f365b5e116737cd06afccb4458f/castopod-1.0.0-alpha.51.zip -SOURCE_SUM=9cbd68a06d6785740a66f24e12d20c616154460ed8ad96b550c18225b38937ca +SOURCE_URL=https://code.podlibre.org/podlibre/castopod/uploads/8621c7a549b21aaa26f02edf1bc9234f/castopod-1.0.0-alpha.53.zip +SOURCE_SUM=149ca2148c4578b3bc1b329b41bbdb1df4d02f181f5c043b6ff0be18ff83e229 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true