From 553c5ad640829705749ca62a54a6f008060353bf Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 17 Mar 2021 09:09:35 +0100 Subject: [PATCH] fix linter warnings --- README.md | 63 ++++++++++++++++++++++++++++++++++++---- check_process | 7 ----- issue_template.md | 4 +-- manifest.json | 16 ++-------- pull_request_template.md | 4 +-- scripts/backup | 8 ----- scripts/change_url | 6 ---- scripts/install | 16 ++-------- scripts/restore | 2 +- scripts/upgrade | 29 ++---------------- 10 files changed, 70 insertions(+), 85 deletions(-) diff --git a/README.md b/README.md index 44a3bff..fc00a93 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ -# Owntracks app for YunoHost +# Owntracks for YunoHost -- [Yunohost project](https://yunohost.org) -- [Owntracks website](http://owntracks.org) -- [php-owntracks-recorder](https://github.com/tomyvi/php-owntracks-recorder) -- [php-owntracks-recorder altered version for YunoHost](https://github.com/tituspijean/php-owntracks-recorder) +[![Integration level](https://dash.yunohost.org/integration/owntracks.svg)](https://dash.yunohost.org/appci/app/owntracks) ![](https://ci-apps.yunohost.org/ci/badges/owntracks.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/owntracks.maintain.svg) +[![Install Owntracks with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=owntracks) +> *This package allows you to install Owntracks quickly and simply on a YunoHost server. +If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* + +## Overview A location history app for YunoHost, based on Owntracks and its PHP implementation for recording and displaying. ## Features @@ -26,3 +28,54 @@ A location history app for YunoHost, based on Owntracks and its PHP implementati - Username/password: your YNH credentials - Device ID: as you wish - Refer to the [Owntracks documentation](http://owntracks.org/booklet) for the other settings + +## Configuration + +How to configure this app: From an admin panel, a plain file with SSH, or any other way. + +## Documentation + + * Official documentation: Link to the official documentation of this app + * YunoHost documentation: If specific documentation is needed, feel free to contribute. + +## YunoHost specific features + +#### Multi-user support + + * Are LDAP and HTTP auth supported? + * Can the app be used by multiple users? + +#### Supported architectures + +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/owntracks%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/owntracks/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/owntracks%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/owntracks/) + +## Limitations + +* Any known limitations. + +## Additional information + +* Other info you would like to add about this app. + +## Links + + * Report a bug: https://github.com/YunoHost-Apps/owntracks_ynh/issues + * App website: http://owntracks.org + * [php-owntracks-recorder](https://github.com/tomyvi/php-owntracks-recorder) + * [php-owntracks-recorder altered version for YunoHost](https://github.com/tituspijean/php-owntracks-recorder) + * Upstream app repository: Link to the official repository of the upstream app. + * YunoHost website: https://yunohost.org/ + +--- + +## Developer info + +Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/owntracks_ynh/tree/testing). + +To try the testing branch, please proceed like that. +``` +sudo yunohost app install https://github.com/YunoHost-Apps/owntracks_ynh/tree/testing --debug +or +sudo yunohost app upgrade owntracks -u https://github.com/YunoHost-Apps/owntracks_ynh/tree/testing --debug +``` diff --git a/check_process b/check_process index 5ebf68e..2befc1f 100644 --- a/check_process +++ b/check_process @@ -1,8 +1,6 @@ # See here for more information # https://github.com/YunoHost/package_check#syntax-check_process-file -# Move this file from check_process.default to check_process when you have filled it. - ;; Test complet ; Manifest domain="domain.tld" (DOMAIN) @@ -20,13 +18,8 @@ upgrade=1 from_commit=86aa2259d605c9504e7e3e25f07e28b609d4ae5a backup_restore=1 multi_instance=1 - # 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=1 -;;; Levels - # If the level 5 (Package linter) is forced to 1. Please add justifications here. - Level 5=auto ;;; Options Email= Notification=none diff --git a/issue_template.md b/issue_template.md index d93e361..37692b7 100644 --- a/issue_template.md +++ b/issue_template.md @@ -7,7 +7,7 @@ about: When creating a bug report, please use the following template to provide **How to post a meaningful bug report** 1. *Read this whole template first.* 2. *Make sure 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 the app itself. Refer to its documentation or repository for help.* - *In doubt, ask here and we will figure it out together.* 3. *Delete these italic comments as you write over them below, and remove this guide.* @@ -31,7 +31,7 @@ about: When creating a bug report, please use the following template to provide - *If you performed a command from the CLI, the command itself is enough. For example:* ```sh - sudo yunohost app install REPLACEBYYOURAPP + sudo yunohost app install owntracks ``` - *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:* diff --git a/manifest.json b/manifest.json index efb92a1..34e2ecb 100644 --- a/manifest.json +++ b/manifest.json @@ -15,31 +15,23 @@ "url": "https://github.com/tituspijean/owntracks_ynh" }, "requirements": { - "yunohost": ">= 3.7" + "yunohost": ">= 4.1.7" }, "multi_instance": true, "services": [ "nginx", - "php7.0-fpm", + "php7.3-fpm", "mysql" ], "arguments": { "install": [{ "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain name for Owntracks", - "fr": "Choisissez un nom de domaine pour Owntracks" - }, "example": "example.com" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for Owntracks", - "fr": "Choisissez un chemin pour Owntracks" - }, "example": "/owntracks", "default": "/owntracks" }, @@ -59,10 +51,6 @@ { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public application?", - "fr": "Est-ce une application publique ?" - }, "help": { "en": "If public, anyone will be able to see the owntracks record from specified user.", "fr": "Si publique, quiconque aura accès aux traces owntracks de l'utilisateur spécifié." diff --git a/pull_request_template.md b/pull_request_template.md index d9b47e9..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/flarum_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/flarum_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/backup b/scripts/backup index 5e7899d..4038b67 100644 --- a/scripts/backup +++ b/scripts/backup @@ -34,11 +34,6 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_print_info --message="Declaring files to be backed up..." -### N.B. : the following 'ynh_backup' calls are only a *declaration* of what needs -### to be backuped and not an actual copy of any file. The actual backup that -### creates and fill the archive with the files happens in the core after this -### script is called. Hence ynh_backups calls takes basically 0 seconds to run. - #================================================= # BACKUP THE APP MAIN DIR #================================================= @@ -70,11 +65,8 @@ ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # BACKUP THE MYSQL DATABASE #================================================= - ynh_print_info --message="Backing up the MySQL database..." -### (However, things like mysql dumps *do* take some time to run, though the -### copy of the generated dump to the archive still happens later) ynh_mysql_dump_db --database="$db_name" > db.sql diff --git a/scripts/change_url b/scripts/change_url index af3a816..6d5a6d4 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -94,12 +94,6 @@ then ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" fi -#================================================= -# SPECIFIC MODIFICATIONS -#================================================= -# ... -#================================================= - #================================================= # GENERIC FINALISATION #================================================= diff --git a/scripts/install b/scripts/install index f98039e..647f600 100644 --- a/scripts/install +++ b/scripts/install @@ -25,16 +25,6 @@ path_url=$YNH_APP_ARG_PATH user=$YNH_APP_ARG_USER is_public=$YNH_APP_ARG_IS_PUBLIC -# This is a multi-instance app, meaning it can be installed several times independently -# The id of the app as stated in the manifest is available as $YNH_APP_ID -# The instance number is available as $YNH_APP_INSTANCE_NUMBER (equals "1", "2", ...) -# The app instance name is available as $YNH_APP_INSTANCE_NAME -# - the first time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample -# - the second time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample__2 -# - ynhexample__{N} for the subsequent installations, with N=3,4, ... -# The app instance name is probably what you are interested the most, since this is -# guaranteed to be unique. This is a good unique identifier to define installation path, -# db names, ... app=$YNH_APP_INSTANCE_NAME #================================================= @@ -86,7 +76,7 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." +ynh_script_progression --message="Configuring NGINX web server..." ### `ynh_add_nginx_config` will use the file conf/nginx.conf @@ -144,7 +134,7 @@ if [ $is_public -eq 1 ] then # Everyone can access the app. # The "main" permission is automatically created before the install script. - ynh_permission_update --permission "main" --add "visitors" + ynh_permission_update --permission="main" --add="visitors" else ynh_permission_update --permission "main" --add $user --remove="all_users" fi @@ -152,7 +142,7 @@ 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 416733c..6a6d7f8 100644 --- a/scripts/restore +++ b/scripts/restore @@ -93,7 +93,7 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading nginx web server and php-fpm..." +ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 2f2b534..574da26 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,7 +19,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) user=$(ynh_app_setting_get --app=$app --key=user) -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=mysqlpwd) @@ -28,12 +27,6 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) # CHECK VERSION #================================================= -### This helper will compare the version of the currently installed app and the version of the upstream package. -### $upgrade_type can have 2 different values -### - UPGRADE_APP if the upstream app version has changed -### - UPGRADE_PACKAGE if only the YunoHost package has changed -### ynh_check_app_version_changed will stop the upgrade if the app is up to date. -### UPGRADE_APP should be used to upgrade the core app only if there's an upgrade to do. upgrade_type=$(ynh_check_app_version_changed) #================================================= @@ -41,15 +34,6 @@ 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 - # If db_name doesn't exist, create it if [ -z "$db_name" ]; then db_name=$(ynh_sanitize_dbid --db_name=$app) @@ -90,13 +74,6 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# CHECK THE PATH -#================================================= - -# Normalize the URL path syntax -path_url=$(ynh_normalize_url_path $path_url) - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -114,7 +91,7 @@ fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." +ynh_script_progression --message="Upgrading NGINX web server configuration..." # Create a dedicated nginx config ynh_add_nginx_config @@ -130,7 +107,7 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading php-fpm configuration..." +ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated php-fpm config ynh_add_fpm_config @@ -156,7 +133,7 @@ chown -R $app:www-data $final_path #================================================= # 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