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

Merge pull request #58 from YunoHost-Apps/testing

Testing
This commit is contained in:
Éric Gaspar 2021-07-19 12:28:43 +02:00 committed by GitHub
commit d27d1c4fd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 30 additions and 10 deletions

View file

@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
Social Communication Server
**Shipped version:** 2021.07~ynh1
**Shipped version:** 2021.07~ynh2
**Demo:** https://dir.friendica.social/servers

View file

@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
Serveur de Communication Social
**Version incluse :** 2021.07~ynh1
**Version incluse :** 2021.07~ynh2
**Démo :** https://dir.friendica.social/servers

View file

@ -2,6 +2,7 @@
; Manifest
domain="domain.tld"
admin="john"
language="en"
; Checks
pkg_linter=1
setup_sub_dir=0

View file

@ -39,6 +39,6 @@ return [
],
'system' => [
'default_timezone' => 'UTC',
'language' => 'en',
'language' => '__LANGUAGE__',
],
];

View file

@ -6,7 +6,7 @@
"en": "Social Communication Server",
"fr": "Serveur de Communication Social"
},
"version": "2021.07~ynh1",
"version": "2021.07~ynh2",
"url": "http://friendi.ca",
"upstream": {
"license": "AGPL-3.0-only",
@ -45,6 +45,16 @@
"name": "admin",
"type": "user",
"example": "johndoe"
},
{
"name": "language",
"type": "string",
"ask": {
"en": "Choose the application language",
"fr": "Choisissez la langue de l'application"
},
"choices": ["de", "en", "es", "fr", "it", "pt"],
"default": "en"
}
]
}

View file

@ -28,6 +28,7 @@ domain=$YNH_APP_ARG_DOMAIN
path_url='/'
admin=$YNH_APP_ARG_ADMIN
email=$(ynh_user_get_info --username=$admin --key=mail)
language=$YNH_APP_ARG_LANGUAGE
app=$YNH_APP_INSTANCE_NAME
@ -51,6 +52,7 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=email --value=$email
ynh_app_setting_set --app=$app --key=language --value=$language
#=================================================
# CREATE DEDICATED USER
@ -81,7 +83,7 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
git clone --quiet https://github.com/friendica/friendica.git -b stable "$final_path"
# Reset branch to the level of update we needed
pushd "$final_path"
git reset --hard $version_commit
git reset --hard --quiet $version_commit
popd
# Copy .htaccess-dist to ..htaccess
@ -91,7 +93,7 @@ cp -f "$final_path/.htaccess-dist" "$final_path/.htaccess"
git clone --quiet https://github.com/friendica/friendica-addons.git -b stable "$final_path/addon"
# Reset addons branch to the level of update we needed
pushd "$final_path/addon"
git reset --hard $addons_version_commit
git reset --hard --quiet $addons_version_commit
popd
chmod 750 "$final_path"

View file

@ -25,6 +25,7 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
email=$(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)
language=$(ynh_app_setting_get --app=$app --key=language)
#=================================================
# CHECK VERSION
@ -82,6 +83,12 @@ if [ -z $email ]; then
ynh_app_setting_set --app=$app --key=email --value=$email
fi
# If language setting doesn't exist, create it
if [ -z $language ]; then
language=en
ynh_app_setting_set --app=$app --key=language --value=$language
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
@ -128,25 +135,25 @@ else
cp -a "$final_path/view/smarty3" "$tmpdir/smarty3"
# Remove the app directory securely
ynh_secure_remove "$final_path"
ynh_secure_remove --file="$final_path"
# 1 - Clone stable repo
git clone --quiet https://github.com/friendica/friendica.git -b stable "$final_path"
# Reset branch to the level of update we needed
pushd "$final_path"
git reset --hard $version_commit
git reset --hard --quiet $version_commit
popd
# 2 - Clone addons repo
git clone --quiet https://github.com/friendica/friendica-addons.git -b stable "$final_path/addon"
# Reset addons branch to the level of update we needed
pushd "$final_path/addon"
git reset --hard $addons_version_commit
git reset --hard --quiet $addons_version_commit
popd
# Restore the smarty3 folder
cp -a "$tmpdir/smarty3" "$final_path/view/smarty3"
ynh_secure_remove "$tmpdir"
ynh_secure_remove --file="$tmpdir"
fi
fi