From bfab1f58cec3912e18f08c5bcd0d4f19a7e8aac0 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 5 Apr 2022 11:05:38 +0200 Subject: [PATCH 1/8] Upgrade to PHP8.0 --- conf/.env.example | 4 ++-- conf/nginx.conf | 5 +---- manifest.json | 4 ++-- scripts/_common.sh | 4 ++-- scripts/install | 1 + scripts/remove | 16 ++++++++-------- 6 files changed, 16 insertions(+), 18 deletions(-) diff --git a/conf/.env.example b/conf/.env.example index 967b49a..b5445f7 100644 --- a/conf/.env.example +++ b/conf/.env.example @@ -6,7 +6,7 @@ APP_NAME=Plainpad # This value determines the "environment" your application is currently # running in. This may determine how you prefer to configure various # services the application utilizes. Set this in your ".env" file. -APP_ENV=local +APP_ENV=production # This key is used by the Illuminate encrypter service and should be set # to a random, 32 character string, otherwise these encrypted strings @@ -44,7 +44,7 @@ DB_PORT=3306 DB_DATABASE=__DB_NAME__ # The database username for the connection. -DB_USERNAME=__DB_NAME__ +DB_USERNAME=__DB_USER__ # The database password for the connection. DB_PASSWORD=__DB_PWD__ diff --git a/conf/nginx.conf b/conf/nginx.conf index c385314..554831e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -6,7 +6,7 @@ location __PATH__/ { index index.php index.html; - #client_max_body_size 50M; + client_max_body_size 50M; try_files $uri $uri/ __PATH__/__PATH__/index.php?$query_string; @@ -20,7 +20,4 @@ location __PATH__/ { fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $request_filename; } - - # Include SSOWAT user panel. - include conf.d/yunohost_panel.conf.inc; } diff --git a/manifest.json b/manifest.json index 919e288..3e79996 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Self hosted, note taking application", "fr": "Application de prise de notes auto-hébergée" }, - "version": "1.0.0~ynh1", + "version": "1.0.0~ynh2", "url": "https://alextselegidis.com/get/plainpad", "upstream": { "license": "AGPL-3.0-only", @@ -26,7 +26,7 @@ "multi_instance": true, "services": [ "nginx", - "php7.3-fpm", + "php8.0-fpm", "mysql" ], "arguments": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 88da38a..e9f1973 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,9 @@ # COMMON VARIABLES #================================================= -YNH_PHP_VERSION="7.3" +YNH_PHP_VERSION="8.0" -pkg_dependencies="php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-fileinfo php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-mysql" +pkg_dependencies="php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-fileinfo php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-mysql" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index b73c88b..70fbf4a 100755 --- a/scripts/install +++ b/scripts/install @@ -28,6 +28,7 @@ domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC key=$(ynh_string_random --length=32) +phpversion=$YNH_PHP_VERSION app=$YNH_APP_INSTANCE_NAME diff --git a/scripts/remove b/scripts/remove index 2300b9a..f75dd97 100755 --- a/scripts/remove +++ b/scripts/remove @@ -29,14 +29,6 @@ ynh_script_progression --message="Removing the MySQL database..." --weight=2 # Remove a database if it exists, along with the associated user ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." --weight=1 - -# Remove metapackage and its dependencies -ynh_remove_app_dependencies - #================================================= # REMOVE APP MAIN DIR #================================================= @@ -61,6 +53,14 @@ ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1 # Remove the dedicated PHP-FPM config ynh_remove_fpm_config +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --weight=1 + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # REMOVE LOGROTATE CONFIGURATION #================================================= From 8c3422125033cecee49cce43972f498da61d1025 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 5 Apr 2022 09:05:43 +0000 Subject: [PATCH 2/8] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0464119..caf3108 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Plainpad is a self hosted, open source note taking application that is very easy to setup on your server. Your data will never leave your server and you will be able to access them from any device connected to the internet. With Plainpad you can allow multiple users to access the application without being able to see each other's notes. The notes are being encrypted and stored safely in the database. -**Shipped version:** 1.0.0~ynh1 +**Shipped version:** 1.0.0~ynh2 **Demo:** https://alextselegidis.com/try/plainpad/#/login diff --git a/README_fr.md b/README_fr.md index bd5d59f..22b907c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Plainpad is a self hosted, open source note taking application that is very easy to setup on your server. Your data will never leave your server and you will be able to access them from any device connected to the internet. With Plainpad you can allow multiple users to access the application without being able to see each other's notes. The notes are being encrypted and stored safely in the database. -**Version incluse :** 1.0.0~ynh1 +**Version incluse :** 1.0.0~ynh2 **Démo :** https://alextselegidis.com/try/plainpad/#/login From 8c668e5128a0442d69d6f9e1b70ef8e0f95e4ae3 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 5 Apr 2022 11:49:34 +0200 Subject: [PATCH 3/8] Update upgrade --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index 12b0ca6..4b13ce0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,6 +20,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +phpversion=$YNH_PHP_VERSION #================================================= # CHECK VERSION From 6182daeecb09deb1b3c0cff6ca65a6d338e30184 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 5 Apr 2022 12:35:42 +0200 Subject: [PATCH 4/8] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 70fbf4a..b9436ca 100755 --- a/scripts/install +++ b/scripts/install @@ -123,7 +123,7 @@ chown $app:$app "$final_path/.env" ynh_script_progression --message="Migrating database..." --weight=1 pushd "$final_path" - php$phpversion artisan migrate:fresh --seed + php$phpversion artisan migrate:fresh -n --seed popd #================================================= From 2eba4102fdadef08ae9fefb664b2d7d1d16c087e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 5 Apr 2022 22:31:05 +0200 Subject: [PATCH 5/8] Update manifest.json --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 3e79996..fb835fd 100644 --- a/manifest.json +++ b/manifest.json @@ -3,8 +3,8 @@ "id": "plainpad", "packaging_format": 1, "description": { - "en": "Self hosted, note taking application", - "fr": "Application de prise de notes auto-hébergée" + "en": "Note taking application", + "fr": "Prise de notes auto-hébergée" }, "version": "1.0.0~ynh2", "url": "https://alextselegidis.com/get/plainpad", From 0b4d264ba655afc118432053564a39cdd2de83e0 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 8 Apr 2022 12:50:11 +0200 Subject: [PATCH 6/8] Update restore --- scripts/restore | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/scripts/restore b/scripts/restore index 6df366c..d4985d9 100755 --- a/scripts/restore +++ b/scripts/restore @@ -70,13 +70,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - #================================================= # REINSTALL DEPENDENCIES #================================================= @@ -85,6 +78,16 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=1 # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies +#================================================= +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1 + +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" + +# Recreate a dedicated PHP-FPM config +ynh_add_fpm_config + #================================================= # RESTORE THE MYSQL DATABASE #================================================= From 5d0488ad13ed68f812f2808bcc29774b29eec793 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 8 Apr 2022 12:51:37 +0200 Subject: [PATCH 7/8] Update install --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index b9436ca..3e37872 100755 --- a/scripts/install +++ b/scripts/install @@ -146,6 +146,7 @@ if [ $is_public -eq 1 ] then ynh_permission_update --permission="main" --add="visitors" fi + ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --auth_header="false" --show_tile="false" --protected="true" #================================================= From bfe6e20500d8406c712668aff76050c633e48b4f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 8 Apr 2022 15:46:44 +0200 Subject: [PATCH 8/8] Update .env.example --- conf/.env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/.env.example b/conf/.env.example index b5445f7..c9abc48 100644 --- a/conf/.env.example +++ b/conf/.env.example @@ -6,7 +6,7 @@ APP_NAME=Plainpad # This value determines the "environment" your application is currently # running in. This may determine how you prefer to configure various # services the application utilizes. Set this in your ".env" file. -APP_ENV=production +APP_ENV=local # This key is used by the Illuminate encrypter service and should be set # to a random, 32 character string, otherwise these encrypted strings