mirror of
https://github.com/YunoHost-Apps/friendica_ynh.git
synced 2024-09-03 18:36:14 +02:00
commit
d27d1c4fd1
7 changed files with 30 additions and 10 deletions
|
@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
|
||||||
|
|
||||||
Social Communication Server
|
Social Communication Server
|
||||||
|
|
||||||
**Shipped version:** 2021.07~ynh1
|
**Shipped version:** 2021.07~ynh2
|
||||||
|
|
||||||
**Demo:** https://dir.friendica.social/servers
|
**Demo:** https://dir.friendica.social/servers
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
|
||||||
|
|
||||||
Serveur de Communication Social
|
Serveur de Communication Social
|
||||||
|
|
||||||
**Version incluse :** 2021.07~ynh1
|
**Version incluse :** 2021.07~ynh2
|
||||||
|
|
||||||
**Démo :** https://dir.friendica.social/servers
|
**Démo :** https://dir.friendica.social/servers
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
; Manifest
|
; Manifest
|
||||||
domain="domain.tld"
|
domain="domain.tld"
|
||||||
admin="john"
|
admin="john"
|
||||||
|
language="en"
|
||||||
; Checks
|
; Checks
|
||||||
pkg_linter=1
|
pkg_linter=1
|
||||||
setup_sub_dir=0
|
setup_sub_dir=0
|
||||||
|
|
|
@ -39,6 +39,6 @@ return [
|
||||||
],
|
],
|
||||||
'system' => [
|
'system' => [
|
||||||
'default_timezone' => 'UTC',
|
'default_timezone' => 'UTC',
|
||||||
'language' => 'en',
|
'language' => '__LANGUAGE__',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"en": "Social Communication Server",
|
"en": "Social Communication Server",
|
||||||
"fr": "Serveur de Communication Social"
|
"fr": "Serveur de Communication Social"
|
||||||
},
|
},
|
||||||
"version": "2021.07~ynh1",
|
"version": "2021.07~ynh2",
|
||||||
"url": "http://friendi.ca",
|
"url": "http://friendi.ca",
|
||||||
"upstream": {
|
"upstream": {
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
|
@ -45,6 +45,16 @@
|
||||||
"name": "admin",
|
"name": "admin",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"example": "johndoe"
|
"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"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ domain=$YNH_APP_ARG_DOMAIN
|
||||||
path_url='/'
|
path_url='/'
|
||||||
admin=$YNH_APP_ARG_ADMIN
|
admin=$YNH_APP_ARG_ADMIN
|
||||||
email=$(ynh_user_get_info --username=$admin --key=mail)
|
email=$(ynh_user_get_info --username=$admin --key=mail)
|
||||||
|
language=$YNH_APP_ARG_LANGUAGE
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
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=path --value=$path_url
|
||||||
ynh_app_setting_set --app=$app --key=admin --value=$admin
|
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=email --value=$email
|
||||||
|
ynh_app_setting_set --app=$app --key=language --value=$language
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# 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"
|
git clone --quiet https://github.com/friendica/friendica.git -b stable "$final_path"
|
||||||
# Reset branch to the level of update we needed
|
# Reset branch to the level of update we needed
|
||||||
pushd "$final_path"
|
pushd "$final_path"
|
||||||
git reset --hard $version_commit
|
git reset --hard --quiet $version_commit
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# Copy .htaccess-dist to ..htaccess
|
# 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"
|
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
|
# Reset addons branch to the level of update we needed
|
||||||
pushd "$final_path/addon"
|
pushd "$final_path/addon"
|
||||||
git reset --hard $addons_version_commit
|
git reset --hard --quiet $addons_version_commit
|
||||||
popd
|
popd
|
||||||
|
|
||||||
chmod 750 "$final_path"
|
chmod 750 "$final_path"
|
||||||
|
|
|
@ -25,6 +25,7 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||||
email=$(ynh_app_setting_get --app=$app --key=email)
|
email=$(ynh_app_setting_get --app=$app --key=email)
|
||||||
admin=$(ynh_app_setting_get --app=$app --key=admin)
|
admin=$(ynh_app_setting_get --app=$app --key=admin)
|
||||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
language=$(ynh_app_setting_get --app=$app --key=language)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
|
@ -82,6 +83,12 @@ if [ -z $email ]; then
|
||||||
ynh_app_setting_set --app=$app --key=email --value=$email
|
ynh_app_setting_set --app=$app --key=email --value=$email
|
||||||
fi
|
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
|
# Cleaning legacy permissions
|
||||||
if ynh_legacy_permissions_exists; then
|
if ynh_legacy_permissions_exists; then
|
||||||
ynh_legacy_permissions_delete_all
|
ynh_legacy_permissions_delete_all
|
||||||
|
@ -128,25 +135,25 @@ else
|
||||||
cp -a "$final_path/view/smarty3" "$tmpdir/smarty3"
|
cp -a "$final_path/view/smarty3" "$tmpdir/smarty3"
|
||||||
|
|
||||||
# Remove the app directory securely
|
# Remove the app directory securely
|
||||||
ynh_secure_remove "$final_path"
|
ynh_secure_remove --file="$final_path"
|
||||||
|
|
||||||
# 1 - Clone stable repo
|
# 1 - Clone stable repo
|
||||||
git clone --quiet https://github.com/friendica/friendica.git -b stable "$final_path"
|
git clone --quiet https://github.com/friendica/friendica.git -b stable "$final_path"
|
||||||
# Reset branch to the level of update we needed
|
# Reset branch to the level of update we needed
|
||||||
pushd "$final_path"
|
pushd "$final_path"
|
||||||
git reset --hard $version_commit
|
git reset --hard --quiet $version_commit
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# 2 - Clone addons repo
|
# 2 - Clone addons repo
|
||||||
git clone --quiet https://github.com/friendica/friendica-addons.git -b stable "$final_path/addon"
|
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
|
# Reset addons branch to the level of update we needed
|
||||||
pushd "$final_path/addon"
|
pushd "$final_path/addon"
|
||||||
git reset --hard $addons_version_commit
|
git reset --hard --quiet $addons_version_commit
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# Restore the smarty3 folder
|
# Restore the smarty3 folder
|
||||||
cp -a "$tmpdir/smarty3" "$final_path/view/smarty3"
|
cp -a "$tmpdir/smarty3" "$final_path/view/smarty3"
|
||||||
ynh_secure_remove "$tmpdir"
|
ynh_secure_remove --file="$tmpdir"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue