From b0ced34e5664c9ad0033291156fd9415ca75a0da Mon Sep 17 00:00:00 2001 From: root Date: Tue, 23 Jan 2024 11:09:05 +0200 Subject: [PATCH] 2 --- Makefile | 19 ++++++++++++++++--- download-gitea.sh | 3 ++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 0318e62..6e29e77 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ all: echo OK + +install: install-dependencies-debian create-user download-gitea create-directories install-gitea-binary install-systemd-service install-nginx + install-dependencies-debian: apt -y install git vim bash-completion jq apt -y install mariadb-server @@ -16,12 +19,22 @@ download-gitea: install-gitea-binary: cp -vf gitea-linux-amd64 /usr/local/bin/gitea + chmod +x /usr/local/bin/gitea gitea --version create-directories: - mkdir -p /etc/gitea /var/lib/gitea/{custom,data,indexers,public,log} - chown git:git /var/lib/gitea/{data,indexers,log} - chmod 750 /var/lib/gitea/{data,indexers,log} + mkdir -vp /etc/gitea + mkdir -vp /var/lib/gitea/custom + mkdir -vp /var/lib/gitea/data + mkdir -vp /var/lib/gitea/indexers + mkdir -vp /var/lib/gitea/public + mkdir -vp /var/lib/gitea/logs + chown git:git /var/lib/gitea/data + chown git:git /var/lib/gitea/indexers + chown git:git /var/lib/gitea/logs + chmod 750 /var/lib/gitea/data + chmod 750 /var/lib/gitea/indexers + chmod 750 /var/lib/gitea/logs chown root:git /etc/gitea chmod 770 /etc/gitea diff --git a/download-gitea.sh b/download-gitea.sh index 853a955..937c5ec 100755 --- a/download-gitea.sh +++ b/download-gitea.sh @@ -7,4 +7,5 @@ RELEASE_URLS=$(curl --silent "${RELEASES_URL}" | jq -r '.assets[] | select (.nam DOWNLOAD_URL=$(echo "${RELEASE_URLS}" | egrep "linux\-amd64$") -wget "${DOWNLOAD_URL}" -O "gitea-linux-amd64" +stat "gitea-linux-amd64" || \ + wget "${DOWNLOAD_URL}" -O "gitea-linux-amd64"