1 Commits
main ... 2.0

Author SHA1 Message Date
5af691b06c First push of single script testing 2023-08-26 16:46:31 -07:00
19 changed files with 638 additions and 975 deletions

143
README.md
View File

@ -1,144 +1,9 @@
**Discontinuation Notice: The Linux List**
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 # The Linux List
### ⚠️ Super Ultra Untested ⚠️
## `~Script Installs~` ## `~Script Installs~`
### Tested scrips ✔️ ## Now Just One script!
### Broken Scripts ### `wget -O scripts.sh https://git.oldgate.org/Sophia/thelinuxlist/raw/branch/2.0/scripts/scripts.sh && bash scripts.sh`
### 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,124 +1,73 @@
#!/usr/bin/env bash #!/usr/bin/env bash
trap 'exit 130' INT trap 'exit 130' INT
while true
# Function to prompt user for installation do
prompt_installation() { read -r -p "Would you like to install Gitea? [Y/n] " input
while true; do
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])
return 0 break
;; ;;
[nN][oO]|[nN]) [nN][oO]|[nN])
return 1 break
;; ;;
*) *)
echo "That wasn't an option..." echo "That wasn't an option..."
;; ;;
esac esac
done done
} set -b
ping -c1 "github.com" &>"/dev/null"
# Function to check if required domains are accessible ping -c1 "api.github.com" &>"/dev/null"
check_domains() { ping -c1 "dl.gitea.io" &>"/dev/null"
echo "Checking necessary domains..." ping -c1 "raw.githubusercontent.com" &>"/dev/null"
for domain in "github.com" "api.github.com" "dl.gitea.io" "raw.githubusercontent.com"; do if [[ "${?}" -ne 0 ]]; then
if ! ping -c1 "$domain" &>"/dev/null"; then echo "I am unable to access one of the necessary domains that are needed to continue this Install."
echo "Unable to access $domain. Installation cannot proceed." elif [[ "${#args[@]}" -eq 0 ]]; then
exit 1 # Check if curl is installed
fi if [ ! -x /usr/bin/curl ] ; then
done CURL_NOT_EXIST=1
} 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
echo "Gitea installation aborted." 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 fi
exit 0 if [ -n "$(uname -a | grep x86_64)" ]; then
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,61 +1,32 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Function to prompt user for confirmation
prompt_confirmation() {
while true; do
read -r -p "Would you like to uninstall Gitea? This is not reversible. [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
return 0
;;
[nN][oO]|[nN])
return 1
;;
*)
echo "That wasn't an option..."
;;
esac
done
}
# 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
while true
do
read -r -p "Would you like to uninstall Gitea? 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 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
if prompt_confirmation; then echo "Gitea has been uninstalled, and all files have are backed up in gitea.tar.gz, you can delete it at your discretion."
uninstall_gitea
else
echo "Gitea uninstallation aborted."
fi
exit 0

View File

@ -1,95 +1,61 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Trap Ctrl+C to exit gracefully
trap 'exit 130' INT trap 'exit 130' INT
while true
# Function to prompt user for confirmation do
prompt_confirmation() { read -r -p "Would you like to update Gitea? [Y/n] " input
while true; do
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])
return 0 break
;; ;;
[nN][oO]|[nN]) [nN][oO]|[nN])
return 1 break
;; ;;
*) *)
echo "That wasn't an option..." echo "That wasn't an option..."
;; ;;
esac esac
done done
} set -b
ping -c1 "github.com" &>"/dev/null"
# Function to check network connectivity ping -c1 "api.github.com" &>"/dev/null"
check_connectivity() { ping -c1 "dl.gitea.io" &>"/dev/null"
echo "Checking necessary domains for connectivity..." ping -c1 "raw.githubusercontent.com" &>"/dev/null"
for domain in "github.com" "api.github.com" "dl.gitea.io" "raw.githubusercontent.com"; do if [[ "${?}" -ne 0 ]]; then
if ! ping -c1 "$domain" &>"/dev/null"; then echo "I am unable to access one of the necessary domains that are needed to continue this Install."
echo "Unable to access $domain. Update cannot proceed." elif [[ "${#args[@]}" -eq 0 ]]; then
exit 1 # Check if curl is installed
fi if [ ! -x /usr/bin/curl ] ; then
done CURL_NOT_EXIST=1
} 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
echo "Gitea update aborted." 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 fi
exit 0 if [ -n "$(uname -a | grep x86_64)" ]; then
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

