From fd737d7643e9bd6f470743281ac8201f20286924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 25 Nov 2020 15:40:26 +0100 Subject: [PATCH 1/5] Fix linter warning --- check_process | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/check_process b/check_process index a0d9972..fa1bb9a 100644 --- a/check_process +++ b/check_process @@ -24,18 +24,7 @@ port_already_use=0 change_url=0 ;;; Levels - Level 1=auto - Level 2=auto - Level 3=auto -# Level 4: If the app supports LDAP and SSOwat, turn level 4 to '1' and add a link to an issue or a part of your code to show it. -# If the app does not use LDAP nor SSOwat, and can't use them, turn level 4 to 'na' and explain as well. - Level 4=1 Level 5=auto - Level 6=auto - Level 7=auto - Level 8=0 - Level 9=0 - Level 10=0 ;;; Options Email=anmol@datamol.org Notification=change From 044ca918b65ae13b8906dd97e7a89ab643acf899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 25 Nov 2020 15:42:40 +0100 Subject: [PATCH 2/5] Fix linter warning --- scripts/upgrade | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index aef000a..48046aa 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -84,7 +84,7 @@ fi ynh_script_progression --message="Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" +ynh_setup_source --dest_dir="$final_path" #================================================= @@ -95,7 +95,7 @@ ynh_script_progression --message="Upgrading source files..." ynh_script_progression --message="Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" +ynh_setup_source --dest_dir="$final_path" cp -a "$tmpdir/cache" "${final_path}" cp -a "$tmpdir/store" "${final_path}" @@ -159,7 +159,7 @@ ynh_print_info "Setting up cron job..." ynh_replace_string --match_string="YNH_WWW_PATH" --replace_string="$final_path" --target_file="../conf/poller-cron" ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="../conf/poller-cron" ynh_replace_string --match_string="__PHP_VERSION__" --replace_string="$phpversion" --target_file="../conf/poller-cron" -sudo cp -f ../conf/poller-cron /etc/cron.d/$app +cp -f ../conf/poller-cron /etc/cron.d/$app #================================================= # UPGRADE DEPENDENCIES From 242f09887437e286b400f32a05990cf1065f1cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 25 Nov 2020 15:45:47 +0100 Subject: [PATCH 3/5] Fix linter warning --- scripts/install | 77 ++----------------------------------------------- 1 file changed, 2 insertions(+), 75 deletions(-) diff --git a/scripts/install b/scripts/install index 7e581bd..f8d53fa 100755 --- a/scripts/install +++ b/scripts/install @@ -33,33 +33,13 @@ database="1" random_string="$(ynh_string_random)$(ynh_string_random)$(ynh_string_random)" database=`expr $YNH_APP_ARG_DATABASE` -# 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 #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -### About --weight and --time -### ynh_script_progression will show to your final users the progression of each scripts. -### In order to do that, --weight will represent the relative time of execution compared to the other steps in the script. -### --time is a packager option, it will show you the execution time since the previous call. -### This option should be removed before releasing your app. -### Use the execution time, given by --time, to estimate the weight of a step. -### A common way to do it is to set a weight equal to the execution time in second +1. -### The execution time is given for the duration since the previous call. So the weight should be applied to this previous call. ynh_script_progression --message="Validating installation parameters..." -### If the app uses nginx as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". -### If the app provides an internal web server (or uses another application server such as uwsgi), the final path should be "/opt/yunohost/$app" final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -79,8 +59,6 @@ ynh_app_setting_set --app=$app --key=upload --value=$upload ynh_app_setting_set --app=$app --key=database --value=$database ynh_app_setting_set --app=$app --key=random_string --value=$random_string - - #================================================= # STANDARD MODIFICATIONS #================================================= @@ -88,19 +66,10 @@ ynh_app_setting_set --app=$app --key=random_string --value=$random_string #================================================= ynh_print_info "Installing dependencies..." -### `ynh_install_app_dependencies` allows you to add any "apt" dependencies to the package. -### Those deb packages will be installed as dependencies of this package. -### If you're not using this helper: -### - Remove the section "REMOVE DEPENDENCIES" in the remove script -### - Remove the variable "pkg_dependencies" in _common.sh -### - As well as the section "REINSTALL DEPENDENCIES" in the restore script -### - And the section "UPGRADE DEPENDENCIES" in the upgrade script - if [ $database -eq 2 ]; then ynh_install_app_dependencies $pkg_dependencies fi - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -108,10 +77,6 @@ fi # 1 - Zap ynh_script_progression --message="Setting up Zap source files..." -### `ynh_setup_source` is used to install an app from a zip or tar.gz file, -### downloaded from an upstream source, like a git repository. -### `ynh_setup_source` use the file conf/app.src - ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" @@ -140,22 +105,12 @@ cp $final_path/install/htconfig.sample.php $config config="$final_path/.htconfig.php" # Create php.log inside for logs ynh_print_info "Create php.log for the debuging..." -sudo touch "$final_path/php.log" +touch "$final_path/php.log" #================================================= # CREATE A DATABASE #================================================= - -### Use these lines if you need a database for the application. -### `ynh_mysql_setup_db` will create a database, an associated user and a ramdom password. -### The password will be stored as 'mysqlpwd' into the app settings, -### and will be available as $db_pwd -### If you're not using these lines: -### - Remove the section "BACKUP THE MYSQL DATABASE" in the backup script -### - Remove also the section "REMOVE THE MYSQL DATABASE" in the remove script -### - As well as the section "RESTORE THE MYSQL DATABASE" in the restore script - if [ $database -eq 1 ]; then ynh_script_progression --message="Creating a MySQL database..." db_name=$(ynh_sanitize_dbid --db_name=$app) @@ -186,8 +141,6 @@ fi # MODIFY A CONFIG FILE #================================================= -### `ynh_replace_string` is used to replace a string in a file. -### (It's compatible with sed regular expressions syntax) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) ynh_replace_string --match_string="your.mysqlhost.com" --replace_string="localhost" --target_file="$config" ynh_replace_string --match_string= "mysqlpassword" --replace_string="$db_pwd" --target_file="$config" @@ -202,18 +155,15 @@ ynh_replace_string --match_string= "//ini_set('log_errors','1');" --replace_stri ynh_replace_string --match_string= "//ini_set('display_errors', '0');" --replace_string="ini_set('display_errors', '0');" --target_file="$config" sed -i "s/\['php_path'\] = 'php';/\['php_path'\] = 'php$phpversion';/g" "$config" -# addon ldap config +# addon LDAP config ynh_script_progression --message="Push Ldap configuration to .htconfig.php..." cat ../conf/ldap_conf.php >> $final_path/.htconfig.php - - #================================================= # NGINX CONFIGURATION #================================================= ynh_script_progression --message="Configuring nginx web server..." -### `ynh_add_nginx_config` will use the file conf/nginx.conf # Create a dedicated nginx config ynh_add_nginx_config @@ -231,17 +181,6 @@ ynh_system_user_create --username=$app #================================================= ynh_script_progression --message="Configuring php-fpm..." -### `ynh_add_fpm_config` is used to set up a PHP config. -### You can remove it if your app doesn't use PHP. -### `ynh_add_fpm_config` will use the files conf/php-fpm.conf -### If you're not using these lines: -### - You can remove these files in conf/. -### - Remove the section "BACKUP THE PHP-FPM CONFIGURATION" in the backup script -### - Remove also the section "REMOVE PHP-FPM CONFIGURATION" in the remove script -### - As well as the section "RESTORE THE PHP-FPM CONFIGURATION" in the restore script -### With the reload at the end of the script. -### - And the section "PHP-FPM CONFIGURATION" in the upgrade script - # Create a dedicated php-fpm config ynh_add_fpm_config --package="$extra_php_dependencies" @@ -260,10 +199,6 @@ cp ../conf/poller-cron /etc/cron.d/$app # STORE THE CONFIG FILE CHECKSUM #================================================= -### `ynh_store_file_checksum` is used to store the checksum of a file. -### That way, during the upgrade script, by using `ynh_backup_if_checksum_is_different`, -### you can make a backup of this file before modifying it again if the admin had modified it. - # Calculate and store the config file checksum into the app settings ynh_store_file_checksum --file="$config" @@ -272,14 +207,6 @@ ynh_store_file_checksum --file="$config" #================================================= ynh_script_progression --message="Configuring log rotation..." -### `ynh_use_logrotate` is used to configure a logrotate configuration for the logs of this app. -### Use this helper only if there is effectively a log file for this app. -### If you're not using this helper: -### - Remove the section "BACKUP LOGROTATE" in the backup script -### - Remove also the section "REMOVE LOGROTATE CONFIGURATION" in the remove script -### - As well as the section "RESTORE THE LOGROTATE CONFIGURATION" in the restore script -### - And the section "SETUP LOGROTATE" in the upgrade script - # Use logrotate to manage application logfile(s) ynh_use_logrotate "$final_path/php.log" From d3ac200028491fe5eb9c2cfc7ad9217e74dfbf85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 25 Nov 2020 15:46:54 +0100 Subject: [PATCH 4/5] Fix linter warning --- scripts/restore | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/restore b/scripts/restore index 78267de..33d5372 100755 --- a/scripts/restore +++ b/scripts/restore @@ -65,7 +65,7 @@ ynh_restore_file --origin_path="$final_path" #================================================= # RESTORE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Restoring the MySQL database..." --time +ynh_script_progression --message="Restoring the MySQL database..." if [ $database -eq 1 ]; then ynh_script_progression --message="Restoring MySQL database..." @@ -120,7 +120,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= # RESTORE FAIL2BAN CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the fail2ban configuration..." --time --weight=1 +ynh_script_progression --message="Restoring the fail2ban configuration..." ynh_restore_file "/etc/fail2ban/jail.d/$app.conf" ynh_restore_file "/etc/fail2ban/filter.d/$app.conf" @@ -134,7 +134,7 @@ ynh_app_setting_set $app skipped_uris "/" #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading nginx web server and php-fpm..." --time --weight=1 +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 @@ -143,4 +143,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --time --last \ No newline at end of file +ynh_script_progression --message="Restoration completed for $app" From 71d081a49a1e2f7c5a15b26c46fcec7d9ef77b63 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Sat, 28 Nov 2020 13:08:51 +0530 Subject: [PATCH 5/5] Updated to version 2020-11-26 --- README.md | 5 ++--- check_process | 2 +- conf/app.src | 4 ++-- manifest.json | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 00dec70..2a4c78d 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* -Version: 2020-11-11 +Version: 2020-11-26 ### Interesting links @@ -39,8 +39,7 @@ Compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzil - [X] Multi-instance - [X] Adeed php.log in the root folder for debugging php, with logrotate applied on it (can be accesssed by **admin->logs** and entering the **php.log**). - [X] Fail2ban -- [X] Choose between **Mysql** and -**PostgreSQL** database to be used for the Zap while installation. +- [X] Option to choose between **Mysql** and **PostgreSQL**. ## Installation diff --git a/check_process b/check_process index a0d9972..14c5709 100644 --- a/check_process +++ b/check_process @@ -17,7 +17,7 @@ setup_private=0 setup_public=1 upgrade=1 - #upgrade=1 from_commit=CommitHash + #upgrade=1 from_commit=a2a416d743aaab3c01f36baec81b36b21720235f backup_restore=1 multi_instance=1 incorrect_path=1 diff --git a/conf/app.src b/conf/app.src index b7c1efe..7a1ae2d 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://codeberg.org/zot/zap/archive/8aa0e232a756be3cb22549342857b4cdcac6fb2a.tar.gz -SOURCE_SUM=9ede3d9f819c47899e27e36a33b435dff13bbc385348a408ae25d21771d0f0af +SOURCE_URL=https://codeberg.org/zot/zap/archive/fe8db82c6e31e7ce7255a086814d285d3dcbe5b8.tar.gz +SOURCE_SUM=59d081cd8525a55ed18fa0cec37181821b6ee305a1df8aa23bfcff48b85b8f7f SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR= SOURCE_FILENAME= diff --git a/manifest.json b/manifest.json index 47f52c5..230ba93 100644 --- a/manifest.json +++ b/manifest.json @@ -5,7 +5,7 @@ "description": { "en": "A fediverse server." }, - "version": "2020-11-11~ynh1", + "version": "2020-11-26~ynh1", "url": "https://zotlabs.com/zap/", "license": "MIT", "maintainer": {