From 46d6c163e399347007035fec92c3ea70b215ad5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 28 Sep 2023 13:17:37 +0200 Subject: [PATCH] chang to .env --- conf/.env | 14 ++++++++++++++ conf/db.example.inc.php | 17 ----------------- scripts/install | 6 +++--- scripts/upgrade | 33 ++++++++------------------------- 4 files changed, 25 insertions(+), 45 deletions(-) create mode 100644 conf/.env delete mode 100644 conf/db.example.inc.php diff --git a/conf/.env b/conf/.env new file mode 100644 index 0000000..58d1b53 --- /dev/null +++ b/conf/.env @@ -0,0 +1,14 @@ +# Database configuration +DB_DRIVER=pgsql +DB_HOST=localhost +DB_PORT=5432 +DB_DATABASE=__DB_NAME__ +DB_USERNAME=__DB_USER__ +DB_PASSWORD=__DB_PWD__ + +# Daemon configuration +DAEMON_URL=https://__DOMAIN____PATH__/ # Public URL of your Movim instance +DAEMON_PORT=__PORT__ # Port on which the daemon will listen +DAEMON_INTERFACE=127.0.0.1 # Interface on which the daemon will listen, must be an IP +DAEMON_DEBUG=false +DAEMON_VERBOSE=false \ No newline at end of file diff --git a/conf/db.example.inc.php b/conf/db.example.inc.php deleted file mode 100644 index 26e9bfb..0000000 --- a/conf/db.example.inc.php +++ /dev/null @@ -1,17 +0,0 @@ - 'pgsql', - # The database username - 'username' => '__DB_USER__', - # The password - 'password' => '__DB_PWD__', - # Where can we find the database ? - 'host' => 'localhost', - # The port number, 3306 for MySQL and 5432 for PostgreSQL - 'port' => 5432, - # The database name - 'database' => '__DB_NAME__' -]; diff --git a/scripts/install b/scripts/install index 3ea6b3a..03125a0 100644 --- a/scripts/install +++ b/scripts/install @@ -71,10 +71,10 @@ ynh_add_systemd_config #================================================= ynh_script_progression --message="Adding a configuration file..." -ynh_add_config --template="../conf/db.example.inc.php" --destination="$install_dir/config/db.inc.php" +ynh_add_config --template="../conf/.env" --destination="$install_dir/config/.env" -chmod 400 "$install_dir/config/db.inc.php" -chown $app:$app "$install_dir/config/db.inc.php" +chmod 400 "$install_dir/config/.env" +chown $app:$app "$install_dir/config/.env" #================================================= # BUILD MOVIM diff --git a/scripts/upgrade b/scripts/upgrade index 8dc1745..85c0564 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -79,14 +79,14 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated PHP-FPM config ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config +# Create a dedicated systemd config +ynh_add_systemd_config + +yunohost service add $app --description="Responsive web-based XMPP client" + #================================================= # SPECIFIC UPGRADE #================================================= @@ -94,10 +94,10 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Updating a configuration file..." -ynh_add_config --template="../conf/db.example.inc.php" --destination="$install_dir/config/db.inc.php" +ynh_add_config --template="../conf/.env" --destination="$install_dir/config/.env" -chmod 400 "$install_dir/config/db.inc.php" -chown $app:$app "$install_dir/config/db.inc.php" +chmod 400 "$install_dir/config/.env" +chown $app:$app "$install_dir/config/.env" #================================================= # BUILD MOVIM @@ -109,23 +109,6 @@ ynh_exec_warn_less ynh_composer_exec --phpversion="$phpversion" --workdir="$inst ynh_exec_warn_less ynh_composer_exec --phpversion="$phpversion" --workdir="$install_dir" --commands="update --no-interaction --quiet" ynh_exec_warn_less ynh_composer_exec --phpversion="$phpversion" --workdir="$install_dir" --commands="movim:migrate --quiet" -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." - -# Create a dedicated systemd config -ynh_add_systemd_config - -#================================================= -# GENERIC FINALIZATION -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." - -yunohost service add $app --description="Responsive web-based XMPP client" - #================================================= # START SYSTEMD SERVICE #=================================================