2024-12-22 22:15:01 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2025-01-04 20:32:03 +01:00
|
|
|
|
|
|
|
echo $APP_URL
|
|
|
|
echo DATABASE_URL
|
|
|
|
echo $DATABASE_URL
|
|
|
|
|
2024-12-22 22:15:01 +01:00
|
|
|
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
|
|
|
|
|
2025-01-04 20:32:03 +01:00
|
|
|
/usr/local/bin/gitea web --port $PORT
|