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

Merge branch 'src' into friendica-daemon.service

This commit is contained in:
eric_G 2023-08-21 12:25:04 +02:00 committed by GitHub
commit 6efd569767
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 35 additions and 76 deletions

View file

@ -20,7 +20,7 @@ Friendica is a decentralised communications platform that integrates social comm
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. 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.
**Shipped version:** 2023.09~ynh1 **Shipped version:** 2023.05~ynh1
**Demo:** https://dir.friendica.social/servers **Demo:** https://dir.friendica.social/servers

View file

@ -20,7 +20,7 @@ Friendica is a decentralised communications platform that integrates social comm
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. 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.
**Version incluse :** 2023.09~ynh1 **Version incluse :** 2023.05~ynh1
**Démo :** https://dir.friendica.social/servers **Démo :** https://dir.friendica.social/servers

View file

@ -5,7 +5,7 @@ name = "Friendica"
description.en = "Social Communication Server" description.en = "Social Communication Server"
description.fr = "Serveur de Communication Social" description.fr = "Serveur de Communication Social"
version = "2023.09~ynh1" version = "2023.05~ynh1"
maintainers = [] maintainers = []
@ -46,6 +46,18 @@ ram.runtime = "50M"
default = "en" default = "en"
[resources] [resources]
[resources.sources]
[resources.sources.main]
url = "https://github.com/friendica/friendica/archive/refs/tags/2023.05.tar.gz"
sha256 = "727a8fdab6a2f6424d3dbc895496447e750eb0f8e1e11b70f1e229a7e3c9a31d"
autoupdate.strategy = "latest_github_tag"
[resources.sources.addons]
url = "https://github.com/friendica/friendica-addons/archive/refs/tags/2023.05.tar.gz"
sha256 = "df29aed28c0208e162c76f91949d0c3a0f77fe09853fe1a6d854b9956075d8a0"
autoupdate.strategy = "latest_github_tag"
[resources.system_user] [resources.system_user]
[resources.install_dir] [resources.install_dir]

View file

@ -4,11 +4,6 @@
# COMMON VARIABLES # COMMON VARIABLES
#================================================= #=================================================
# commit hashes
# 2023.08
version_commit="2dbfb070083ec395bf5d24ec89fe96b282c6a12d"
addons_version_commit="f2cc0312ca9a95d99a8330452848180792bf9227"
#================================================= #=================================================
# EXPERIMENTAL HELPERS # EXPERIMENTAL HELPERS
#================================================= #=================================================

View file

@ -34,7 +34,15 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
#================================================= #=================================================
# BACKUP SYSTEMD # SPECIFIC BACKUP
#=================================================
# BACKUP LOGROTATE
#=================================================
ynh_backup --src_path="/etc/logrotate.d/$app"
#=================================================
# BACKUP VARIOUS FILES
#================================================= #=================================================
ynh_backup --src_path="/etc/systemd/system/$app.service" ynh_backup --src_path="/etc/systemd/system/$app.service"

View file

@ -28,26 +28,13 @@ ynh_app_setting_set --app=$app --key=email --value=$email
#================================================= #=================================================
ynh_script_progression --message="Setting up source files..." --weight=5 ynh_script_progression --message="Setting up source files..." --weight=5
git config --system --add safe.directory $install_dir # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"
# 1 - Clone stable repo ynh_setup_source --dest_dir="$install_dir/addon" --source_id="addons"
git clone --quiet https://github.com/friendica/friendica.git -b stable "$install_dir"
# Reset branch to the level of update we needed
pushd "$install_dir"
git reset --hard --quiet $version_commit
popd
# Copy .htaccess-dist to ..htaccess # Copy .htaccess-dist to ..htaccess
cp -f "$install_dir/.htaccess-dist" "$install_dir/.htaccess" cp -f "$install_dir/.htaccess-dist" "$install_dir/.htaccess"
# 2 - Clone addons repo
git clone --quiet https://github.com/friendica/friendica-addons.git -b stable "$install_dir/addon"
# Reset addons branch to the level of update we needed
pushd "$install_dir/addon"
git reset --hard --quiet $addons_version_commit
popd
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R $app:www-data "$install_dir"
@ -64,6 +51,9 @@ ynh_add_fpm_config --usage=low --footprint=low
ynh_add_systemd_config ynh_add_systemd_config
# Use logrotate to manage application logfile(s)
ynh_use_logrotate
yunohost service add $app --description="Friendica daemon" --log="/var/log/$app/$app.log" yunohost service add $app --description="Friendica daemon" --log="/var/log/$app/$app.log"
#================================================= #=================================================

View file

@ -66,63 +66,17 @@ fi
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading source files..." --weight=3 ynh_script_progression --message="Upgrading source files..." --weight=1
# Check if the repo can be updated with git
if [ `cd $install_dir && git rev-parse --is-inside-work-tree &> /dev/null` ];
then
# Update through Git
pushd "$install_dir"
git fetch
git checkout stable
git pull
git reset --hard $version_commit
popd
pushd "$install_dir/addon"
git fetch
git checkout stable
git pull
git reset --hard $addons_version_commit
popd
# If Git is not present upgrade through manual method
else
# Create a temporary directory and backup smarty3 folder # Download, check integrity, uncompress and patch the source from app.src
tmpdir="$(mktemp -d)" ynh_setup_source --dest_dir="$install_dir" --keep ="config/local.config.php view/smarty3"
cp -a "$install_dir/view/smarty3" "$tmpdir/smarty3" ynh_setup_source --dest_dir="$install_dir/addon" --source_id="addons"
# Remove the app directory securely
ynh_secure_remove --file="$install_dir"
# 1 - Clone stable repo
git clone --quiet https://github.com/friendica/friendica.git -b stable "$install_dir"
# Reset branch to the level of update we needed
pushd "$install_dir"
git reset --hard --quiet $version_commit
popd
# 2 - Clone addons repo
git clone --quiet https://github.com/friendica/friendica-addons.git -b stable "$install_dir/addon"
# Reset addons branch to the level of update we needed
pushd "$install_dir/addon"
git reset --hard --quiet $addons_version_commit
popd
# Restore the smarty3 folder
cp -a "$tmpdir/smarty3" "$install_dir/view/smarty3"
ynh_secure_remove --file="$tmpdir"
fi
fi fi
# Copy config file for correct place chmod -R 775 "$install_dir/view/smarty3"
ynh_add_config --template="../conf/local-sample.config.php" --destination="$install_dir/config/local.config.php"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R $app:www-data "$install_dir"
# 3 - some extra folders
chmod -R 775 "$install_dir/view/smarty3"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================