diff --git a/README.md b/README.md index 18f064d..63c3738 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,6 @@ The app can be used by multiple users. * App website: https://pleroma.social/ * Upstream app repository https://git.pleroma.social/pleroma/pleroma/ * YunoHost website: https://yunohost.org/ - * Report usage problems with yunohost on [Yunohost Forum](https://forum.yunohost.org/c/support/apps) --- diff --git a/check_process b/check_process index 2de1977..9a42aeb 100644 --- a/check_process +++ b/check_process @@ -51,13 +51,8 @@ upgrade=1 from_commit=059ddc457aabe6962f5960612ed2dc1db53daeeb backup_restore=1 multi_instance=0 - # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. - # incorrect_path=1 port_already_use=0 change_url=0 -;;; Levels - # If the level 5 (Package linter) is forced to 1. Please add justifications here. - Level 5=auto ;;; Options Email=anmol@datamol.org;yalh@yahoo.com Notification=yes diff --git a/issue_template.md b/issue_template.md index fbdd93d..72440d9 100644 --- a/issue_template.md +++ b/issue_template.md @@ -1,32 +1,34 @@ --- name: Bug report -about: Create a report to help us debug, it would be nice to fill the template as much as you can to help us, help you and help us all. +about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently. --- **How to post a meaningful bug report** 1. *Read this whole template first.* 2. *Determine if you are on the right place:* - - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change url...), you are on the right place!* + - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* - *Otherwise, the issue may be due to Pleroma itself. Refer to its documentation or repository for help.* - - *If you have a doubt, post here, we will figure it out together.* + - *When in doubt, post here and we will figure it out together.* 3. *Delete the italic comments as you write over them below, and remove this guide.* --- -**Describe the bug** +### Describe the bug + *A clear and concise description of what the bug is.* -**Versions** +### Context + - Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...* - YunoHost version: x.x.x - I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...* -- Are you in a special context or did you perform some particular tweaking on your YunoHost instance ?: *no / yes* +- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes* - If yes, please explain: - Using, or trying to install package version/branch: - If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`* -**To Reproduce** -*Steps to reproduce the behavior.* +### Steps to reproduce + - *If you performed a command from the CLI, the command itself is enough. For example:* ```sh sudo yunohost app install pleroma @@ -34,13 +36,20 @@ about: Create a report to help us debug, it would be nice to fill the template a - *If you used the webadmin, please perform the equivalent command from the CLI first.* - *If the error occurs in your browser, explain what you did:* 1. *Go to '...'* - 2. *Click on '....'* - 3. *Scroll down to '....'* + 2. *Click on '...'* + 3. *Scroll down to '...'* 4. *See error* -**Expected behavior** +### Expected behavior + *A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.* -**Logs** -*After a failed command, YunoHost makes the log available to you, but also to others, thanks to `yunohost log display [log name] --share`. The actual command, with the correct log name, is displayed at the end of the failed attempt in the CLI. Execute it and copy here the share link it outputs.* +### Logs + +*When an operation fails, YunoHost provides a simple way to share the logs.* +- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.* +- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.* + +*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)* + *If applicable and useful, add screenshots to help explain your problem.* diff --git a/manifest.json b/manifest.json index bd97055..3c6bd09 100644 --- a/manifest.json +++ b/manifest.json @@ -18,7 +18,7 @@ "name": "yalh76" }], "requirements": { - "yunohost": ">= 4.0" + "yunohost": ">= 4.1.3" }, "multi_instance": false, "services": [ diff --git a/pull_request_template.md b/pull_request_template.md index a24f41a..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/pleroma_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/pleroma_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/change_url b/scripts/change_url index c0cf702..d1bcc13 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -126,6 +126,7 @@ ynh_store_file_checksum --file="$config" #================================================= 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="Started $app" if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then diff --git a/scripts/install b/scripts/install index 2190d7f..ef82b9d 100755 --- a/scripts/install +++ b/scripts/install @@ -64,7 +64,6 @@ ynh_script_progression --message="Storing installation settings..." 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 -ynh_app_setting_set --app=$app --key=is_public --value=$is_public ynh_app_setting_set --app=$app --key=name --value=$name ynh_app_setting_set --app=$app --key=registration --value=$registration ynh_app_setting_set --app=$app --key=cache --value=$cache @@ -256,18 +255,19 @@ chown -R "$app":"$app" "$final_path" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for Pleroma" +yunohost service add $app --description="$app daemon for Pleroma" #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." +ynh_script_progression --message="Configuring permissions..." # Make app public if necessary if [ $is_public -eq 1 ] then - # unprotected_uris allows SSO credentials to be passed anyway. - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission="main" --add="visitors" fi #================================================= diff --git a/scripts/remove b/scripts/remove index 462eacc..b6225d7 100755 --- a/scripts/remove +++ b/scripts/remove @@ -28,12 +28,11 @@ datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # REMOVE SERVICE INTEGRATION IN YUNOHOST #================================================= -ynh_script_progression --message="Removing service integration in YunoHost..." # Remove the service from the list of services known by Yunohost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null then - ynh_script_progression --message="Removing $app service..." + ynh_script_progression --message="Removing $app service integration..." yunohost service remove $app fi @@ -90,7 +89,6 @@ ynh_secure_remove --file="/etc/nginx/conf.d/$app-cache.conf" #================================================= # CLOSE A PORT #================================================= -ynh_script_progression --message="Closing a port..." if yunohost firewall list | grep -q "\- $port$" then diff --git a/scripts/restore b/scripts/restore index f8692d7..b369738 100755 --- a/scripts/restore +++ b/scripts/restore @@ -160,7 +160,7 @@ fi #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -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/upgrade b/scripts/upgrade index 29f3ed9..7fc34d8 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,7 +21,6 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) admin=$(ynh_app_setting_get --app=$app --key=admin) -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) admin_email=$(ynh_app_setting_get --app=$app --key=admin_email) @@ -46,27 +45,12 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." -# Fix is_public as a boolean value -if [ "$is_public" = "Yes" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=1 - is_public=1 -elif [ "$is_public" = "No" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=0 - is_public=0 -fi +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all -# If db_name doesn't exist, create it -if [ -z "$db_name" ]; then - db_name=$(ynh_sanitize_dbid --db_name=$app) - ynh_app_setting_set --app=$app --key=db_name --value=$db_name + ynh_app_setting_delete --app=$app --key=is_public fi - -# If final_path doesn't exist, create it -if [ -z "$final_path" ]; then - final_path=/var/www/$app - ynh_app_setting_set --app=$app --key=final_path --value=$final_path -fi - #Switch variables name psql_db=$(ynh_app_setting_get --app=$app --key=psql_db) @@ -301,18 +285,6 @@ if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then sleep 60 fi -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." - -# Make app public if necessary -if [ $is_public -eq 1 ] -then - # unprotected_uris allows SSO credentials to be passed anyway - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" -fi - #================================================= # RELOAD NGINX #=================================================