mirror of
https://github.com/YunoHost-Apps/friendica_ynh.git
synced 2024-09-03 18:36:14 +02:00
fix url (#125)
* 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:
parent
513a4759be
commit
81927f29de
3 changed files with 15 additions and 3 deletions
|
@ -32,7 +32,7 @@ return [
|
||||||
// ****************************************************************
|
// ****************************************************************
|
||||||
|
|
||||||
'config' => [
|
'config' => [
|
||||||
'php_path' => '/usr/bin/php'
|
'php_path' => '/usr/bin/php',
|
||||||
'admin_email' => '__EMAIL__',
|
'admin_email' => '__EMAIL__',
|
||||||
'sitename' => 'Friendica Social Network',
|
'sitename' => 'Friendica Social Network',
|
||||||
'register_policy' => \Friendica\Module\Register::OPEN,
|
'register_policy' => \Friendica\Module\Register::OPEN,
|
||||||
|
@ -40,7 +40,7 @@ return [
|
||||||
],
|
],
|
||||||
'system' => [
|
'system' => [
|
||||||
'url' => 'https://__DOMAIN__',
|
'url' => 'https://__DOMAIN__',
|
||||||
'basepath' => '__INSTALL_DIR__'
|
'basepath' => '__INSTALL_DIR__',
|
||||||
'default_timezone' => '__TIMEZONE__',
|
'default_timezone' => '__TIMEZONE__',
|
||||||
'language' => '__LANGUAGE__',
|
'language' => '__LANGUAGE__',
|
||||||
],
|
],
|
||||||
|
|
|
@ -38,6 +38,8 @@ chmod -R 775 "$install_dir/view/smarty3"
|
||||||
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"
|
||||||
|
|
||||||
|
ynh_add_config --template="local-sample.config.php" --destination="$install_dir/config/local.config.php"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SYSTEM CONFIGURATION
|
# SYSTEM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -79,7 +81,7 @@ pushd "$install_dir"
|
||||||
# Install application
|
# Install application
|
||||||
ynh_exec_as "$app" "php$phpversion" bin/console.php autoinstall\
|
ynh_exec_as "$app" "php$phpversion" bin/console.php autoinstall\
|
||||||
--dbhost "localhost" --dbdata "$db_name" --dbuser "$db_user" --dbpass "$db_pwd"\
|
--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
|
# Enable LDAP Auth addon
|
||||||
ynh_exec_as "$app" "php$phpversion" bin/console.php addon enable ldapauth
|
ynh_exec_as "$app" "php$phpversion" bin/console.php addon enable ldapauth
|
||||||
|
|
|
@ -58,6 +58,16 @@ chmod 644 "/etc/cron.d/$app"
|
||||||
# Create a dedicated Fail2Ban config
|
# Create a dedicated Fail2Ban config
|
||||||
ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="^.*authenticate\: failed login attempt.*\"ip\"\:\"<HOST>\".*$"
|
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
|
# STORE THE CONFIG FILE CHECKSUM
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue