gitea/install.sh
2024-08-31 02:26:17 +05:00

22 lines
539 B
Bash

#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo -e "\033[31mThis script requires superuser rights.\033[0m"
exit 0
fi
trap 'echo -e "\033[31minstall.sh: Something went wrong\033[0m"; exit 1' ERR
set -e
export DEBIAN_FRONTEND=noninteractive
echo "Install gitea..."
cd /data/utils
GITEA__database__PASSWD=$(pwgen -s 20 1);
sudo bash env-gen.sh GITEA__database__PASSWD $GITEA__database__PASSWD
sudo bash init-db.sh gitea $GITEA__database__PASSWD
cd /data/gitea
sudo docker compose up -d
trap - ERR
echo "Install postgres complete"