heroku-gitea/parse_db_url.sh
awieczarek 949e8d8696 Test
2024-10-20 16:06:54 +02:00

13 lines
510 B
Bash

#!/bin/sh
export GITEA__database__DB_TYPE=${DATABASE_URL%%:*}
export GITEA__database__USER=$(echo ${DATABASE_URL} | sed -r "s|.*://([^:]+):.*|\1|")
export GITEA__database__PASSWD=$(echo ${DATABASE_URL} | sed -r "s|.*://[^:]+:([^@]+)@.*|\1|")
export GITEA__database__HOST=$(echo ${DATABASE_URL} | sed -r "s|.*@([^:]+):.*|\1|")
export GITEA__database__NAME=$(echo ${DATABASE_URL} | sed -r "s|.*:([0-9]+)/([^?]+).*|\2|")
echo $DATABASE_URL
echo $GITEA__database__NAME
exec /usr/local/bin/gitea web -port $PORT