From 0377dac6bb98baaa2984767364bb1f7bb6570363 Mon Sep 17 00:00:00 2001 From: Amo Date: Fri, 2 Jul 2021 01:44:37 +0530 Subject: [PATCH] Git auto update --- conf/addons.src | 6 --- conf/app.src | 6 --- manifest.json | 92 +++++++++++++++++++++++----------------------- scripts/_common.sh | 33 +++++++++++++++++ scripts/install | 2 +- scripts/upgrade | 12 +++--- tags | 87 +++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 172 insertions(+), 66 deletions(-) delete mode 100644 conf/addons.src delete mode 100644 conf/app.src create mode 100644 tags diff --git a/conf/addons.src b/conf/addons.src deleted file mode 100644 index 711bbcb..0000000 --- a/conf/addons.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://files.friendi.ca/friendica-addons-2021.04.tar.gz -SOURCE_SUM=6c798634ce75d25bb71c80a00fcd3b6dd48be3ca2e233ca0f9ed80981cba83af -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= diff --git a/conf/app.src b/conf/app.src deleted file mode 100644 index 36543d3..0000000 --- a/conf/app.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://files.friendi.ca/friendica-full-2021.04.tar.gz -SOURCE_SUM=440d3a39cd701c3a4179f89fcb1a7197c3bf03f02c087c4a6e1bbe88932a1ce4 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=2 -SOURCE_FILENAME= diff --git a/manifest.json b/manifest.json index 8462dac..c7147f1 100644 --- a/manifest.json +++ b/manifest.json @@ -1,52 +1,52 @@ { - "name": "Friendica", - "id": "friendica", - "packaging_format": 1, - "description": { - "en": "Social Communication Server", - "fr": "Serveur de Communication Social" - }, - "url": "http://friendi.ca", - "license": "AGPL-3.0-only", - "version": "2021.04~ynh2", - "maintainer": { - "name": "Anmol Sharma", - "email": "" - }, - "requirements": { - "yunohost": ">= 4.1.0" - }, - "previous_maintainers": { - "name": "aymhce", - "email": "aymhce@gmail.com" - }, - "multi_instance": true, - "services": [ - "nginx", - "php7.3-fpm", - "mysql" + "name": "Friendica", + "id": "friendica", + "packaging_format": 1, + "description": { + "en": "Social Communication Server", + "fr": "Serveur de Communication Social" + }, + "url": "http://friendi.ca", + "license": "AGPL-3.0-only", + "version": "2021.04~ynh2", + "maintainer": { + "name": "Anmol Sharma", + "email": "" + }, + "requirements": { + "yunohost": ">= 4.1.0" + }, + "previous_maintainers": { + "name": "aymhce", + "email": "aymhce@gmail.com" + }, + "multi_instance": true, + "services": [ + "nginx", + "php7.3-fpm", + "mysql" ], "arguments": { - "install" : [ - { - "name": "domain", - "type": "domain", - "ask": { - "en": "Choose a domain for Friendica. Friendica must be installed on the ROOT domain, so be careful!", - "fr": "Choisissez un domaine pour Friendica.Friendica doit etre installe a la racine, soyez prudent" - }, - "example": "domain.org" - }, - { - "name": "admin", - "type": "user", - "ask": { - "en": "Choose the Friendica administrator (must be an existing YunoHost user)", - "fr": "Choisissez l'administrateur pour Friendica (l'utilisateur YunoHost doit exister)" - }, - "example": "homer" - } + "install" : [ + { + "name": "domain", + "type": "domain", + "ask": { + "en": "Choose a domain for Friendica. Friendica must be installed on the ROOT domain, so be careful!", + "fr": "Choisissez un domaine pour Friendica.Friendica doit etre installe a la racine, soyez prudent" + }, + "example": "domain.org" + }, + { + "name": "admin", + "type": "user", + "ask": { + "en": "Choose the Friendica administrator (must be an existing YunoHost user)", + "fr": "Choisissez l'administrateur pour Friendica (l'utilisateur YunoHost doit exister)" + }, + "example": "homer" + } - ] + ] } } diff --git a/scripts/_common.sh b/scripts/_common.sh index 0446752..b8749f1 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -8,3 +8,36 @@ YNH_PHP_VERSION="7.3" extra_php_dependencies="php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-gd" + +#================================================= +# EXPERIMENTAL HELPERS +#================================================= + +ynh_smart_mktemp () { + local min_size="${1:-300}" + # Transform the minimum size from megabytes to kilobytes + min_size=$(( $min_size * 1024 )) + + # Check if there's enough free space in a directory + is_there_enough_space () { + local free_space=$(df --output=avail "$1" | sed 1d) + test $free_space -ge $min_size + } + + if is_there_enough_space /tmp; then + local tmpdir=/tmp + elif is_there_enough_space /var; then + local tmpdir=/var + elif is_there_enough_space /; then1 + local tmpdir=/ + elif is_there_enough_space /home; then + local tmpdir=/home + else + ynh_die "Insufficient free space to continue..." + fi + + echo "$(mktemp --directory --tmpdir="$tmpdir")" +} +#================================================= +# FUTURE OFFICIAL HELPERS +#================================================= diff --git a/scripts/install b/scripts/install index 129d95b..0b7abc3 100644 --- a/scripts/install +++ b/scripts/install @@ -119,7 +119,7 @@ ynh_system_user_create --username=$app #================================================= ynh_script_progression --message="Configuring php-fpm..." -# Create a dedicated php-fpm config +# Create a dedicated php-fpm configy ynh_add_fpm_config --package="$extra_php_dependencies" phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) diff --git a/scripts/upgrade b/scripts/upgrade index 01fc9b1..f5bbe95 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -120,16 +120,14 @@ else # Remove the app directory securely ynh_secure_remove "$final_path" - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + # 1- Clone stable repo + $git clone https://github.com/friendica/friendica.git -b stable "$final_path" # Remove the addon directory securely ynh_secure_remove "$final_path/addon" - # Remove addon - ynh_secure_remove "$final_path/addon" - # Download, check integrity, uncompress and patch addons - ynh_setup_source --dest_dir="$final_path/addon" --source_id="addons" + # 2 - Clone addons repo + git clone https://github.com/friendica/friendica-addons.git -b stable "$final_path/addon" # Restore the smarty3 folder cp -a "$tmpdir/view/smarty3" "${final_path}" @@ -147,7 +145,7 @@ ynh_replace_string --match_string="mysqlusername" --replace_string="$db_nam ynh_replace_string --match_string="mysqldatabasename" --replace_string="$db_name" --target_file="$config" ynh_replace_string --match_string="mysqlpassword" --replace_string="$db_pwd" --target_file= "$config" ynh_replace_string --match_string="'admin_email' => ''," --replace_string="'admin_email' => '$admin_mail'," --target_file="$config" -ynh_replace_string --match_string="OPEN" --replace_string="CLOSED" --target_file="$config" +#ynh_replace_string --match_string="OPEN" --replace_string="CLOSED" --target_file="$config" # ldap addon config cp -f "../conf/addon.config.php" "$final_path/config/." diff --git a/tags b/tags new file mode 100644 index 0000000..2e420e2 --- /dev/null +++ b/tags @@ -0,0 +1,87 @@ +!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ +!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ +!_TAG_OUTPUT_FILESEP slash /slash or backslash/ +!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/ +!_TAG_PATTERN_LENGTH_LIMIT 96 /0 for no limit/ +!_TAG_PROGRAM_AUTHOR Universal Ctags Team // +!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/ +!_TAG_PROGRAM_URL https://ctags.io/ /official site/ +!_TAG_PROGRAM_VERSION 0.0.0 // +0 manifest.json /^ {$/;" o array:arguments.install +0 manifest.json /^ "nginx",$/;" s array:services +1 manifest.json /^ {$/;" o array:arguments.install +1 manifest.json /^ "php7.3-fpm",$/;" s array:services +2 manifest.json /^ "mysql"$/;" s array:services +Developers info README.md /^## Developers info$/;" s chapter:Friendica for YunoHost +Friendica README.md /^## Friendica$/;" s chapter:Friendica for YunoHost +Friendica for YunoHost README.md /^# Friendica for YunoHost$/;" c +Install Friendica README.md /^### Install Friendica$/;" S section:Friendica for YunoHost""Installation +Installation README.md /^## Installation$/;" s chapter:Friendica for YunoHost +Links README.md /^## Links$/;" s chapter:Friendica for YunoHost +Overview README.md /^## Overview$/;" s chapter:Friendica for YunoHost +PR Status pull_request_template.md /^## PR Status$/;" s +Package_check results pull_request_template.md /^## Package_check results$/;" s +Problem pull_request_template.md /^## Problem$/;" s +Register a new domain and add it to YunoHost README.md /^### Register a new domain and add it to YunoHost$/;" S section:Friendica for YunoHost""Installation +Solution pull_request_template.md /^## Solution$/;" s +Supported architectures README.md /^#### Supported architectures$/;" t section:Friendica for YunoHost""User with ldap admin rights +This app claims following features: README.md /^## This app claims following features:$/;" s chapter:Friendica for YunoHost +User with ldap admin rights README.md /^## User with ldap admin rights$/;" s chapter:Friendica for YunoHost +__NAMETOCHANGE__ conf/php-fpm.conf /^[__NAMETOCHANGE__]$/;" s +arguments manifest.json /^ "arguments": {$/;" o +ask manifest.json /^ "ask": {$/;" o object:arguments.install.0 +ask manifest.json /^ "ask": {$/;" o object:arguments.install.1 +chdir conf/php-fpm.conf /^chdir = __FINALPATH__$/;" k section:__NAMETOCHANGE__ +db_data conf/htconfig.php /^ $db_data = getenv('MYSQL_DATABASE');$/;" v +db_data conf/htconfig.php /^$db_data = 'mysqldatabasename';$/;" v +db_host conf/htconfig.php /^ $db_host = getenv('MYSQL_HOST') . ':' . getenv('MYSQL_PORT');$/;" v +db_host conf/htconfig.php /^$db_host = 'your.mysqlhost.com';$/;" v +db_pass conf/htconfig.php /^ $db_pass = getenv('MYSQL_PASSWORD');$/;" v +db_pass conf/htconfig.php /^$db_pass = 'mysqlpassword';$/;" v +db_user conf/htconfig.php /^ $db_user = getenv('MYSQL_USER');$/;" v +db_user conf/htconfig.php /^ $db_user = getenv('MYSQL_USERNAME');$/;" v +db_user conf/htconfig.php /^$db_user = 'mysqlusername';$/;" v +default_timezone conf/htconfig.php /^$default_timezone = 'America\/Los_Angeles';$/;" v +description manifest.json /^ "description": {$/;" o +email manifest.json /^ "email": ""$/;" s object:maintainer +email manifest.json /^ "email": "aymhce@gmail.com"$/;" s object:previous_maintainers +en manifest.json /^ "en": "Choose a domain for Friendica. Friendica must be installed on the ROOT domain/;" s object:arguments.install.0.ask +en manifest.json /^ "en": "Choose the Friendica administrator (must be an existing YunoHost user)",$/;" s object:arguments.install.1.ask +en manifest.json /^ "en": "Social Communication Server",$/;" s object:description +example manifest.json /^ "example": "domain.org"$/;" s object:arguments.install.0 +example manifest.json /^ "example": "homer"$/;" s object:arguments.install.1 +fr manifest.json /^ "fr": "Choisissez l'administrateur pour Friendica (l'utilisateur YunoHost doit exist/;" s object:arguments.install.1.ask +fr manifest.json /^ "fr": "Choisissez un domaine pour Friendica.Friendica doit etre installe a la racine/;" s object:arguments.install.0.ask +fr manifest.json /^ "fr": "Serveur de Communication Social"$/;" s object:description +group conf/php-fpm.conf /^group = __USER__$/;" k section:__NAMETOCHANGE__ +group conf/php-fpm.conf /^listen.group = www-data$/;" k section:__NAMETOCHANGE__ +id manifest.json /^ "id": "friendica",$/;" s +install manifest.json /^ "install" : [$/;" a object:arguments +is_there_enough_space scripts/_common.sh /^ is_there_enough_space () {$/;" f +license manifest.json /^ "license": "AGPL-3.0-only",$/;" s +listen conf/php-fpm.conf /^listen = \/var\/run\/php\/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock$/;" k section:__NAMETOCHANGE__ +maintainer manifest.json /^ "maintainer": {$/;" o +max_children conf/php-fpm.conf /^pm.max_children = 5$/;" k section:__NAMETOCHANGE__ +max_spare_servers conf/php-fpm.conf /^pm.max_spare_servers = 3$/;" k section:__NAMETOCHANGE__ +min_spare_servers conf/php-fpm.conf /^pm.min_spare_servers = 1$/;" k section:__NAMETOCHANGE__ +multi_instance manifest.json /^ "multi_instance": true,$/;" b +name manifest.json /^ "name": "admin",$/;" s object:arguments.install.1 +name manifest.json /^ "name": "domain",$/;" s object:arguments.install.0 +name manifest.json /^ "name": "Anmol Sharma",$/;" s object:maintainer +name manifest.json /^ "name": "aymhce",$/;" s object:previous_maintainers +name manifest.json /^ "name": "Friendica",$/;" s +owner conf/php-fpm.conf /^listen.owner = www-data$/;" k section:__NAMETOCHANGE__ +packaging_format manifest.json /^ "packaging_format": 1,$/;" n +pm conf/php-fpm.conf /^pm = dynamic$/;" k section:__NAMETOCHANGE__ +previous_maintainers manifest.json /^ "previous_maintainers": {$/;" o +request_terminate_timeout conf/php-fpm.conf /^request_terminate_timeout = 1d$/;" k section:__NAMETOCHANGE__ +requirements manifest.json /^ "requirements": {$/;" o +services manifest.json /^ "services": [$/;" a +start_servers conf/php-fpm.conf /^pm.start_servers = 2$/;" k section:__NAMETOCHANGE__ +type manifest.json /^ "type": "domain",$/;" s object:arguments.install.0 +type manifest.json /^ "type": "user",$/;" s object:arguments.install.1 +url manifest.json /^ "url": "http:\/\/friendi.ca",$/;" s +user conf/php-fpm.conf /^user = __USER__$/;" k section:__NAMETOCHANGE__ +version manifest.json /^ "version": "2021.04~ynh2",$/;" s +ynh_smart_mktemp scripts/_common.sh /^ynh_smart_mktemp () {$/;" f +yunohost manifest.json /^ "yunohost": ">= 4.1.0"$/;" s object:requirements