From 884112091e461157a64bfef8ef6f8c2176e68287 Mon Sep 17 00:00:00 2001 From: allan Date: Sat, 29 Nov 2025 15:20:21 +0100 Subject: [PATCH] =?UTF-8?q?Not=20a=20bugfix=20=E2=80=94=20just=20cleaning?= =?UTF-8?q?=20up=20because=20consistency=20matters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- giteainstall | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/giteainstall b/giteainstall index 53921ed..26f33a1 100755 --- a/giteainstall +++ b/giteainstall @@ -160,20 +160,6 @@ if [[ "$dbpass" =~ [[:space:]] ]]; then exit 1 fi -# Prevent accidental overwrite of existing Nginx config -if [[ -f "/etc/nginx/conf.d/${hostname}.conf" ]]; then - printf "\nERROR: A configuration file already exists for %s.\n" "$hostname" - printf "Refusing to overwrite existing site.\n\n" - exit 1 -fi - -# Check for existing references in other Nginx configs -hostcheck=$(grep -r --exclude="README.md" "$hostname" /etc/nginx/ 2>/dev/null || true) -if [[ -n "$hostcheck" ]]; then - printf "\nFound existing configuration mentioning %s — aborting to avoid collision.\n\n" "$hostname" - exit 1 -fi - # # Ensure curl and wget are installed # @@ -260,10 +246,10 @@ mkdir -p /home/$giteauser/.ssh ; chown -R $giteauser:$giteauser /home/$giteauser # # Create Gitea data structure # -mkdir -p /var/lib/$giteauser/{data,indexers,public,log} +mkdir -p /var/lib/$giteauser/{custom,data,indexers,public,log} chown "$giteauser":"$giteauser" /var/lib/$giteauser/{data,indexers,log} chmod 750 /var/lib/$giteauser/{data,indexers,log} -mkdir -p /etc/$giteauser/custom/{templates,public/assets/img} +mkdir -p /var/lib/$giteauser/custom/{templates,public/assets/img} chown -R $giteauser:$giteauser /etc/$giteauser/custom chmod -R 750 /etc/$giteauser/custom mkdir -p /etc/$giteauser ; chown root:"$giteauser" /etc/$giteauser ; chmod 770 /etc/$giteauser @@ -287,7 +273,7 @@ Group=$giteauser WorkingDirectory=/var/lib/$giteauser/ ExecStart=/usr/local/bin/gitea web -c /etc/$giteauser/app.ini Restart=always -Environment=USER=$giteauser HOME=/home/$giteauser GITEA_WORK_DIR=/var/lib/$giteauser GITEA_CUSTOM=/etc/$giteauser/custom +Environment=USER=$giteauser HOME=/home/$giteauser GITEA_WORK_DIR=/var/lib/$giteauser GITEA_CUSTOM=/var/lib/$giteauser/custom [Install] WantedBy=multi-user.target