From deeb8638af0cf7ec003bfe60acf6487c340c3879 Mon Sep 17 00:00:00 2001 From: leo <426742@gmail.com> Date: Sat, 31 Aug 2024 02:26:17 +0500 Subject: [PATCH] autocommit --- docker-compose.yml | 6 +++--- install.sh | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 install.sh diff --git a/docker-compose.yml b/docker-compose.yml index 1b3a1ce..51b5709 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: gitea: - image: gitea/gitea:1.22.0 + image: gitea/gitea:1.22.1 container_name: gitea env_file: - /data/secrets/${SERVER_DOMAIN}/${SERVER_DOMAIN}.env @@ -31,7 +31,7 @@ services: GITEA__repository__ENABLE_PUSH_CREATE_ORG: true GITEA__security__INSTALL_LOCK: true - restart: always + restart: unless-stopped networks: - proxynet depends_on: @@ -58,7 +58,7 @@ services: gitea-cache: container_name: gitea-cache image: redis:7.2.5-alpine3.20 - restart: always + restart: unless-stopped networks: - proxynet healthcheck: diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..5b91ef0 --- /dev/null +++ b/install.sh @@ -0,0 +1,22 @@ +#!/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" \ No newline at end of file