feat: Source .env file safely in update script for improved security
This commit is contained in:
1 parent
7972a31b3f
commit
a45eeec12b
1 file changed
+4
-1
@@ -28,7 +28,10 @@ fi
|
|||||||
|
|
||||||
# Load DB credentials from .env
|
# Load DB credentials from .env
|
||||||
if [ -f .env ]; then
|
if [ -f .env ]; then
|
||||||
export $(grep -v '^#' .env | xargs)
|
# Source .env file safely
|
||||||
|
set -a
|
||||||
|
source .env
|
||||||
|
set +a
|
||||||
DB_USER=${DB_USERNAME:-amnezia}
|
DB_USER=${DB_USERNAME:-amnezia}
|
||||||
DB_PASS=${DB_PASSWORD:-amnezia}
|
DB_PASS=${DB_PASSWORD:-amnezia}
|
||||||
DB_ROOT_PASS=${DB_ROOT_PASSWORD:-rootpassword}
|
DB_ROOT_PASS=${DB_ROOT_PASSWORD:-rootpassword}
|
||||||
|
|||||||
Reference in new issue
Block a user