chmura-zajecia-gitea-heroku/run.sh

28 lines
1015 B
Bash
Raw Normal View History

2024-12-22 22:15:01 +01:00
#!/bin/bash
2025-01-04 20:32:03 +01:00
2025-01-04 22:36:40 +01:00
echo $APP_URL
echo DATABASE_URL
echo $DATABASE_URL
2025-01-04 21:00:56 +01:00
HOST=`echo $DATABASE_URL | grep -o "@.*/" | sed 's/.$//' | cut -c 2-`
NAME=`echo $DATABASE_URL | grep -o "/[[:alnum:]]*$" | cut -c 2-`
USER=`echo $DATABASE_URL | grep -o "//[[:alnum:]]*:" | grep -o "[[:alnum:]]*"`
PASSWD=`echo $DATABASE_URL | grep -o ":[[:alnum:]]*@" | grep -o "[[:alnum:]]*"`
2025-01-04 22:36:40 +01:00
mkdir -p /var/lib/gitea/custom/conf
echo "[server]" > /var/lib/gitea/custom/conf/app.ini
echo "ROOT_URL = $APP_URL" >> /var/lib/gitea/custom/conf/app.ini
echo "[database]" >> /var/lib/gitea/custom/conf/app.ini
echo "DB_TYPE = postgres" >> /var/lib/gitea/custom/conf/app.ini
echo "HOST = $HOST" >> /var/lib/gitea/custom/conf/app.ini
echo "NAME = $NAME" >> /var/lib/gitea/custom/conf/app.ini
echo "USER = $USER" >> /var/lib/gitea/custom/conf/app.ini
echo "PASSWD = $PASSWD" >> /var/lib/gitea/custom/conf/app.ini
echo "SSL_MODE = require" >> /var/lib/gitea/custom/conf/app.ini
2025-01-04 21:00:56 +01:00
cat /var/lib/gitea/custom/conf/app.ini
2025-01-04 22:36:40 +01:00
/usr/local/bin/gitea web --port $PORT