Merge pull request 'main' (#1) from Sophia/thelinuxlist:main into main

Reviewed-on: #1
This commit is contained in:
Wade Waters 2022-12-05 11:39:30 -08:00
commit a0a7781ed2
11 changed files with 327 additions and 21 deletions

View File

@ -59,4 +59,17 @@
### `wget -O gogsinstall.sh https://sop.wtf/sh/gogsinstall && bash gogsinstall.sh`
### ✔️ Uninstall
### `wget -O gogsuninstall.sh https://sop.wtf/sh/gogsuninstall && bash gogsuninstall.sh`
---
## Wordpress
### ✔️ Install
### `wget -O wpinstall.sh https://sop.wtf/sh/wpinstall && bash wpinstall.sh`
---
## Fail2Ban
### ✔️ Install
### `wget -O fail2baninstall.sh https://sop.wtf/sh/fail2baninstall && bash fail2baninstall.sh`
---

34
list.md
View File

@ -1,3 +1,7 @@
# This has been retired. Please refer to the README.md for scripts.
# Some of these commands may not function as normal, I will NOT provide any compensation or support for commands that are run that cause things to break. Thanks for your understanding.
![SA Sig](https://sophiaatkinson.com/wp-content/uploads/2022/10/signature-blurple.svg)
_______________________________________________________________________
## Update & Upgrade
@ -71,16 +75,26 @@ df -h
```
## You may need to do this if on virsion 22.04 or higher
```
fdisk -l (note it's partition 3 by looking at the current Size)
parted
resizepart, Fix, 3, 100% (type this instead), quit
pvresize /dev/sda3
lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
resize2fs /dev/ubuntu-vg/ubuntu-lv
df -h
```
```fdisk -l``` (note it's partition 3 by looking at the current Size)
```parted```
```Fix```
```3```
```100%```
```quit```
```pvresize /dev/sda3```
```lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv```
```resize2fs /dev/ubuntu-vg/ubuntu-lv```
```df -h```
_________________________________________________________________________
## Enable Root on SSH
@ -90,7 +104,7 @@ sudo su -
passwd
nano /etc/ssh/sshd_config
Look for: PermitRootLogin prohibit-password (line 34) and change it to PermitRootLogin yes
or if your lazy, sudo echo "PermitRootLogin yes" >> nano /etc/ssh/sshd_config
or if your lazy, sudo echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
reboot
```
_________________________________________________________________________

View File

@ -0,0 +1,32 @@
#!/bin/bash
while true
do
read -r -p "Would you like to install fail2ban? [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 && 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 "=================================================================="

View File

@ -16,11 +16,11 @@ do
;;
esac
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/1.17.3/gitea-1.17.3-linux-amd64
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}
@ -30,6 +30,7 @@ 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

60
scripts/masto.sh Normal file
View File

@ -0,0 +1,60 @@
#!/bin/bash
while true
do
read -r -p "Would you like to install Mastodon? [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
break
;;
[nN][oO]|[nN])
break
;;
*)
echo "That wasn't an option..."
;;
esac
done
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

57
scripts/misskeyinstall.sh Normal file
View File

@ -0,0 +1,57 @@
#!/bin/bash
while true
do
read -r -p "Would you like to install Misskey? [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
break
;;
[nN][oO]|[nN])
break
;;
*)
echo "That wasn't an option..."
;;
esac
done
NODE_LTS= "18.12.1"
sudo apt update && apt upgrade -y
sudo apt install postgresql postgresql-contrib -y
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
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
sudo apt update && sudo apt install yarn
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
sudo wget -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

View File

@ -18,7 +18,7 @@ do
done
sudo apt update && apt upgrade -y
sudo add-apt-repository ppa:ondrej/php && apt install libapache2-mod-php8.1 -y
sudo add-apt-repository --yes ppa:ondrej/php && apt install libapache2-mod-php8.1 -y
sudo systemtl stop apache2
sudo apt install apache2 -y
sudo apt install software-properties-common
@ -34,8 +34,20 @@ sudo a2enmod proxy_fcgi
sudo a2enconf php8.1-fpm
sudo systemctl restart php8.1-fpm
sudo systemctl enable apache2
## Updating phpMyAdmin.
PMA_VER="5.2.0"
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)
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
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)

View File

@ -18,16 +18,25 @@ do
done
sudo apt remove phpmyadmin -y
sudo apt-get autoremove -y
rm -rf /usr/share/phpmyadmin/
sudo systemctl restart apache2
while [ "$go" != 'yes' ] && [ "$go" != 'no' ]; do
read -p "Would you like to also uninstall apache2? This is not reversible. (yes/no) " go
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
if [ "$go" == 'no' ]; then
exit
fi
sudo systemctl stop apache2
sudo apt remove apache2 -y
sudo apt-get autoremove -y

52
scripts/smbamount.sh Normal file
View File

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

39
scripts/wpinstall.sh Normal file
View File

@ -0,0 +1,39 @@
#!/bin/bash
while true
do
read -r -p "Would you like to install Wordpress? [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
break
;;
[nN][oO]|[nN])
break
;;
*)
echo "That wasn't an option..."
;;
esac
done
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
wget -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

17
systemd/misskey.service Normal file
View File

@ -0,0 +1,17 @@
[Unit]
Description=Misskey daemon
[Service]
Type=simple
User=misskey
ExecStart=npm start
WorkingDirectory=/home/misskey/misskey
Environment="NODE_ENV=production"
TimeoutSec=60
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=misskey
Restart=always
[Install]
WantedBy=multi-user.target