8 Commits
2.0 ... main

Author SHA1 Message Date
974f6d4fb5 add EOL notice 2024-03-20 20:50:36 -07:00
0cc27e1896 EOL this project :( 2024-03-20 20:49:27 -07:00
797b4d8de6 added traefik script, and updated hugo script 2023-10-10 20:03:43 -07:00
ef659774d7 fix curl name for hugo script
Signed-off-by: Sophia Atkinson <sophialul@protonmail.com>
2023-10-04 04:57:24 -07:00
0fbfaae109 i dont want to talk about it lol 2023-10-04 04:55:51 -07:00
cb841ad51f i dont want to talk about it lol 2023-10-04 03:13:13 -07:00
d74e431019 forgot to remove testing grep 2023-08-31 20:12:12 -07:00
bf3e3609fa updated PMA scripts 2023-08-31 20:10:37 -07:00
19 changed files with 973 additions and 636 deletions

143
README.md
View File

@ -1,9 +1,144 @@
# The Linux List **Discontinuation Notice: The Linux List**
### ⚠️ Super Ultra Untested ⚠️ Sad news... I've decided to pull the plug on The Linux List. Juggling other projects means I can't give it the love it needs anymore.
Big thanks to all who've been part of the journey. No more updates or fixes, but the Git repo will stick around for those who need it.
Thanks for rolling with it,
Sophia Atkinson 💜
_______________________________________________________________________
# The Linux List
## `~Script Installs~` ## `~Script Installs~`
## Now Just One script! ### Tested scrips ✔️
### `wget -O scripts.sh https://git.oldgate.org/Sophia/thelinuxlist/raw/branch/2.0/scripts/scripts.sh && bash scripts.sh` ### Broken Scripts ❌
### Untested Scripts ⚠️
### Retired Scripts 💀
## Don't like typing "Y"? Just add a "u" after the /sh/ `(/sh/u/RANDOMSCRIPT)`
---
## [Gitea](https://about.gitea.com/)
### ✔️ Install
### `wget https://sop.wtf/sh/giteainstall ; bash giteainstall`
### ✔️ Uninstall
### `wget https://sop.wtf/sh/gitearemove ; bash gitearemove`
### ✔️ Update
### `wget https://sop.wtf/sh/giteaupdate ; bash giteaupdate`
---
## [Go Hugo](https://gohugo.io/)
### ✔️ Install/Update
### `wget https://sop.wtf/sh/hugoinstall ; bash hugoinstall`
### ✔️ Uninstall
### `rm -rf /usr/local/bin/hugo`
---
## [Go](https://go.dev/)
### ✔️ Install/Update
### `wget https://sop.wtf/sh/goinstall ; bash goinstall`
### ✔️ Uninstall
### `rm -rf /usr/local/go`
---
## [Traefik](https://go.dev/)
### ✔️ Install/Update
### `wget https://sop.wtf/sh/traefikinstall ; bash traefikinstall`
### ✔️ Uninstall
### `rm -rf /usr/local/traefik`
---
## [MariaDB](https://mariadb.org/)
### ✔️ Install
### `wget https://sop.wtf/sh/mariadbinstall ; bash mariadbinstall`
### ✔️ Uninstall
### `sudo apt remove mariadb-server mariadb-client -y ; apt autoremove -y`
---
## [phpMyAdmin](https://www.phpmyadmin.net/)
### ✔️ Install
### `wget https://sop.wtf/sh/pmainstall ; bash pmainstall`
### ⚠️ Uninstall
### `wget https://sop.wtf/sh/pmauninstall ; bash pmauninstall`
### ✔️ Update
### `wget https://sop.wtf/sh/pmaupdate ; bash pmaupdate`
---
## [MongoDB](https://www.mongodb.com/)
### ⚠️ Install
### `wget https://sop.wtf/sh/mongodbinstall ; bash mongodbinstall`
### ✔️ Uninstall
### `sudo apt remove mongodb-org libssl1.1 -y ; sudo apt autoremove`
---
## [Gogs](https://gogs.io/)
### ✔️ Install
### `wget https://sop.wtf/sh/gogsinstall ; bash gogsinstall`
### ✔️ Uninstall
### `wget https://sop.wtf/sh/gogsuninstall ; bash gogsuninstall`
---
## [Wordpress](https://wordpress.org/)
### ⚠️ Install
### `wget https://sop.wtf/sh/wpinstall ; bash wpinstall`
---
## [Fail2Ban](https://www.fail2ban.org/)
### ✔️ Install
### `wget https://sop.wtf/sh/fail2baninstall ; bash fail2baninstall`
---

View File

@ -1,73 +1,124 @@
#!/usr/bin/env bash #!/usr/bin/env bash
trap 'exit 130' INT trap 'exit 130' INT
while true
do # Function to prompt user for installation
prompt_installation() {
while true; do
read -r -p "Would you like to install Gitea? [Y/n] " input read -r -p "Would you like to install Gitea? [Y/n] " input
case $input in case $input in
[yY][eE][sS]|[yY]) [yY][eE][sS]|[yY])
break return 0
;; ;;
[nN][oO]|[nN]) [nN][oO]|[nN])
break return 1
;; ;;
*) *)
echo "That wasn't an option..." echo "That wasn't an option..."
;; ;;
esac esac
done done
set -b }
ping -c1 "github.com" &>"/dev/null"
ping -c1 "api.github.com" &>"/dev/null" # Function to check if required domains are accessible
ping -c1 "dl.gitea.io" &>"/dev/null" check_domains() {
ping -c1 "raw.githubusercontent.com" &>"/dev/null" echo "Checking necessary domains..."
if [[ "${?}" -ne 0 ]]; then for domain in "github.com" "api.github.com" "dl.gitea.io" "raw.githubusercontent.com"; do
echo "I am unable to access one of the necessary domains that are needed to continue this Install." if ! ping -c1 "$domain" &>"/dev/null"; then
elif [[ "${#args[@]}" -eq 0 ]]; then echo "Unable to access $domain. Installation cannot proceed."
# Check if curl is installed exit 1
if [ ! -x /usr/bin/curl ] ; then fi
CURL_NOT_EXIST=1 done
apt install -y curl }
# Function to install Gitea
install_gitea() {
echo "Installing Gitea..."
# Check if curl is installed
if ! command -v curl &>/dev/null; then
echo "Installing curl..."
sudo apt install -y curl || { echo "Failed to install curl. Exiting."; exit 1; }
fi
# Get latest Gitea version
VER=$(curl --silent "https://api.github.com/repos/go-gitea/gitea/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's|[v,]||g')
# Install git
echo "Installing git..."
sudo apt-get install git -y || { echo "Failed to install git. Exiting."; exit 1; }
# Create git user
echo "Creating git user..."
sudo adduser --system --shell /bin/bash --gecos 'Git Version Control' --group --disabled-password --home /home/git git
# Download and install Gitea binary
echo "Downloading Gitea binary..."
case "$(uname -m)" in
i386)
arch="386"
;;
x86_64)
arch="amd64"
;;
armv6l)
arch="arm-6"
;;
armv7l)
arch="arm-7"
;;
*)
echo "Unsupported architecture"
exit 1
;;
esac
gitea_url="https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-$arch"
echo "Downloading Gitea from: $gitea_url"
sudo curl -fsSL -o "/tmp/gitea" "$gitea_url"
sudo mv /tmp/gitea /usr/local/bin
sudo chmod +x /usr/local/bin/gitea
# Create necessary directories and files
echo "Setting up directories and files..."
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 -p /etc/gitea
sudo chown root:git /etc/gitea
sudo chmod 770 /etc/gitea
# Configure systemd service
echo "Configuring systemd service..."
sudo curl -fsSL -o /etc/systemd/system/gitea.service https://raw.githubusercontent.com/go-gitea/gitea/master/contrib/systemd/gitea.service
sudo systemctl daemon-reload
sudo systemctl enable --now gitea
# Allow port through firewall
echo "Allowing port 3000 through firewall..."
sudo ufw allow 3000
# Get public and internal IP addresses
public_ip=$(curl -sS --connect-timeout 10 -m 60 https://ipv4.icanhazip.com/ || curl -sS --connect-timeout 10 -m 60 https://api.ipify.org )
internal_ip=$(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)
# Output installation information
echo -e "=================================================================="
echo "Gitea has been installed successfully!"
echo "The Gitea web interface should be available at:"
echo "http://$internal_ip:3000"
echo "Or, if you are using a VPS, at:"
echo "http://$public_ip:3000"
echo "=================================================================="
}
# Main script
if prompt_installation; then
check_domains
install_gitea
else else
CURL_NOT_EXIST=0 echo "Gitea installation aborted."
fi
VER=$(curl --silent "https://api.github.com/repos/go-gitea/gitea/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's|[v,]||g' )
sudo systemctl stop gitea
sudo apt-get install git -y
sudo adduser --system --shell /bin/bash --gecos 'Git Version Control' --group --disabled-password --home /home/git git
if [ -n "$(uname -a | grep i386)" ]; then
curl -fsSL -o "/tmp/gitea" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-386"
fi fi
if [ -n "$(uname -a | grep x86_64)" ]; then exit 0
curl -fsSL -o "/tmp/gitea" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-amd64"
fi
if [ -n "$(uname -a | grep armv6l)" ]; then
curl -fsSL -o "/tmp/gitea" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-arm-6"
fi
if [ -n "$(uname -a | grep armv7l)" ]; then
curl -fsSL -o "/tmp/gitea" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-arm-7"
fi
sudo mv /tmp/gitea /usr/local/bin
sudo chmod +x /usr/local/bin/gitea
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
curl -fsSL -o /etc/systemd/system/gitea.service https://raw.githubusercontent.com/go-gitea/gitea/master/contrib/systemd/gitea.service
sudo systemctl daemon-reload
sudo systemctl enable --now 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 -e "=================================================================="
fi

View File

@ -1,32 +1,61 @@
#!/usr/bin/env bash #!/usr/bin/env bash
trap 'exit 130' INT
while true # Function to prompt user for confirmation
do prompt_confirmation() {
while true; do
read -r -p "Would you like to uninstall Gitea? This is not reversible. [Y/n] " input read -r -p "Would you like to uninstall Gitea? This is not reversible. [Y/n] " input
case $input in case $input in
[yY][eE][sS]|[yY]) [yY][eE][sS]|[yY])
break return 0
;; ;;
[nN][oO]|[nN]) [nN][oO]|[nN])
break return 1
;; ;;
*) *)
echo "That wasn't an option..." echo "That wasn't an option..."
;; ;;
esac esac
done 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
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." # Function to perform uninstallation
uninstall_gitea() {
echo "Stopping Gitea service..."
sudo systemctl stop gitea
echo "Disabling Gitea service..."
sudo systemctl disable gitea
echo "Removing Gitea service file..."
sudo rm -rf /etc/systemd/system/gitea.service
echo "Backing up files..."
timestamp=$(date +"%Y%m%d_%H%M%S")
tar -cvzf "gitea_backup_${timestamp}.tar.gz" /var/lib/gitea/ /etc/gitea || { echo "Failed to backup files. Exiting."; exit 1; }
echo "Removing Gitea user and home directory..."
sudo userdel -r git || { echo "Failed to delete Gitea user. Exiting."; exit 1; }
echo "Removing Gitea binary..."
sudo rm -rf /usr/local/bin/gitea
echo "Cleaning up Gitea data and configuration..."
sudo rm -rf /var/lib/gitea/* /etc/gitea
echo "Removing firewall rule for port 3000..."
sudo ufw delete allow 3000
echo "Gitea has been uninstalled, and all files have been backed up."
}
# Main script
trap 'exit 130' INT
if prompt_confirmation; then
uninstall_gitea
else
echo "Gitea uninstallation aborted."
fi
exit 0

View File

@ -1,61 +1,95 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Trap Ctrl+C to exit gracefully
trap 'exit 130' INT trap 'exit 130' INT
while true
do # Function to prompt user for confirmation
prompt_confirmation() {
while true; do
read -r -p "Would you like to update Gitea? [Y/n] " input read -r -p "Would you like to update Gitea? [Y/n] " input
case $input in case $input in
[yY][eE][sS]|[yY]) [yY][eE][sS]|[yY])
break return 0
;; ;;
[nN][oO]|[nN]) [nN][oO]|[nN])
break return 1
;; ;;
*) *)
echo "That wasn't an option..." echo "That wasn't an option..."
;; ;;
esac esac
done done
set -b }
ping -c1 "github.com" &>"/dev/null"
ping -c1 "api.github.com" &>"/dev/null" # Function to check network connectivity
ping -c1 "dl.gitea.io" &>"/dev/null" check_connectivity() {
ping -c1 "raw.githubusercontent.com" &>"/dev/null" echo "Checking necessary domains for connectivity..."
if [[ "${?}" -ne 0 ]]; then for domain in "github.com" "api.github.com" "dl.gitea.io" "raw.githubusercontent.com"; do
echo "I am unable to access one of the necessary domains that are needed to continue this Install." if ! ping -c1 "$domain" &>"/dev/null"; then
elif [[ "${#args[@]}" -eq 0 ]]; then echo "Unable to access $domain. Update cannot proceed."
# Check if curl is installed exit 1
if [ ! -x /usr/bin/curl ] ; then fi
CURL_NOT_EXIST=1 done
apt install -y curl }
# Function to perform the update
update_gitea() {
echo "Updating Gitea..."
# Check if curl is installed
if ! command -v curl &>/dev/null; then
echo "Installing curl..."
sudo apt install -y curl || { echo "Failed to install curl. Exiting."; exit 1; }
fi
# Get latest Gitea version
VER=$(curl --silent "https://api.github.com/repos/go-gitea/gitea/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's|[v,]||g')
# Determine architecture
case "$(uname -m)" in
i386)
arch="386"
;;
x86_64)
arch="amd64"
;;
armv6l)
arch="arm-6"
;;
armv7l)
arch="arm-7"
;;
*)
echo "Unsupported architecture"
exit 1
;;
esac
# Download and install Gitea binary
gitea_url="https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-$arch"
echo "Downloading Gitea from: $gitea_url"
sudo curl -fsSL -o "/tmp/gitea" "$gitea_url"
sudo mv /tmp/gitea /usr/local/bin
sudo chmod +x /usr/local/bin/gitea
# Restart Gitea service
echo "Restarting Gitea service..."
sudo systemctl restart gitea
# Allow port through firewall
echo "Allowing port 3000 through firewall..."
sudo ufw allow 3000
echo "Gitea has been updated successfully!"
}
# Main script
if prompt_confirmation; then
check_connectivity
update_gitea
else else
CURL_NOT_EXIST=0 echo "Gitea update aborted."
fi
VER=$(curl --silent "https://api.github.com/repos/go-gitea/gitea/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's|[v,]||g' )
sudo systemctl stop gitea
if [ -n "$(uname -a | grep i386)" ]; then
curl -fsSL -o "/tmp/gitea" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-386"
fi fi
if [ -n "$(uname -a | grep x86_64)" ]; then exit 0
curl -fsSL -o "/tmp/gitea" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-amd64"
fi
if [ -n "$(uname -a | grep armv6l)" ]; then
curl -fsSL -o "/tmp/gitea" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-arm-6"
fi
if [ -n "$(uname -a | grep armv7l)" ]; then
curl -fsSL -o "/tmp/gitea" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-arm-7"
fi
sudo mv /tmp/gitea /usr/local/bin
sudo chmod +x /usr/local/bin/gitea
sudo chown -R git:git /var/lib/gitea
sudo chmod -R 750 /var/lib/gitea
sudo chown root:git /etc/gitea
sudo systemctl start gitea
sudo ufw allow 3000
echo -e "=================================================================="
echo "Gitea has been updated!!"
echo -e "=================================================================="
fi

View File

@ -1,23 +0,0 @@
#!/usr/bin/env bash
while true
do
read -r -p "Would you like to uninstall Gitlab? This is not reversible. [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
break
;;
[nN][oO]|[nN])
break
;;
*)
echo "That wasn't an option..."
;;
esac
done
sudo gitlab-ctl stop
sudo apt remove gitlab-ce -y
sudo apt update && apt upgrade -y
sudo ufw delete allow 443
sudo ufw delete allow 80

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
trap 'exit 130' INT
while true # Confirmation prompt
do while true; do
read -r -p "Would you like to install Go Language? [Y/n] " input read -r -p "Would you like to install Go Language? [Y/n] " input
case $input in case $input in
@ -9,7 +9,8 @@ do
break break
;; ;;
[nN][oO]|[nN]) [nN][oO]|[nN])
break echo "Go installation aborted."
exit 0
;; ;;
*) *)
echo "That wasn't an option..." echo "That wasn't an option..."
@ -18,27 +19,32 @@ do
done done
# Check if curl is installed # Check if curl is installed
if [ ! -x /usr/bin/curl ] ; then if ! command -v curl &>/dev/null; then
CURL_NOT_EXIST=1 echo "curl is required but not installed. Installing curl..."
apt install -y curl sudo apt update && sudo apt install -y curl
fi
# Get latest Go version
if [ "$(uname -m)" == "x86_64" ]; then
ARCH="amd64"
elif [ "$(uname -m)" == "armv6l" ]; then
ARCH="armv6l"
else else
CURL_NOT_EXIST=0 ARCH="386"
fi fi
apt remove golang -y
rm -rf /tmp/go/ GO_VERSION=$(curl -sSL https://golang.org/dl/?mode=json | grep -oP '"version":"\K[^"]+' | head -n1)
mkdir /tmp/go/ GO_URL="https://golang.org/dl/go$GO_VERSION.linux-$ARCH.tar.gz"
cd /tmp/go/
VER=$(curl --silent "https://go.dev/dl/?mode=json" | grep '"version":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's|[v,]||g' | head -1) # Install Go
if [ -n "$(uname -a | grep x86_64)" ]; then echo "Downloading and installing Go $GO_VERSION..."
curl -fsSL -o "/tmp/go/"$VER".linux-amd64.tar.gz" "https://go.dev/dl/"$VER".linux-amd64.tar.gz" curl -fsSL -o "/tmp/go.tar.gz" "$GO_URL"
fi sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf /tmp/go.tar.gz
if [ -n "$(uname -a | grep armv6l)" ]; then rm -f /tmp/go.tar.gz
curl -fsSL -o "/tmp/go/"$VER".linux-armv6l.tar.gz" "https://go.dev/dl/"$VER".linux-armv6l.tar.gz"
fi # Update PATH
if [ -n "$(uname -a | grep i386)" ]; then echo "Updating PATH..."
curl -fsSL -o "/tmp/go/"$VER".linux-386.tar.gz" "https://go.dev/dl/"$VER".linux-386.tar.gz"
fi
rm -rf /usr/local/go && tar -C /usr/local -xzf *.tar.gz
chmod +x /usr/local/go/bin/go
export PATH=$PATH:/usr/local/go/bin export PATH=$PATH:/usr/local/go/bin
cd ~ echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc # Add to .bashrc for persistent PATH
echo "Go $GO_VERSION has been successfully installed."

View File

@ -1,7 +1,10 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Trap INT signal to ensure clean exits
trap 'exit 130' INT trap 'exit 130' INT
while true
do # Confirmation prompt
while true; do
read -r -p "Would you like to install Hugo? [Y/n] " input read -r -p "Would you like to install Hugo? [Y/n] " input
case $input in case $input in
@ -9,37 +12,53 @@ do
break break
;; ;;
[nN][oO]|[nN]) [nN][oO]|[nN])
break echo "Hugo installation aborted."
exit 0
;; ;;
*) *)
echo "That wasn't an option..." echo "That wasn't an option..."
;; ;;
esac esac
done done
if [ ! -x /usr/bin/curl ] ; then
CURL_NOT_EXIST=1 # Check for dependencies and install if needed
apt install -y curl if ! command -v curl &>/dev/null; then
else echo "Installing curl..."
CURL_NOT_EXIST=0 sudo apt update && sudo apt install -y curl || { echo "Failed to install curl. Exiting."; exit 1; }
fi fi
apt remove golang -y
apt autoremove -y # Remove unused dependencies (optional)
wget -O goinstall.sh https://sop.wtf/sh/u/goinstall && bash goinstall.sh echo "Removing unused dependencies..."
rm -rf /tmp/hugo/ sudo apt autoremove -y
mkdir /tmp/hugo/
VER=$(curl --silent "https://api.github.com/repos/gohugoio/hugo/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's|[v,]||g' ) # Download Hugo
echo "Downloading Hugo..."
mkdir -p /tmp/hugo && cd /tmp/hugo || { echo "Failed to create directory. Exiting."; exit 1; }
VER=$(curl --silent "https://api.github.com/repos/gohugoio/hugo/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's|[v,]||g' ) || { echo "Failed to fetch Hugo version. Exiting."; exit 1; }
if [ -n "$(uname -a | grep x86_64)" ]; then if [ -n "$(uname -a | grep x86_64)" ]; then
curl -fsSL -o "/tmp/hugo/hugo_extended_"$VER"_linux-amd64.tar.gz" "https://github.com/gohugoio/hugo/releases/download/v$VER/hugo_"$VER"_linux-amd64.tar.gz" HUGO_URL="https://github.com/gohugoio/hugo/releases/download/v$VER/hugo_extended_${VER}_Linux-64bit.tar.gz"
elif [ -n "$(uname -a | grep armv6l)" ]; then
HUGO_URL="https://github.com/gohugoio/hugo/releases/download/v$VER/hugo_extended_${VER}_Linux-ARM64.tar.gz"
elif [ -n "$(uname -a | grep armv7l)" ]; then
HUGO_URL="https://github.com/gohugoio/hugo/releases/download/v$VER/hugo_${VER}_Linux-ARM.tar.gz"
echo "Hugo Extended is not supported on armv7l, installing standard Hugo..."
sudo apt update && sudo apt install -y snapd || { echo "Failed to install snapd. Exiting."; exit 1; }
sudo snap install dart-sass || { echo "Failed to install dart-sass via snap. Exiting."; exit 1; }
else
echo "Unsupported architecture. Exiting."
exit 1
fi fi
if [ -n "$(uname -a | grep armv6l)" ]; then # Download and install Hugo
curl -fsSL -o "/tmp/hugo/hugo_extended_"$VER"-arm64.tar.gz" "https://github.com/gohugoio/hugo/releases/download/v$VER/hugo_"$VER"-arm64.tar.gz" echo "Downloading and installing Hugo..."
fi wget -O hugo.tar.gz "$HUGO_URL" || { echo "Failed to download Hugo. Exiting."; exit 1; }
tar -xzf hugo.tar.gz || { echo "Failed to extract Hugo. Exiting."; exit 1; }
sudo mv hugo /usr/local/bin || { echo "Failed to move Hugo binary. Exiting."; exit 1; }
echo "Hugo successfully installed!"
if [ -n "$(uname -a | grep armv7l)" ]; then # Clean up
curl -fsSL -o "/tmp/hugo/hugo_extended_"$VER"-arm.tar.gz" "https://github.com/gohugoio/hugo/releases/download/v$VER/hugo_"$VER"-arm.tar.gz" rm -rf /tmp/hugo
fi
cd /tmp/hugo/
tar -xzf /tmp/hugo/*.tar.gz
sudo mv /tmp/hugo/hugo /usr/local/bin
cd ~ cd ~
exit 0

View File

@ -1,7 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
trap 'exit 130' INT trap 'exit 130' INT
while true
do # Confirmation prompt
while true; do
read -r -p "Would you like to install phpMyAdmin? [Y/n] " input read -r -p "Would you like to install phpMyAdmin? [Y/n] " input
case $input in case $input in
@ -9,74 +10,68 @@ do
break break
;; ;;
[nN][oO]|[nN]) [nN][oO]|[nN])
break echo "phpMyAdmin installation aborted."
exit 0
;; ;;
*) *)
echo "That wasn't an option..." echo "That wasn't an option..."
;; ;;
esac esac
done done
# Web server selection prompt
while [ "$go" != 'apache' ] && [ "$go" != 'nginx' ]; do while [ "$go" != 'apache' ] && [ "$go" != 'nginx' ]; do
read -p "Would you like to install using Nginx or Apache? (nginx/apache) " go read -p "Would you like to install using Nginx or Apache? (nginx/apache) " go
done done
# Update and upgrade system packages
apt update && apt upgrade -y
# Install dependencies and add repositories
apt-get install build-essential lsb-release software-properties-common -y
if [ "$go" == 'nginx' ]; then if [ "$go" == 'nginx' ]; then
sudo apt update && apt upgrade -y add-apt-repository --yes ppa:ondrej/nginx
sudo apt-get install build-essential lsb-release software-properties-common -y add-apt-repository --yes ppa:ondrej/php
sudo add-apt-repository --yes ppa:ondrej/nginx && sudo add-apt-repository --yes ppa:ondrej/php && sudo apt install php-fpm software-properties-common phpmyadmin php-mbstring php-zip php-gd php-json php-curl nginx-full php-mysql -y apt install nginx-full phpmyadmin php-{mbstring,zip,fpm,gd,json,curl,mysql} unzip -y
sudo systemctl stop nginx systemctl stop nginx
sudo wget -O /etc/nginx/conf.d/phpmyadmin.conf https://git.oldgate.org/Sophia/thelinuxlist/raw/branch/main/conf/pmanginx.conf wget -O /etc/nginx/conf.d/phpmyadmin.conf https://git.oldgate.org/Sophia/thelinuxlist/raw/branch/main/conf/pmanginx.conf
sudo systemctl enable nginx systemctl enable nginx
sudo systemctl start nginx systemctl start nginx
## Updating phpMyAdmin. elif [ "$go" == 'apache' ]; then
PMA_VER="5.2.1" add-apt-repository --yes ppa:ondrej/apache2
sudo rm -rf /usr/share/phpmyadmin.bak apt install apache2 libapache2-mod-php phpmyadmin php-{mbstring,zip,fpm,gd,json,curl,mysql} unzip -y
sudo mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak systemctl stop apache2
sudo mkdir /usr/share/phpmyadmin/ wget -O /etc/apache2/sites-enabled/phpmyadmin.conf https://git.oldgate.org/Sophia/thelinuxlist/raw/branch/main/conf/pmaapache.conf
sudo wget https://files.phpmyadmin.net/phpMyAdmin/$PMA_VER/phpMyAdmin-"$PMA_VER"-all-languages.tar.gz -P /usr/share/phpmyadmin/ systemctl restart php-fpm
sudo tar xzf /usr/share/phpmyadmin/phpMyAdmin-"$PMA_VER"-all-languages.tar.gz -C /usr/share/phpmyadmin/ systemctl reload apache2
sudo mv /usr/share/phpmyadmin/phpMyAdmin-"$PMA_VER"-all-languages/* /usr/share/phpmyadmin systemctl enable apache2
sudo mkdir /usr/share/phpmyadmin/tmp/ && chmod -R 777 /usr/share/phpmyadmin/tmp/ fi
sudo rm -rf /usr/share/phpmyadmin/phpMyAdmin-"$PMA_VER"-all-languages /usr/share/phpmyadmin/phpMyAdmin-"$PMA_VER"-all-languages.tar.gz
## Thanks https://stackoverflow.com/users/3266847/benjamin-w # Update phpMyAdmin
rm -rf /usr/share/phpmyadmin.bak
mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak
mkdir /usr/share/phpmyadmin/
wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz -P /usr/share/phpmyadmin/
tar -xzf /usr/share/phpmyadmin/*.tar.gz -C /usr/share/phpmyadmin/
mv /usr/share/phpmyadmin/phpMyAdmin-*-all-languages/* /usr/share/phpmyadmin
mkdir /usr/share/phpmyadmin/tmp/ && chmod -R 777 /usr/share/phpmyadmin/tmp/
# Set random Blowfish secret
randomBlowfishSecret=$(openssl rand -base64 22) randomBlowfishSecret=$(openssl rand -base64 22)
sudo sed -e "s|cfg\['blowfish_secret'\] = ''|cfg['blowfish_secret'] = '$randomBlowfishSecret'|" /usr/share/phpmyadmin/config.sample.inc.php > /usr/share/phpmyadmin/config.inc.php sed -e "s|cfg\['blowfish_secret'\] = ''|cfg['blowfish_secret'] = '$randomBlowfishSecret'|" /usr/share/phpmyadmin/config.sample.inc.php > /usr/share/phpmyadmin/config.inc.php
sudo systemctl restart nginx
sudo ufw allow 8080 # Restart web server and allow connections
if [ "$go" == 'nginx' ]; then
systemctl restart nginx
elif [ "$go" == 'apache' ]; then
systemctl restart apache2
fi
ufw allow 8080
# Display information
echo -e "==================================================================" 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 ) 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) internalip=$(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 "phpMyAdmin Should be available at http://${intenalip}:8080" echo "phpMyAdmin should be available at http://${internalip}:8080"
echo "Or If you are using a VPS at http://${publicipaddress}:8080" echo "Or if you are using a VPS, at http://${publicipaddress}:8080"
echo -e "==================================================================" echo -e "=================================================================="
fi
if [ "$go" == 'apache' ]; then
sudo apt update && apt upgrade -y
sudo apt-get install build-essential lsb-release software-properties-common -y
sudo add-apt-repository --yes ppa:ondrej/apache2 && apt install apache2 libapache2-mod-php php-fpm software-properties-common phpmyadmin php-mbstring php-zip php-gd php-json php-curl php-mysql -y
sudo systemctl stop apache2
sudo wget -O /etc/apache2/sites-enabled/phpmyadmin.conf https://git.oldgate.org/Sophia/thelinuxlist/raw/branch/main/conf/pmaapache.conf
sudo systemctl restart php-fpm
sudo systemctl reload apache2
sudo systemctl enable apache2
## Updating phpMyAdmin.
PMA_VER="5.2.1"
sudo rm -rf /usr/share/phpmyadmin.bak
sudo mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak
sudo mkdir /usr/share/phpmyadmin/
sudo wget https://files.phpmyadmin.net/phpMyAdmin/$PMA_VER/phpMyAdmin-"$PMA_VER"-all-languages.tar.gz -P /usr/share/phpmyadmin/
sudo tar xzf /usr/share/phpmyadmin/phpMyAdmin-"$PMA_VER"-all-languages.tar.gz -C /usr/share/phpmyadmin/
sudo mv /usr/share/phpmyadmin/phpMyAdmin-"$PMA_VER"-all-languages/* /usr/share/phpmyadmin
sudo mkdir /usr/share/phpmyadmin/tmp/ && chmod -R 777 /usr/share/phpmyadmin/tmp/
sudo rm -rf /usr/share/phpmyadmin/phpMyAdmin-"$PMA_VER"-all-languages /usr/share/phpmyadmin/phpMyAdmin-"$PMA_VER"-all-languages.tar.gz
## Thanks https://stackoverflow.com/users/3266847/benjamin-w
randomBlowfishSecret=$(openssl rand -base64 22)
sudo sed -e "s|cfg\['blowfish_secret'\] = ''|cfg['blowfish_secret'] = '$randomBlowfishSecret'|" /usr/share/phpmyadmin/config.sample.inc.php > /usr/share/phpmyadmin/config.inc.php
sudo systemctl restart apache2
sudo ufw allow 8080
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 "phpMyAdmin Should be available at http://${intenalip}:8080"
echo "Or If you are using a VPS at http://${publicipaddress}:8080"
echo -e "=================================================================="
fi

View File

@ -1,7 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
trap 'exit 130' INT trap 'exit 130' INT
while true
do # Confirmation prompt
while true; do
read -r -p "Would you like to uninstall phpMyAdmin? [Y/n] " input read -r -p "Would you like to uninstall phpMyAdmin? [Y/n] " input
case $input in case $input in
@ -9,40 +10,31 @@ do
break break
;; ;;
[nN][oO]|[nN]) [nN][oO]|[nN])
break echo "phpMyAdmin uninstallation aborted."
exit 0
;; ;;
*) *)
echo "That wasn't an option..." echo "That wasn't an option..."
;; ;;
esac esac
done done
sudo apt remove phpmyadmin -y
sudo apt-get autoremove -y
sudo rm -rf /usr/share/phpmyadmin/
sudo rm -rf /etc/apache2/sites-enabled/phpmyadmin.conf
sudo systemctl restart apache2
while true
do
read -r -p "Would you like to also uninstall apache2? This is not reversible. [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
break
;;
[nN][oO]|[nN])
break
;;
*)
echo "That wasn't an option..."
;;
esac
done
sudo systemctl stop apache2
sudo apt remove apache2 -y
sudo apt-get autoremove -y
# Uninstallation
if [ -n "$(dpkg --get-selections | grep apache)" ]; then
sudo apt remove phpmyadmin -y
sudo apt-get autoremove -y
sudo rm -rf /usr/share/phpmyadmin/
sudo rm -rf /etc/apache2/sites-enabled/phpmyadmin.conf
sudo systemctl restart apache2
elif [ -n "$(dpkg --get-selections | grep nginx)" ]; then
sudo apt remove phpmyadmin -y
sudo apt-get autoremove -y
sudo rm -rf /usr/share/phpmyadmin/
sudo rm -rf /etc/nginx/conf.d/phpmyadmin.conf
sudo systemctl restart nginx
else
echo "Neither Apache nor Nginx is installed. Cannot uninstall phpMyAdmin."
exit 1
fi
echo "phpMyAdmin has been successfully uninstalled."

View File

@ -1,7 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
trap 'exit 130' INT trap 'exit 130' INT
while true
do # Confirmation prompt
while true; do
read -r -p "Would you like to Update phpMyAdmin? [Y/n] " input read -r -p "Would you like to Update phpMyAdmin? [Y/n] " input
case $input in case $input in
@ -9,41 +10,37 @@ do
break break
;; ;;
[nN][oO]|[nN]) [nN][oO]|[nN])
break echo "phpMyAdmin update aborted."
exit 0
;; ;;
*) *)
echo "That wasn't an option..." echo "That wasn't an option..."
;; ;;
esac esac
done done
if [ ! -x /usr/bin/curl ] ; then
CURL_NOT_EXIST=1 # Dependency check
apt install -y curl if ! command -v curl &>/dev/null; then
else echo "Installing curl..."
CURL_NOT_EXIST=0 sudo apt install -y curl
fi fi
sudo apt update && apt upgrade -y
# Update process
echo "Updating phpMyAdmin..."
sudo apt update && sudo apt upgrade -y
sudo rm -rf /usr/share/phpmyadmin.bak sudo rm -rf /usr/share/phpmyadmin.bak
sudo mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak sudo mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak
sudo mkdir /usr/share/phpmyadmin/ sudo mkdir /usr/share/phpmyadmin/
sudo curl -fsSL -o "/usr/share/phpmyadmin/" https://files.phpmyadmin.net/phpMyAdmin/$PMA_VER/phpMyAdmin-"$PMA_VER"-all-languages.tar.gz sudo wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz -P /usr/share/phpmyadmin/
sudo tar xzf /usr/share/phpmyadmin/phpMyAdmin-"$PMA_VER"-all-languages.tar.gz -C /usr/share/phpmyadmin/ sudo tar -xzf /usr/share/phpmyadmin/*.tar.gz -C /usr/share/phpmyadmin/
sudo mv /usr/share/phpmyadmin/phpMyAdmin-"$PMA_VER"-all-languages/* /usr/share/phpmyadmin sudo mv /usr/share/phpmyadmin/phpMyAdmin-*-all-languages/* /usr/share/phpmyadmin
sudo mkdir /usr/share/phpmyadmin/tmp/ && chmod -R 777 /usr/share/phpmyadmin/tmp/ sudo mkdir /usr/share/phpmyadmin/tmp/ && sudo chmod -R 777 /usr/share/phpmyadmin/tmp/
sudo rm -rf /usr/share/phpmyadmin/phpMyAdmin-"$PMA_VER"-all-languages /usr/share/phpmyadmin/phpMyAdmin-"$PMA_VER"-all-languages.tar.gz
## Thanks https://stackoverflow.com/users/3266847/benjamin-w
randomBlowfishSecret=$(openssl rand -base64 22) randomBlowfishSecret=$(openssl rand -base64 22)
sudo sed -e "s|cfg\['blowfish_secret'\] = ''|cfg['blowfish_secret'] = '$randomBlowfishSecret'|" /usr/share/phpmyadmin/config.sample.inc.php > /usr/share/phpmyadmin/config.inc.php sudo sed -i "s|cfg\['blowfish_secret'\] = ''|cfg['blowfish_secret'] = '$randomBlowfishSecret'|" /usr/share/phpmyadmin/config.sample.inc.php
sudo systemctl restart apache2 sudo mv /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php
sudo systemctl restart nginx sudo systemctl restart apache2 nginx
# Completion message
echo -e "==================================================================" echo -e "=================================================================="
echo "phpMyAdmin has been updated!" echo "phpMyAdmin has been updated!"
echo -e "==================================================================" echo -e "=================================================================="

View File

@ -1,78 +0,0 @@
#!/bin/bash
case $1 in
(install gitea)
wget -O giteainstall.sh https://sop.wtf/sh/giteainstall && bash giteainstall.sh
;;
(remove gitea)
wget -O gitearemove.sh https://sop.wtf/sh/gitearemove && bash gitearemove.sh
;;
(update gitea)
wget -O giteaupdate.sh https://sop.wtf/sh/giteaupdate && bash giteaupdate.sh
;;
(install hugo)
wget -O hugoinstall.sh https://sop.wtf/sh/hugoinstall && bash hugoinstall.sh
;;
(update hugo)
wget -O hugoinstall.sh https://sop.wtf/sh/hugoinstall && bash hugoinstall.sh
;;
(remove hugo)
rm -rf /usr/local/bin/hugo
;;
(install go)
wget -O goinstall.sh https://sop.wtf/sh/goinstall && bash goinstall.sh
;;
(update go)
wget -O goinstall.sh https://sop.wtf/sh/goinstall && bash goinstall.sh
;;
(remove go)
rm -rf /usr/local/go
;;
(install golang)
wget -O goinstall.sh https://sop.wtf/sh/goinstall && bash goinstall.sh
;;
(update golang)
wget -O goinstall.sh https://sop.wtf/sh/goinstall && bash goinstall.sh
;;
(remove golang)
rm -rf /usr/local/go
;;
(install mariadb)
wget -O mariadbinstall.sh https://sop.wtf/sh/mariadbinstall && bash mariadbinstall.sh
;;
(remove mariadb)
sudo apt remove mariadb-server mariadb-client -y && apt autoremove -y
;;
(install phpmyadmin)
wget -O pmainstall.sh https://sop.wtf/sh/pmainstall && bash pmainstall.sh
;;
(update phpmyadmin)
wget -O pmauninstall.sh https://sop.wtf/sh/pmauninstall && bash pmauninstall.sh
;;
(remove phpmyadmin)
wget -O pmauninstall.sh https://sop.wtf/sh/pmauninstall && bash pmauninstall.sh
;;
(install mongodb)
wget -O mongodbinstall.sh https://sop.wtf/sh/mongodbinstall && bash mongodbinstall.sh
;;
(remove mongodb)
sudo apt remove mongodb-org libssl1.1 -y && sudo apt autoremove
;;
(remove gogs)
wget -O gogsuninstall.sh https://sop.wtf/sh/gogsuninstall && bash gogsuninstall.sh
;;
(install gogs)
wget -O gogsinstall.sh https://sop.wtf/sh/gogsinstall && bash gogsinstall.sh
;;
(install wordpress)
wget -O wpinstall.sh https://sop.wtf/sh/wpinstall && bash wpinstall.sh
;;
(install wp)
wget -O wpinstall.sh https://sop.wtf/sh/wpinstall && bash wpinstall.sh
;;
(install fail2ban)
wget -O fail2baninstall.sh https://sop.wtf/sh/fail2baninstall && bash fail2baninstall.sh
;;
(install f2b)
wget -O fail2baninstall.sh https://sop.wtf/sh/fail2baninstall && bash fail2baninstall.sh
;;
esac

42
scripts/traefikinstall.sh Normal file
View File

@ -0,0 +1,42 @@
#!/usr/bin/env bash
trap 'exit 130' INT
while true
do
read -r -p "Would you like to install traefik? [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
break
;;
[nN][oO]|[nN])
break
;;
*)
echo "That wasn't an option..."
;;
esac
done
if [ ! -x /usr/bin/curl ] ; then
CURL_NOT_EXIST=1
apt install -y curl
else
CURL_NOT_EXIST=0
fi
rm -rf /tmp/traefik/
mkdir /tmp/traefik/
VER=$(curl --silent "https://api.github.com/repos/traefik/traefik/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's|[v,]||g' )
if [ -n "$(uname -a | grep x86_64)" ]; then
curl -fsSL -o "/tmp/traefik/traefik_"$VER"_linux_amd64.tar.gz" "https://github.com/traefik/traefik/releases/download/v$VER/traefik_"$VER"_linux_amd64.tar.gz"
fi
if [ -n "$(uname -a | grep armv6l)" ]; then
curl -fsSL -o "/tmp/traefik/traefik_"$VER"_linux_armv6.tar.gz" "https://github.com/traefik/traefik/releases/download/v$VER/traefik_"$VER"_linux_armv6.tar.gz"
fi
if [ -n "$(uname -a | grep armv7l)" ]; then
curl -fsSL -o "/tmp/traefik/traefik_"$VER"_linux_arm64.tar.gz" "https://github.com/traefik/traefik/releases/download/v$VER/traefik_"$VER"_linux_arm64.tar.gz"
fi
cd /tmp/traefik/
tar -xzf /tmp/traefik/*.tar.gz
sudo mv /tmp/traefik/traefik /usr/local/bin
cd ~

View File

@ -1,57 +1,102 @@
#!/usr/bin/env bash #!/usr/bin/env bash
trap 'exit 130' INT trap 'exit 130' INT
set -b
ping -c1 "github.com" &>"/dev/null"
ping -c1 "api.github.com" &>"/dev/null"
ping -c1 "dl.gitea.io" &>"/dev/null"
ping -c1 "raw.githubusercontent.com" &>"/dev/null"
if [[ "${?}" -ne 0 ]]; then
echo "I am unable to access one of the necessary domains that are needed to continue this Install."
elif [[ "${#args[@]}" -eq 0 ]]; then
# Check if curl is installed
if [ ! -x /usr/bin/curl ] ; then
CURL_NOT_EXIST=1
apt install -y curl
else
CURL_NOT_EXIST=0
fi
VER=$(curl --silent "https://api.github.com/repos/go-gitea/gitea/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's|[v,]||g' )
sudo systemctl stop gitea
sudo apt-get install git -y
sudo adduser --system --shell /bin/bash --gecos 'Git Version Control' --group --disabled-password --home /home/git git
if [ -n "$(uname -a | grep i386)" ]; then
curl -fsSL -o "/tmp/gitea" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-386"
fi
if [ -n "$(uname -a | grep x86_64)" ]; then # Function to check if required domains are accessible
curl -fsSL -o "/tmp/gitea" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-amd64" check_domains() {
fi echo "Checking necessary domains..."
for domain in "github.com" "api.github.com" "dl.gitea.io" "raw.githubusercontent.com"; do
if ! ping -c1 "$domain" &>"/dev/null"; then
echo "Unable to access $domain. Installation cannot proceed."
exit 1
fi
done
}
if [ -n "$(uname -a | grep armv6l)" ]; then # Function to install Gitea
curl -fsSL -o "/tmp/gitea" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-arm-6" install_gitea() {
fi echo "Installing Gitea..."
if [ -n "$(uname -a | grep armv7l)" ]; then # Check if curl is installed
curl -fsSL -o "/tmp/gitea" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-arm-7" if ! command -v curl &>/dev/null; then
fi echo "Installing curl..."
sudo apt install -y curl || { echo "Failed to install curl. Exiting."; exit 1; }
fi
sudo mv /tmp/gitea /usr/local/bin # Get latest Gitea version
sudo chmod +x /usr/local/bin/gitea VER=$(curl --silent "https://api.github.com/repos/go-gitea/gitea/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's|[v,]||g')
sudo mkdir -p /var/lib/gitea/{custom,data,log}
sudo chown -R git:git /var/lib/gitea # Install git
sudo chmod -R 750 /var/lib/gitea echo "Installing git..."
sudo mkdir /etc/gitea sudo apt-get install git -y || { echo "Failed to install git. Exiting."; exit 1; }
sudo chown root:git /etc/gitea
sudo chmod 770 /etc/gitea # Create git user
curl -fsSL -o /etc/systemd/system/gitea.service https://raw.githubusercontent.com/go-gitea/gitea/master/contrib/systemd/gitea.service echo "Creating git user..."
sudo systemctl daemon-reload sudo adduser --system --shell /bin/bash --gecos 'Git Version Control' --group --disabled-password --home /home/git git
sudo systemctl enable --now gitea
sudo systemctl start gitea # Download and install Gitea binary
sudo ufw allow 3000 echo "Downloading Gitea binary..."
echo -e "==================================================================" case "$(uname -m)" in
publicipaddress=$(curl -sS --connect-timeout 10 -m 60 https://ipv4.icanhazip.com/ || curl -sS --connect-timeout 10 -m 60 https://api.ipify.org ) i386)
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) arch="386"
echo "Gitea Should be available at http://${intenalip}:3000" ;;
echo "Or If you are using a VPS at http://${publicipaddress}:3000" x86_64)
echo -e "==================================================================" arch="amd64"
fi ;;
armv6l)
arch="arm-6"
;;
armv7l)
arch="arm-7"
;;
*)
echo "Unsupported architecture"
exit 1
;;
esac
gitea_url="https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-$arch"
echo "Downloading Gitea from: $gitea_url"
sudo curl -fsSL -o "/tmp/gitea" "$gitea_url"
sudo mv /tmp/gitea /usr/local/bin
sudo chmod +x /usr/local/bin/gitea
# Create necessary directories and files
echo "Setting up directories and files..."
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 -p /etc/gitea
sudo chown root:git /etc/gitea
sudo chmod 770 /etc/gitea
# Configure systemd service
echo "Configuring systemd service..."
sudo curl -fsSL -o /etc/systemd/system/gitea.service https://raw.githubusercontent.com/go-gitea/gitea/master/contrib/systemd/gitea.service
sudo systemctl daemon-reload
sudo systemctl enable --now gitea
# Allow port through firewall
echo "Allowing port 3000 through firewall..."
sudo ufw allow 3000
# Get public and internal IP addresses
public_ip=$(curl -sS --connect-timeout 10 -m 60 https://ipv4.icanhazip.com/ || curl -sS --connect-timeout 10 -m 60 https://api.ipify.org )
internal_ip=$(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)
# Output installation information
echo -e "=================================================================="
echo "Gitea has been installed successfully!"
echo "The Gitea web interface should be available at:"
echo "http://$internal_ip:3000"
echo "Or, if you are using a VPS, at:"
echo "http://$public_ip:3000"
echo "=================================================================="
}
# Main script
# Automate installation by assuming yes to the prompt
check_domains
install_gitea
exit 0

View File

@ -1,16 +1,39 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Function to perform uninstallation
uninstall_gitea() {
echo "Stopping Gitea service..."
sudo systemctl stop gitea
echo "Disabling Gitea service..."
sudo systemctl disable gitea
echo "Removing Gitea service file..."
sudo rm -rf /etc/systemd/system/gitea.service
echo "Backing up files..."
timestamp=$(date +"%Y%m%d_%H%M%S")
tar -cvzf "gitea_backup_${timestamp}.tar.gz" /var/lib/gitea/ /etc/gitea || { echo "Failed to backup files. Exiting."; exit 1; }
echo "Removing Gitea user and home directory..."
sudo userdel -r git || { echo "Failed to delete Gitea user. Exiting."; exit 1; }
echo "Removing Gitea binary..."
sudo rm -rf /usr/local/bin/gitea
echo "Cleaning up Gitea data and configuration..."
sudo rm -rf /var/lib/gitea/* /etc/gitea
echo "Removing firewall rule for port 3000..."
sudo ufw delete allow 3000
echo "Gitea has been uninstalled, and all files have been backed up."
}
# Main script
trap 'exit 130' INT trap 'exit 130' INT
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
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." # Automate confirmation by assuming yes to the prompt
uninstall_gitea
exit 0

View File

@ -1,45 +1,70 @@
#!/usr/bin/env bash #!/usr/bin/env bash
trap 'exit 130' INT
set -b
ping -c1 "github.com" &>"/dev/null"
ping -c1 "api.github.com" &>"/dev/null"
ping -c1 "dl.gitea.io" &>"/dev/null"
ping -c1 "raw.githubusercontent.com" &>"/dev/null"
if [[ "${?}" -ne 0 ]]; then
echo "I am unable to access one of the necessary domains that are needed to continue this Install."
elif [[ "${#args[@]}" -eq 0 ]]; then
# Check if curl is installed
if [ ! -x /usr/bin/curl ] ; then
CURL_NOT_EXIST=1
apt install -y curl
else
CURL_NOT_EXIST=0
fi
VER=$(curl --silent "https://api.github.com/repos/go-gitea/gitea/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's|[v,]||g' )
sudo systemctl stop gitea
if [ -n "$(uname -a | grep i386)" ]; then
curl -fsSL -o "/tmp/gitea" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-386"
fi
if [ -n "$(uname -a | grep x86_64)" ]; then # Function to check network connectivity
curl -fsSL -o "/tmp/gitea" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-amd64" check_connectivity() {
fi echo "Checking necessary domains for connectivity..."
for domain in "github.com" "api.github.com" "dl.gitea.io" "raw.githubusercontent.com"; do
if ! ping -c1 "$domain" &>"/dev/null"; then
echo "Unable to access $domain. Update cannot proceed."
exit 1
fi
done
}
if [ -n "$(uname -a | grep armv6l)" ]; then # Function to perform the update
curl -fsSL -o "/tmp/gitea" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-arm-6" update_gitea() {
fi echo "Updating Gitea..."
if [ -n "$(uname -a | grep armv7l)" ]; then # Check if curl is installed
curl -fsSL -o "/tmp/gitea" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-arm-7" if ! command -v curl &>/dev/null; then
fi echo "Installing curl..."
sudo mv /tmp/gitea /usr/local/bin sudo apt install -y curl || { echo "Failed to install curl. Exiting."; exit 1; }
sudo chmod +x /usr/local/bin/gitea fi
sudo chown -R git:git /var/lib/gitea
sudo chmod -R 750 /var/lib/gitea # Get latest Gitea version
sudo chown root:git /etc/gitea VER=$(curl --silent "https://api.github.com/repos/go-gitea/gitea/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's|[v,]||g')
sudo systemctl start gitea
sudo ufw allow 3000 # Determine architecture
echo -e "==================================================================" case "$(uname -m)" in
echo "Gitea has been updated!!" i386)
echo -e "==================================================================" arch="386"
fi ;;
x86_64)
arch="amd64"
;;
armv6l)
arch="arm-6"
;;
armv7l)
arch="arm-7"
;;
*)
echo "Unsupported architecture"
exit 1
;;
esac
# Download and install Gitea binary
gitea_url="https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-$arch"
echo "Downloading Gitea from: $gitea_url"
sudo curl -fsSL -o "/tmp/gitea" "$gitea_url"
sudo mv /tmp/gitea /usr/local/bin
sudo chmod +x /usr/local/bin/gitea
# Restart Gitea service
echo "Restarting Gitea service..."
sudo systemctl restart gitea
# Allow port through firewall
echo "Allowing port 3000 through firewall..."
sudo ufw allow 3000
echo "Gitea has been updated successfully!"
}
# Main script
# Automate confirmation by assuming yes to the prompt
check_connectivity
update_gitea
exit 0

View File

@ -1,6 +0,0 @@
#!/usr/bin/env bash
sudo gitlab-ctl stop
sudo apt remove gitlab-ce -y
sudo apt update && apt upgrade -y
sudo ufw delete allow 443
sudo ufw delete allow 80

View File

@ -1,27 +1,36 @@
#!/usr/bin/env bash #!/usr/bin/env bash
trap 'exit 130' INT
# Check if curl is installed # Check if curl is installed
if [ ! -x /usr/bin/curl ] ; then if ! command -v curl &>/dev/null; then
CURL_NOT_EXIST=1 echo "curl is required but not installed. Installing curl..."
apt install -y curl sudo apt update && sudo apt install -y curl || {
else echo "Failed to install curl. Exiting."
CURL_NOT_EXIST=0 exit 1
}
fi fi
apt remove golang -y
rm -rf /tmp/go/ # Get latest Go version
mkdir /tmp/go/ ARCH=$(uname -m)
cd /tmp/go/ case $ARCH in
VER=$(curl --silent "https://go.dev/dl/?mode=json" | grep '"version":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's|[v,]||g' | head -1) "x86_64") ARCH="amd64" ;;
if [ -n "$(uname -a | grep x86_64)" ]; then "armv6l") ARCH="armv6l" ;;
curl -fsSL -o "/tmp/go/"$VER".linux-amd64.tar.gz" "https://go.dev/dl/"$VER".linux-amd64.tar.gz" *) ARCH="386" ;;
fi esac
if [ -n "$(uname -a | grep armv6l)" ]; then
curl -fsSL -o "/tmp/go/"$VER".linux-armv6l.tar.gz" "https://go.dev/dl/"$VER".linux-armv6l.tar.gz" GO_VERSION=$(curl -sSL https://golang.org/dl/?mode=json | grep -oP '"version":"\K[^"]+' | head -n1)
fi GO_URL="https://golang.org/dl/go$GO_VERSION.linux-$ARCH.tar.gz"
if [ -n "$(uname -a | grep i386)" ]; then
curl -fsSL -o "/tmp/go/"$VER".linux-386.tar.gz" "https://go.dev/dl/"$VER".linux-386.tar.gz" # Install Go
fi echo "Downloading and installing Go $GO_VERSION..."
rm -rf /usr/local/go && tar -C /usr/local -xzf *.tar.gz sudo rm -rf /usr/local/go
chmod +x /usr/local/go/bin/go sudo curl -fsSL "$GO_URL" | sudo tar -C /usr/local -xz || {
export PATH=$PATH:/usr/local/go/bin echo "Failed to download and install Go. Exiting."
cd ~ exit 1
}
# Update PATH
echo "Updating PATH..."
echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee -a /etc/profile.d/go.sh >/dev/null
source /etc/profile.d/go.sh
echo "Go $GO_VERSION has been successfully installed."

View File

@ -1,30 +1,46 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Trap INT signal to ensure clean exits
trap 'exit 130' INT trap 'exit 130' INT
if [ ! -x /usr/bin/curl ] ; then
CURL_NOT_EXIST=1 # Check for dependencies and install if needed
apt install -y curl if ! command -v curl &>/dev/null; then
else echo "Installing curl..."
CURL_NOT_EXIST=0 sudo apt update && sudo apt install -y curl || { echo "Failed to install curl. Exiting."; exit 1; }
fi fi
apt remove golang -y
apt autoremove -y # Remove unused dependencies (optional)
wget -O goinstall.sh https://sop.wtf/sh/u/goinstall && bash goinstall.sh echo "Removing unused dependencies..."
rm -rf /tmp/hugo/ sudo apt autoremove -y
mkdir /tmp/hugo/
VER=$(curl --silent "https://api.github.com/repos/gohugoio/hugo/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's|[v,]||g' ) # Download Hugo
echo "Downloading Hugo..."
mkdir -p /tmp/hugo && cd /tmp/hugo || { echo "Failed to create directory. Exiting."; exit 1; }
VER=$(curl --silent "https://api.github.com/repos/gohugoio/hugo/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's|[v,]||g' ) || { echo "Failed to fetch Hugo version. Exiting."; exit 1; }
if [ -n "$(uname -a | grep x86_64)" ]; then if [ -n "$(uname -a | grep x86_64)" ]; then
curl -fsSL -o "/tmp/hugo/hugo_extended_"$VER"_linux-amd64.tar.gz" "https://github.com/gohugoio/hugo/releases/download/v$VER/hugo_extended_"$VER"_linux-amd64.tar.gz" HUGO_URL="https://github.com/gohugoio/hugo/releases/download/v$VER/hugo_extended_${VER}_Linux-64bit.tar.gz"
elif [ -n "$(uname -a | grep armv6l)" ]; then
HUGO_URL="https://github.com/gohugoio/hugo/releases/download/v$VER/hugo_extended_${VER}_Linux-ARM64.tar.gz"
elif [ -n "$(uname -a | grep armv7l)" ]; then
HUGO_URL="https://github.com/gohugoio/hugo/releases/download/v$VER/hugo_${VER}_Linux-ARM.tar.gz"
echo "Hugo Extended is not supported on armv7l, installing standard Hugo..."
sudo apt update && sudo apt install -y snapd || { echo "Failed to install snapd. Exiting."; exit 1; }
sudo snap install dart-sass || { echo "Failed to install dart-sass via snap. Exiting."; exit 1; }
else
echo "Unsupported architecture. Exiting."
exit 1
fi fi
if [ -n "$(uname -a | grep armv6l)" ]; then # Download and install Hugo
curl -fsSL -o "/tmp/hugo/hugo_extended_"$VER"-arm64.tar.gz" "https://github.com/gohugoio/hugo/releases/download/v$VER/hugo_extended_"$VER"-arm64.tar.gz" echo "Downloading and installing Hugo..."
fi wget -O hugo.tar.gz "$HUGO_URL" || { echo "Failed to download Hugo. Exiting."; exit 1; }
tar -xzf hugo.tar.gz || { echo "Failed to extract Hugo. Exiting."; exit 1; }
sudo mv hugo /usr/local/bin || { echo "Failed to move Hugo binary. Exiting."; exit 1; }
echo "Hugo successfully installed!"
if [ -n "$(uname -a | grep armv7l)" ]; then # Clean up
curl -fsSL -o "/tmp/hugo/hugo_"$VER"-arm.tar.gz" "https://github.com/gohugoio/hugo/releases/download/v$VER/hugo_extended_"$VER"-arm.tar.gz" rm -rf /tmp/hugo
echo "Hugo Extended is not supported on armv7l, Installing Hugo standard"
fi
cd /tmp/hugo/
tar -xzf /tmp/hugo/*.tar.gz
sudo mv /tmp/hugo/hugo /usr/local/bin
cd ~ cd ~
exit 0

View File

@ -0,0 +1,26 @@
#!/usr/bin/env bash
trap 'exit 130' INT
if [ ! -x /usr/bin/curl ] ; then
CURL_NOT_EXIST=1
apt install -y curl
else
CURL_NOT_EXIST=0
fi
rm -rf /tmp/traefik/
mkdir /tmp/traefik/
VER=$(curl --silent "https://api.github.com/repos/traefik/traefik/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's|[v,]||g' )
if [ -n "$(uname -a | grep x86_64)" ]; then
curl -fsSL -o "/tmp/traefik/traefik_"$VER"_linux_amd64.tar.gz" "https://github.com/traefik/traefik/releases/download/v$VER/traefik_"$VER"_linux_amd64.tar.gz"
fi
if [ -n "$(uname -a | grep armv6l)" ]; then
curl -fsSL -o "/tmp/traefik/traefik_"$VER"_linux_armv6.tar.gz" "https://github.com/traefik/traefik/releases/download/v$VER/traefik_"$VER"_linux_armv6.tar.gz"
fi
if [ -n "$(uname -a | grep armv7l)" ]; then
curl -fsSL -o "/tmp/traefik/traefik_"$VER"_linux_arm64.tar.gz" "https://github.com/traefik/traefik/releases/download/v$VER/traefik_"$VER"_linux_arm64.tar.gz"
fi
cd /tmp/traefik/
tar -xzf /tmp/traefik/*.tar.gz
sudo mv /tmp/traefik/traefik /usr/local/bin
cd ~