mirror of
https://github.com/pelican-dev/panel.git
synced 2026-02-16 03:11:10 +03:00
Compare commits
2 Commits
main
...
lance/2132
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b91af3118 | ||
|
|
4ece9dcf2e |
@@ -2,8 +2,13 @@
|
||||
# check for .env file or symlink and generate app keys if missing
|
||||
if [ -f /var/www/html/.env ]; then
|
||||
echo "external vars exist."
|
||||
# load specific env vars from .env used in the entrypoint and they are not already set
|
||||
for VAR in "APP_KEY" "APP_INSTALLED" "DB_CONNECTION" "DB_HOST" "DB_PORT"; do if ! (printenv | grep -q ${VAR}); then export $(grep ${VAR} .env | grep -ve "^#"); fi; done
|
||||
# load specific env vars from .env used in the entrypoint if they are not already set
|
||||
for VAR in "APP_KEY" "APP_INSTALLED" "DB_CONNECTION" "DB_HOST" "DB_PORT"; do
|
||||
if ! (printenv | grep -q "^${VAR}="); then
|
||||
VAL=$(grep "^${VAR}=" /var/www/html/.env | head -1 | cut -d= -f2- | sed -e 's/^"//' -e 's/"$//' -e "s/^'//" -e "s/'$//")
|
||||
if [ -n "$VAL" ]; then export "${VAR}=${VAL}"; fi
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "external vars don't exist."
|
||||
# webroot .env is symlinked to this path
|
||||
|
||||
Reference in New Issue
Block a user