This commit is contained in:
Sophia Atkinson 2023-04-30 10:39:29 -07:00
parent cf97300af6
commit b2306b5b97
4 changed files with 16 additions and 15 deletions

View File

@ -53,9 +53,9 @@ fi
sudo mv /tmp/gitea /usr/local/bin
sudo chmod +x /usr/local/bin/gitea
sudo mkdir -p /var/lib/gitea/{custom,data,indexers,public,log}
sudo chown git: /var/lib/gitea/{data,indexers,log}
sudo chmod 750 /var/lib/gitea/{data,indexers,log}
sudo mkdir -p /var/lib/gitea/{custom,data,log}
sudo chown -R git:git /var/lib/gitea
sudo chmod -R 750 /var/lib/gitea
sudo mkdir /etc/gitea
sudo chown root:git /etc/gitea
sudo chmod 770 /etc/gitea

View File

@ -19,6 +19,8 @@ done
sudo systemctl stop gitea
sudo systemctl disable gitea
sudo rm -rf /etc/systemd/system/gitea.service
echo "Backing up Files"
tar -cvzf gitea.tar.gz /var/lib/gitea/ /etc/gitea
sudo rm -rf /home/git
sudo userdel git
sudo rm -rf /usr/local/bin/gitea
@ -26,3 +28,5 @@ sudo rm -rf /var/lib/gitea/*
sudo rm -rf /etc/gitea
sudo ufw delete allow 3000
echo "Gitea has been uninstalled, and all files have are backed up in gitea.tar.gz, you can delete it at your discretion."

View File

@ -50,16 +50,12 @@ if [ -n "$(uname -a | grep armv7l)" ]; then
fi
sudo mv /tmp/gitea /usr/local/bin
sudo chmod +x /usr/local/bin/gitea
sudo chown git: /var/lib/gitea/{data,indexers,log}
sudo chmod 750 /var/lib/gitea/{data,indexers,log}
sudo chown -R git:git /var/lib/gitea
sudo chmod -R 750 /var/lib/gitea
sudo chown root:git /etc/gitea
sudo chmod 770 /etc/gitea
sudo systemctl start gitea
sudo ufw allow 3000
echo -e "=================================================================="
publicipaddress=$(curl -sS --connect-timeout 10 -m 60 https://ipv4.icanhazip.com/ || curl -sS --connect-timeout 10 -m 60 https://api.ipify.org )
intenalip=$(ip addr | grep -E -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -E -v "^127\.|^255\.|^0\." | head -n 1)
echo "Gitea Should be available at http://${intenalip}:3000"
echo "Or If you are using a VPS at http://${publicipaddress}:3000"
echo "Gitea has been updated!!"
echo -e "=================================================================="
fi

View File

@ -16,11 +16,12 @@ do
esac
done
sudo apt install wget git -y
GOGS_VER="0.13.0"
sudo wget -O linux_amd64.tar.gz https://dl.gogs.io/$GOGS_VER/gogs_"$GOGS_VER"_linux_amd64.tar.gz
sudo tar xvf linux_amd64.tar.gz
sudo adduser --system --shell /bin/bash --gecos 'Git Version Control' --group --disabled-password --home /home/git git
sudo apt install wget git go-lang -y
sudo adduser --disabled-login --gecos 'Gogs' git
git clone --depth 1 https://github.com/gogs/gogs.git gogs
cd gogs
go build -o gogs
./gogs web
sudo mkdir /var/log/gogs
sudo chown -R git:git /var/log/gogs/
sudo echo "