ko-heroku-gitea/exe.sh
2024-11-24 19:46:56 +01:00

29 lines
1.4 KiB
Bash

#!/bin/sh
#postgres://u31jkbnvvpd15e:pa8cfe0badf685292f0a11bbd79fa914561832dbe604f0ea0c3aa8282a85bff11@c5hilnj7pn10vb.cluster-czrs8kj4isg7.us-east-1.rds.amazonaws.com:5432/d7f6pcdio089u7
# {print $0} "postgres"
# {print $1} ""
# {print $2} ""
# {print $3} ""
USER="$(echo "$DATABASE_URL" | awk -F[/:@] '{print $4}')"
PASSWD="$(echo "$DATABASE_URL" | awk -F[/:@] '{print $5}')"
HOST="$(echo "$DATABASE_URL" | awk -F[/:@] '{print $6}')"
PORTDB="$(echo "$DATABASE_URL" | awk -F[/:@] '{print $7}')"
NAME="$(echo "$DATABASE_URL" | awk -F[/:@] '{print $8}')"
echo "[server]" >> /var/lib/gitea/custom/conf/app.ini
echo "HTTP_PORT = $PORT" >> /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:$PORTDB" >> /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
echo "[ui]" >> /var/lib/gitea/custom/conf/app.ini
echo "DEFAULT_THEME= arc-green">> /var/lib/gitea/custom/conf/app.ini
echo "REACTIONS = wine_glass:, white_check_mark:, x:, warning:" >> /var/lib/gitea/custom/conf/app.ini
/usr/local/bin/gitea web