@ -0,0 +1,23 @@
#!/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,50 +1,44 @@
#!/usr/bin/env bash #!/usr/bin/env bash
trap 'exit 130' INT
# Confirmation prompt while true
while true; do 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
[yY][eE][sS]|[yY]) [yY][eE][sS]|[yY])
break break
;; ;;
[nN][oO]|[nN]) [nN][oO]|[nN])
echo "Go installation aborted." break
exit 0 ;;
;; *)
*) echo "That wasn't an option..."
echo "That wasn't an option..." ;;
;; esac
esac
done done
# Check if curl is installed # Check if curl is installed
if ! command -v curl &>/dev/null; then if [ ! -x /usr/bin/curl ] ; then
echo "curl is required but not installed. Installing curl..." CURL_NOT_EXIST=1
sudo apt update && sudo apt install -y curl 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
ARCH="386" CURL_NOT_EXIST=0
fi fi
apt remove golang -y
GO_VERSION=$(curl -sSL https://golang.org/dl/?mode=json | grep -oP '"version":"\K[^"]+' | head -n1) rm -rf /tmp/go/
GO_URL="https://golang.org/dl/go$GO_VERSION.linux-$ARCH.tar.gz" mkdir /tmp/go/
cd /tmp/go/
# Install Go VER=$(curl --silent "https://go.dev/dl/?mode=json" | grep '"version":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's|[v,]||g' | head -1)
echo "Downloading and installing Go $GO_VERSION..." if [ -n "$(uname -a | grep x86_64)" ]; then
curl -fsSL -o "/tmp/go.tar.gz" "$GO_URL" curl -fsSL -o "/tmp/go/"$VER".linux-amd64.tar.gz" "https://go.dev/dl/"$VER".linux-amd64.tar.gz"
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf /tmp/go.tar.gz fi
rm -f /tmp/go.tar.gz 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"
# Update PATH fi
echo "Updating PATH..." 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"
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
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc # Add to .bashrc for persistent PATH cd ~
echo "Go $GO_VERSION has been successfully installed."

View File

@ -1,64 +1,45 @@
#!/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
# Confirmation prompt do
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 [yY][eE][sS]|[yY])
[yY][eE][sS]|[yY]) 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
# Check for dependencies and install if needed CURL_NOT_EXIST=1
if ! command -v curl &>/dev/null; then apt install -y curl
echo "Installing curl..."
sudo apt update && sudo apt install -y curl || { echo "Failed to install curl. Exiting."; exit 1; }
fi
# Remove unused dependencies (optional)
echo "Removing unused dependencies..."
sudo apt autoremove -y
# 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
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 else
echo "Unsupported architecture. Exiting." CURL_NOT_EXIST=0
exit 1 fi
apt remove golang -y
apt autoremove -y
wget -O goinstall.sh https://sop.wtf/sh/u/goinstall && bash goinstall.sh
rm -rf /tmp/hugo/
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' )
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"
fi
if [ -n "$(uname -a | grep armv6l)" ]; then
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"
fi fi
# Download and install Hugo if [ -n "$(uname -a | grep armv7l)" ]; then
echo "Downloading and installing Hugo..." 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"
wget -O hugo.tar.gz "$HUGO_URL" || { echo "Failed to download Hugo. Exiting."; exit 1; } fi
tar -xzf hugo.tar.gz || { echo "Failed to extract Hugo. Exiting."; exit 1; } cd /tmp/hugo/
sudo mv hugo /usr/local/bin || { echo "Failed to move Hugo binary. Exiting."; exit 1; } tar -xzf /tmp/hugo/*.tar.gz
echo "Hugo successfully installed!" sudo mv /tmp/hugo/hugo /usr/local/bin
cd ~
# Clean up
rm -rf /tmp/hugo
cd ~
exit 0

View File

@ -1,77 +1,82 @@
#!/usr/bin/env bash #!/usr/bin/env bash
trap 'exit 130' INT trap 'exit 130' INT
while true
# Confirmation prompt do
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 [yY][eE][sS]|[yY])
[yY][eE][sS]|[yY]) 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
add-apt-repository --yes ppa:ondrej/nginx sudo apt update && apt upgrade -y
add-apt-repository --yes ppa:ondrej/php sudo apt-get install build-essential lsb-release software-properties-common -y
apt install nginx-full phpmyadmin php-{mbstring,zip,fpm,gd,json,curl,mysql} unzip -y 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
systemctl stop nginx sudo systemctl stop nginx
wget -O /etc/nginx/conf.d/phpmyadmin.conf https://git.oldgate.org/Sophia/thelinuxlist/raw/branch/main/conf/pmanginx.conf sudo wget -O /etc/nginx/conf.d/phpmyadmin.conf https://git.oldgate.org/Sophia/thelinuxlist/raw/branch/main/conf/pmanginx.conf
systemctl enable nginx sudo systemctl enable nginx
systemctl start nginx sudo systemctl start nginx
elif [ "$go" == 'apache' ]; then ## Updating phpMyAdmin.
add-apt-repository --yes ppa:ondrej/apache2 PMA_VER="5.2.1"
apt install apache2 libapache2-mod-php phpmyadmin php-{mbstring,zip,fpm,gd,json,curl,mysql} unzip -y sudo rm -rf /usr/share/phpmyadmin.bak
systemctl stop apache2 sudo mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak
wget -O /etc/apache2/sites-enabled/phpmyadmin.conf https://git.oldgate.org/Sophia/thelinuxlist/raw/branch/main/conf/pmaapache.conf sudo mkdir /usr/share/phpmyadmin/
systemctl restart php-fpm sudo wget https://files.phpmyadmin.net/phpMyAdmin/$PMA_VER/phpMyAdmin-"$PMA_VER"-all-languages.tar.gz -P /usr/share/phpmyadmin/
systemctl reload apache2 sudo tar xzf /usr/share/phpmyadmin/phpMyAdmin-"$PMA_VER"-all-languages.tar.gz -C /usr/share/phpmyadmin/
systemctl enable apache2 sudo mv /usr/share/phpmyadmin/phpMyAdmin-"$PMA_VER"-all-languages/* /usr/share/phpmyadmin
fi 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
# Update phpMyAdmin ## Thanks https://stackoverflow.com/users/3266847/benjamin-w
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)
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 -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
# Restart web server and allow connections sudo ufw allow 8080
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 )
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) 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://${internalip}:8080" echo "phpMyAdmin Should be available at http://${intenalip}: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,40 +1,48 @@
#!/usr/bin/env bash #!/usr/bin/env bash
trap 'exit 130' INT trap 'exit 130' INT
while true
# Confirmation prompt do
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 [yY][eE][sS]|[yY])
[yY][eE][sS]|[yY]) 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,46 +1,49 @@
#!/usr/bin/env bash #!/usr/bin/env bash
trap 'exit 130' INT trap 'exit 130' INT
while true
# Confirmation prompt do
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 [yY][eE][sS]|[yY])
[yY][eE][sS]|[yY]) 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
# Dependency check CURL_NOT_EXIST=1
if ! command -v curl &>/dev/null; then apt install -y curl
echo "Installing curl..." else
sudo apt install -y curl CURL_NOT_EXIST=0
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 wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz -P /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 tar -xzf /usr/share/phpmyadmin/*.tar.gz -C /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-*-all-languages/* /usr/share/phpmyadmin sudo mv /usr/share/phpmyadmin/phpMyAdmin-"$PMA_VER"-all-languages/* /usr/share/phpmyadmin
sudo mkdir /usr/share/phpmyadmin/tmp/ && sudo chmod -R 777 /usr/share/phpmyadmin/tmp/ 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) randomBlowfishSecret=$(openssl rand -base64 22)
sudo sed -i "s|cfg\['blowfish_secret'\] = ''|cfg['blowfish_secret'] = '$randomBlowfishSecret'|" /usr/share/phpmyadmin/config.sample.inc.php 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 mv /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php sudo systemctl restart apache2
sudo systemctl restart apache2 nginx sudo systemctl restart nginx
# Completion message
echo -e "==================================================================" echo -e "=================================================================="
echo "phpMyAdmin has been updated!" echo "phpMyAdmin has been updated!"
echo -e "==================================================================" echo -e "=================================================================="

78
scripts/scripts.sh Normal file
View File

@ -0,0 +1,78 @@
#!/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

View File

@ -1,42 +0,0 @@
#!/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,102 +1,57 @@
#!/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
# Function to check if required domains are accessible if [ -n "$(uname -a | grep x86_64)" ]; then
check_domains() { curl -fsSL -o "/tmp/gitea" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-amd64"
echo "Checking necessary domains..." fi
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
}
# Function to install Gitea if [ -n "$(uname -a | grep armv6l)" ]; then
install_gitea() { curl -fsSL -o "/tmp/gitea" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-arm-6"
echo "Installing Gitea..." fi
# Check if curl is installed if [ -n "$(uname -a | grep armv7l)" ]; then
if ! command -v curl &>/dev/null; then curl -fsSL -o "/tmp/gitea" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-arm-7"
echo "Installing curl..." fi
sudo apt install -y curl || { echo "Failed to install curl. Exiting."; exit 1; }
fi
# Get latest Gitea version sudo mv /tmp/gitea /usr/local/bin
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 chmod +x /usr/local/bin/gitea
sudo mkdir -p /var/lib/gitea/{custom,data,log}
# Install git sudo chown -R git:git /var/lib/gitea
echo "Installing git..." sudo chmod -R 750 /var/lib/gitea
sudo apt-get install git -y || { echo "Failed to install git. Exiting."; exit 1; } sudo mkdir /etc/gitea
sudo chown root:git /etc/gitea
# Create git user sudo chmod 770 /etc/gitea
echo "Creating git user..." curl -fsSL -o /etc/systemd/system/gitea.service https://raw.githubusercontent.com/go-gitea/gitea/master/contrib/systemd/gitea.service
sudo adduser --system --shell /bin/bash --gecos 'Git Version Control' --group --disabled-password --home /home/git git sudo systemctl daemon-reload
sudo systemctl enable --now gitea
# Download and install Gitea binary sudo systemctl start gitea
echo "Downloading Gitea binary..." sudo ufw allow 3000
case "$(uname -m)" in echo -e "=================================================================="
i386) publicipaddress=$(curl -sS --connect-timeout 10 -m 60 https://ipv4.icanhazip.com/ || curl -sS --connect-timeout 10 -m 60 https://api.ipify.org )
arch="386" 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"
x86_64) echo "Or If you are using a VPS at http://${publicipaddress}:3000"
arch="amd64" echo -e "=================================================================="
;; 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,39 +1,16 @@
#!/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
# Automate confirmation by assuming yes to the prompt echo "Gitea has been uninstalled, and all files have are backed up in gitea.tar.gz, you can delete it at your discretion."
uninstall_gitea
exit 0

View File

@ -1,70 +1,45 @@
#!/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
# Function to check network connectivity if [ -n "$(uname -a | grep x86_64)" ]; then
check_connectivity() { curl -fsSL -o "/tmp/gitea" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-amd64"
echo "Checking necessary domains for connectivity..." fi
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
}
# Function to perform the update if [ -n "$(uname -a | grep armv6l)" ]; then
update_gitea() { curl -fsSL -o "/tmp/gitea" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-arm-6"
echo "Updating Gitea..." fi
# Check if curl is installed if [ -n "$(uname -a | grep armv7l)" ]; then
if ! command -v curl &>/dev/null; then curl -fsSL -o "/tmp/gitea" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-arm-7"
echo "Installing curl..." fi
sudo apt install -y curl || { echo "Failed to install curl. Exiting."; exit 1; } sudo mv /tmp/gitea /usr/local/bin
fi sudo chmod +x /usr/local/bin/gitea
sudo chown -R git:git /var/lib/gitea
# Get latest Gitea version sudo chmod -R 750 /var/lib/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 chown root:git /etc/gitea
sudo systemctl start gitea
# Determine architecture sudo ufw allow 3000
case "$(uname -m)" in echo -e "=================================================================="
i386) echo "Gitea has been updated!!"
arch="386" echo -e "=================================================================="
;; 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

@ -0,0 +1,6 @@
#!/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,36 +1,27 @@
#!/usr/bin/env bash #!/usr/bin/env bash
trap 'exit 130' INT
# Check if curl is installed # Check if curl is installed
if ! command -v curl &>/dev/null; then if [ ! -x /usr/bin/curl ] ; then
echo "curl is required but not installed. Installing curl..." CURL_NOT_EXIST=1
sudo apt update && sudo apt install -y curl || { apt install -y curl
echo "Failed to install curl. Exiting." else
exit 1 CURL_NOT_EXIST=0
}
fi fi
apt remove golang -y
# Get latest Go version rm -rf /tmp/go/
ARCH=$(uname -m) mkdir /tmp/go/
case $ARCH in cd /tmp/go/
"x86_64") ARCH="amd64" ;; VER=$(curl --silent "https://go.dev/dl/?mode=json" | grep '"version":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's|[v,]||g' | head -1)
"armv6l") ARCH="armv6l" ;; if [ -n "$(uname -a | grep x86_64)" ]; then
*) ARCH="386" ;; curl -fsSL -o "/tmp/go/"$VER".linux-amd64.tar.gz" "https://go.dev/dl/"$VER".linux-amd64.tar.gz"
esac fi
if [ -n "$(uname -a | grep armv6l)" ]; then
GO_VERSION=$(curl -sSL https://golang.org/dl/?mode=json | grep -oP '"version":"\K[^"]+' | head -n1) curl -fsSL -o "/tmp/go/"$VER".linux-armv6l.tar.gz" "https://go.dev/dl/"$VER".linux-armv6l.tar.gz"
GO_URL="https://golang.org/dl/go$GO_VERSION.linux-$ARCH.tar.gz" fi
if [ -n "$(uname -a | grep i386)" ]; then
# Install Go curl -fsSL -o "/tmp/go/"$VER".linux-386.tar.gz" "https://go.dev/dl/"$VER".linux-386.tar.gz"
echo "Downloading and installing Go $GO_VERSION..." fi
sudo rm -rf /usr/local/go rm -rf /usr/local/go && tar -C /usr/local -xzf *.tar.gz
sudo curl -fsSL "$GO_URL" | sudo tar -C /usr/local -xz || { chmod +x /usr/local/go/bin/go
echo "Failed to download and install Go. Exiting." export PATH=$PATH:/usr/local/go/bin
exit 1 cd ~
}
# 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,46 +1,30 @@
#!/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
# Check for dependencies and install if needed CURL_NOT_EXIST=1
if ! command -v curl &>/dev/null; then apt install -y curl
echo "Installing curl..."
sudo apt update && sudo apt install -y curl || { echo "Failed to install curl. Exiting."; exit 1; }
fi
# Remove unused dependencies (optional)
echo "Removing unused dependencies..."
sudo apt autoremove -y
# 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
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 else
echo "Unsupported architecture. Exiting." CURL_NOT_EXIST=0
exit 1 fi
apt remove golang -y
apt autoremove -y
wget -O goinstall.sh https://sop.wtf/sh/u/goinstall && bash goinstall.sh
rm -rf /tmp/hugo/
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' )
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"
fi
if [ -n "$(uname -a | grep armv6l)" ]; then
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"
fi fi
# Download and install Hugo if [ -n "$(uname -a | grep armv7l)" ]; then
echo "Downloading and installing Hugo..." 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"
wget -O hugo.tar.gz "$HUGO_URL" || { echo "Failed to download Hugo. Exiting."; exit 1; } echo "Hugo Extended is not supported on armv7l, Installing Hugo standard"
tar -xzf hugo.tar.gz || { echo "Failed to extract Hugo. Exiting."; exit 1; } fi
sudo mv hugo /usr/local/bin || { echo "Failed to move Hugo binary. Exiting."; exit 1; } cd /tmp/hugo/
echo "Hugo successfully installed!" tar -xzf /tmp/hugo/*.tar.gz
sudo mv /tmp/hugo/hugo /usr/local/bin
# Clean up cd ~
rm -rf /tmp/hugo
cd ~
exit 0

View File

@ -1,26 +0,0 @@
#!/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 ~