Skip to content

Commit

Permalink
Merge pull request #40 from linuxserver/base64
Browse files Browse the repository at this point in the history
  • Loading branch information
thespad authored Nov 26, 2024
2 parents a229bb5 + fcf6b03 commit be807d5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions root/etc/s6-overlay/s6-rc.d/init-phpmyadmin-config/run
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,26 @@ mkdir -p \
/config/phpmyadmin \
/app/www/public/tmp

if [ ! -f /config/phpmyadmin/config.secret.inc.php ]; then
if [[ ! -f /config/phpmyadmin/config.secret.inc.php ]]; then
cat >/config/phpmyadmin/config.secret.inc.php <<EOT
<?php
\$cfg['blowfish_secret'] = '$(tr -dc 'a-zA-Z0-9~!@#$%^&*_()+}{?></";.,[]=-' </dev/urandom | fold -w 32 | head -n 1)';
EOT
fi

if [ ! -f /config/phpmyadmin/config.user.inc.php ]; then
if [[ -n "${PMA_CONFIG_BASE64}" ]]; then
echo "${PMA_CONFIG_BASE64}" | base64 -d > /config/phpmyadmin/config.inc.php
fi

if [[ -n "${PMA_USER_CONFIG_BASE64}" ]]; then
echo "${PMA_USER_CONFIG_BASE64}" | base64 -d > /config/phpmyadmin/config.user.inc.php
fi

if [[ ! -f /config/phpmyadmin/config.user.inc.php ]]; then
touch /config/phpmyadmin/config.user.inc.php
fi

if [ ! -f /config/phpmyadmin/config.inc.php ]; then
if [[ ! -f /config/phpmyadmin/config.inc.php ]]; then
cp /defaults/config.inc.php /config/phpmyadmin/config.inc.php
fi

Expand Down

0 comments on commit be807d5

Please sign in to comment.