From 2e0733df3b4b26aef9d8a363038cbcdb046241df Mon Sep 17 00:00:00 2001 From: asmigiel Date: Sat, 4 Jan 2025 21:00:56 +0100 Subject: [PATCH] test2 --- run.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/run.sh b/run.sh index 6fe352c..b0fdcd0 100644 --- a/run.sh +++ b/run.sh @@ -5,10 +5,10 @@ echo $APP_URL echo DATABASE_URL echo $DATABASE_URL -export DB_HOST=$(heroku config:get DATABASE_URL | sed 's/.*\/\/\(.*\):\(.*\)\/.*/\1/') -export DB_USER=$(heroku config:get DATABASE_URL | sed 's/.*\/\/\(.*\):\(.*\)\/.*/\1/') -export DB_PASSWORD=$(heroku config:get DATABASE_URL | sed 's/.*:\/\/.*:\(.*\)@.*/\1/') -export DB_NAME=$(heroku config:get DATABASE_URL | sed 's/.*\/\(.*\)/\1/') +HOST=`echo $DATABASE_URL | grep -o "@.*/" | sed 's/.$//' | cut -c 2-` +NAME=`echo $DATABASE_URL | grep -o "/[[:alnum:]]*$" | cut -c 2-` +USER=`echo $DATABASE_URL | grep -o "//[[:alnum:]]*:" | grep -o "[[:alnum:]]*"` +PASSWD=`echo $DATABASE_URL | grep -o ":[[:alnum:]]*@" | grep -o "[[:alnum:]]*"` mkdir -p /var/lib/gitea/custom/conf @@ -17,10 +17,11 @@ echo "ROOT_URL = $APP_URL" >> /var/lib/gitea/custom/conf/app.ini echo "[database]" >> /var/lib/gitea/custom/conf/app.ini echo "DB_TYPE = postgres" >> /var/lib/gitea/custom/conf/app.ini -echo "HOST = $DB_HOST" >> /var/lib/gitea/custom/conf/app.ini -echo "NAME = $DB_NAME" >> /var/lib/gitea/custom/conf/app.ini -echo "USER = $DB_USER" >> /var/lib/gitea/custom/conf/app.ini -echo "PASSWD = $DB_PASS" >> /var/lib/gitea/custom/conf/app.ini +echo "HOST = $HOST" >> /var/lib/gitea/custom/conf/app.ini +echo "NAME = $NAME" >> /var/lib/gitea/custom/conf/app.ini +echo "USER = $USER" >> /var/lib/gitea/custom/conf/app.ini +echo "PASSWD = $PASSWD" >> /var/lib/gitea/custom/conf/app.ini echo "SSL_MODE = require" >> /var/lib/gitea/custom/conf/app.ini +cat /var/lib/gitea/custom/conf/app.ini /usr/local/bin/gitea web --port $PORT \ No newline at end of file