mirror of
https://github.com/YunoHost-Apps/friendica_ynh.git
synced 2024-09-03 18:36:14 +02:00
Fix
This commit is contained in:
parent
30bc787b0c
commit
8b4a143628
3 changed files with 7 additions and 32 deletions
|
@ -13,31 +13,6 @@ extra_php_dependencies="php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-cli
|
|||
# EXPERIMENTAL HELPERS
|
||||
#=================================================
|
||||
|
||||
ynh_smart_mktemp () {
|
||||
local min_size="${1:-300}"
|
||||
# Transform the minimum size from megabytes to kilobytes
|
||||
min_size=$(( $min_size * 1024 ))
|
||||
|
||||
# Check if there's enough free space in a directory
|
||||
is_there_enough_space () {
|
||||
local free_space=$(df --output=avail "$1" | sed 1d)
|
||||
test $free_space -ge $min_size
|
||||
}
|
||||
|
||||
if is_there_enough_space /tmp; then
|
||||
local tmpdir=/tmp
|
||||
elif is_there_enough_space /var; then
|
||||
local tmpdir=/var
|
||||
elif is_there_enough_space /; then1
|
||||
local tmpdir=/
|
||||
elif is_there_enough_space /home; then
|
||||
local tmpdir=/home
|
||||
else
|
||||
ynh_die "Insufficient free space to continue..."
|
||||
fi
|
||||
|
||||
echo "$(mktemp --directory --tmpdir="$tmpdir")"
|
||||
}
|
||||
#=================================================
|
||||
# FUTURE OFFICIAL HELPERS
|
||||
#=================================================
|
||||
|
|
|
@ -29,8 +29,6 @@ domain=$YNH_APP_ARG_DOMAIN
|
|||
path_url='/'
|
||||
admin=$YNH_APP_ARG_ADMIN
|
||||
email=$(ynh_user_get_info --username=$admin --key=mail)
|
||||
is_public=1
|
||||
database="1"
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
|
@ -54,7 +52,6 @@ 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=database --value=$database
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
|
@ -81,13 +78,13 @@ ynh_script_progression --message="Setting up source files..."
|
|||
|
||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
# 1- Clone stable repo
|
||||
git clone https://github.com/friendica/friendica.git -b stable "$final_path"
|
||||
ynh_exec_warn_less 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 - Clone addons repo
|
||||
git clone https://github.com/friendica/friendica-addons.git -b stable "$final_path/addon"
|
||||
ynh_exec_warn_less git clone https://github.com/friendica/friendica-addons.git -b stable "$final_path/addon"
|
||||
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
|
@ -101,7 +98,10 @@ ynh_script_progression --message="Configuring NGINX web server..."
|
|||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
||||
|
||||
#=================================================
|
||||
# ADD A CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Adding a configuration file..."
|
||||
|
||||
ynh_add_config --template="../conf/local-sample.config.php" --destination="$final_path/config/local.config.php"
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ then
|
|||
else
|
||||
|
||||
# Create a temporary directory and backup smarty3 folder
|
||||
tmpdir="$(ynh_smart_mktemp 6000)"
|
||||
tmpdir="$(mktemp -d)"
|
||||
ynh_script_progression --message="Upgrading source files..."
|
||||
cp -a "$final_path/view/smarty3" "$tmpdir/view/smarty3"
|
||||
|
||||
|
|
Loading…
Reference in a new issue