forked from Sophia/thelinuxlist
Compare commits
58 Commits
Author | SHA1 | Date |
---|---|---|
Sophia Atkinson | 974f6d4fb5 | |
Sophia Atkinson | 0cc27e1896 | |
Sophia Atkinson | 797b4d8de6 | |
Sophia Atkinson | ef659774d7 | |
Sophia Atkinson | 0fbfaae109 | |
Sophia Atkinson | cb841ad51f | |
Sophia Atkinson | d74e431019 | |
Sophia Atkinson | bf3e3609fa | |
Sophia Atkinson | 9961c8679a | |
Sophia Atkinson | 8a79c3d8ba | |
Sophia Atkinson | 4c988cdc04 | |
Sophia Atkinson | 895cbc1c1c | |
Sophia Atkinson | ece5f6ae68 | |
Sophia Atkinson | 205998f576 | |
Sophia Atkinson | 50190c9996 | |
Sophia Atkinson | b2306b5b97 | |
Sophia Atkinson | cf97300af6 | |
Sophia Atkinson | 7b6e136b88 | |
Sophia Atkinson | 931e03a7db | |
Sophia Atkinson | a02e2830ef | |
Sophia Atkinson | 31fe64c2e0 | |
Sophia Atkinson | 9ccbe37569 | |
Sophia Atkinson | 6aa2168f97 | |
Sophia Atkinson | 6b3a3bffd3 | |
Sophia Atkinson | 421f67b5bb | |
Sophia Atkinson | 14c65580fc | |
Sophia Atkinson | f5c10b9b01 | |
Sophia Atkinson | 008e098bfd | |
Sophia Atkinson | 49331c443c | |
Sophia Atkinson | f43a8a77d2 | |
Sophia Atkinson | 4f4768a619 | |
Sophia Atkinson | f9a1651ce9 | |
Sophia Atkinson | 6c2140851d | |
Sophia Atkinson | 0b6915ebd7 | |
Sophia Atkinson | 804477aeb8 | |
Sophia Atkinson | cc987eac61 | |
Sophia Atkinson | 7054ab4815 | |
Sophia Atkinson | 6418a4c975 | |
Sophia Atkinson | 2bf73b8a3b | |
Sophia Atkinson | 8be3efa9e0 | |
Sophia Atkinson | 5f5e2dee15 | |
Sophia Atkinson | 73859156fd | |
Sophia Atkinson | a8222bcfdd | |
Sophia Atkinson | 4c5d16ab18 | |
Sophia Atkinson | b17540254a | |
Sophia Atkinson | 2c0af1f3ef | |
Sophia Atkinson | 135405249a | |
Sophia Atkinson | 10d3885d28 | |
Wade Waters | 8b65c9ae1a | |
Sophia Atkinson | 81c1ce08a9 | |
Sophia Atkinson | 151880e03c | |
Sophia Atkinson | f36cb7e0bd | |
Sophia Atkinson | 41eccb7d5a | |
Sophia Atkinson | 4fd5fd4fa2 | |
Sophia Atkinson | 0cd15876c8 | |
Sophia Atkinson | 71cdecdd13 | |
Sophia Atkinson | 22a15430b0 | |
Sophia Atkinson | 11a4547f82 |
131
README.md
131
README.md
|
@ -1,3 +1,14 @@
|
||||||
|
**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
|
||||||
|
|
||||||
## `~Script Installs~`
|
## `~Script Installs~`
|
||||||
|
@ -8,68 +19,126 @@
|
||||||
|
|
||||||
### Untested Scripts ⚠️
|
### Untested Scripts ⚠️
|
||||||
|
|
||||||
---
|
### Retired Scripts 💀
|
||||||
|
|
||||||
## Gitea
|
## Don't like typing "Y"? Just add a "u" after the /sh/ `(/sh/u/RANDOMSCRIPT)`
|
||||||
|
|
||||||
### ✔️ Install
|
|
||||||
### `wget -O giteainstall.sh https://sop.wtf/sh/giteainstall && bash giteainstall.sh`
|
|
||||||
### ✔️ Uninstall
|
|
||||||
### `wget -O gitearemove.sh https://sop.wtf/sh/gitearemove && bash gitearemove.sh`
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## MariaDB
|
## [Gitea](https://about.gitea.com/)
|
||||||
|
|
||||||
### ✔️ Install
|
### ✔️ Install
|
||||||
### `wget -O mariadbinstall.sh https://sop.wtf/sh/mariadbinstall && bash mariadbinstall.sh`
|
|
||||||
|
### `wget https://sop.wtf/sh/giteainstall ; bash giteainstall`
|
||||||
|
|
||||||
### ✔️ Uninstall
|
### ✔️ Uninstall
|
||||||
### `sudo apt remove mariadb-server mariadb-client -y && apt autoremove -y`
|
|
||||||
|
### `wget https://sop.wtf/sh/gitearemove ; bash gitearemove`
|
||||||
|
|
||||||
|
### ✔️ Update
|
||||||
|
|
||||||
|
### `wget https://sop.wtf/sh/giteaupdate ; bash giteaupdate`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## phpMyAdmin
|
## [Go Hugo](https://gohugo.io/)
|
||||||
### ✔️ Install
|
|
||||||
### `wget -O pmainstall.sh https://sop.wtf/sh/pmainstall && bash pmainstall.sh`
|
### ✔️ Install/Update
|
||||||
|
|
||||||
|
### `wget https://sop.wtf/sh/hugoinstall ; bash hugoinstall`
|
||||||
|
|
||||||
### ✔️ Uninstall
|
### ✔️ Uninstall
|
||||||
### `wget -O pmauninstall.sh https://sop.wtf/sh/pmauninstall && bash pmauninstall.sh`
|
|
||||||
|
### `rm -rf /usr/local/bin/hugo`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
## [Go](https://go.dev/)
|
||||||
|
|
||||||
|
### ✔️ Install/Update
|
||||||
|
|
||||||
|
### `wget https://sop.wtf/sh/goinstall ; bash goinstall`
|
||||||
|
|
||||||
## MongoDB
|
|
||||||
### ✔️ Install
|
|
||||||
### `wget -O mongodbinstall.sh https://sop.wtf/sh/mongodbinstall && bash mongodbinstall.sh`
|
|
||||||
### ✔️ Uninstall
|
### ✔️ Uninstall
|
||||||
### `sudo apt remove mongodb-org libssl1.1 -y && sudo apt autoremove`
|
|
||||||
|
### `rm -rf /usr/local/go`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
## [Traefik](https://go.dev/)
|
||||||
|
|
||||||
## Gitlab
|
### ✔️ Install/Update
|
||||||
|
|
||||||
|
### `wget https://sop.wtf/sh/traefikinstall ; bash traefikinstall`
|
||||||
|
|
||||||
### ✔️ Install
|
|
||||||
### `wget -O gitlabinstall.sh https://sop.wtf/sh/gitlabinstall && bash gitlabinstall.sh`
|
|
||||||
### ✔️ Uninstall
|
### ✔️ Uninstall
|
||||||
### `wget -O gitlabuninstall.sh https://sop.wtf/sh/gitlabuninstall && bash gitlabuninstall.sh`
|
|
||||||
|
### `rm -rf /usr/local/traefik`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Gogs
|
## [MariaDB](https://mariadb.org/)
|
||||||
|
|
||||||
### ✔️ Install
|
### ✔️ Install
|
||||||
### `wget -O gogsinstall.sh https://sop.wtf/sh/gogsinstall && bash gogsinstall.sh`
|
|
||||||
|
### `wget https://sop.wtf/sh/mariadbinstall ; bash mariadbinstall`
|
||||||
|
|
||||||
### ✔️ Uninstall
|
### ✔️ Uninstall
|
||||||
### `wget -O gogsuninstall.sh https://sop.wtf/sh/gogsuninstall && bash gogsuninstall.sh`
|
|
||||||
|
### `sudo apt remove mariadb-server mariadb-client -y ; apt autoremove -y`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Wordpress
|
## [phpMyAdmin](https://www.phpmyadmin.net/)
|
||||||
|
|
||||||
### ✔️ Install
|
### ✔️ Install
|
||||||
### `wget -O wpinstall.sh https://sop.wtf/sh/wpinstall && bash wpinstall.sh`
|
|
||||||
|
### `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`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Fail2Ban
|
## [MongoDB](https://www.mongodb.com/)
|
||||||
### ✔️ Install
|
|
||||||
### `wget -O fail2baninstall.sh https://sop.wtf/sh/fail2baninstall && bash fail2baninstall.sh`
|
|
||||||
|
|
||||||
---
|
### ⚠️ 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`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
Listen 8080
|
||||||
|
|
||||||
|
<VirtualHost *:8080>
|
||||||
|
|
||||||
|
ServerName localhost
|
||||||
|
|
||||||
|
<Directory /usr/share/phpmyadmin>
|
||||||
|
AllowOverride None
|
||||||
|
Require all granted
|
||||||
|
</Directory>
|
||||||
|
|
||||||
|
DocumentRoot /usr/share/phpmyadmin
|
||||||
|
|
||||||
|
Include /etc/phpmyadmin/apache.conf
|
||||||
|
|
||||||
|
ErrorLog ${APACHE_LOG_DIR}/phpmyadmin.error.log
|
||||||
|
CustomLog ${APACHE_LOG_DIR}/phpmyadmin.access.log combined
|
||||||
|
# Error log location should be in /var/log/apache2
|
||||||
|
|
||||||
|
</VirtualHost>
|
|
@ -0,0 +1,17 @@
|
||||||
|
server {
|
||||||
|
listen 8080;
|
||||||
|
listen [::]:8080;
|
||||||
|
server_name localhost;
|
||||||
|
access_log /var/log/nginx/phpmyadmin.vhost.access.log;
|
||||||
|
error_log /var/log/nginx/phpmyadmin.vhost.error.log;
|
||||||
|
root /usr/share/phpmyadmin;
|
||||||
|
index index.php;
|
||||||
|
location ~ \.php$ {
|
||||||
|
try_files $uri =404;
|
||||||
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
|
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
include fastcgi_params;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,87 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
trap 'exit 130' INT
|
||||||
|
while true
|
||||||
|
do
|
||||||
|
read -r -p "Would you like to install Caddy Server? [Y/n] " input
|
||||||
|
|
||||||
|
case $input in
|
||||||
|
[yY][eE][sS]|[yY])
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
[nN][oO]|[nN])
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "That wasn't an option..."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# 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
|
||||||
|
apt remove golang -y
|
||||||
|
rm -rf /tmp/go/
|
||||||
|
mkdir /tmp/go/
|
||||||
|
cd /tmp/go/
|
||||||
|
VER="1.20.7"
|
||||||
|
if [ -n "$(uname -a | grep x86_64)" ]; then
|
||||||
|
curl -fsSL -o "/tmp/go/go"$VER".linux-amd64.tar.gz" "https://go.dev/dl/go"$VER".linux-amd64.tar.gz"
|
||||||
|
fi
|
||||||
|
if [ -n "$(uname -a | grep armv6l)" ]; then
|
||||||
|
curl -fsSL -o "/tmp/go/go"$VER".linux-armv6l.tar.gz" "https://go.dev/dl/go"$VER".linux-armv6l.tar.gz"
|
||||||
|
fi
|
||||||
|
if [ -n "$(uname -a | grep i386)" ]; then
|
||||||
|
curl -fsSL -o "/tmp/go/go"$VER".linux-386.tar.gz" "https://go.dev/dl/go"$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
|
||||||
|
cd ~
|
||||||
|
rm -rf /tmp/caddy
|
||||||
|
mkdir /tmp/caddy
|
||||||
|
cd /tmp/caddy
|
||||||
|
VER=$(curl --silent "https://api.github.com/repos/caddyserver/xcaddy/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/caddy/xcaddy_"$VER"_linux_amd64.tar.gz" "https://github.com/caddyserver/xcaddy/releases/download/v"$VER"/xcaddy_"$VER"_linux_amd64.tar.gz"
|
||||||
|
fi
|
||||||
|
if [ -n "$(uname -a | grep armv6l)" ]; then
|
||||||
|
curl -fsSL -o "/tmp/caddy/xcaddy_"$VER"_armv6.tar.gz" "https://github.com/caddyserver/xcaddy/releases/download/v"$VER"/xcaddy_v"$VER"_armv6.tar.gz"
|
||||||
|
fi
|
||||||
|
if [ -n "$(uname -a | grep armv7l)" ]; then
|
||||||
|
curl -fsSL -o "/tmp/caddy/xcaddy_"$VER"_linux_armv7.tar.gz" "https://github.com/caddyserver/xcaddy/releases/download/v"$VER"/xcaddy_v"$VER"_linux_armv7.tar.gz"
|
||||||
|
fi
|
||||||
|
if [ -n "$(uname -a | grep armv5l)" ]; then
|
||||||
|
curl -fsSL -o "/tmp/caddy/xcaddy_"$VER"_linux_armv5.tar.gz" "https://github.com/caddyserver/xcaddy/releases/download/v"$VER"/xcaddy_v"$VER"_linux_armv5.tar.gz"
|
||||||
|
fi
|
||||||
|
tar xvf *.tar.gz xcaddy
|
||||||
|
sudo mv xcaddy /usr/bin
|
||||||
|
mkdir ~/caddy
|
||||||
|
cd ~/caddy
|
||||||
|
xcaddy build
|
||||||
|
sudo mv caddy /usr/bin
|
||||||
|
sudo groupadd --system caddy
|
||||||
|
sudo useradd --system \
|
||||||
|
--gid caddy \
|
||||||
|
--create-home \
|
||||||
|
--home-dir /var/lib/caddy \
|
||||||
|
--shell /usr/sbin/nologin \
|
||||||
|
--comment "Caddy web server" \
|
||||||
|
caddy
|
||||||
|
sudo chown root:root /usr/bin/caddy
|
||||||
|
sudo chmod 755 /usr/bin/caddy
|
||||||
|
sudo mkdir /etc/caddy
|
||||||
|
sudo chown -R root:caddy /etc/caddy
|
||||||
|
sudo mkdir /etc/ssl/caddy
|
||||||
|
sudo chown -R root:caddy /etc/ssl/caddy
|
||||||
|
sudo chmod 0770 /etc/ssl/caddy
|
||||||
|
sudo mkdir /var/www
|
||||||
|
sudo chown caddy:caddy /var/www
|
||||||
|
sudo sh -c 'curl https://raw.githubusercontent.com/caddyserver/dist/master/init/caddy.service > /etc/systemd/system/caddy.service'
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl status caddy
|
||||||
|
sudo ufw allow proto tcp from any to any port 80,443
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
trap 'exit 130' INT
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
read -r -p "Would you like to install fail2ban? [Y/n] " input
|
read -r -p "Would you like to install fail2ban? [Y/n] " input
|
||||||
|
|
|
@ -1,42 +1,124 @@
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
while true
|
trap 'exit 130' INT
|
||||||
do
|
|
||||||
read -r -p "Would you like to install Gitea? [Y/n] " input
|
# Function to prompt user for installation
|
||||||
|
prompt_installation() {
|
||||||
case $input in
|
while true; do
|
||||||
|
read -r -p "Would you like to install Gitea? [Y/n] " input
|
||||||
|
|
||||||
|
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
|
||||||
GITEA_VER="1.17.3"
|
}
|
||||||
sudo systemctl stop gitea
|
|
||||||
sudo apt-get install git -y
|
|
||||||
sudo ufw allow 3000
|
|
||||||
sudo wget -O /usr/local/bin/gitea https://dl.gitea.io/gitea/$GITEA_VER/gitea-"$GITEA_VER"-linux-amd64
|
|
||||||
sudo chmod +x /usr/local/bin/gitea
|
|
||||||
sudo adduser --system --shell /bin/bash --gecos 'Git Version Control' --group --disabled-password --home /home/git git
|
|
||||||
sudo mkdir -pv /var/lib/gitea/{custom,data,log}
|
|
||||||
sudo chown -Rv git:git /var/lib/gitea
|
|
||||||
sudo chmod -Rv 750 /var/lib/gitea
|
|
||||||
sudo mkdir -v /etc/gitea
|
|
||||||
sudo chown -Rv root:git /etc/gitea
|
|
||||||
sudo chmod -Rv 770 /etc/gitea
|
|
||||||
sudo wget -O /etc/systemd/system/gitea.service https://git.oldgate.org/Sophia/thelinuxlist/raw/branch/main/systemd/gitea.service
|
|
||||||
sudo systemctl daemon-reload
|
|
||||||
sudo systemctl enable --now gitea
|
|
||||||
sudo systemctl start gitea
|
|
||||||
|
|
||||||
echo -e "=================================================================="
|
# Function to check if required domains are accessible
|
||||||
publicipaddress=$(curl -sS --connect-timeout 10 -m 60 https://ipv4.icanhazip.com/ || curl -sS --connect-timeout 10 -m 60 https://api.ipify.org )
|
check_domains() {
|
||||||
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 "Checking necessary domains..."
|
||||||
echo "Gitea Should be available at http://${intenalip}:3000"
|
for domain in "github.com" "api.github.com" "dl.gitea.io" "raw.githubusercontent.com"; do
|
||||||
echo "Or If you are using a VPS at http://${publicipaddress}:3000"
|
if ! ping -c1 "$domain" &>"/dev/null"; then
|
||||||
echo -e "=================================================================="
|
echo "Unable to access $domain. Installation cannot proceed."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# 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
|
||||||
|
echo "Gitea installation aborted."
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
|
@ -1,28 +1,61 @@
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
while true
|
# Function to prompt user for confirmation
|
||||||
do
|
prompt_confirmation() {
|
||||||
read -r -p "Would you like to uninstall Gitea? This is not reversible. [Y/n] " input
|
while true; do
|
||||||
|
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
|
|
||||||
rm -rf /etc/systemd/system/gitea.service
|
|
||||||
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
|
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
|
@ -0,0 +1,95 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Trap Ctrl+C to exit gracefully
|
||||||
|
trap 'exit 130' INT
|
||||||
|
|
||||||
|
# Function to prompt user for confirmation
|
||||||
|
prompt_confirmation() {
|
||||||
|
while true; do
|
||||||
|
read -r -p "Would you like to update Gitea? [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 check network connectivity
|
||||||
|
check_connectivity() {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
# 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
|
||||||
|
echo "Gitea update aborted."
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
|
@ -1,39 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
while true
|
|
||||||
do
|
|
||||||
read -r -p "Would you like to install Gitlab? [Y/n] " input
|
|
||||||
|
|
||||||
case $input in
|
|
||||||
[yY][eE][sS]|[yY])
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
[nN][oO]|[nN])
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "That wasn't an option..."
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
sudo apt update && apt upgrade -y
|
|
||||||
sudo apt install tzdata curl ca-certificates openssh-server -y
|
|
||||||
sudo apt-get install git -y
|
|
||||||
gpg_key_url="https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey"
|
|
||||||
curl -fsSL $gpg_key_url| sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/gitlab.gpg
|
|
||||||
sudo tee /etc/apt/sources.list.d/gitlab_gitlab-ce.list<<EOF
|
|
||||||
deb https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ focal main
|
|
||||||
deb-src https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ focal main
|
|
||||||
EOF
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install gitlab-ce
|
|
||||||
sudo ufw allow https
|
|
||||||
sudo ufw allow http
|
|
||||||
sudo ufw allow ssh
|
|
||||||
sudo ufw reload
|
|
||||||
echo -e "=================================================================="
|
|
||||||
echo "Congrats on installing GitLab Community Edition"
|
|
||||||
echo "These are your login credentials, make sure to change them."
|
|
||||||
echo "Username: root"
|
|
||||||
cat /etc/gitlab/initial_root_password | grep Password:
|
|
||||||
echo -e "=================================================================="
|
|
|
@ -1,23 +0,0 @@
|
||||||
#!/bin/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
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
read -r -p "Would you like to install Gogs? [Y/n] " input
|
read -r -p "Would you like to install Gogs? [Y/n] " input
|
||||||
|
@ -15,23 +15,60 @@ do
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
if [ ! -x /usr/bin/curl ] ; then
|
||||||
sudo apt install wget -y
|
CURL_NOT_EXIST=1
|
||||||
GOGS_VER="0.12.10"
|
apt install -y curl
|
||||||
sudo wget -O linux_amd64.tar.gz https://dl.gogs.io/$GOGS_VER/gogs_"$GOGS_VER"_linux_amd64.tar.gz
|
else
|
||||||
tar xvf linux_amd64.tar.gz
|
CURL_NOT_EXIST=0
|
||||||
sudo apt install git -y
|
fi
|
||||||
sudo adduser --system --shell /bin/bash --gecos 'Git Version Control' --group --disabled-password --home /home/git git
|
sudo apt install wget git -y
|
||||||
|
wget -O goinstall.sh https://sop.wtf/sh/u/goinstall && bash goinstall.sh
|
||||||
|
sudo adduser --disabled-login --gecos 'Gogs' git
|
||||||
|
git clone --depth 1 https://github.com/gogs/gogs.git gogs
|
||||||
|
cd gogs
|
||||||
|
go build -o gogs
|
||||||
|
./gogs web
|
||||||
sudo mkdir /var/log/gogs
|
sudo mkdir /var/log/gogs
|
||||||
sudo chown -R git:git /var/log/gogs/
|
sudo chown -R git:git /var/log/gogs/
|
||||||
sudo wget -O /etc/systemd/system/gogs.service https://git.oldgate.org/Sophia/thelinuxlist/raw/branch/main/systemd/gogs.service
|
sudo echo "
|
||||||
|
[Unit]
|
||||||
|
Description=Gogs self-hosted Git service
|
||||||
|
After=syslog.target
|
||||||
|
After=network.target
|
||||||
|
After=mysql.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
# Modify these two values and uncomment them if you have
|
||||||
|
# repos with lots of files and get an HTTP error 500 because
|
||||||
|
# of that
|
||||||
|
###
|
||||||
|
#LimitMEMLOCK=infinity
|
||||||
|
#LimitNOFILE=65535
|
||||||
|
Type=simple
|
||||||
|
User=git
|
||||||
|
Group=git
|
||||||
|
WorkingDirectory=/home/git
|
||||||
|
ExecStart=/home/git/gogs web
|
||||||
|
Restart=always
|
||||||
|
Environment=USER=git HOME=/home/git
|
||||||
|
|
||||||
|
# Some distributions may not support these hardening directives. If you cannot start the service due
|
||||||
|
# to an unknown option, comment out the ones not supported by your version of systemd.
|
||||||
|
ProtectSystem=full
|
||||||
|
PrivateDevices=yes
|
||||||
|
PrivateTmp=yes
|
||||||
|
NoNewPrivileges=true
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
" >> /etc/systemd/system/gogs.service
|
||||||
sudo rsync -avz gogs/* /home/git/
|
sudo rsync -avz gogs/* /home/git/
|
||||||
sudo chown -R git:git /home/git/
|
sudo chown -R git:git /home/git/
|
||||||
sudo ufw allow 3000
|
sudo ufw allow 3000
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
sudo systemctl enable gogs
|
sudo systemctl enable gogs
|
||||||
sudo systemctl start gogs
|
sudo systemctl start gogs
|
||||||
rm -rf gogs linux_amd64.tar.gz
|
sudo rm -rf gogs linux_amd64.tar.gz
|
||||||
|
|
||||||
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 )
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
read -r -p "Would you like to install Gogs? This is not reversible. [Y/n] " input
|
read -r -p "Would you like to install Gogs? This is not reversible. [Y/n] " input
|
||||||
|
@ -18,7 +18,7 @@ done
|
||||||
|
|
||||||
sudo systemctl stop gogs
|
sudo systemctl stop gogs
|
||||||
sudo systemctl disable gogs
|
sudo systemctl disable gogs
|
||||||
rm -rf /etc/systemd/system/gogs.service
|
sudo rm -rf /etc/systemd/system/gogs.service
|
||||||
sudo userdel git
|
sudo userdel git
|
||||||
sudo rm -rf /home/git
|
sudo rm -rf /home/git
|
||||||
sudo rm -rf /var/log/gogs/*
|
sudo rm -rf /var/log/gogs/*
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Confirmation prompt
|
||||||
|
while true; do
|
||||||
|
read -r -p "Would you like to install Go Language? [Y/n] " input
|
||||||
|
|
||||||
|
case $input in
|
||||||
|
[yY][eE][sS]|[yY])
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
[nN][oO]|[nN])
|
||||||
|
echo "Go installation aborted."
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "That wasn't an option..."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# Check if curl is installed
|
||||||
|
if ! command -v curl &>/dev/null; then
|
||||||
|
echo "curl is required but not installed. Installing 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
|
||||||
|
ARCH="386"
|
||||||
|
fi
|
||||||
|
|
||||||
|
GO_VERSION=$(curl -sSL https://golang.org/dl/?mode=json | grep -oP '"version":"\K[^"]+' | head -n1)
|
||||||
|
GO_URL="https://golang.org/dl/go$GO_VERSION.linux-$ARCH.tar.gz"
|
||||||
|
|
||||||
|
# Install Go
|
||||||
|
echo "Downloading and installing Go $GO_VERSION..."
|
||||||
|
curl -fsSL -o "/tmp/go.tar.gz" "$GO_URL"
|
||||||
|
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf /tmp/go.tar.gz
|
||||||
|
rm -f /tmp/go.tar.gz
|
||||||
|
|
||||||
|
# Update PATH
|
||||||
|
echo "Updating PATH..."
|
||||||
|
export PATH=$PATH:/usr/local/go/bin
|
||||||
|
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc # Add to .bashrc for persistent PATH
|
||||||
|
|
||||||
|
echo "Go $GO_VERSION has been successfully installed."
|
|
@ -0,0 +1,42 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
trap 'exit 130' INT
|
||||||
|
while true
|
||||||
|
do
|
||||||
|
read -r -p "Would you like to install Hockeypuck? [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
|
||||||
|
sudo apt-get install bzr git mercurial -y
|
||||||
|
# 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
|
||||||
|
apt remove golang -y
|
||||||
|
wget -O goinstall.sh https://sop.wtf/sh/u/goinstall && bash goinstall.sh
|
||||||
|
git clone https://github.com/hockeypuck/packaging /var/lib/hockeypuck
|
||||||
|
cd packaging
|
||||||
|
./prepare.bash
|
||||||
|
export GOPATH=$(pwd)
|
||||||
|
go install github.com/hockeypuck/server/cmd/hockeypuck
|
||||||
|
go install github.com/hockeypuck/server/cmd/hockeypuck-load
|
||||||
|
go install github.com/hockeypuck/server/cmd/hockeypuck-pbuild
|
||||||
|
bash /var/lib/hockeypuck -config /var/lib/hockeypuck/hockeypuck.conf
|
|
@ -0,0 +1,64 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Trap INT signal to ensure clean exits
|
||||||
|
trap 'exit 130' INT
|
||||||
|
|
||||||
|
# Confirmation prompt
|
||||||
|
while true; do
|
||||||
|
read -r -p "Would you like to install Hugo? [Y/n] " input
|
||||||
|
|
||||||
|
case $input in
|
||||||
|
[yY][eE][sS]|[yY])
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
[nN][oO]|[nN])
|
||||||
|
echo "Hugo installation aborted."
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "That wasn't an option..."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# Check for dependencies and install if needed
|
||||||
|
if ! command -v curl &>/dev/null; then
|
||||||
|
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
|
||||||
|
echo "Unsupported architecture. Exiting."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Download and install Hugo
|
||||||
|
echo "Downloading and installing Hugo..."
|
||||||
|
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!"
|
||||||
|
|
||||||
|
# Clean up
|
||||||
|
rm -rf /tmp/hugo
|
||||||
|
cd ~
|
||||||
|
|
||||||
|
exit 0
|
|
@ -0,0 +1,37 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
trap 'exit 130' INT
|
||||||
|
while true
|
||||||
|
do
|
||||||
|
read -r -p "Would you like to install Librenms? [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
|
||||||
|
sudo apt install acl fping git graphviz imagemagick mariadb-client mariadb-server mtr-tiny nginx-full nmap php-cli php-curl php-fpm php-gd php-gmp php-json php-mbstring php-mysql php-snmp php-xml php-zip rrdtool snmp snmpd whois unzip python3-pymysql python3-dotenv python3-redis python3-setuptools python3-systemd python3-pip -y
|
||||||
|
sudo useradd librenms -d /opt/librenms -M -r -s "$(which bash)"
|
||||||
|
cd /opt
|
||||||
|
sudo git clone https://github.com/librenms/librenms.git
|
||||||
|
sudo chown -R librenms:librenms /opt/librenms
|
||||||
|
sudo chmod 771 /opt/librenms
|
||||||
|
sudo setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
|
||||||
|
sudo setfacl -R -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
|
||||||
|
sudo -u librenms bash -c './scripts/composer_wrapper.php install --no-dev'
|
||||||
|
exit
|
||||||
|
sudo curl -fsSL -o "composer-stable.phar" https://getcomposer.org/composer-stable.phar
|
||||||
|
sudo mv composer-stable.phar /usr/bin/composer
|
||||||
|
sudo chmod +x /usr/bin/composer
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
trap 'exit 130' INT
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
read -r -p "Would you like to install MariaDB? [Y/n] " input
|
read -r -p "Would you like to install MariaDB? [Y/n] " input
|
||||||
|
@ -16,10 +16,8 @@ do
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
apt update && apt upgrade -y
|
apt update && apt upgrade -y
|
||||||
sudo apt install wget software-properties-common dirmngr ca-certificates apt-transport-https -y
|
sudo apt install wget software-properties-common dirmngr ca-certificates apt-transport-https mariadb-server mariadb-client -y
|
||||||
sudo apt install mariadb-server mariadb-client -y
|
|
||||||
echo -e "=================================================================="
|
echo -e "=================================================================="
|
||||||
echo "Time to Configure MariaDB."
|
echo "Time to Configure MariaDB."
|
||||||
echo "Don't Know what to do? I can help!"
|
echo "Don't Know what to do? I can help!"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
trap 'exit 130' INT
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
read -r -p "Would you like to install Mastodon? [Y/n] " input
|
read -r -p "Would you like to install Mastodon? [Y/n] " input
|
||||||
|
@ -15,7 +16,12 @@ do
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
if [ ! -x /usr/bin/curl ] ; then
|
||||||
|
CURL_NOT_EXIST=1
|
||||||
|
apt install -y curl
|
||||||
|
else
|
||||||
|
CURL_NOT_EXIST=0
|
||||||
|
fi
|
||||||
curl -sL https://deb.nodesource.com/setup_16.x | bash -
|
curl -sL https://deb.nodesource.com/setup_16.x | bash -
|
||||||
apt-get install nodejs -y
|
apt-get install nodejs -y
|
||||||
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
trap 'exit 130' INT
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
read -r -p "Would you like to install Misskey? [Y/n] " input
|
read -r -p "Would you like to install Misskey? [Y/n] " input
|
||||||
|
@ -16,14 +16,16 @@ do
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
if [ ! -x /usr/bin/curl ] ; then
|
||||||
|
CURL_NOT_EXIST=1
|
||||||
|
apt install -y curl
|
||||||
|
else
|
||||||
|
CURL_NOT_EXIST=0
|
||||||
|
fi
|
||||||
NODE_LTS= "18.12.1"
|
NODE_LTS= "18.12.1"
|
||||||
sudo apt update && apt upgrade -y
|
sudo apt update && apt upgrade -y
|
||||||
sudo apt install postgresql postgresql-contrib -y
|
sudo apt install postgresql postgresql-contrib ffmpeg redis-server npm yarn -y
|
||||||
sudo systemctl start postgresql.service
|
sudo systemctl start postgresql.service
|
||||||
sudo apt install npm -y
|
|
||||||
sudo apt install redis-server -y
|
|
||||||
sudo apt install ffmpeg -y
|
|
||||||
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
|
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
|
||||||
source ~/.bashrc
|
source ~/.bashrc
|
||||||
nvm install node
|
nvm install node
|
||||||
|
@ -31,7 +33,6 @@ nvm install v$NODE_LTS
|
||||||
nvm use v$NODE_LTS
|
nvm use v$NODE_LTS
|
||||||
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
|
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
|
||||||
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
|
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
|
||||||
sudo apt update && sudo apt install yarn
|
|
||||||
PASSWD_GEN=$(openssl rand -base64 10)
|
PASSWD_GEN=$(openssl rand -base64 10)
|
||||||
sudo -i -u postgres psql -c "CREATE USER misskey WITH PASSWORD '$PASSWD_GEN';"
|
sudo -i -u postgres psql -c "CREATE USER misskey WITH PASSWORD '$PASSWD_GEN';"
|
||||||
sudo -i -u postgres psql -c "CREATE USER misskey WITH PASSWORD '$PASSWD_GEN';"
|
sudo -i -u postgres psql -c "CREATE USER misskey WITH PASSWORD '$PASSWD_GEN';"
|
||||||
|
@ -50,7 +51,7 @@ sed -e "s|user: example-misskey-pass = ''user: = '$PASSWD_GEN'|" >> .config/def
|
||||||
NODE_ENV=production yarn build
|
NODE_ENV=production yarn build
|
||||||
yarn run init
|
yarn run init
|
||||||
exit
|
exit
|
||||||
sudo wget -O /etc/systemd/system/misskey.service https://git.oldgate.org/Sophia/thelinuxlist/raw/branch/main/systemd/misskey.service
|
curl -fsSL -o "/etc/systemd/system/misskey.service" https://git.oldgate.org/Sophia/thelinuxlist/raw/branch/main/systemd/misskey.service
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
sudo systemctl enable misskey.service
|
sudo systemctl enable misskey.service
|
||||||
sudo systemctl start misskey.service
|
sudo systemctl start misskey.service
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
trap 'exit 130' INT
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
read -r -p "Would you like to install MongoDB? [Y/n] " input
|
read -r -p "Would you like to install MongoDB? [Y/n] " input
|
||||||
|
@ -16,12 +16,17 @@ do
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
if [ ! -x /usr/bin/curl ] ; then
|
||||||
|
CURL_NOT_EXIST=1
|
||||||
|
apt install -y curl
|
||||||
|
else
|
||||||
|
CURL_NOT_EXIST=0
|
||||||
|
fi
|
||||||
sudo apt update && apt upgrade -y
|
sudo apt update && apt upgrade -y
|
||||||
sudo apt install wget curl gnupg2 software-properties-common apt-transport-https ca-certificates lsb-release
|
sudo apt install wget curl gnupg2 software-properties-common apt-transport-https ca-certificates lsb-release -y
|
||||||
sudo curl -fsSL https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
|
sudo curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
|
||||||
echo "deb http://security.ubuntu.com/ubuntu focal-security main" | sudo tee /etc/apt/sources.list.d/focal-security.list
|
echo "deb http://security.ubuntu.com/ubuntu jammy-security main" | sudo tee /etc/apt/sources.list.d/jammy-security.list
|
||||||
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
|
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
|
||||||
sudo apt update -y
|
sudo apt update -y
|
||||||
sudo apt-get install libssl1.1 -y
|
sudo apt-get install libssl1.1 -y
|
||||||
sudo apt install mongodb-org -y
|
sudo apt install mongodb-org -y
|
||||||
|
|
|
@ -1,64 +1,77 @@
|
||||||
#!/bin/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 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
|
||||||
|
|
||||||
sudo apt update && apt upgrade -y
|
# Web server selection prompt
|
||||||
sudo add-apt-repository --yes ppa:ondrej/php && apt install libapache2-mod-php8.1 -y
|
while [ "$go" != 'apache' ] && [ "$go" != 'nginx' ]; do
|
||||||
sudo systemtl stop apache2
|
read -p "Would you like to install using Nginx or Apache? (nginx/apache) " go
|
||||||
sudo apt install apache2 -y
|
done
|
||||||
sudo apt install software-properties-common
|
|
||||||
sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl -y
|
# Update and upgrade system packages
|
||||||
sudo echo "Include /etc/phpmyadmin/apache.conf" >> /etc/apache2/apache2.conf
|
apt update && apt upgrade -y
|
||||||
sudo phpenmod mbstring
|
|
||||||
sudo a2dismod php8.1
|
# Install dependencies and add repositories
|
||||||
sudo a2dismod mpm_prefork
|
apt-get install build-essential lsb-release software-properties-common -y
|
||||||
sudo a2disconf php7.4-fpm
|
if [ "$go" == 'nginx' ]; then
|
||||||
sudo a2enmod mpm_event
|
add-apt-repository --yes ppa:ondrej/nginx
|
||||||
sudo a2enmod proxy
|
add-apt-repository --yes ppa:ondrej/php
|
||||||
sudo a2enmod proxy_fcgi
|
apt install nginx-full phpmyadmin php-{mbstring,zip,fpm,gd,json,curl,mysql} unzip -y
|
||||||
sudo a2enconf php8.1-fpm
|
systemctl stop nginx
|
||||||
sudo systemctl restart php8.1-fpm
|
wget -O /etc/nginx/conf.d/phpmyadmin.conf https://git.oldgate.org/Sophia/thelinuxlist/raw/branch/main/conf/pmanginx.conf
|
||||||
sudo systemctl enable apache2
|
systemctl enable nginx
|
||||||
## Updating phpMyAdmin.
|
systemctl start nginx
|
||||||
PMA_VER="5.2.0"
|
elif [ "$go" == 'apache' ]; then
|
||||||
sudo rm -rf /usr/share/phpmyadmin.bak
|
add-apt-repository --yes ppa:ondrej/apache2
|
||||||
sudo mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak
|
apt install apache2 libapache2-mod-php phpmyadmin php-{mbstring,zip,fpm,gd,json,curl,mysql} unzip -y
|
||||||
sudo mkdir /usr/share/phpmyadmin/
|
systemctl stop apache2
|
||||||
sudo wget https://files.phpmyadmin.net/phpMyAdmin/$PMA_VER/phpMyAdmin-"$PMA_VER"-all-languages.tar.gz -P /usr/share/phpmyadmin/
|
wget -O /etc/apache2/sites-enabled/phpmyadmin.conf https://git.oldgate.org/Sophia/thelinuxlist/raw/branch/main/conf/pmaapache.conf
|
||||||
sudo tar xzf /usr/share/phpmyadmin/phpMyAdmin-"$PMA_VER"-all-languages.tar.gz -C /usr/share/phpmyadmin/
|
systemctl restart php-fpm
|
||||||
sudo mv /usr/share/phpmyadmin/phpMyAdmin-"$PMA_VER"-all-languages/* /usr/share/phpmyadmin
|
systemctl reload apache2
|
||||||
sudo mkdir /usr/share/phpmyadmin/tmp/ && chmod -R 777 /usr/share/phpmyadmin/tmp/
|
systemctl enable apache2
|
||||||
sudo rm -rf /usr/share/phpmyadmin/phpMyAdmin-"$PMA_VER"-all-languages /usr/share/phpmyadmin/phpMyAdmin-"$PMA_VER"-all-languages.tar.gz
|
fi
|
||||||
## 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)
|
||||||
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 apache2
|
|
||||||
|
# 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}/phpmyadmin"
|
echo "phpMyAdmin should be available at http://${internalip}:8080"
|
||||||
echo "Or If you are using a VPS at http://${publicipaddress}/phpmyadmin"
|
echo "Or if you are using a VPS, at http://${publicipaddress}:8080"
|
||||||
echo -e "=================================================================="
|
echo -e "=================================================================="
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,47 +1,40 @@
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
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
|
|
||||||
rm -rf /usr/share/phpmyadmin/
|
|
||||||
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."
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
trap 'exit 130' INT
|
||||||
|
|
||||||
|
# Confirmation prompt
|
||||||
|
while true; do
|
||||||
|
read -r -p "Would you like to Update phpMyAdmin? [Y/n] " input
|
||||||
|
|
||||||
|
case $input in
|
||||||
|
[yY][eE][sS]|[yY])
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
[nN][oO]|[nN])
|
||||||
|
echo "phpMyAdmin update aborted."
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "That wasn't an option..."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# Dependency check
|
||||||
|
if ! command -v curl &>/dev/null; then
|
||||||
|
echo "Installing curl..."
|
||||||
|
sudo apt install -y curl
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Update process
|
||||||
|
echo "Updating phpMyAdmin..."
|
||||||
|
sudo apt update && sudo apt upgrade -y
|
||||||
|
sudo rm -rf /usr/share/phpmyadmin.bak
|
||||||
|
sudo mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak
|
||||||
|
sudo mkdir /usr/share/phpmyadmin/
|
||||||
|
sudo wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz -P /usr/share/phpmyadmin/
|
||||||
|
sudo tar -xzf /usr/share/phpmyadmin/*.tar.gz -C /usr/share/phpmyadmin/
|
||||||
|
sudo mv /usr/share/phpmyadmin/phpMyAdmin-*-all-languages/* /usr/share/phpmyadmin
|
||||||
|
sudo mkdir /usr/share/phpmyadmin/tmp/ && sudo chmod -R 777 /usr/share/phpmyadmin/tmp/
|
||||||
|
randomBlowfishSecret=$(openssl rand -base64 22)
|
||||||
|
sudo sed -i "s|cfg\['blowfish_secret'\] = ''|cfg['blowfish_secret'] = '$randomBlowfishSecret'|" /usr/share/phpmyadmin/config.sample.inc.php
|
||||||
|
sudo mv /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php
|
||||||
|
sudo systemctl restart apache2 nginx
|
||||||
|
|
||||||
|
# Completion message
|
||||||
|
echo -e "=================================================================="
|
||||||
|
echo "phpMyAdmin has been updated!"
|
||||||
|
echo -e "=================================================================="
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
|
|
|
@ -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 ~
|
|
@ -0,0 +1,70 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
trap 'exit 130' INT
|
||||||
|
# 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
|
||||||
|
apt remove golang -y
|
||||||
|
rm -rf /tmp/go/
|
||||||
|
mkdir /tmp/go/
|
||||||
|
cd /tmp/go/
|
||||||
|
VER="1.20.7"
|
||||||
|
if [ -n "$(uname -a | grep x86_64)" ]; then
|
||||||
|
curl -fsSL -o "/tmp/go/go"$VER".linux-amd64.tar.gz" "https://go.dev/dl/go"$VER".linux-amd64.tar.gz"
|
||||||
|
fi
|
||||||
|
if [ -n "$(uname -a | grep armv6l)" ]; then
|
||||||
|
curl -fsSL -o "/tmp/go/go"$VER".linux-armv6l.tar.gz" "https://go.dev/dl/go"$VER".linux-armv6l.tar.gz"
|
||||||
|
fi
|
||||||
|
if [ -n "$(uname -a | grep i386)" ]; then
|
||||||
|
curl -fsSL -o "/tmp/go/go"$VER".linux-386.tar.gz" "https://go.dev/dl/go"$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
|
||||||
|
cd ~
|
||||||
|
rm -rf /tmp/caddy
|
||||||
|
mkdir /tmp/caddy
|
||||||
|
cd /tmp/caddy
|
||||||
|
VER=$(curl --silent "https://api.github.com/repos/caddyserver/xcaddy/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/caddy/xcaddy_"$VER"_linux_amd64.tar.gz" "https://github.com/caddyserver/xcaddy/releases/download/v"$VER"/xcaddy_"$VER"_linux_amd64.tar.gz"
|
||||||
|
fi
|
||||||
|
if [ -n "$(uname -a | grep armv6l)" ]; then
|
||||||
|
curl -fsSL -o "/tmp/caddy/xcaddy_"$VER"_armv6.tar.gz" "https://github.com/caddyserver/xcaddy/releases/download/v"$VER"/xcaddy_v"$VER"_armv6.tar.gz"
|
||||||
|
fi
|
||||||
|
if [ -n "$(uname -a | grep armv7l)" ]; then
|
||||||
|
curl -fsSL -o "/tmp/caddy/xcaddy_"$VER"_linux_armv7.tar.gz" "https://github.com/caddyserver/xcaddy/releases/download/v"$VER"/xcaddy_v"$VER"_linux_armv7.tar.gz"
|
||||||
|
fi
|
||||||
|
if [ -n "$(uname -a | grep armv5l)" ]; then
|
||||||
|
curl -fsSL -o "/tmp/caddy/xcaddy_"$VER"_linux_armv5.tar.gz" "https://github.com/caddyserver/xcaddy/releases/download/v"$VER"/xcaddy_v"$VER"_linux_armv5.tar.gz"
|
||||||
|
fi
|
||||||
|
tar xvf *.tar.gz xcaddy
|
||||||
|
sudo mv xcaddy /usr/bin
|
||||||
|
mkdir ~/caddy
|
||||||
|
cd ~/caddy
|
||||||
|
xcaddy build
|
||||||
|
sudo mv caddy /usr/bin
|
||||||
|
sudo groupadd --system caddy
|
||||||
|
sudo useradd --system \
|
||||||
|
--gid caddy \
|
||||||
|
--create-home \
|
||||||
|
--home-dir /var/lib/caddy \
|
||||||
|
--shell /usr/sbin/nologin \
|
||||||
|
--comment "Caddy web server" \
|
||||||
|
caddy
|
||||||
|
sudo chown root:root /usr/bin/caddy
|
||||||
|
sudo chmod 755 /usr/bin/caddy
|
||||||
|
sudo mkdir /etc/caddy
|
||||||
|
sudo chown -R root:caddy /etc/caddy
|
||||||
|
sudo mkdir /etc/ssl/caddy
|
||||||
|
sudo chown -R root:caddy /etc/ssl/caddy
|
||||||
|
sudo chmod 0770 /etc/ssl/caddy
|
||||||
|
sudo mkdir /var/www
|
||||||
|
sudo chown caddy:caddy /var/www
|
||||||
|
sudo sh -c 'curl https://raw.githubusercontent.com/caddyserver/dist/master/init/caddy.service > /etc/systemd/system/caddy.service'
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl status caddy
|
||||||
|
sudo ufw allow proto tcp from any to any port 80,443
|
|
@ -0,0 +1,16 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
trap 'exit 130' INT
|
||||||
|
sudo apt update && sudo apt upgrade -y
|
||||||
|
sudo apt install fail2ban -y
|
||||||
|
sudo cp /etc/fail2ban/fail2ban.conf /etc/fail2ban/fail2ban.local
|
||||||
|
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
|
||||||
|
sudo systemctl enable fail2ban
|
||||||
|
|
||||||
|
echo -e "=================================================================="
|
||||||
|
|
||||||
|
echo "Fail2Ban has been installed!"
|
||||||
|
echo "The F2B Config can be found at /etc/fail2ban/fail2ban.local"
|
||||||
|
echo "The F2B Jails Config can be found at /etc/fail2ban/jail.local"
|
||||||
|
echo "When it has been setup to your liking you can run ~fail2ban-client start~"
|
||||||
|
|
||||||
|
echo -e "=================================================================="
|
|
@ -0,0 +1,102 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
trap 'exit 130' INT
|
||||||
|
|
||||||
|
# Function to check if required domains are accessible
|
||||||
|
check_domains() {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
# 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
|
||||||
|
# Automate installation by assuming yes to the prompt
|
||||||
|
check_domains
|
||||||
|
install_gitea
|
||||||
|
|
||||||
|
exit 0
|
|
@ -0,0 +1,39 @@
|
||||||
|
#!/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
|
||||||
|
|
||||||
|
# Automate confirmation by assuming yes to the prompt
|
||||||
|
uninstall_gitea
|
||||||
|
|
||||||
|
exit 0
|
|
@ -0,0 +1,70 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Function to check network connectivity
|
||||||
|
check_connectivity() {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
# 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
|
||||||
|
# Automate confirmation by assuming yes to the prompt
|
||||||
|
check_connectivity
|
||||||
|
update_gitea
|
||||||
|
|
||||||
|
exit 0
|
|
@ -0,0 +1,62 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
if [ ! -x /usr/bin/curl ] ; then
|
||||||
|
CURL_NOT_EXIST=1
|
||||||
|
apt install -y curl
|
||||||
|
else
|
||||||
|
CURL_NOT_EXIST=0
|
||||||
|
fi
|
||||||
|
sudo apt install wget git -y
|
||||||
|
wget -O goinstall.sh https://sop.wtf/sh/u/goinstall && bash goinstall.sh
|
||||||
|
sudo adduser --disabled-login --gecos 'Gogs' git
|
||||||
|
git clone --depth 1 https://github.com/gogs/gogs.git gogs
|
||||||
|
cd gogs
|
||||||
|
go build -o gogs
|
||||||
|
./gogs web
|
||||||
|
sudo mkdir /var/log/gogs
|
||||||
|
sudo chown -R git:git /var/log/gogs/
|
||||||
|
sudo echo "
|
||||||
|
[Unit]
|
||||||
|
Description=Gogs self-hosted Git service
|
||||||
|
After=syslog.target
|
||||||
|
After=network.target
|
||||||
|
After=mysql.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
# Modify these two values and uncomment them if you have
|
||||||
|
# repos with lots of files and get an HTTP error 500 because
|
||||||
|
# of that
|
||||||
|
###
|
||||||
|
#LimitMEMLOCK=infinity
|
||||||
|
#LimitNOFILE=65535
|
||||||
|
Type=simple
|
||||||
|
User=git
|
||||||
|
Group=git
|
||||||
|
WorkingDirectory=/home/git
|
||||||
|
ExecStart=/home/git/gogs web
|
||||||
|
Restart=always
|
||||||
|
Environment=USER=git HOME=/home/git
|
||||||
|
|
||||||
|
# Some distributions may not support these hardening directives. If you cannot start the service due
|
||||||
|
# to an unknown option, comment out the ones not supported by your version of systemd.
|
||||||
|
ProtectSystem=full
|
||||||
|
PrivateDevices=yes
|
||||||
|
PrivateTmp=yes
|
||||||
|
NoNewPrivileges=true
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
" >> /etc/systemd/system/gogs.service
|
||||||
|
sudo rsync -avz gogs/* /home/git/
|
||||||
|
sudo chown -R git:git /home/git/
|
||||||
|
sudo ufw allow 3000
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl enable gogs
|
||||||
|
sudo systemctl start gogs
|
||||||
|
sudo rm -rf gogs linux_amd64.tar.gz
|
||||||
|
|
||||||
|
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 "Gogs Should be available at http://${intenalip}:3000"
|
||||||
|
echo "Or If you are using a VPS at http://${publicipaddress}:3000"
|
||||||
|
echo -e "=================================================================="
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
sudo systemctl stop gogs
|
||||||
|
sudo systemctl disable gogs
|
||||||
|
sudo rm -rf /etc/systemd/system/gogs.service
|
||||||
|
sudo userdel git
|
||||||
|
sudo rm -rf /home/git
|
||||||
|
sudo rm -rf /var/log/gogs/*
|
||||||
|
sudo ufw delete allow 3000
|
|
@ -0,0 +1,36 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Check if curl is installed
|
||||||
|
if ! command -v curl &>/dev/null; then
|
||||||
|
echo "curl is required but not installed. Installing curl..."
|
||||||
|
sudo apt update && sudo apt install -y curl || {
|
||||||
|
echo "Failed to install curl. Exiting."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get latest Go version
|
||||||
|
ARCH=$(uname -m)
|
||||||
|
case $ARCH in
|
||||||
|
"x86_64") ARCH="amd64" ;;
|
||||||
|
"armv6l") ARCH="armv6l" ;;
|
||||||
|
*) ARCH="386" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
GO_VERSION=$(curl -sSL https://golang.org/dl/?mode=json | grep -oP '"version":"\K[^"]+' | head -n1)
|
||||||
|
GO_URL="https://golang.org/dl/go$GO_VERSION.linux-$ARCH.tar.gz"
|
||||||
|
|
||||||
|
# Install Go
|
||||||
|
echo "Downloading and installing Go $GO_VERSION..."
|
||||||
|
sudo rm -rf /usr/local/go
|
||||||
|
sudo curl -fsSL "$GO_URL" | sudo tar -C /usr/local -xz || {
|
||||||
|
echo "Failed to download and install Go. Exiting."
|
||||||
|
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."
|
|
@ -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
|
||||||
|
sudo apt-get install bzr git mercurial -y
|
||||||
|
# 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
|
||||||
|
apt remove golang -y
|
||||||
|
wget -O goinstall.sh https://sop.wtf/sh/u/goinstall && bash goinstall.sh
|
||||||
|
git clone https://github.com/hockeypuck/packaging /var/lib/hockeypuck
|
||||||
|
cd packaging
|
||||||
|
./prepare.bash
|
||||||
|
export GOPATH=$(pwd)
|
||||||
|
go install github.com/hockeypuck/server/cmd/hockeypuck
|
||||||
|
go install github.com/hockeypuck/server/cmd/hockeypuck-load
|
||||||
|
go install github.com/hockeypuck/server/cmd/hockeypuck-pbuild
|
||||||
|
bash /var/lib/hockeypuck -config /var/lib/hockeypuck/hockeypuck.conf
|
|
@ -0,0 +1,46 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Trap INT signal to ensure clean exits
|
||||||
|
trap 'exit 130' INT
|
||||||
|
|
||||||
|
# Check for dependencies and install if needed
|
||||||
|
if ! command -v curl &>/dev/null; then
|
||||||
|
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
|
||||||
|
echo "Unsupported architecture. Exiting."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Download and install Hugo
|
||||||
|
echo "Downloading and installing Hugo..."
|
||||||
|
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!"
|
||||||
|
|
||||||
|
# Clean up
|
||||||
|
rm -rf /tmp/hugo
|
||||||
|
cd ~
|
||||||
|
|
||||||
|
exit 0
|
|
@ -0,0 +1,22 @@
|
||||||
|
#!/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
|
||||||
|
sudo apt install acl fping git graphviz imagemagick mariadb-client mariadb-server mtr-tiny nginx-full nmap php-cli php-curl php-fpm php-gd php-gmp php-json php-mbstring php-mysql php-snmp php-xml php-zip rrdtool snmp snmpd whois unzip python3-pymysql python3-dotenv python3-redis python3-setuptools python3-systemd python3-pip -y
|
||||||
|
sudo useradd librenms -d /opt/librenms -M -r -s "$(which bash)"
|
||||||
|
cd /opt
|
||||||
|
sudo git clone https://github.com/librenms/librenms.git
|
||||||
|
sudo chown -R librenms:librenms /opt/librenms
|
||||||
|
sudo chmod 771 /opt/librenms
|
||||||
|
sudo setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
|
||||||
|
sudo setfacl -R -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
|
||||||
|
sudo -u librenms bash -c './scripts/composer_wrapper.php install --no-dev'
|
||||||
|
exit
|
||||||
|
sudo curl -fsSL -o "composer-stable.phar" https://getcomposer.org/composer-stable.phar
|
||||||
|
sudo mv composer-stable.phar /usr/bin/composer
|
||||||
|
sudo chmod +x /usr/bin/composer
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
trap 'exit 130' INT
|
||||||
|
apt update && apt upgrade -y
|
||||||
|
sudo apt install wget software-properties-common dirmngr ca-certificates apt-transport-https mariadb-server mariadb-client -y
|
||||||
|
echo -e "=================================================================="
|
||||||
|
echo "Time to Configure MariaDB."
|
||||||
|
echo "Don't Know what to do? I can help!"
|
||||||
|
echo "1. Root password just click ENTER as there is no password"
|
||||||
|
echo "2. Switch to unix_socket authentication select. n"
|
||||||
|
echo "3. Change the root password? Y"
|
||||||
|
echo "4. Remove anonymous users? Y "
|
||||||
|
echo "5. Disallow root login remotely? y, But if it's local it's fine to say no."
|
||||||
|
echo "6. Remove test database and access to it? Y"
|
||||||
|
echo "7. Reload privilege tables now? Y"
|
||||||
|
echo -e "=================================================================="
|
||||||
|
sleep 5
|
||||||
|
sudo mysql_secure_installation
|
||||||
|
|
||||||
|
echo "If you want to install phpMyAdmin run wget -O pmainstall.sh https://sop.wtf/sh/pmainstall && bash pmainstall.sh"
|
|
@ -0,0 +1,50 @@
|
||||||
|
#!/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
|
||||||
|
curl -sL https://deb.nodesource.com/setup_16.x | bash -
|
||||||
|
apt-get install nodejs -y
|
||||||
|
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
||||||
|
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
|
||||||
|
apt-get update -y
|
||||||
|
apt-get install yarn -y
|
||||||
|
apt-get install postgresql postgresql-contrib -y
|
||||||
|
su - postgres
|
||||||
|
psql
|
||||||
|
CREATE USER mastodon CREATEDB;
|
||||||
|
exit
|
||||||
|
adduser --disabled-login --gecos 'Mastodon Server' mastodon
|
||||||
|
su - mastodon
|
||||||
|
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
|
||||||
|
cd ~/.rbenv && src/configure && make -C src
|
||||||
|
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
|
||||||
|
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
|
||||||
|
exec bash
|
||||||
|
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build\
|
||||||
|
RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 3.0.3
|
||||||
|
rbenv global 3.0.3
|
||||||
|
gem update --system
|
||||||
|
gem install bundler --no-document
|
||||||
|
su - mastodon
|
||||||
|
git clone https://github.com/tootsuite/mastodon.git ~/live
|
||||||
|
cd ~/live
|
||||||
|
bundle config deployment 'true'
|
||||||
|
bundle config without 'development test'
|
||||||
|
bundle install -j$(getconf _NPROCESSORS_ONLN)
|
||||||
|
yarn install --pure-lockfile
|
||||||
|
RAILS_ENV=production bundle exec rake mastodon:setup
|
||||||
|
exit
|
||||||
|
cp /home/mastodon/live/dist/mastodon-web.service /etc/systemd/system/
|
||||||
|
cp /home/mastodon/live/dist/mastodon-sidekiq.service /etc/systemd/system/
|
||||||
|
cp /home/mastodon/live/dist/mastodon-streaming.service /etc/systemd/system/
|
||||||
|
systemctl start mastodon-web
|
||||||
|
systemctl start mastodon-sidekiq
|
||||||
|
systemctl start mastodon-streaming
|
||||||
|
systemctl enable mastodon-web
|
||||||
|
systemctl enable mastodon-sidekiq
|
||||||
|
systemctl enable mastodon-streaming
|
||||||
|
systemctl status mastodon-web mastodon-sidekiq mastodon-streaming
|
|
@ -0,0 +1,42 @@
|
||||||
|
#!/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
|
||||||
|
NODE_LTS= "18.12.1"
|
||||||
|
sudo apt update && apt upgrade -y
|
||||||
|
sudo apt install postgresql postgresql-contrib ffmpeg redis-server npm yarn -y
|
||||||
|
sudo systemctl start postgresql.service
|
||||||
|
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
|
||||||
|
source ~/.bashrc
|
||||||
|
nvm install node
|
||||||
|
nvm install v$NODE_LTS
|
||||||
|
nvm use v$NODE_LTS
|
||||||
|
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
|
||||||
|
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
|
||||||
|
PASSWD_GEN=$(openssl rand -base64 10)
|
||||||
|
sudo -i -u postgres psql -c "CREATE USER misskey WITH PASSWORD '$PASSWD_GEN';"
|
||||||
|
sudo -i -u postgres psql -c "CREATE USER misskey WITH PASSWORD '$PASSWD_GEN';"
|
||||||
|
sudo -i -u postgres psql -c "CREATE DATABASE misskey;"
|
||||||
|
sudo -i -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE misskey to misskey;"
|
||||||
|
sudo -i -u postgres psql -c "ALTER DATABASE misskey OWNER TO misskey;"
|
||||||
|
adduser --disabled-password --disabled-login misskey
|
||||||
|
sudo -i -u misskey
|
||||||
|
git clone -b master https://github.com/misskey-dev/misskey.git
|
||||||
|
cd misskey
|
||||||
|
git checkout master
|
||||||
|
yarn
|
||||||
|
cp .config/example.yml .config/default.yml
|
||||||
|
sed -e "s|user: example-misskey-user = ''user: = 'misskey'|" >> .config/default.yml
|
||||||
|
sed -e "s|user: example-misskey-pass = ''user: = '$PASSWD_GEN'|" >> .config/default.yml
|
||||||
|
NODE_ENV=production yarn build
|
||||||
|
yarn run init
|
||||||
|
exit
|
||||||
|
curl -fsSL -o "/etc/systemd/system/misskey.service" https://git.oldgate.org/Sophia/thelinuxlist/raw/branch/main/systemd/misskey.service
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl enable misskey.service
|
||||||
|
sudo systemctl start misskey.service
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/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
|
||||||
|
sudo apt update && apt upgrade -y
|
||||||
|
sudo apt install wget curl gnupg2 software-properties-common apt-transport-https ca-certificates lsb-release -y
|
||||||
|
sudo curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
|
||||||
|
echo "deb http://security.ubuntu.com/ubuntu jammy-security main" | sudo tee /etc/apt/sources.list.d/jammy-security.list
|
||||||
|
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
|
||||||
|
sudo apt update -y
|
||||||
|
sudo apt-get install libssl1.1 -y
|
||||||
|
sudo apt install mongodb-org -y
|
||||||
|
sudo systemctl start mongod
|
||||||
|
sudo systemctl enable mongod
|
||||||
|
apt autoremove -y
|
|
@ -0,0 +1,66 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
trap 'exit 130' INT
|
||||||
|
while [ "$go" != 'apache' ] && [ "$go" != 'nginx' ]; do
|
||||||
|
read -p "Would you like to install using Nginx or Apache? (nginx/apache) " go
|
||||||
|
done
|
||||||
|
if [ "$go" == 'nginx' ]; 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/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
|
||||||
|
sudo systemctl stop nginx
|
||||||
|
sudo wget -O /etc/nginx/conf.d/phpmyadmin.conf https://git.oldgate.org/Sophia/thelinuxlist/raw/branch/main/conf/pmanginx.conf
|
||||||
|
sudo systemctl enable nginx
|
||||||
|
sudo systemctl start nginx
|
||||||
|
## 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 nginx
|
||||||
|
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
|
||||||
|
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
|
|
@ -0,0 +1,32 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
trap 'exit 130' INT
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
#!/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
|
||||||
|
sudo apt update && apt upgrade -y
|
||||||
|
sudo rm -rf /usr/share/phpmyadmin.bak
|
||||||
|
sudo mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak
|
||||||
|
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 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 systemctl restart nginx
|
||||||
|
echo -e "=================================================================="
|
||||||
|
echo "phpMyAdmin has been updated!"
|
||||||
|
echo -e "=================================================================="
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
while true
|
||||||
|
do
|
||||||
|
read -p "Where would you like to mount your share?: " MOUNT_DIR
|
||||||
|
|
||||||
|
if [ -d "$MOUNT_DIR" ]; then
|
||||||
|
echo "The Directory $MOUNT_DIR Already Exist"
|
||||||
|
sleep 1
|
||||||
|
else
|
||||||
|
mkdir -p $MOUNT_DIR
|
||||||
|
echo "creating $MOUNT_DIR"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
while true
|
||||||
|
do
|
||||||
|
read -p "What is your Shares Username?: " SMB_USR
|
||||||
|
|
||||||
|
if [ -d "$SMB_USR" ]; then
|
||||||
|
echo "username=$SMB_USR" >> /.smb-credentials
|
||||||
|
sleep 1
|
||||||
|
else
|
||||||
|
echo "username=$SMB_USR" >> /.smb-credentials
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
while true
|
||||||
|
do
|
||||||
|
read -p "What is your Shares Password?: " SMB_PASS
|
||||||
|
|
||||||
|
if [ -d "$SMB_PASS" ]; then
|
||||||
|
echo "password=$SMB_PASS" >> /.smb-credentials
|
||||||
|
sleep 1
|
||||||
|
else
|
||||||
|
echo "password=$SMB_PASS" >> /.smb-credentials
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
while true
|
||||||
|
do
|
||||||
|
read -p "What is your Shares IP Address?: " SMB_ADDR
|
||||||
|
read -p "Where is your Share located on the remote server? i.e /mnt/Share: " SMB_REMDIR
|
||||||
|
|
||||||
|
if [ -d "$SMB_ADDR" ]; then
|
||||||
|
sudo mount -t cifs -o rw,vers=3.0,credentials=/.smb-credentials //$SMB_ADDR/$SMB_REMDIR $MOUNT_DIR
|
||||||
|
sleep 1
|
||||||
|
else
|
||||||
|
sudo mount -t cifs -o rw,vers=3.0,credentials=/root/.smb-credentials //$SMB_ADDR/$SMB_REMDIR $MOUNT_DIR
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
|
@ -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 ~
|
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
trap 'exit 130' INT
|
||||||
|
while true
|
||||||
|
do
|
||||||
|
read -p "Enter The Directory Where you want to install Wordpress: " INSTALL_DIR
|
||||||
|
|
||||||
|
if [ -d "$INSTALL_DIR" ]; then
|
||||||
|
echo "The Directory $INSTALL_DIR Already Exist"
|
||||||
|
sleep 1
|
||||||
|
else
|
||||||
|
mkdir -p $INSTALL_DIR
|
||||||
|
echo "creating $INSTALL_DIR"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ ! -x /usr/bin/curl ] ; then
|
||||||
|
CURL_NOT_EXIST=1
|
||||||
|
apt install -y curl
|
||||||
|
else
|
||||||
|
CURL_NOT_EXIST=0
|
||||||
|
fi
|
||||||
|
curl -fsSL -o "latest.zip" https://wordpress.org/latest.zip
|
||||||
|
apt install unzip -y
|
||||||
|
unzip latest.zip -d $INSTALL_DIR
|
||||||
|
cp -r $INSTALL_DIR/wordpress/* $INSTALL_DIR
|
||||||
|
rm -rf $INSTALL_DIR/wordpress
|
||||||
|
rm -rf latest.zip
|
||||||
|
chmod -R 775 $INSTALL_DIR
|
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
trap 'exit 130' INT
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
read -r -p "Would you like to install Wordpress? [Y/n] " input
|
read -r -p "Would you like to install Wordpress? [Y/n] " input
|
||||||
|
@ -29,8 +30,13 @@ do
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
if [ ! -x /usr/bin/curl ] ; then
|
||||||
wget -O latest.zip https://wordpress.org/latest.zip
|
CURL_NOT_EXIST=1
|
||||||
|
apt install -y curl
|
||||||
|
else
|
||||||
|
CURL_NOT_EXIST=0
|
||||||
|
fi
|
||||||
|
curl -fsSL -o "latest.zip" https://wordpress.org/latest.zip
|
||||||
apt install unzip -y
|
apt install unzip -y
|
||||||
unzip latest.zip -d $INSTALL_DIR
|
unzip latest.zip -d $INSTALL_DIR
|
||||||
cp -r $INSTALL_DIR/wordpress/* $INSTALL_DIR
|
cp -r $INSTALL_DIR/wordpress/* $INSTALL_DIR
|
||||||
|
|
Loading…
Reference in New Issue