From 1e5c7a036d2758e90ebe687cba6886ec902c0615 Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Fri, 10 May 2024 00:57:42 +0200 Subject: [PATCH] Add an include in .htconfig.php for additional settings --- conf/htconfig.sample.php | 36 +++--------------------------------- manifest.toml | 2 +- scripts/backup | 2 +- scripts/install | 2 ++ scripts/upgrade | 5 +++++ 5 files changed, 12 insertions(+), 35 deletions(-) diff --git a/conf/htconfig.sample.php b/conf/htconfig.sample.php index bc4ef88..60a15a7 100644 --- a/conf/htconfig.sample.php +++ b/conf/htconfig.sample.php @@ -121,39 +121,6 @@ App::$config['system']['theme'] = 'fresh'; // Allow local test environments with unverified SSL certs using Lando App::$config['system']['ssl_exceptions'] = 'lndo.site'; -// Mail configuration -// By default, uses local sendmail service -// Only change these settings if you require SMTP transport - -// App::$config['phpmailer']['mailer'] = 'smtp'; -// App::$config['phpmailer']['host'] = 'example.com'; - -// Leave this line commented if using SSL or STARTTLS and set the port in the next sections -// App::$config['phpmailer']['port'] = 25; // (or 587 or 465 if using ssl) - -// If using smtp authentication: -// App::$config['phpmailer']['smtpauth'] = 1; -// App::$config['phpmailer']['uername'] = 'your_username'; -// App::$config['phpmailer']['password'] = 'your_secret_password'; - -// If using starttls: -// App::$config['phpmailer']['smtpsecure'] = 'tls'; -// App::$config['phpmailer']['port'] = 587; - -// If using ssl: -// App::$config['phpmailer']['smtpsecure'] = 'ssl'; -// App::$config['phpmailer']['port'] = 465; - -// If the server has a self-signed cert: -// App::$config['phpmailer']['noverify'] = 1; - -// For debugging -// App::$config['phpmailer']['smtpdebug'] = 2; // valid values are 0-4 - -// These settings should work for 99% of use cases -// If you encounter any issues, please see https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting -// If you need to extend these configuration options, please submit a pull request with your changes. - // PHP error logging setup // Before doing this ensure that the webserver has permission @@ -166,3 +133,6 @@ ini_set('display_errors', '0'); error_reporting(E_ERROR | E_PARSE ); ini_set('error_log','php.log'); ini_set('log_errors','1'); + +// Extra settings stored in the app data dir (Service Classes, PHPMailer...) +include __DATA_DIR__/extra_conf.php diff --git a/manifest.toml b/manifest.toml index e710bd5..92663b6 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Streams" description.en = "Open source fediverse server" description.fr = "Serveur fediverse open source" -version = "24.02.18~ynh3" +version = "24.05.10~ynh1" maintainers = ["Papa Dragon"] diff --git a/scripts/backup b/scripts/backup index c06af88..b1c66e8 100644 --- a/scripts/backup +++ b/scripts/backup @@ -53,7 +53,7 @@ ynh_backup --src_path="/etc/logrotate.d/$app" #================================================= ynh_backup --src_path="/etc/cron.d/$app" -ynh_backup --src_path="/$data_dir" +ynh_backup --src_path="$data_dir" #================================================= # BACKUP THE DATABASE diff --git a/scripts/install b/scripts/install index 78fd60c..6ad146d 100755 --- a/scripts/install +++ b/scripts/install @@ -122,6 +122,8 @@ ynh_store_file_checksum --file=$install_dir/.htconfig.php chmod 600 "$install_dir/.htconfig.php" chown $app:$app "$install_dir/.htconfig.php" +ynh_exec_as $app touch $data_dir/extra_conf.php + #================================================= # SET CRON JOBS #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2f11b5a..c922090 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -148,6 +148,11 @@ ynh_add_config --template="../conf/htconfig.sample.php" --destination="$install_ chmod 600 "$install_dir/.htconfig.php" chown $app:$app "$install_dir/.htconfig.php" +if [ ! -f $data_dir/extra_conf.php ] +then + ynh_exec_as $app touch $data_dir/extra_conf.php +fi + #================================================= # UPGRADE CRON JOB #=================================================