diff --git a/README.md b/README.md index ae85039..d62e09e 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview [Misskey](https://join.misskey.page/en/) is a forever evolving, sophisticated microblogging platform that support Fediverse. It provide another flavour to decentralised network. Why don't you take a short break from the hustle and bustle of the city, and dive into a new Internet? -**Shipped version:** 12.66.0 +**Shipped version:** 12.69.0 ## Screenshots diff --git a/conf/app.src b/conf/app.src index bd824a3..44fb126 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/syuilo/misskey/archive/12.66.0.tar.gz -SOURCE_SUM=bdba1e3c1fd0de1044df068464850c3230c9c7218d8a691493602ab8b5f80f5c +SOURCE_URL=https://github.com/syuilo/misskey/archive/12.69.0.tar.gz +SOURCE_SUM=9cc9b284dee849ad6f4570204263fc8b949a975f0b230047fe08a7e35b804f73 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/nginx.conf b/conf/nginx.conf index 05f1836..216e7dd 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,3 @@ - location / { # Force usage of https @@ -6,7 +5,6 @@ location / { rewrite ^ https://$server_name$request_uri? permanent; } - # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file #client_max_body_size 50M; proxy_pass http://127.0.0.1:__PORT__; diff --git a/manifest.json b/manifest.json index a8fe4c5..46efca9 100644 --- a/manifest.json +++ b/manifest.json @@ -4,16 +4,16 @@ "packaging_format": 1, "description": { "en": "Microblogging platform", - "fr": "Microblogging platform" + "fr": "Platforme de Microblogging" }, - "version": "12.66.0~ynh1", + "version": "12.69.0~ynh1", "url": "https://join.misskey.page/en/", "license": "AGPL-3.0-or-later", "maintainer": { "name": "Anmol" }, "requirements": { - "yunohost": ">= 3.8.1" + "yunohost": ">= 4.0.0" }, "multi_instance": true, "services": ["nginx"], diff --git a/pull_request_template.md b/pull_request_template.md index 5d5c08b..6c28fc5 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -13,6 +13,4 @@ ## Package_check results --- -*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results* - -[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/misskey_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/misskey_ynh%20PR-NUM-%20(USERNAME)/) +* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* diff --git a/scripts/_common.sh b/scripts/_common.sh index 5fa2131..e33d6ad 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,9 +7,9 @@ MEMORY_NEEDED="2560" # dependencies used by the app -pkg_dependencies=" build-essential python ffmpeg redis-server redis-tools postgresql postgresql-contrib" +pkg_dependencies="build-essential python ffmpeg redis-server redis-tools postgresql postgresql-contrib" -nodejs_version=12 +NODEJS_VERSION="12" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index c60b8e0..ac4d408 100755 --- a/scripts/install +++ b/scripts/install @@ -66,10 +66,11 @@ ynh_app_setting_set --app=$app --key=port --value=$port #================================================= ynh_script_progression --message="Installing dependencies..." -ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +ynh_install_nodejs --nodejs_version=$NODEJS_VERSION -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies $pkg_dependencies +curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= @@ -79,13 +80,9 @@ ynh_script_progression --message="Creating a POSTGRESQL database..." # Create postgresql database db_name=$(ynh_sanitize_dbid --db_name=$app) -db_user=$db_name -db_pwd=$(ynh_string_random --length=8) ynh_app_setting_set --app=$app --key=db_name --value=$db_name -ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd ynh_psql_test_if_first_run -ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd -ynh_psql_execute_as_root --sql="ALTER USER $db_user CREATEDB;" +ynh_psql_setup_db --db_user=$db_name --db_name=$db_name #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -117,9 +114,7 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." - -### `ynh_add_nginx_config` will use the file conf/nginx.conf +ynh_script_progression --message="Configuring NGINX web server..." # Create a dedicated nginx config ynh_add_nginx_config @@ -133,22 +128,19 @@ ynh_script_progression --message="Configuring system user..." ynh_system_user_create --username=$app #================================================= -# MODIFY A CONFIG FILE +# SETUP SYSTEMD #================================================= +ynh_script_progression --message="Configuring a systemd service..." -cp -f ../conf/default.yml "$final_path/.config/default.yml" - -ynh_replace_string --match_string="__DB_USER__" --replace_string="$app" --target_file="$final_path/.config/default.yml" -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/.config/default.yml" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/.config/default.yml" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/.config/default.yml" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/.config/default.yml" +# Create a dedicated systemd config +ynh_add_systemd_config #================================================= # STORE THE CONFIG FILE CHECKSUM #================================================= -# Calculate and store the config file checksum into the app settings +ynh_add_config --template="../conf/default.yml" --destination="$final_path/.config/default.yml" + ynh_store_file_checksum --file="$final_path/.config/default.yml" #================================================= @@ -173,7 +165,7 @@ chown -R $app: $final_path #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="A interplanetary blogging platform" --log="/var/log/$app/$app.log" @@ -183,22 +175,23 @@ yunohost service add $app --description="A interplanetary blogging platform" --l ynh_script_progression --message="Starting a systemd service..." # Start a systemd service -ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="All workers started" +ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="All workers started" #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." +ynh_script_progression --message="Configuring permissions..." --weight=1 +# Make app public if necessary if [ $is_public -eq 1 ] then - ynh_permission_update --permission "main" --add "visitors" + ynh_permission_update --permission="main" --add="visitors" fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/restore b/scripts/restore index 951c0a0..5d58a93 100755 --- a/scripts/restore +++ b/scripts/restore @@ -45,7 +45,6 @@ ynh_webpath_available --domain=$domain --path_url=$path_url \ test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " -#================================================= # STANDARD RESTORATION STEPS #================================================= # RESTORE THE NGINX CONFIGURATION @@ -98,13 +97,12 @@ fi ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies -ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +ynh_install_nodejs --nodejs_version=$NODEJS_VERSION -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies $pkg_dependencies ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" - #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= @@ -112,7 +110,6 @@ ynh_script_progression --message="Restoring the PostgreSQL database..." ynh_psql_test_if_first_run ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd -ynh_psql_execute_as_root --sql="ALTER USER $db_user CREATEDB;" ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name" #================================================= @@ -144,15 +141,17 @@ yunohost service add $app --description="A interplanetary blogging platform" --l #================================================= ynh_script_progression --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="All workers started" +ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="All workers started" + +#================================================= +# RELOAD NGINX AND PHP-FPM +#================================================= +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 + +ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT #================================================= -#=============================================== -# RESTORE THE NGINX CONFIGURATION -#================================================= - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_script_progression --message="Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index ce7dea0..5fed64a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,8 +21,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) is_public=$(ynh_app_setting_get --app=$app --key=is_public) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) - -db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) +db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) #================================================= # CHECK VERSION @@ -56,6 +55,13 @@ if [ -z "$final_path" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi +# 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 #================================================= @@ -77,7 +83,7 @@ ynh_abort_if_errors #================================================= ynh_script_progression --message="Stopping a systemd service..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped" +ynh_systemd_action --service_name=$app --action=stop --log_path=systemd --line_match="Stopped" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -104,16 +110,18 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Upgrading dependencies..." -ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +ynh_install_nodejs --nodejs_version=$NODEJS_VERSION -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies $pkg_dependencies +curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= # CREATE DEDICATED USER #================================================= ynh_script_progression --message="Making sure dedicated system user exists..." + # Create a dedicated user (if not existing) ynh_system_user_create --username=$app @@ -139,13 +147,9 @@ ynh_add_swap --size=$swap_needed # SPECIFIC UPGRADE #================================================= -config="$final_path/.config/default.yml" -cp -f ../conf/default.yml "$config" -ynh_replace_string --match_string="__DB_USER__" --replace_string="$app" --target_file="$config" -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$config" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$config" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config" +ynh_add_config --template="../conf/default.yml" --destination="$final_path/.config/default.yml" + +ynh_store_file_checksum --file="$final_path/.config/default.yml" #================================================= # Updating process MISSKEY @@ -157,11 +161,11 @@ pushd "$final_path" ynh_exec_warn_less yarn run init popd - #================================================= # SETUP SYSTEMD #================================================= ynh_script_progression --message="Upgrading systemd configuration..." + # Create a dedicated systemd config ynh_add_systemd_config @@ -169,8 +173,6 @@ ynh_add_systemd_config # MODIFY A CONFIG FILE #================================================= -### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script. -### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it. ynh_backup_if_checksum_is_different --file="$config" ynh_replace_string --match_string="match_string" --replace_string="replace_string" --target_file="$final_path/.config/default.yml.backup" @@ -199,7 +201,7 @@ yunohost service add $app --description="A interplanetary blogging platform" --l #================================================= ynh_script_progression --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="All workers started" +ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="All workers started" #================================================= # RELOAD NGINX