From 205cb0097b43359d1060c41ee967113c2a1c1a48 Mon Sep 17 00:00:00 2001 From: Gilles FELIX Date: Tue, 23 Feb 2021 21:31:24 +0100 Subject: [PATCH 1/4] Update setup-ttrss.sh --- root/srv/setup-ttrss.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/root/srv/setup-ttrss.sh b/root/srv/setup-ttrss.sh index ad2d77c..d53e23d 100755 --- a/root/srv/setup-ttrss.sh +++ b/root/srv/setup-ttrss.sh @@ -114,12 +114,12 @@ setup_ttrss() fi # Patch URL path. - sed -i -e "s@define('SELF_URL_PATH'.*@define('SELF_URL_PATH', '$TTRSS_SELF_URL');@g" ${TTRSS_PATH}/config.php - + echo "putenv('TTRSS_SELF_URL_PATH=$TTRSS_SELF_URL');" >> ${TTRSS_PATH}/config.php + # Check if single user mode is selected if [ "$TTRSS_SINGLEUSER" = true ]; then echo "Single User mode Selected" - sed -i -e "s/.*define('SINGLE_USER_MODE'.*/define('SINGLE_USER_MODE', 'true');/g" ${TTRSS_PATH}/config.php + echo "putenv('TTRSS_SINGLE_USER_MODE=1');" >> ${TTRSS_PATH}/config.php fi # Enable additional system plugins. From 8d6350a4ba689ab57a6adde73d91ec4469c41b9b Mon Sep 17 00:00:00 2001 From: Gilles FELIX Date: Tue, 23 Feb 2021 21:32:13 +0100 Subject: [PATCH 2/4] Update ttrss-configure-db.php --- root/srv/ttrss-configure-db.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/srv/ttrss-configure-db.php b/root/srv/ttrss-configure-db.php index 73895c7..9eaa815 100644 --- a/root/srv/ttrss-configure-db.php +++ b/root/srv/ttrss-configure-db.php @@ -85,6 +85,6 @@ catch (PDOException $e) { $contents = file_get_contents($conffile); foreach ($config as $name => $value) { - $contents = preg_replace('/(define\s*\(\'' . $name . '\',\s*)(.*)(\);)/', '$1"' . $value . '"$3', $contents); + $contents .= "putenv('TTRSS_" . $name . "=" . $value . "');\n"; } file_put_contents($conffile, $contents); From d2365335e1505ee3fc539603b739bdb390c9e593 Mon Sep 17 00:00:00 2001 From: Gilles FELIX Date: Tue, 23 Feb 2021 21:33:43 +0100 Subject: [PATCH 3/4] Update setup-ttrss.sh --- root/srv/setup-ttrss.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/srv/setup-ttrss.sh b/root/srv/setup-ttrss.sh index d53e23d..e98a144 100755 --- a/root/srv/setup-ttrss.sh +++ b/root/srv/setup-ttrss.sh @@ -115,7 +115,7 @@ setup_ttrss() # Patch URL path. echo "putenv('TTRSS_SELF_URL_PATH=$TTRSS_SELF_URL');" >> ${TTRSS_PATH}/config.php - + # Check if single user mode is selected if [ "$TTRSS_SINGLEUSER" = true ]; then echo "Single User mode Selected" From eff41ce18839f933e742fd96d15581e771af6e1f Mon Sep 17 00:00:00 2001 From: Gilles FELIX Date: Thu, 25 Feb 2021 08:46:49 +0100 Subject: [PATCH 4/4] Assume that TTRSS_PATH has no trailing slash in ttrss-configure-db.php, as in setup-ttrss.sh --- root/srv/ttrss-configure-db.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/root/srv/ttrss-configure-db.php b/root/srv/ttrss-configure-db.php index 9eaa815..062ec1d 100644 --- a/root/srv/ttrss-configure-db.php +++ b/root/srv/ttrss-configure-db.php @@ -3,8 +3,8 @@ include '/srv/ttrss-utils.php'; -$confpath = env('TTRSS_PATH', '/var/www/ttrss/'); -$conffile = $confpath . 'config.php'; +$confpath = env('TTRSS_PATH', '/var/www/ttrss'); +$conffile = $confpath . '/config.php'; $ename = 'DB'; $eport = 5432; @@ -73,7 +73,8 @@ try { } catch (PDOException $e) { echo 'Database table not found, applying schema... ' . PHP_EOL; - $schema = file_get_contents($confpath . 'schema/ttrss_schema_' . $config['DB_TYPE'] . '.sql'); + + $schema = file_get_contents($confpath . '/schema/ttrss_schema_' . $config['DB_TYPE'] . '.sql'); $schema = preg_replace('/--(.*?);/', '', $schema); $schema = preg_replace('/[\r\n]/', ' ', $schema); $schema = trim($schema, ' ;');