chmura-zajecia-gitea-heroku/run.sh
2024-12-22 22:15:01 +01:00

24 lines
628 B
Bash

#!/bin/bash
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/')
cat > /data/gitea/conf/app.ini <<EOL
[database]
DB_TYPE = postgres
HOST = ${DB_HOST}
NAME = ${DB_NAME}
USER = ${DB_USER}
PASSWD = ${DB_PASSWORD}
SSL_MODE = require
[server]
DOMAIN = ${HEROKU_APP_DEFAULT_DOMAIN_NAME}
HTTP_PORT = ${PORT}
EOL
/usr/bin/gitea web