heroku-gitea/parse_db_url.sh

11 lines
525 B
Bash
Raw Normal View History

2024-10-20 15:22:00 +02:00
#!/bin/sh
2024-10-23 12:18:56 +02:00
export GITEA__database__DB_TYPE=postgres
2024-10-20 15:22:00 +02:00
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|")
2024-10-23 12:49:39 +02:00
printf "[database]\nDB_TYPE = postgres\n" > /var/lib/gitea/custom/conf/app.ini
2024-10-20 15:22:00 +02:00
2024-10-23 12:29:23 +02:00
/usr/local/bin/gitea web -port $PORT