Browse Source

Add script to automatically remove Gitea.

pull/2/head
Josh Mudge 9 months ago
parent
commit
f389c2cad2
3 changed files with 24 additions and 6 deletions
  1. 11
    5
      README.md
  2. 1
    1
      install.bash
  3. 12
    0
      remove.sh

+ 11
- 5
README.md View File

@@ -45,21 +45,21 @@ Click on "Admin Account Settings" to setup your user account and click "Install
45 45
 If you want to install Gitea manually, you can follow these instructions:
46 46
 
47 47
 ```bash
48
-# Create a 'gitea' user and group with the home /opt/gitea, no password (because it's a system user) and no GECOS
48
+### Create a 'gitea' user and group with the home /opt/gitea, no password (because it's a system user) and no GECOS
49 49
 sudo adduser gitea --home /opt/gitea --disabled-password --gecos ''
50 50
 
51
-# Make some other potentially useful directories for that user/group
51
+### Make some other potentially useful directories for that user/group
52 52
 sudo mkdir -p /opt/gitea/ /var/log/gitea
53 53
 sudo chown -R gitea:gitea /opt/gitea/ /var/log/gitea
54 54
 
55
-# Download and install gitea. Replace "amd64" with "i386" for 32 bit x86 or "arm-7" for ARMv7 and "arm-6" for ARMv6.
55
+### Download and install gitea. Replace "amd64" with "i386" for 32 bit x86 or "arm-7" for ARMv7 and "arm-6" for ARMv6.
56 56
 sudo wget -O /opt/gitea/gitea https://dl.gitea.io/gitea/1.4.1/gitea-1.4.1-linux-amd64
57 57
 sudo chmod +x /opt/gitea/gitea
58 58
 
59
-# Download and install the gitea.service for systemd
59
+### Download and install the gitea.service for systemd
60 60
 sudo wget -O /etc/systemd/system/gitea.service https://git.coolaj86.com/coolaj86/gitea-installer.sh/raw/master/dist/etc/systemd/system/gitea.service
61 61
 
62
-# Start gitea
62
+### Start gitea
63 63
 sudo systemctl restart gitea
64 64
 ```
65 65
 
@@ -103,3 +103,9 @@ You can find more information about customization and templates in the docs and
103 103
 # Troubleshooting systemd
104 104
 
105 105
 See [Troubleshooting systemd](https://git.coolaj86.com/coolaj86/service-installer.sh/src/master/README.md#troubleshooting-systemd)
106
+
107
+# Removing Gitea
108
+
109
+Run this command to uninstall Gitea: (THIS WILL REMOVE ALL DATA if you are using SQLite!)
110
+
111
+`curl -fsSL https://git.coolaj86.com/coolaj86/gitea-installer.sh/raw/branch/master/remove.bash | bash`

+ 1
- 1
install.bash View File

@@ -1,6 +1,6 @@
1 1
 #!/bin/bash
2 2
 
3
-# Most of code credit for determining version is here: https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c
3
+# Most of the code credit for determining version is here: https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c
4 4
 VER=$(curl --silent "https://api.github.com/repos/go-gitea/gitea/releases/latest" | # Get latest release from GitHub api
5 5
     grep '"tag_name":' |                                            # Get tag line
6 6
     sed -E 's/.*"([^"]+)".*/\1/'    |                               # Pluck JSON value

+ 12
- 0
remove.sh View File

@@ -0,0 +1,12 @@
1
+# Gitea Uninstall Script
2
+# This script removes Gitea as installed by this script. THIS DELTES ALL DATA if you are using SQLite.
3
+
4
+echo "Removing Gitea and DELETING ALL DATA."
5
+
6
+sudo systemctl stop gitea # Stop the Gitea service
7
+sudo systemctl disable gitea # Disable the Gitea service automatically starting on boot.
8
+sudo rm /etc/systemd/system/gitea.service # Delete the Gitea service.
9
+sudo rm /usr/local/bin/gitea # Remove Gitea from Path
10
+sudo rm -rf /opt/gitea # Remove Gitea Data
11
+
12
+echo "Done."

Loading…
Cancel
Save