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

* no need for the path variable

* fix url on upgrade

* add config

* fix variable

* check if the config file exists

* fix config file
This commit is contained in:
OniriCorpe 2024-02-12 00:03:37 +01:00 committed by GitHub
parent 513a4759be
commit 81927f29de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 3 deletions

View file

@ -32,7 +32,7 @@ return [
// ****************************************************************
'config' => [
'php_path' => '/usr/bin/php'
'php_path' => '/usr/bin/php',
'admin_email' => '__EMAIL__',
'sitename' => 'Friendica Social Network',
'register_policy' => \Friendica\Module\Register::OPEN,
@ -40,7 +40,7 @@ return [
],
'system' => [
'url' => 'https://__DOMAIN__',
'basepath' => '__INSTALL_DIR__'
'basepath' => '__INSTALL_DIR__',
'default_timezone' => '__TIMEZONE__',
'language' => '__LANGUAGE__',
],

View file

@ -38,6 +38,8 @@ chmod -R 775 "$install_dir/view/smarty3"
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
ynh_add_config --template="local-sample.config.php" --destination="$install_dir/config/local.config.php"
#=================================================
# SYSTEM CONFIGURATION
#=================================================
@ -79,7 +81,7 @@ pushd "$install_dir"
# Install application
ynh_exec_as "$app" "php$phpversion" bin/console.php autoinstall\
--dbhost "localhost" --dbdata "$db_name" --dbuser "$db_user" --dbpass "$db_pwd"\
--admin "$email" --tz "$timezone" --lang "$language" --url "https://$domain$path"
--admin "$email" --tz "$timezone" --lang "$language" --url "https://$domain"
# Enable LDAP Auth addon
ynh_exec_as "$app" "php$phpversion" bin/console.php addon enable ldapauth

View file

@ -58,6 +58,16 @@ chmod 644 "/etc/cron.d/$app"
# Create a dedicated Fail2Ban config
ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="^.*authenticate\: failed login attempt.*\"ip\"\:\"<HOST>\".*$"
#=================================================
# UPDATE A CONFIG FILE
#=================================================
ynh_script_progression --message="Updating a configuration file..." --weight=1
# fix the url if necessary (there should be no trailing slash)
if [ -f "$install_dir/config/local.config.php" ] && ! grep -q -e "'url' => 'https://$domain'," "$install_dir/config/local.config.php"; then
ynh_replace_string --match_string="'url' => 'https://.*'," --replace_string="'url' => 'https://$domain'," --target_file="$install_dir/config/local.config.php"
fi
#=================================================
# STORE THE CONFIG FILE CHECKSUM
#=================================================