docker/gitea/setup.sh
2024-03-07 17:53:12 +01:00

20 lines
528 B
Bash
Executable File

#!/bin/bash -e
[ "$EUID" != 0 ] && { echo "This script need to run as root" >&2; exit 1; }
docker-compose up --no-start --build
chown -R 1000:1000 /var/lib/docker/volumes/gitea_{config,data}/_data
docker-compose up -d --build
(
. ./.env
echo -e "\n\ngo to https://$BASE_URL, setup gitea and press enter\n\n"
read -r
)
sed -i -e "s/^SSH_PORT.*/SSH_PORT = $SSH_PORT/" \
-e 's/^SSH_LISTEN_PORT.*/SSH_LISTEN_PORT = 2222/' \
/var/lib/docker/volumes/gitea_config/_data/app.ini
docker-compose restart gitea