Compare commits

..

No commits in common. "61106a36925115b44e4e01d351a9eaaff14346c2" and "158d8e28fe722acbe18616d3475ae082d746a5a6" have entirely different histories.

2 changed files with 22 additions and 39 deletions

4
doctor
View file

@ -1,4 +0,0 @@
#!/bin/bash
ACTION="$@"
su - git -c "cd /srv/gitea/bin ; /srv/gitea/bin/gitea doctor -c /etc/gitea/gitea.ini -w /srv/gitea/ -C /srv/gitea/custom $ACTION"

51
upgrade
View file

@ -16,47 +16,34 @@ else
# Verify.
if ./gitea --version | grep -q "version $VERSION " ; then
echo "Same version."
echo "Same version."
else
# Download the binary file.
wget https://codeberg.org/forgejo/forgejo/releases/download/v${VERSION}/forgejo-${VERSION}-linux-amd64
# Check the binary file.
wget https://codeberg.org/forgejo/forgejo/releases/download/v${VERSION}/forgejo-${VERSION}-linux-amd64.sha256
sha256sum -c forgejo-${VERSION}-linux-amd64.sha256
# Verify the binary file.
wget https://codeberg.org/forgejo/forgejo/releases/download/v${VERSION}/forgejo-${VERSION}-linux-amd64.asc
# gpg --keyserver keys.openpgp.org --recv EB114F5E6C0DC2BCDD183550A4B61A2DC5923710
gpg --verify forgejo-${VERSION}-linux-amd64.asc forgejo-${VERSION}-linux-amd64
# Download.
wget https://dl.gitea.io/gitea/$VERSION/gitea-$VERSION-linux-amd64
wget https://dl.gitea.io/gitea/$VERSION/gitea-$VERSION-linux-amd64.asc
wget https://dl.gitea.io/gitea/$VERSION/gitea-$VERSION-linux-amd64.sha256
sha256sum -c gitea-$VERSION-linux-amd64.sha256
# gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --verify gitea-$VERSION-linux-amd64.asc gitea-$VERSION-linux-amd64
# Flush queues.
su - git -c "cd /srv/gitea/bin ; $BINDIR/gitea -c /etc/gitea/gitea.ini manager flush-queues"
# Stop.
systemctl stop gitea
# Stop.
systemctl stop gitea
# Dump.
su - git -c "cd /srv/gitea/bin ; $BINDIR/gitea dump --tempdir $GITEA_HOME/tmp/ -c /etc/gitea/gitea.ini"
# Dump.
su - git -c "cd /srv/gitea/bin ; $BINDIR/gitea dump --tempdir $GITEA_HOME/tmp/ -c /etc/gitea/gitea.ini"
# Call doctor.
#su - git -c "cd /srv/gitea/bin ; $BINDIR/gitea doctor --all --fix -c /etc/gitea/gitea.ini"
#su - git -c "cd /srv/forgejo/bin ; $BINDIR/forgejo doctor --all --fix -c /etc/forgejo/forgejo.ini -C /srv/forgejo/custom -w /srv/forgejo/"
su - git -c "cd /srv/gitea/bin ; $BINDIR/gitea doctor check --all --fix -c /etc/gitea/gitea.ini -C /srv/gitea/custom -w /srv/gitea/"
su - git -c "cd /srv/gitea/bin ; $BINDIR/gitea doctor --all --fix -c /etc/gitea/gitea.ini"
# Upgrade.
chmod u+x forgejo-$VERSION-linux-amd64
chown git:gitea forgejo-$VERSION-linux-amd64
ln --force forgejo-$VERSION-linux-amd64 gitea
# Upgrade.
chmod u+x gitea-$VERSION-linux-amd64
chown git.gitea gitea-$VERSION-linux-amd64
ln --force gitea-$VERSION-linux-amd64 gitea
# Start.
#systemctl start gitea
echo "Please, check then start the service Gitea."
read -e -p "Start Gitea service? [Y/n] " choice
if [[ "$choice" =~ ^[yY]$ ]]; then
echo "Restarting…"
systemctl start gitea
journalctl -f -u gitea
fi
# Start.
#systemctl start gitea
fi
fi