chmura-zajecia-gitea-heroku/run.sh

26 lines
983 B
Bash
Raw Permalink Normal View History

2025-01-07 20:06:44 +01:00
#!/bin/bash
2025-01-07 21:44:23 +01:00
2025-01-07 22:11:31 +01:00
FILE=./app_url.txt
2025-01-07 21:44:23 +01:00
ROOT_URL=$(cat $FILE)
2025-01-07 22:11:31 +01:00
printf($ROOT_URL)
2025-01-07 21:12:07 +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-06 18:46:02 +01:00
2025-01-07 20:35:59 +01:00
mkdir -p /var/lib/gitea/custom/conf
2025-01-06 18:46:02 +01:00
2025-01-07 21:12:07 +01:00
echo "[server]" > /var/lib/gitea/custom/conf/app.ini
2025-01-07 21:44:23 +01:00
echo "ROOT_URL = $ROOT_URL >> /var/lib/gitea/custom/conf/app.ini
2025-01-07 21:12:07 +01:00
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-07 20:06:44 +01:00
2025-01-07 21:12:07 +01:00
/usr/local/bin/gitea web --port $PORT