diff --git a/README.md b/README.md index 5ce5602..2b408de 100644 --- a/README.md +++ b/README.md @@ -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` + +--- \ No newline at end of file diff --git a/list.md b/list.md index 20534d4..25d62a2 100644 --- a/list.md +++ b/list.md @@ -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 ``` _________________________________________________________________________ diff --git a/scripts/fail2baninstall.sh b/scripts/fail2baninstall.sh new file mode 100644 index 0000000..3094fcf --- /dev/null +++ b/scripts/fail2baninstall.sh @@ -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 "==================================================================" \ No newline at end of file diff --git a/scripts/giteainstall.sh b/scripts/giteainstall.sh index 4c8101f..ff3e83e 100644 --- a/scripts/giteainstall.sh +++ b/scripts/giteainstall.sh @@ -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 diff --git a/scripts/masto.sh b/scripts/masto.sh new file mode 100644 index 0000000..fcce914 --- /dev/null +++ b/scripts/masto.sh @@ -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 \ No newline at end of file diff --git a/scripts/misskeyinstall.sh b/scripts/misskeyinstall.sh new file mode 100644 index 0000000..0c624ac --- /dev/null +++ b/scripts/misskeyinstall.sh @@ -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 + diff --git a/scripts/pmainstall.sh b/scripts/pmainstall.sh index 40ea10c..eedeeea 100644 --- a/scripts/pmainstall.sh +++ b/scripts/pmainstall.sh @@ -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) diff --git a/scripts/pmauninstall.sh b/scripts/pmauninstall.sh index 9834c10..e34722a 100644 --- a/scripts/pmauninstall.sh +++ b/scripts/pmauninstall.sh @@ -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 diff --git a/scripts/smbamount.sh b/scripts/smbamount.sh new file mode 100644 index 0000000..5f72629 --- /dev/null +++ b/scripts/smbamount.sh @@ -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 \ No newline at end of file diff --git a/scripts/wpinstall.sh b/scripts/wpinstall.sh new file mode 100644 index 0000000..ee2215d --- /dev/null +++ b/scripts/wpinstall.sh @@ -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 \ No newline at end of file diff --git a/systemd/misskey.service b/systemd/misskey.service new file mode 100644 index 0000000..e7ae39c --- /dev/null +++ b/systemd/misskey.service @@ -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 \ No newline at end of file