From 601d419dc01846e2ae60b9473489d3938604c6f8 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 7 Sep 2021 10:21:40 +0000 Subject: [PATCH] updated how to find the initial configuration file --- codepot/docker/Dockerfile.rocky84 | 2 +- codepot/docker/httpd-fg.sh | 10 +++------- codepot/src/config.php.in | 5 ++++- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/codepot/docker/Dockerfile.rocky84 b/codepot/docker/Dockerfile.rocky84 index 7f5bed3f..66fca349 100644 --- a/codepot/docker/Dockerfile.rocky84 +++ b/codepot/docker/Dockerfile.rocky84 @@ -9,7 +9,7 @@ RUN dnf install -y \ httpd php php-mysqli php-gd php-pdo \ perl-Digest-SHA \ perl-DBD-MySQL perl-DBD-SQLite perl-LDAP \ - mod_dav_svn mod_perl diffutils sqlite3 + mod_dav_svn mod_perl diffutils sqlite RUN dnf install -y php-devel subversion-devel perl-devel make diff --git a/codepot/docker/httpd-fg.sh b/codepot/docker/httpd-fg.sh index 97426c3a..2b1cd464 100755 --- a/codepot/docker/httpd-fg.sh +++ b/codepot/docker/httpd-fg.sh @@ -50,13 +50,9 @@ chown -R apache:apache /var/lib/codepot /var/cache/codepot /var/log/codepot [ ! -f /var/lib/codepot/codepot.ini ] && cp -pf /etc/codepot/codepot.ini /var/lib/codepot/codepot.ini -#grep -F -q '' /etc/httpd/conf-enabled/codepot.conf || { -# cat <> /etc/httpd/conf-enabled/codepot.conf -# -# SetEnv CODEPOT_CONFIG_FILE /var/lib/codepot/codepot.ini -# -#EOF -#} +grep -F -q 'env[CODEPOT_CONFIG_FILE]' /etc/php-fpm.d/www.conf || { + echo 'env[CODEPOT_CONFIG_FILE] = /var/lib/codepot/codepot.ini' >> /etc/php-fpm.d/www.conf +} php-fpm exec httpd -DFOREGROUND "$@" diff --git a/codepot/src/config.php.in b/codepot/src/config.php.in index 334f5212..3f920fbe 100644 --- a/codepot/src/config.php.in +++ b/codepot/src/config.php.in @@ -192,10 +192,13 @@ function load_ini ($file) } $codepot_ini_file = CODEPOT_CFG_DIR.'/codepot.ini'; -if (function_exists('apache_getenv')) +$tmp = getenv('CODEPOT_CONFIG_FILE'); +if ($tmp != '') $codepot_ini_file = $tmp; +elseif (function_exists('apache_getenv')) { $tmp = apache_getenv('CODEPOT_CONFIG_FILE'); if ($tmp != '') $codepot_ini_file = $tmp; } load_ini ($codepot_ini_file); + ?>