mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-09-12 05:00:05 +00:00

- Updated Docker configuration to support PostgreSQL as an alternative to SQLite. - Enhanced DockerEntrypoint.sh to create a database environment file and test PostgreSQL connection. - Introduced database setup functions in install.sh for PostgreSQL installation and configuration. - Added database management options in x-ui.sh, including backup and switching between SQLite and PostgreSQL. - Implemented database configuration retrieval in the web service and controller layers. - Updated frontend settings to include database configuration options. - Added translations for new database settings in multiple languages.
17 lines
No EOL
303 B
Bash
17 lines
No EOL
303 B
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
host="$1"
|
|
port="$2"
|
|
user="$3"
|
|
database="$4"
|
|
shift 4
|
|
cmd="$@"
|
|
|
|
until PGPASSWORD="$DB_PASSWORD" psql -h "$host" -p "$port" -U "$user" -d "$database" -c '\q'; do
|
|
>&2 echo "PostgreSQL is unavailable - sleeping"
|
|
sleep 1
|
|
done
|
|
|
|
>&2 echo "PostgreSQL is up - executing command"
|
|
exec $cmd |