From e1b08b432fe4471b8eaf58a270a17f7237c4fde0 Mon Sep 17 00:00:00 2001 From: Spencer Dub Date: Thu, 24 Sep 2020 09:57:51 -0700 Subject: [PATCH 01/21] Update README.md Copy-editing --- README.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index cb7adce..89e1a74 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to [Friendica](http://friendi.ca/) integration for YunoHost
-**Version:2020.03**

+**Version:2020.09*

Current snapshot in *sources*: @@ -18,14 +18,11 @@ Current snapshot in *sources*: ## Important Notes -Before installing, read the [Friendica installation instructions](https://github.com/friendica/friendica/blob/master/INSTALL.txt) for important information about +Before installing, read the [Friendica installation instructions](https://github.com/friendica/friendica/blob/develop/doc/Install.md) for important information about - SSL certificate validation requirement (now with support for [Let's Encrypt!](https://letsencrypt.org)). See Installation section below. - Dedicated domain (must install under web root like **https://hub.example.com/** not **https://example.com/hub/** ) -#### Multi-users support - -LDAP auth supported. There are not yet active SSO. -

+**Note:** You can use accounts from YunoHost's LDAP. Single sign-on (SSO) is not yet functional. # To-do - [ ] Fail2Ban support @@ -36,15 +33,19 @@ LDAP auth supported. There are not yet active SSO. ### Register a new domain and add it to YunoHost Friendica requires a dedicated domain, so obtain one and add it using the YunoHost admin panel. **Domains -> Add domain**. As Friendica uses the full domain and is installed on the root, you can create a subdomain such as friendica.domain.tld. Don't forget to update your DNS if you manage them manually. +Friendica requires browser-approved SSL certificates. If you have certificates not issued by [Let's Encrypt](https://letsencrypt.org/), install them manually as usual. + + ### Install the Friendica application -Use the YunoHost admin panel to install Friendica by entering the GitHub repo address in the custom app URL +Use the YunoHost admin panel to install Friendica by entering the GitHub repo address in the custom app URL: https://github.com/YunoHost-Apps/friendica_ynh Make sure to select your domain from the previous section as the application domain. -After the installation,login with the username provided at the time of the installaion with your SSO password.You can then create your profile and access the admin panel from the button in the center of the top nav bar, just adjecent to the search bar.(The admin panel don't have text,so don't get confuse with it) -Public users can register and use the instance as normal users. SSO users can login with there username and password as normal users too. +After the installation, login with the username provided at the time of the installation with your SSO password. You can then create your profile and access the admin panel from the button in the center of the top nav bar, just adjacent to the search bar. **(The admin panel doesn't have text, so don't get confused with it.)** +Public users can register and use the instance as normal users. SSO users can login with their username and password as normal users too. + Developers info ---------------- From 79af3c5ed4e001d8ccc2b372fd07c9179851f654 Mon Sep 17 00:00:00 2001 From: Spencer Dub Date: Thu, 24 Sep 2020 09:58:58 -0700 Subject: [PATCH 02/21] Update README.md More minor copy-edits --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 89e1a74..0b0f218 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,12 @@ [![Install Friendica with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=friendica) > *This package allow you to install Friendica quickly and simply on a YunoHost server. -If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* +If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to learn how to install and enjoy it.* -[Friendica](http://friendi.ca/) integration for YunoHost
-**Version:2020.09*

+[Friendica](http://friendi.ca/) integration for YunoHost + +**Version:2020.09** Current snapshot in *sources*: From 3d452f1f7474be0e2fcfc34df98ecb8a7475ccb5 Mon Sep 17 00:00:00 2001 From: Spencer Dub Date: Thu, 24 Sep 2020 10:00:39 -0700 Subject: [PATCH 03/21] Update app.src Update source to v2020.09 --- conf/app.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/app.src b/conf/app.src index 968419c..a91b942 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://friendi.ca/wp-content/uploads/2020/03/friendica-full-2020.03.tar.gz -SOURCE_SUM=dbfb001a90533e57fc453ff8d8d5c017236251aef78e5feb9902744d8b8dc1bd +SOURCE_URL=https://files.friendi.ca/friendica-full-2020.09.tar.gz +SOURCE_SUM=fb3b8f07aaf3110d26e0c6226ceab3ad9c206b773c3c310eb1e066e3568ed9a5 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true From bb4961656b6d197becc62ee3513d3b7b7195c41a Mon Sep 17 00:00:00 2001 From: Spencer Dub Date: Thu, 24 Sep 2020 10:06:25 -0700 Subject: [PATCH 04/21] Update addons.src Update addons source for 2020.09 --- conf/addons.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/addons.src b/conf/addons.src index 9ce9c67..610275d 100644 --- a/conf/addons.src +++ b/conf/addons.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/friendica/friendica-addons/archive/2020.03.tar.gz -SOURCE_SUM=937aa87bbe8a40ef78348387969e77ac0422d2ce8bd00579aaf4ce45ea1362da +SOURCE_URL=https://files.friendi.ca/friendica-addons-2020.09.tar.gz +SOURCE_SUM=37d4e878b7cb4684a91c4742bf016f3a18bc4a9cfc74000c0ed6c55b84354256 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true From c0c4b871f5d00bd247a1cb51b3f6b6c56fb06581 Mon Sep 17 00:00:00 2001 From: Spencer Dub Date: Thu, 24 Sep 2020 10:10:40 -0700 Subject: [PATCH 05/21] Update LICENSE It is 2020. --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 2bbe2d1..c258e1e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ Friendica Communications Server -Copyright (c) 2010-2017 the Friendica Project +Copyright (c) 2010-2020 the Friendica Project This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by From 997e2f3998723e0fa093e2cfda9155eece312f92 Mon Sep 17 00:00:00 2001 From: Spencer Dub Date: Thu, 24 Sep 2020 10:15:19 -0700 Subject: [PATCH 06/21] Update README.md Update sources --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0b0f218..3a91420 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to Current snapshot in *sources*: -* https://github.com/friendica/friendica: 2020.03 -* https://github.com/friendica/friendica-addons: 2020.03 +* https://github.com/friendica/friendica: 2020.09 +* https://github.com/friendica/friendica-addons: 2020.09 ## Important Notes From d79d99d34bd4cdbb19128803aaa6befdabd9fa11 Mon Sep 17 00:00:00 2001 From: Spencer Dub Date: Thu, 24 Sep 2020 10:26:37 -0700 Subject: [PATCH 07/21] Update manifest.json Update version, copy-edit English prompts --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 48d1380..a3a7b90 100644 --- a/manifest.json +++ b/manifest.json @@ -8,7 +8,7 @@ }, "url": "http://friendi.ca", "license": "free", - "version": "2020.03-ynh2", + "version": "2020.09-ynh2", "maintainer": { "name": "Anmol Sharma", "email": "anmol@datamol.org" @@ -32,7 +32,7 @@ "name": "domain", "type": "domain", "ask": { - "en": "Choose a domain for Friendica.Friendica must be installed on the ROOT domain, so be careful", + "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" From be6e30ed34cf1686481f3839984b433a9fe4a5c8 Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Sun, 11 Oct 2020 02:03:54 +0200 Subject: [PATCH 08/21] [fix] Version number --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index a3a7b90..a717265 100644 --- a/manifest.json +++ b/manifest.json @@ -8,7 +8,7 @@ }, "url": "http://friendi.ca", "license": "free", - "version": "2020.09-ynh2", + "version": "2020.09~ynh1", "maintainer": { "name": "Anmol Sharma", "email": "anmol@datamol.org" From f8c8288c0dde23ea9be92f3cd73af669761d98af Mon Sep 17 00:00:00 2001 From: anmol Date: Fri, 16 Oct 2020 00:39:24 +0530 Subject: [PATCH 09/21] Updated to version 2020.09-1 \o/ --- README.md | 54 +++++++++++++++++++++++---------------- conf/addons.src | 4 +-- conf/app.src | 4 +-- conf/nginx.conf | 14 +++++------ conf/poller-cron | 2 +- manifest.json | 4 +-- scripts/_common.sh | 37 +++------------------------ scripts/backup | 17 +++++++------ scripts/install | 55 ++++++++++++++++++++++------------------ scripts/remove | 14 +++++------ scripts/restore | 30 ++++++++++++---------- scripts/upgrade | 63 +++++++++++++++++++++++++--------------------- 12 files changed, 147 insertions(+), 151 deletions(-) diff --git a/README.md b/README.md index 3a91420..7ad49ae 100644 --- a/README.md +++ b/README.md @@ -1,51 +1,62 @@ # Friendica social network for YunoHost -[![Integration level](https://dash.yunohost.org/integration/friendica.svg)](https://dash.yunohost.org/appci/app/friendica) +[![Integration level](https://dash.yunohost.org/integration/friendica.svg)](https://dash.yunohost.org/appci/app/friendica) ![](https://ci-apps.yunohost.org/ci/badges/friendica.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/friendica.maintain.svg) [![Install Friendica with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=friendica) -> *This package allow you to install Friendica quickly and simply on a YunoHost server. +> *This package allow you to install Friendica quickly and simply on a YunoHost server. If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to learn how to install and enjoy it.* -[Friendica](http://friendi.ca/) integration for YunoHost - -**Version:2020.09** +**Version:**2020.09-1 Current snapshot in *sources*: -* https://github.com/friendica/friendica: 2020.09 -* https://github.com/friendica/friendica-addons: 2020.09 +* https://github.com/friendica/friendica: 2020.09-1 +* https://github.com/friendica/friendica-addons: 2020.09-1 -## Important Notes +## Friendica +[Friendica](http://friendi.ca/) is a decentralised communications platform that integrates social communication. Our platform links to independent social projects and corporate services. -Before installing, read the [Friendica installation instructions](https://github.com/friendica/friendica/blob/develop/doc/Install.md) for important information about -- SSL certificate validation requirement (now with support for [Let's Encrypt!](https://letsencrypt.org)). See Installation section below. -- Dedicated domain (must install under web root like **https://hub.example.com/** not **https://example.com/hub/** ) +Friendica connects you effortlessly to a federated communications network of several thousand servers, with more than half a million user registrations. You can directly connect to anyone on **Friendica**, **Mastodon**, **Diaspora**, **GnuSocial**, **Pleroma**, or **Hubzilla**, regardless where each user profile is hosted. -**Note:** You can use accounts from YunoHost's LDAP. Single sign-on (SSO) is not yet functional. +![](https://raw.githubusercontent.com/friendica/friendica/develop/images/screenshots/friendica-frio-green-profle-1.png) -# To-do -- [ ] Fail2Ban support + +## This app claims following features: +- [X] Ldap integration +- [X] Multi-instance +- [ ] Add 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**). +- [ ] Fail2ban ## Installation ### Register a new domain and add it to YunoHost -Friendica requires a dedicated domain, so obtain one and add it using the YunoHost admin panel. **Domains -> Add domain**. As Friendica uses the full domain and is installed on the root, you can create a subdomain such as friendica.domain.tld. Don't forget to update your DNS if you manage them manually. -Friendica requires browser-approved SSL certificates. If you have certificates not issued by [Let's Encrypt](https://letsencrypt.org/), install them manually as usual. +Before installing, read the [Friendica installation instructions](https://github.com/friendica/friendica/blob/develop/doc/Install.md) for important information about installation. + +- Dedicated domain (must install under web root like **https://friendica.example.com/** not **https://example.com/friendica/** ) + +- Friendica requires browser-approved SSL certificates. -### Install the Friendica application +### Install Friendica Use the YunoHost admin panel to install Friendica by entering the GitHub repo address in the custom app URL: https://github.com/YunoHost-Apps/friendica_ynh -Make sure to select your domain from the previous section as the application domain. -After the installation, login with the username provided at the time of the installation with your SSO password. You can then create your profile and access the admin panel from the button in the center of the top nav bar, just adjacent to the search bar. **(The admin panel doesn't have text, so don't get confused with it.)** -Public users can register and use the instance as normal users. SSO users can login with their username and password as normal users too. +## User with ldap admin rights +**For admin rights**: When installation is complete, you will need to visit your domain page and login with the **admin account username and password** which was entered at the time of installation process. You can then create your profile and access the admin panel. + + **For normal YunoHost users :** Normal LDAP users can login through Ldap authentication and create there profiles. + +#### Supported architectures + +* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/friendica%20%28Official%29.svg)](https://ci-apps.yunohost.org/ci/apps/friendica/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/friendica%20%28Official%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/friendica/) +* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/friendica%20%28Official%29.svg)](https://ci-stretch.nohost.me/ci/apps/friendica/) Developers info @@ -58,6 +69,5 @@ To try the testing branch, please proceed like that. ``` sudo yunohost app install https://github.com/YunoHost-Apps/friendica_ynh/tree/testing --debug or -sudo yunohost app upgrade REPLACEBYYOURAPP -u https://github.com/YunoHost-Apps/friendica_ynh/tree/testing --debug +sudo yunohost app upgrade friendica -u https://github.com/YunoHost-Apps/friendica_ynh/tree/testing --debug ``` - diff --git a/conf/addons.src b/conf/addons.src index 610275d..40d6d2a 100644 --- a/conf/addons.src +++ b/conf/addons.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://files.friendi.ca/friendica-addons-2020.09.tar.gz -SOURCE_SUM=37d4e878b7cb4684a91c4742bf016f3a18bc4a9cfc74000c0ed6c55b84354256 +SOURCE_URL=https://github.com/friendica/friendica-addons/archive/2020.09-1.tar.gz +SOURCE_SUM=74e6011074e341ae0016dced83e6cadbde9928006b04e31b4a727206b15ed91f SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/app.src b/conf/app.src index a91b942..5cdec8f 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://files.friendi.ca/friendica-full-2020.09.tar.gz -SOURCE_SUM=fb3b8f07aaf3110d26e0c6226ceab3ad9c206b773c3c310eb1e066e3568ed9a5 +SOURCE_URL=https://github.com/friendica/friendica/archive/2020.09-1.tar.gz +SOURCE_SUM=ca5d5ece6bff08310b6a87596e431df3ccd84580e33318f1863de32114374b7f SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/nginx.conf b/conf/nginx.conf index 45ea394..564a0aa 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -34,12 +34,12 @@ location __PATH__ { if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } - + if (!-e $request_filename) { rewrite ^(.*)$ /index.php?pagename=$1; } - - + + #allow uploads up to 20MB in size client_max_body_size 20m; @@ -48,7 +48,7 @@ location __PATH__ { #Default indexes and catch-all index index.php; - + # make sure webfinger and other well known services aren't blocked # by denying dot files and rewrite request to the front controller @@ -58,7 +58,7 @@ location __PATH__ { rewrite ^(.*)$ /index.php?pagename=$1; } } - + include mime.types; # block these file types @@ -71,13 +71,13 @@ location __PATH__ { location ~* \.php$ { fastcgi_split_path_info ^(.+?\.php)(/.*)$; try_files $uri =404; - fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } - + # deny access to all dot files location ~ /\. { deny all; diff --git a/conf/poller-cron b/conf/poller-cron index 8367ccd..d2fd9b7 100644 --- a/conf/poller-cron +++ b/conf/poller-cron @@ -1,2 +1,2 @@ # Run poller periodically to update Friendica -*/10 * * * * __USER__ cd __YNH_WWW_PATH__; /usr/bin/php bin/worker.php +*/10 * * * * __USER__ cd __YNH_WWW_PATH__; /usr/bin/php__PHP_VERSION__ bin/worker.php diff --git a/manifest.json b/manifest.json index a717265..7704872 100644 --- a/manifest.json +++ b/manifest.json @@ -8,7 +8,7 @@ }, "url": "http://friendi.ca", "license": "free", - "version": "2020.09~ynh1", + "version": "2020.09-1~ynh1", "maintainer": { "name": "Anmol Sharma", "email": "anmol@datamol.org" @@ -23,7 +23,7 @@ "multi_instance": true, "services": [ "nginx", - "php5-fpm", + "php7.3-fpm", "mysql" ], "arguments": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 37d0f4f..c3249f9 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,38 +5,7 @@ #================================================= # dependencies used by the app -pkg_dependencies="php-mbstring php-cli php-imagick php-gd php-xml" +YNH_PHP_VERSION="7.3" +pkg_dependencies="" -# ============================================================================= -# COMMON ROUNDCUBE FUNCTIONS -# ============================================================================= - -# Execute a composer command from a given directory -# usage: composer_exec workdir COMMAND [ARG ...] -exec_composer() { - local workdir=$1 - shift 1 - - COMPOSER_HOME="${workdir}/.composer" \ - php "${workdir}/composer.phar" $@ \ - -d "${workdir}" --quiet --no-interaction -} - -# Install and initialize Composer in the given directory -# usage: init_composer destdir -init_composer() { - local destdir=$1 - - # install composer - curl -sS https://getcomposer.org/installer \ - | COMPOSER_HOME="${destdir}/.composer" \ - php -- --quiet --install-dir="$destdir" \ - || ynh_die "Unable to install Composer" - - # install composer.json - cp "${destdir}/composer.json-dist" "${destdir}/composer.json" - - # update dependencies to create composer.lock - exec_composer "$destdir" install --no-dev \ - || ynh_die "Unable to update Roundcube core dependencies" -} +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}-pgsql php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-gd" diff --git a/scripts/backup b/scripts/backup index bea7d44..b2346c0 100644 --- a/scripts/backup +++ b/scripts/backup @@ -24,7 +24,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -32,6 +32,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # STANDARD BACKUP STEPS @@ -39,36 +40,36 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_script_progression --message="Backing up the main app directory..." --time --weight=1 +ynh_script_progression --message="Backing up the main app directory..." ynh_backup --src_path="$final_path" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Backing up nginx web server configuration..." --time --weight=1 +ynh_script_progression --message="Backing up nginx web server configuration..." ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Backing up php-fpm configuration..." --time --weight=1 +ynh_script_progression --message="Backing up php-fpm configuration..." -ynh_backup --src_path="/etc/php/7.0/fpm/pool.d/$app.conf" +ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # BACKUP THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Backing up the MySQL database..." --time --weight=1 +ynh_script_progression --message="Backing up the MySQL database..." ynh_mysql_dump_db --database="$db_name" > db.sql # Backup cron job -ynh_backup --src_path="/etc/cron.d/$app" +ynh_backup --src_path="/etc/cron.d/$app" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --time --last +ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." \ No newline at end of file diff --git a/scripts/install b/scripts/install index a29b22e..4525cf3 100644 --- a/scripts/install +++ b/scripts/install @@ -56,8 +56,7 @@ app=$YNH_APP_INSTANCE_NAME ### 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..." --time --weight=1 - +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 @@ -69,7 +68,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --time --weight=1 +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 @@ -81,7 +80,7 @@ ynh_app_setting_set --app=$app --key=database --value=$database #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." --time --weight=1 +ynh_script_progression --message="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. @@ -96,7 +95,7 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE A MYSQL DATABASE #================================================= -ynh_script_progression --message="Creating a MySQL database..." --time --weight=1 +ynh_script_progression --message="Creating a MySQL 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. @@ -134,7 +133,7 @@ ynh_setup_source --dest_dir="$final_path/addon" --source_id="addons" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." --time --weight=1 +ynh_script_progression --message="Configuring nginx web server..." ### `ynh_add_nginx_config` will use the file conf/nginx.conf @@ -143,25 +142,26 @@ ynh_add_nginx_config # configure friendica -sudo cp -f "/var/www/$app/config/local-sample.config.php" "/var/www/$app/config/local.config.php" -ynh_replace_string --match_string="your.mysqlhost.com" --replace_string="localhost" --target_file="$final_path/config/local.config.php" -ynh_replace_string --match_string="mysqlusername" --replace_string="$db_name" --target_file="$final_path/config/local.config.php" -ynh_replace_string --match_string="mysqldatabasename" --replace_string="$db_name" --target_file="$final_path/config/local.config.php" -ynh_replace_string --match_string="mysqlpassword" --replace_string="$db_pwd" --target_file="$final_path/config/local.config.php" -ynh_replace_string --match_string="'admin_email' => ''," --replace_string="'admin_email' => '$admin_mail'," --target_file="$final_path/config/local.config.php" -ynh_replace_string --match_string="OPEN" --replace_string="CLOSED" --target_file="$final_path/config/local.config.php" +config="$final_path/config/local.config.php" +sudo cp -f "$final_path/config/local-sample.config.php" $config +ynh_replace_string --match_string="your.mysqlhost.com" --replace_string="localhost" --target_file="$config" +ynh_replace_string --match_string="mysqlusername" --replace_string="$db_name" --target_file="$config" +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" # init db ynh_mysql_connect_as "$db_name" "$db_pwd" "$db_name" < "$final_path/database.sql" -# addon config +# ldap addon config cp "../conf/addon.config.php" "$final_path/config/." #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." --time --weight=1 +ynh_script_progression --message="Configuring system user..." # Create a system user ynh_system_user_create --username=$app @@ -169,7 +169,8 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring php-fpm..." --time --weight=1 +ynh_script_progression --message="Configuring php-fpm..." +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) ### `ynh_add_fpm_config` is used to set up a PHP config. ### You can remove it if your app doesn't use PHP. @@ -183,10 +184,8 @@ ynh_script_progression --message="Configuring php-fpm..." --time --weight=1 ### - And the section "PHP-FPM CONFIGURATION" in the upgrade script # Create a dedicated php-fpm config -ynh_add_fpm_config +ynh_add_fpm_config --package="$extra_php_dependencies" - -chown -R www-data:www-data $final_path # 3 - some extra folders sudo mkdir -p "${final_path}/view/smarty3" sudo chmod -R 775 $final_path/view/smarty3 @@ -194,6 +193,7 @@ sudo chmod -R 775 $final_path/view/smarty3 # Set up poller 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" cp ../conf/poller-cron /etc/cron.d/$app #================================================= @@ -207,11 +207,18 @@ cp ../conf/poller-cron /etc/cron.d/$app # Calculate and store the config file checksum into the app settings ynh_store_file_checksum --file="$final_path/config/local.config.php" -# Run composer -(cd $final_path && sudo php bin/composer.phar install) -(cd $final_path && sudo bin/console config system addon ldapauth) +# Run composer +pushd "$final_path" + php$phpversion bin/composer.phar install + sudo bin/console config system addon ldapauth +popd ynh_mysql_connect_as "$db_name" "$db_pwd" "$db_name" <<< "INSERT INTO addon (id, name, version, installed, hidden, timestamp, plugin_admin) VALUES (NULL, 'ldapauth', '', '1', '0', UNIX_TIMESTAMP(), '0');" + +#================================================= +# Folder rights +#================================================= chown -R $app: $final_path + #================================================= # SETUP SSOWAT #================================================= @@ -224,7 +231,7 @@ ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 +ynh_script_progression --message="Reloading nginx web server..." ynh_systemd_action --service_name=nginx --action=reload @@ -232,4 +239,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --time --last +ynh_script_progression --message="Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index a807cca..8cb73fa 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -24,7 +24,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # REMOVE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Removing the MySQL database..." --time --weight=1 +ynh_script_progression --message="Removing the MySQL database..." # Remove a database if it exists, along with the associated user ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name @@ -32,7 +32,7 @@ ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." --time --weight=1 +ynh_script_progression --message="Removing dependencies..." # Remove metapackage and its dependencies ynh_remove_app_dependencies @@ -40,7 +40,7 @@ ynh_remove_app_dependencies #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --time --weight=1 +ynh_script_progression --message="Removing app main directory..." # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -48,7 +48,7 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration..." --time --weight=1 +ynh_script_progression --message="Removing nginx web server configuration..." # Remove the dedicated nginx config ynh_remove_nginx_config @@ -56,7 +56,7 @@ ynh_remove_nginx_config #================================================= # REMOVE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Removing php-fpm configuration..." --time --weight=1 +ynh_script_progression --message="Removing php-fpm configuration..." # Remove the dedicated php-fpm config ynh_remove_fpm_config @@ -64,7 +64,7 @@ ynh_remove_fpm_config #================================================= # REMOVE LOGROTATE CONFIGURATION #================================================= -ynh_script_progression --message="Removing logrotate configuration..." --time --weight=1 +ynh_script_progression --message="Removing logrotate configuration..." # Remove the app-specific logrotate config ynh_remove_logrotate diff --git a/scripts/restore b/scripts/restore index 971f179..537d1d9 100644 --- a/scripts/restore +++ b/scripts/restore @@ -26,7 +26,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading settings..." --time --weight=1 +ynh_script_progression --message="Loading settings..." app=$YNH_APP_INSTANCE_NAME @@ -34,12 +34,12 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) - +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." --time --weight=1 +ynh_script_progression --message="Validating restoration parameters..." ynh_webpath_available --domain=$domain --path_url=$path_url \ || ynh_die --message="Path not available: ${domain}${path_url}" @@ -64,7 +64,7 @@ ynh_mysql_connect_as $db_name $db_pwd $db_name < ./db.sql #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." --time --weight=1 +ynh_script_progression --message="Restoring the app main directory..." ynh_restore_file --origin_path="$final_path" @@ -79,15 +79,19 @@ ynh_system_user_create $app #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= +ynh_script_progression --message="Restoring PHP-FPM configuration..." -ynh_restore_file "/etc/php/7.0/fpm/pool.d/$app.conf" +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" + +# Recreate a dedicated php-fpm config +ynh_add_fpm_config --package="$extra_php_dependencies" #================================================= # SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --time --weight=1 +ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies @@ -100,12 +104,12 @@ chmod -R 775 $final_path/view/smarty3 #================================================= ynh_restore_file "/etc/cron.d/$app" -# Run composer -(cd $final_path && sudo php bin/composer.phar install) -(cd $final_path && sudo bin/console config system addon ldapauth) - +#================================================= +# Folder rights +#================================================= chown -R $app: $final_path + # unprotected_uris allows SSO credentials to be passed anyway. ynh_app_setting_set $app unprotected_uris "/" @@ -114,13 +118,13 @@ ynh_app_setting_set $app unprotected_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=php7.0-fpm --action=reload +ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --time --last +ynh_script_progression --message="Restoration completed for $app" \ No newline at end of file diff --git a/scripts/upgrade b/scripts/upgrade index 792e153..f4ae5e7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -23,6 +23,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) admin_mail=$(ynh_app_setting_get --app=$app --key=email) admin=$(ynh_app_setting_get --app=$app --key=admin) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK VERSION @@ -39,7 +40,7 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --time --weight=1 +ynh_script_progression --message="Ensuring downward compatibility..." # If db_name doesn't exist, create it if [ -z "$db_name" ]; then @@ -50,7 +51,7 @@ fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --time --weight=1 +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." # Backup the current version of the app ynh_backup_before_upgrade @@ -80,7 +81,7 @@ if [ -z "$final_path" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi -# Remove files for upgrade compatibilty from previous versions of Friendica +# Remove files for upgrade compatibilty from previous versions of Friendica if [ -f $final_path/.htconfig.php ]; then rm "$final_path/.htconfig.php" fi @@ -91,7 +92,7 @@ fi # If admin_mail setting doesn't exist, create it -if [ -z $admin_mail ]; then +if [ -z $admin_mail ]; then admin_mail=$(sudo yunohost user info $admin | grep "mail:" | cut -d' ' -f2) ynh_app_setting_set --app=$app --key=email --value=$admin_mail fi @@ -102,22 +103,23 @@ fi if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression --message="Upgrading source files..." --time --weight=1 + 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" fi # Copy config file for correct place -cp -f "/var/www/$app/config/local-sample.config.php" "/var/www/$app/config/local.config.php" +config="$final_path/config/local.config.php" +cp -f "/var/www/$app/config/local-sample.config.php" $config # Replace strings in config file -ynh_replace_string --match_string="your.mysqlhost.com" --replace_string="localhost" --target_file="$final_path/config/local.config.php" -ynh_replace_string --match_string="mysqlusername" --replace_string="$db_name" --target_file="$final_path/config/local.config.php" -ynh_replace_string --match_string="mysqldatabasename" --replace_string="$db_name" --target_file="$final_path/config/local.config.php" -ynh_replace_string --match_string="mysqlpassword" --replace_string="$db_pwd" --target_file= "$final_path/config/local.config.php" -ynh_replace_string --match_string="'admin_email' => ''," --replace_string="'admin_email' => '$admin_mail'," --target_file="$final_path/config/local.config.php" -ynh_replace_string --match_string="OPEN" --replace_string="CLOSED" --target_file="$final_path/config/local.config.php" +ynh_replace_string --match_string="your.mysqlhost.com" --replace_string="localhost" --target_file="$config" +ynh_replace_string --match_string="mysqlusername" --replace_string="$db_name" --target_file="$config" +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" #Copy Addons @@ -131,7 +133,7 @@ chmod -R 775 $final_path/view/smarty3 #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading nginx web server configuration..." # Create a dedicated nginx config ynh_add_nginx_config @@ -139,14 +141,13 @@ ynh_add_nginx_config #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." --time --weight=1 - +ynh_script_progression --message="Upgrading dependencies..." ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --time --weight=1 +ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) ynh_system_user_create --username=$app @@ -154,12 +155,10 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading php-fpm configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading php-fpm configuration..." # Create a dedicated php-fpm config -ynh_add_fpm_config - - +ynh_add_fpm_config --package="$extra_php_dependencies" #================================================= # STORE THE CONFIG FILE CHECKSUM @@ -174,19 +173,26 @@ ynh_store_file_checksum --file="$final_path/config/local.config.php" # Set 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" cp "../conf/poller-cron" "/etc/cron.d/$app" -# Run composer -(cd $final_path && sudo php bin/composer.phar install) -(cd $final_path && sudo bin/console config system addon ldapauth) +# Run composer +# Run composer +pushd "$final_path" + php$phpversion bin/console dbstructure update + sudo bin/console config system addon ldapauth +popd -# Set app as owner +#================================================= +# Folder rights +#================================================= chown -R $app: $final_path + #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading SSOwat configuration..." # unprotected_uris allows SSO credentials to be passed anyway. ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" @@ -194,7 +200,7 @@ ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 +ynh_script_progression --message="Reloading nginx web server..." ynh_systemd_action --service_name=nginx --action=reload @@ -202,5 +208,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --time --last - +ynh_script_progression --message="Upgrade of $app completed" From cd20ac08ae620f7292088468b667a79c024c6f80 Mon Sep 17 00:00:00 2001 From: anmol Date: Sun, 1 Nov 2020 04:24:02 +0530 Subject: [PATCH 10/21] App Source from Friendica site --- README.md | 3 ++- conf/app.src | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7ad49ae..5e4cb08 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,14 @@ [![Integration level](https://dash.yunohost.org/integration/friendica.svg)](https://dash.yunohost.org/appci/app/friendica) ![](https://ci-apps.yunohost.org/ci/badges/friendica.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/friendica.maintain.svg) + [![Install Friendica with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=friendica) > *This package allow you to install Friendica quickly and simply on a YunoHost server. If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to learn how to install and enjoy it.* -**Version:**2020.09-1 +**Version:** 2020.09-1 Current snapshot in *sources*: diff --git a/conf/app.src b/conf/app.src index 5cdec8f..e192f37 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/friendica/friendica/archive/2020.09-1.tar.gz -SOURCE_SUM=ca5d5ece6bff08310b6a87596e431df3ccd84580e33318f1863de32114374b7f +SOURCE_URL=https://files.friendi.ca/friendica-full-2020.09-1.tar.gz +SOURCE_SUM=6210f74a0cc247536d4106017809f3152c93f1874d424f4acb9c5ed97f95f36b SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true From 886d30b64b9c42818f6ddd34cba1c8b16c7e58ed Mon Sep 17 00:00:00 2001 From: anmol Date: Sun, 1 Nov 2020 04:59:31 +0530 Subject: [PATCH 11/21] Modified php7.0 instead of php7.3 in manifest --- manifest.json | 2 +- scripts/install | 2 +- scripts/remove | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index 7704872..496bd24 100644 --- a/manifest.json +++ b/manifest.json @@ -23,7 +23,7 @@ "multi_instance": true, "services": [ "nginx", - "php7.3-fpm", + "php7.0-fpm", "mysql" ], "arguments": { diff --git a/scripts/install b/scripts/install index 4525cf3..d2d39b3 100644 --- a/scripts/install +++ b/scripts/install @@ -114,7 +114,7 @@ ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." --time --weight=1 +ynh_script_progression --message="Setting up 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. diff --git a/scripts/remove b/scripts/remove index 8cb73fa..e485426 100644 --- a/scripts/remove +++ b/scripts/remove @@ -77,7 +77,7 @@ ynh_secure_remove --file="/etc/cron.d/$app" #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." --time --weight=1 +ynh_script_progression --message="Removing the dedicated system user..." # Delete a system user ynh_system_user_delete --username=$app From cbfcb548205787427b689bc018c79a66c637e199 Mon Sep 17 00:00:00 2001 From: anmol Date: Sat, 14 Nov 2020 04:00:14 +0530 Subject: [PATCH 12/21] fixed app sources --- conf/app.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/app.src b/conf/app.src index e192f37..6ddc6d7 100644 --- a/conf/app.src +++ b/conf/app.src @@ -2,5 +2,5 @@ SOURCE_URL=https://files.friendi.ca/friendica-full-2020.09-1.tar.gz SOURCE_SUM=6210f74a0cc247536d4106017809f3152c93f1874d424f4acb9c5ed97f95f36b SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true +SOURCE_IN_SUBDIR=2 SOURCE_FILENAME= From d871a4ef96bbbf077f1ab532175e40950b394c41 Mon Sep 17 00:00:00 2001 From: Spencer Dub Date: Fri, 8 Jan 2021 21:33:56 -0800 Subject: [PATCH 13/21] Update app source and sum to 2021.01 version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit as a reminder this is the full extent of my capabilities; I really shouldn't be responsible for this repo 🙃 --- conf/app.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/app.src b/conf/app.src index 6ddc6d7..41c185c 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://files.friendi.ca/friendica-full-2020.09-1.tar.gz -SOURCE_SUM=6210f74a0cc247536d4106017809f3152c93f1874d424f4acb9c5ed97f95f36b +SOURCE_URL=https://files.friendi.ca/friendica-full-2021.01.tar.gz +SOURCE_SUM=13d1a31373ec3e47913386241f5bee7524c18ddb77258cbf7b410450ec2cd601 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=2 From 206fcc2732c357b89004c25ff2fed905798dcad2 Mon Sep 17 00:00:00 2001 From: Spencer Dub Date: Fri, 8 Jan 2021 21:34:33 -0800 Subject: [PATCH 14/21] Change Friendica version --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 496bd24..336e2bc 100644 --- a/manifest.json +++ b/manifest.json @@ -8,7 +8,7 @@ }, "url": "http://friendi.ca", "license": "free", - "version": "2020.09-1~ynh1", + "version": "2021.01~ynh1", "maintainer": { "name": "Anmol Sharma", "email": "anmol@datamol.org" From 1e06c729ccd9374b0447bb8b67c8c1d3f8551024 Mon Sep 17 00:00:00 2001 From: Spencer Dub Date: Fri, 8 Jan 2021 21:36:12 -0800 Subject: [PATCH 15/21] Updated Friendica version to 2021.01 I'm just updating some stuff that I haven't tested; I really shouldn't be in charge of this repo and would appreciate it if someone with more knowledge forked it and took responsibility. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5e4cb08..5a73816 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,12 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to learn how to install and enjoy it.* -**Version:** 2020.09-1 +**Version:** 2021.01 Current snapshot in *sources*: -* https://github.com/friendica/friendica: 2020.09-1 -* https://github.com/friendica/friendica-addons: 2020.09-1 +* https://github.com/friendica/friendica: 2021.01 +* https://github.com/friendica/friendica-addons: 2021.01 ## Friendica [Friendica](http://friendi.ca/) is a decentralised communications platform that integrates social communication. Our platform links to independent social projects and corporate services. From bf936fe4f6c4b7a49484d4463da8849ea5759f37 Mon Sep 17 00:00:00 2001 From: Spencer Dub Date: Fri, 8 Jan 2021 21:46:59 -0800 Subject: [PATCH 16/21] Correct checksum accidentally used the addons checksum --- conf/app.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/app.src b/conf/app.src index 41c185c..5a0600c 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ SOURCE_URL=https://files.friendi.ca/friendica-full-2021.01.tar.gz -SOURCE_SUM=13d1a31373ec3e47913386241f5bee7524c18ddb77258cbf7b410450ec2cd601 +SOURCE_SUM=b6f6ac81a0dd8e4bd32848ab2b6a54c35baf104d77abb589751fbd4f26edbcd7 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=2 From 8c2c3dc959051e712cf40f139332895da14d2a60 Mon Sep 17 00:00:00 2001 From: Spencer Dub Date: Fri, 8 Jan 2021 21:47:57 -0800 Subject: [PATCH 17/21] Update addons source URL and sum --- conf/addons.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/addons.src b/conf/addons.src index 40d6d2a..000bc7e 100644 --- a/conf/addons.src +++ b/conf/addons.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/friendica/friendica-addons/archive/2020.09-1.tar.gz -SOURCE_SUM=74e6011074e341ae0016dced83e6cadbde9928006b04e31b4a727206b15ed91f +SOURCE_URL=https://github.com/friendica/friendica-addons/archive/2021.01.tar.gz +SOURCE_SUM=13d1a31373ec3e47913386241f5bee7524c18ddb77258cbf7b410450ec2cd601 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true From 882de157bb390b026ccb3f04f9ebca1335b3308f Mon Sep 17 00:00:00 2001 From: Spencer Dub Date: Fri, 8 Jan 2021 22:00:06 -0800 Subject: [PATCH 18/21] Fix addons source for 2021.01 It's 10:00 and I'm a couple beers in, so third time's the charm as I try to get SOURCE_URL and SOURCE_SUM matching for both this file and `app.src`. I should have done this on a new branch but WHOOPSIE-DOODLE Seriously, y'all, I'm not deliberately trying to illustrate this, but I should not be trusted as the maintainer for this repo. I'm not the schmuck you want doing this. --- conf/addons.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/addons.src b/conf/addons.src index 000bc7e..a0c78eb 100644 --- a/conf/addons.src +++ b/conf/addons.src @@ -1,4 +1,4 @@ -SOURCE_URL=https://github.com/friendica/friendica-addons/archive/2021.01.tar.gz +SOURCE_URL=https://files.friendi.ca/friendica-addons-2021.01.tar.gz SOURCE_SUM=13d1a31373ec3e47913386241f5bee7524c18ddb77258cbf7b410450ec2cd601 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz From fb59b1d0615044da51612e8f6809d1fb97b75334 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Wed, 3 Feb 2021 00:58:30 +0530 Subject: [PATCH 19/21] Updated readme, fixes and opened register_policy --- README.md | 4 +++- manifest.json | 2 +- scripts/install | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5a73816..9d8959c 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ Current snapshot in *sources*: * https://github.com/friendica/friendica: 2021.01 * https://github.com/friendica/friendica-addons: 2021.01 +**Warning:** It's advised to use Barracuda as MySQL DB file format for your Friendica database. + ## Friendica [Friendica](http://friendi.ca/) is a decentralised communications platform that integrates social communication. Our platform links to independent social projects and corporate services. @@ -25,7 +27,7 @@ Friendica connects you effortlessly to a federated communications network of sev ## This app claims following features: -- [X] Ldap integration +- [ ] Ldap integration(Ldap is broken in the latest version.[See this](https://github.com/friendica/friendica/issues/4140#issuecomment-731579013)) - [X] Multi-instance - [ ] Add 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**). - [ ] Fail2ban diff --git a/manifest.json b/manifest.json index 336e2bc..1d3fabc 100644 --- a/manifest.json +++ b/manifest.json @@ -23,7 +23,7 @@ "multi_instance": true, "services": [ "nginx", - "php7.0-fpm", + "php7.3-fpm", "mysql" ], "arguments": { diff --git a/scripts/install b/scripts/install index d2d39b3..9356837 100644 --- a/scripts/install +++ b/scripts/install @@ -149,7 +149,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" # init db From ed682bbe3c686165c7912866063f88e4e7abc50a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 3 Feb 2021 19:48:11 +0100 Subject: [PATCH 20/21] Update check_process --- check_process | 7 ------- 1 file changed, 7 deletions(-) diff --git a/check_process b/check_process index eb9fe54..4b72b27 100644 --- a/check_process +++ b/check_process @@ -10,17 +10,10 @@ setup_private=0 setup_public=1 upgrade=1 - upgrade=1 from_commit=3396188976f75170f2217fcc0e6c9b5f61f7b9e9 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=0 - -;;; Levels - # If the level 5 (Package linter) is forced to 1. Please add justifications here. - Level 5=auto ;;; Options Email=anmol@datamol.org Notification=change From 55fd23cd2a2a65418dd6d65146aa83d6c5a5a593 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 3 Feb 2021 19:50:12 +0100 Subject: [PATCH 21/21] Fix linter --- manifest.json | 2 +- scripts/_common.sh | 2 +- scripts/install | 10 +++++----- scripts/upgrade | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest.json b/manifest.json index 1d3fabc..fe1f8b4 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "anmol@datamol.org" }, "requirements": { - "yunohost": ">= 3.5" + "yunohost": ">= 4.0.0" }, "previous_maintainers": { "name": "aymhce", diff --git a/scripts/_common.sh b/scripts/_common.sh index c3249f9..8fc0fff 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -8,4 +8,4 @@ YNH_PHP_VERSION="7.3" pkg_dependencies="" -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}-pgsql php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-gd" +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" diff --git a/scripts/install b/scripts/install index 9356837..31ff0d0 100644 --- a/scripts/install +++ b/scripts/install @@ -127,7 +127,7 @@ ynh_setup_source --dest_dir="$final_path" cp -f "$final_path/.htaccess-dist" "$final_path/.htaccess" # 2 - Addons -sudo mkdir $final_path/addon +mkdir $final_path/addon ynh_setup_source --dest_dir="$final_path/addon" --source_id="addons" #================================================= @@ -143,7 +143,7 @@ ynh_add_nginx_config # configure friendica config="$final_path/config/local.config.php" -sudo cp -f "$final_path/config/local-sample.config.php" $config +cp -f "$final_path/config/local-sample.config.php" $config ynh_replace_string --match_string="your.mysqlhost.com" --replace_string="localhost" --target_file="$config" ynh_replace_string --match_string="mysqlusername" --replace_string="$db_name" --target_file="$config" ynh_replace_string --match_string="mysqldatabasename" --replace_string="$db_name" --target_file="$config" @@ -187,8 +187,8 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) ynh_add_fpm_config --package="$extra_php_dependencies" # 3 - some extra folders -sudo mkdir -p "${final_path}/view/smarty3" -sudo chmod -R 775 $final_path/view/smarty3 +mkdir -p "${final_path}/view/smarty3" +chmod -R 775 $final_path/view/smarty3 # Set up poller ynh_replace_string --match_string="__YNH_WWW_PATH__" --replace_string="$final_path" --target_file="../conf/poller-cron" @@ -210,7 +210,7 @@ ynh_store_file_checksum --file="$final_path/config/local.config.php" # Run composer pushd "$final_path" php$phpversion bin/composer.phar install - sudo bin/console config system addon ldapauth + bin/console config system addon ldapauth popd ynh_mysql_connect_as "$db_name" "$db_pwd" "$db_name" <<< "INSERT INTO addon (id, name, version, installed, hidden, timestamp, plugin_admin) VALUES (NULL, 'ldapauth', '', '1', '0', UNIX_TIMESTAMP(), '0');" diff --git a/scripts/upgrade b/scripts/upgrade index d0c9dd5..fa52762 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -180,7 +180,7 @@ cp "../conf/poller-cron" "/etc/cron.d/$app" # Run composer pushd "$final_path" php$phpversion bin/console dbstructure update - sudo bin/console config system addon ldapauth + bin/console config system addon ldapauth popd #=================================================