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/')
|
|
|
|
|
2025-01-04 20:51:06 +01:00
|
|
|
mkdir -p /var/lib/gitea/custom/conf
|
2024-12-22 22:15:01 +01:00
|
|
|
|
2025-01-04 20:51:06 +01:00
|
|
|
echo "[server]" > /var/lib/gitea/custom/conf/app.ini
|
|
|
|
echo "ROOT_URL = $APP_URL" >> /var/lib/gitea/custom/conf/app.ini
|
2024-12-22 22:15:01 +01:00
|
|
|
|
2025-01-04 20:51:06 +01:00
|
|
|
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 "SSL_MODE = require" >> /var/lib/gitea/custom/conf/app.ini
|
2024-12-22 22:15:01 +01:00
|
|
|
|
2025-01-04 20:32:03 +01:00
|
|
|
/usr/local/bin/gitea web --port $PORT
|