mirror of
https://github.com/YunoHost-Apps/friendica_ynh.git
synced 2024-09-03 18:36:14 +02:00
use the provided config file template at install
This commit is contained in:
parent
57e53c571d
commit
22054c05ab
2 changed files with 4 additions and 13 deletions
|
@ -79,23 +79,12 @@ pushd "$install_dir"
|
|||
ynh_exec_as "$app" "php$phpversion" bin/composer.phar install --no-dev --quiet
|
||||
|
||||
# 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"
|
||||
ynh_exec_as "$app" "php$phpversion" bin/console.php -f "$install_dir/config/local.config.php"
|
||||
|
||||
# Enable LDAP Auth addon
|
||||
ynh_exec_as "$app" "php$phpversion" bin/console.php addon enable ldapauth
|
||||
popd
|
||||
|
||||
# add the path to the pidfile (we can't do that using the autoinstall)
|
||||
# in fact we can using 'autoinstall -f <prepared.config.php>' but i'm tired
|
||||
# we definively would dig that:
|
||||
# the local.config.php file is overwritten by autoinstall so it's useless
|
||||
if [ -f "$install_dir/config/local.config.php" ] && ! grep -q -e "pidfile" "$install_dir/config/local.config.php"; then
|
||||
ynh_replace_string --match_string="'basepath' => '$install_dir'," --replace_string="'basepath' => '$install_dir', 'pidfile' => '$install_dir/daemon.pid'," --target_file="$install_dir/config/local.config.php"
|
||||
ynh_store_file_checksum --file="$install_dir/config/local.config.php"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
#=================================================
|
||||
|
|
|
@ -69,13 +69,15 @@ 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_print_info --message="Patching the Friendica config file: fix the domain setting..."
|
||||
ynh_replace_string --match_string="'url' => 'https://.*'," --replace_string="'url' => 'https://$domain'," --target_file="$install_dir/config/local.config.php"
|
||||
ynh_store_file_checksum --file="$install_dir/config/local.config.php"
|
||||
fi
|
||||
|
||||
# add the path to the pidfile if missing
|
||||
if [ -f "$install_dir/config/local.config.php" ] && ! grep -q -e "pidfile" "$install_dir/config/local.config.php"; then
|
||||
ynh_replace_string --match_string="'basepath' => '$install_dir'," --replace_string="'basepath' => '$install_dir', 'pidfile' => '$install_dir/daemon.pid'," --target_file="$install_dir/config/local.config.php"
|
||||
ynh_print_info --message="Patching the Friendica config file: add the PID file path for the daemon..."
|
||||
ynh_replace_string --match_string="'basepath' => '$install_dir'," --replace_string="'basepath' => '$install_dir',\n 'pidfile' => '$install_dir/daemon.pid'," --target_file="$install_dir/config/local.config.php"
|
||||
ynh_store_file_checksum --file="$install_dir/config/local.config.php"
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue