1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/friendica_ynh.git synced 2024-09-03 18:36:14 +02:00

Updated to 2020.04

This commit is contained in:
Amo 2021-05-25 02:16:53 +05:30
parent d6742c2cca
commit bccd3aacf1
7 changed files with 56 additions and 20 deletions

View file

@ -10,12 +10,12 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to
## Overview
Friendica is a software to create a distributed social network. It is part of the federation of servers that are running with Friendica, Diaspora and Hubzilla which are compatible to each other.
**Version:** 2021.01
**Version:** 2021.04
Current snapshot in *sources*:
* https://github.com/friendica/friendica: 2021.01
* https://github.com/friendica/friendica-addons: 2021.01
* https://github.com/friendica/friendica: 2021.04
* https://github.com/friendica/friendica-addons: 2021.04
**Warning:** It's advised to use Barracuda as MySQL DB file format for your Friendica database.

View file

@ -10,10 +10,10 @@
setup_private=0
setup_public=1
upgrade=1
backup_restore=1
upgrade=1 from_commit=b3642c110f0e927ba36ee32e738a81e6afce958f7ackup_restore=1
multi_instance=1
port_already_use=0
change_url=0
;;; Options
Email=anmol@datamol.org
Email=""
Notification=change

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://files.friendi.ca/friendica-addons-2021.01.tar.gz
SOURCE_SUM=13d1a31373ec3e47913386241f5bee7524c18ddb77258cbf7b410450ec2cd601
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

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://files.friendi.ca/friendica-full-2021.01.tar.gz
SOURCE_SUM=b6f6ac81a0dd8e4bd32848ab2b6a54c35baf104d77abb589751fbd4f26edbcd7
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

View file

@ -8,10 +8,10 @@
},
"url": "http://friendi.ca",
"license": "AGPL-3.0-only",
"version": "2021.01~ynh2",
"version": "2021.04~ynh2",
"maintainer": {
"name": "Anmol Sharma",
"email": "anmol@datamol.org"
"email": ""
},
"requirements": {
"yunohost": ">= 4.1.0"

View file

@ -73,14 +73,14 @@ ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
ynh_script_progression --message="Setting up source files..."
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"
# 1- Clone stable repo
$git clone https://github.com/friendica/friendica.git -b stable "$final_path"
# Copy .htaccess-dist to ..htaccess
cp -f "$final_path/.htaccess-dist" "$final_path/.htaccess"
# 2 - Addons
mkdir $final_path/addon
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"
#=================================================
# NGINX CONFIGURATION

View file

@ -94,15 +94,52 @@ fi
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
# Check if the repo can be updated with git
if [ `cd $final_path && git rev-parse --is-inside-work-tree` ];
then
# Update through git
pushd "$final_path"
git fetch
git checkout stable
git pull
popd
pushd "$final_path/addon"
git fetch
git checkout stable
git pull
popd
# If git is not present upgrade through manual method
else
# Create a temporary directory and backup smarty3 folder
tmpdir="$(ynh_smart_mktemp 6000)"
ynh_script_progression --message="Upgrading source files..."
cp -a "$final_path/view/smarty3" "$tmpdir/view/smarty3"
# 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"
# 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"
# Restore the smarty3 folder
cp -a "$tmpdir/view/smarty3" "${final_path}"
fi
fi
# Copy config file for correct place
config="$final_path/config/local.config.php"
cp -f "/var/www/$app/config/local-sample.config.php" $config
cp -a "/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="$config"
@ -112,9 +149,8 @@ ynh_replace_string --match_string="mysqlpassword" --replace_string="$db_pwd
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
ynh_secure_remove "$final_path/addon"
ynh_setup_source --dest_dir="$final_path/addon" --source_id="addons"
# ldap addon config
cp -f "../conf/addon.config.php" "$final_path/config/."
# 3 - some extra folders
chmod -R 775 $final_path/view/smarty3