From 61da9598109f154ca20881498464a9c80248b431 Mon Sep 17 00:00:00 2001 From: Sophia Atkinson Date: Sun, 23 Oct 2022 11:29:35 -0700 Subject: [PATCH 01/22] Update 'scripts/giteainstall.sh' --- scripts/giteainstall.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/giteainstall.sh b/scripts/giteainstall.sh index 4c8101f..f5ba654 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} From 577d53c09845a932530a572db5350890f099c8bf Mon Sep 17 00:00:00 2001 From: Sophia Atkinson Date: Sun, 23 Oct 2022 11:30:02 -0700 Subject: [PATCH 02/22] Update 'scripts/giteainstall.sh' --- scripts/giteainstall.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/giteainstall.sh b/scripts/giteainstall.sh index f5ba654..ff3e83e 100644 --- a/scripts/giteainstall.sh +++ b/scripts/giteainstall.sh @@ -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 From 6149d2c68aa5d281f14cfd9ced33a561ca80ced8 Mon Sep 17 00:00:00 2001 From: Sophia Atkinson Date: Sun, 23 Oct 2022 13:04:23 -0700 Subject: [PATCH 03/22] Update 'scripts/pmainstall.sh' --- scripts/pmainstall.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/pmainstall.sh b/scripts/pmainstall.sh index 40ea10c..5c6d5ed 100644 --- a/scripts/pmainstall.sh +++ b/scripts/pmainstall.sh @@ -35,6 +35,20 @@ sudo a2enconf php8.1-fpm sudo systemctl restart php8.1-fpm sudo systemctl enable apache2 sudo systemctl restart 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 cd /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 +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 32) +sed -e "s|cfg\['blowfish_secret'\] = ''|cfg['blowfish_secret'] = '$randomBlowfishSecret'|" /usr/share/phpmyadmin/config.sample.inc.php > /usr/share/phpmyadmin/config.inc.php 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 ) From f01c2015177ee9a48bbc05824f16b9a2e7e549b1 Mon Sep 17 00:00:00 2001 From: Sophia Atkinson Date: Sun, 23 Oct 2022 13:11:28 -0700 Subject: [PATCH 04/22] Update 'scripts/pmainstall.sh' --- scripts/pmainstall.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/pmainstall.sh b/scripts/pmainstall.sh index 5c6d5ed..8abc71e 100644 --- a/scripts/pmainstall.sh +++ b/scripts/pmainstall.sh @@ -40,7 +40,6 @@ 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 cd /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 sudo mv /usr/share/phpmyadmin/phpMyAdmin-"$PMA_VER"-all-languages/* /usr/share/phpmyadmin From 808c3097b1be1246f2d6baa59075e012d2dcb64e Mon Sep 17 00:00:00 2001 From: Sophia Atkinson Date: Sun, 23 Oct 2022 13:20:18 -0700 Subject: [PATCH 05/22] openssl rand -base64 32 is 44 characters not 32 --- scripts/pmainstall.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/pmainstall.sh b/scripts/pmainstall.sh index 8abc71e..03b53b2 100644 --- a/scripts/pmainstall.sh +++ b/scripts/pmainstall.sh @@ -34,21 +34,20 @@ sudo a2enmod proxy_fcgi sudo a2enconf php8.1-fpm sudo systemctl restart php8.1-fpm sudo systemctl enable apache2 -sudo systemctl restart 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 +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 32) +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) From a2bb5bc8940f91d410e3d42bbb025c3e37754945 Mon Sep 17 00:00:00 2001 From: Sophia Atkinson Date: Sun, 23 Oct 2022 13:29:22 -0700 Subject: [PATCH 06/22] Update 'scripts/pmauninstall.sh' --- scripts/pmauninstall.sh | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) 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 From 2451c5129d5704c9cd8e58606d35646593939972 Mon Sep 17 00:00:00 2001 From: Sophia Atkinson Date: Sun, 23 Oct 2022 13:35:52 -0700 Subject: [PATCH 07/22] ppa:ondrej/php no more prompt --- scripts/pmainstall.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pmainstall.sh b/scripts/pmainstall.sh index 03b53b2..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 From 63d7dd384577115ff83192e51b171d1fd553dffb Mon Sep 17 00:00:00 2001 From: Sophia Atkinson Date: Mon, 24 Oct 2022 18:18:25 -0700 Subject: [PATCH 08/22] nano not needed >> works similar in bash --- list.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/list.md b/list.md index 20534d4..2ae1697 100644 --- a/list.md +++ b/list.md @@ -90,7 +90,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 ``` _________________________________________________________________________ From 8f82bb22bd293e569d989534c115d5a842779cfa Mon Sep 17 00:00:00 2001 From: Sophia Atkinson Date: Fri, 28 Oct 2022 22:45:20 -0700 Subject: [PATCH 09/22] Add 'scripts/wpinstall.sh' --- scripts/wpinstall.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 scripts/wpinstall.sh diff --git a/scripts/wpinstall.sh b/scripts/wpinstall.sh new file mode 100644 index 0000000..3aea5e3 --- /dev/null +++ b/scripts/wpinstall.sh @@ -0,0 +1,38 @@ +#!/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 \ No newline at end of file From 04b094743d58dd0487ad34433cb08260e484f7b0 Mon Sep 17 00:00:00 2001 From: Sophia Date: Sun, 30 Oct 2022 15:04:32 -0700 Subject: [PATCH 10/22] Start of Mastodon script, added Wordpress to ReadME --- README.md | 9 ++++++++ scripts/masto.sh | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 scripts/masto.sh diff --git a/README.md b/README.md index 5ce5602..566671d 100644 --- a/README.md +++ b/README.md @@ -59,4 +59,13 @@ ### `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/wpinstall && bash wpinstall.sh` + +--- + 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 From 4e8772e286c2dccb7ec0b50935488313354e121f Mon Sep 17 00:00:00 2001 From: Sophia Atkinson Date: Sun, 30 Oct 2022 15:06:11 -0700 Subject: [PATCH 11/22] extra ### oops --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 566671d..8177f57 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,6 @@ --- ## Wordpress -### ### ✔️ Install ### `wget -O wpinstall.sh https://sop.wtf/wpinstall && bash wpinstall.sh` From 996707c7171279ec4b8b9949e56f1cab2602d06e Mon Sep 17 00:00:00 2001 From: Sophia Date: Sun, 30 Oct 2022 15:57:18 -0700 Subject: [PATCH 12/22] Added Fail2Ban script --- README.md | 7 ++++++- scripts/fail2baninstall.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 scripts/fail2baninstall.sh diff --git a/README.md b/README.md index 8177f57..7d5f23b 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,12 @@ ## Wordpress ### ✔️ Install -### `wget -O wpinstall.sh https://sop.wtf/wpinstall && bash wpinstall.sh` +### `wget -O wpinstall.sh https://sop.wtf/sh/wpinstall && bash wpinstall.sh` --- +## Fail2Ban +### ✔️ Install +### `wget -O wpinstall.sh https://sop.wtf/sh/fail2baninstall && bash fail2baninstall.sh` + +--- \ No newline at end of file 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 From c4d1a3dcdc151341691c16f591bd3591f3a5ff79 Mon Sep 17 00:00:00 2001 From: Sophia Atkinson Date: Sun, 30 Oct 2022 16:01:30 -0700 Subject: [PATCH 13/22] Update 'README.md' --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7d5f23b..2b408de 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,6 @@ ## Fail2Ban ### ✔️ Install -### `wget -O wpinstall.sh https://sop.wtf/sh/fail2baninstall && bash fail2baninstall.sh` +### `wget -O fail2baninstall.sh https://sop.wtf/sh/fail2baninstall && bash fail2baninstall.sh` --- \ No newline at end of file From 58034ec8beca2514cac34c771b857c4ac21b27a6 Mon Sep 17 00:00:00 2001 From: Sophia Date: Mon, 31 Oct 2022 20:52:16 -0700 Subject: [PATCH 14/22] SMB Script, DONT USE. It's broken. --- scripts/smbamount.sh | 52 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 scripts/smbamount.sh diff --git a/scripts/smbamount.sh b/scripts/smbamount.sh new file mode 100644 index 0000000..cea5e6d --- /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=/.smb-credentials //$SMB_ADDR/$SMB_REMDIR $MOUNT_DIR + break + fi +done \ No newline at end of file From a1aa63526aafd37c06eb8262e726fc16cf8773df Mon Sep 17 00:00:00 2001 From: Sophia Date: Mon, 31 Oct 2022 20:55:36 -0700 Subject: [PATCH 16/22] SMB Script. DON'T USE --- scripts/smbamount.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/smbamount.sh b/scripts/smbamount.sh index cea5e6d..5f72629 100644 --- a/scripts/smbamount.sh +++ b/scripts/smbamount.sh @@ -46,7 +46,7 @@ do 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=/.smb-credentials //$SMB_ADDR/$SMB_REMDIR $MOUNT_DIR + 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 From d8c78934d42246509a8be05288d9abdd75fd5286 Mon Sep 17 00:00:00 2001 From: Sophia Date: Sat, 5 Nov 2022 18:43:45 -0700 Subject: [PATCH 17/22] Misskey install and retired list.md --- list.md | 2 ++ scripts/misskeyinstall.sh | 59 +++++++++++++++++++++++++++++++++++++++ systemd/misskey.service | 17 +++++++++++ 3 files changed, 78 insertions(+) create mode 100644 scripts/misskeyinstall.sh create mode 100644 systemd/misskey.service diff --git a/list.md b/list.md index 2ae1697..a5c9a1c 100644 --- a/list.md +++ b/list.md @@ -1,3 +1,5 @@ + +# This has been retired. Please refer to the README.md for scripts. _______________________________________________________________________ ## Update & Upgrade diff --git a/scripts/misskeyinstall.sh b/scripts/misskeyinstall.sh new file mode 100644 index 0000000..7cf2082 --- /dev/null +++ b/scripts/misskeyinstall.sh @@ -0,0 +1,59 @@ +#!/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" +PASSWD_GEN=$(openssl rand -base64 10) +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 +sudo -i -u postgres +psql +CREATE USER misskey WITH PASSWORD '$PASSWD_GEN'; +CREATE DATABASE misskey; +GRANT ALL PRIVILEGES ON DATABASE misskey to misskey; +ALTER DATABASE misskey OWNER TO misskey; +\q +exit +adduser --disabled-password --disabled-login misskey +su - misskey +git clone -b master https://github.com/misskey-dev/misskey.git +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/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 From 43bdbaa21a30353441196022627e66fcf3dcf738 Mon Sep 17 00:00:00 2001 From: Sophia Date: Sun, 6 Nov 2022 01:22:21 -0700 Subject: [PATCH 18/22] somewhat working misskey --- scripts/misskeyinstall.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/scripts/misskeyinstall.sh b/scripts/misskeyinstall.sh index 7cf2082..9fb235b 100644 --- a/scripts/misskeyinstall.sh +++ b/scripts/misskeyinstall.sh @@ -18,7 +18,6 @@ do done NODE_LTS= "18.12.1" -PASSWD_GEN=$(openssl rand -base64 10) sudo apt update && apt upgrade -y sudo apt install postgresql postgresql-contrib -y sudo systemctl start postgresql.service @@ -33,17 +32,16 @@ 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 -sudo -i -u postgres -psql -CREATE USER misskey WITH PASSWORD '$PASSWD_GEN'; -CREATE DATABASE misskey; -GRANT ALL PRIVILEGES ON DATABASE misskey to misskey; -ALTER DATABASE misskey OWNER TO misskey; -\q -exit +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 su - 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 From cef01a80e263cd990594e3316c9f01191e09f05d Mon Sep 17 00:00:00 2001 From: Sophia Date: Wed, 9 Nov 2022 19:49:27 -0800 Subject: [PATCH 19/22] updated list.md to make resizing part easy --- list.md | 20 ++++++++++---------- scripts/misskeyinstall.sh | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/list.md b/list.md index a5c9a1c..ed0f10f 100644 --- a/list.md +++ b/list.md @@ -73,16 +73,16 @@ 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 diff --git a/scripts/misskeyinstall.sh b/scripts/misskeyinstall.sh index 9fb235b..0c624ac 100644 --- a/scripts/misskeyinstall.sh +++ b/scripts/misskeyinstall.sh @@ -39,7 +39,7 @@ 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 -su - misskey +sudo -i -u misskey git clone -b master https://github.com/misskey-dev/misskey.git cd misskey git checkout master From f4e77e966712854099cd683cc3d6277f6475ada1 Mon Sep 17 00:00:00 2001 From: Sophia Atkinson Date: Wed, 9 Nov 2022 19:54:12 -0800 Subject: [PATCH 20/22] Update 'list.md' --- list.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/list.md b/list.md index ed0f10f..d2be973 100644 --- a/list.md +++ b/list.md @@ -73,15 +73,25 @@ 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) + +```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``` _________________________________________________________________________ From 156df1e1e32e4972eab34554b21223ae6dc2105c Mon Sep 17 00:00:00 2001 From: Sophia Atkinson Date: Wed, 9 Nov 2022 20:02:10 -0800 Subject: [PATCH 21/22] Update 'list.md' Signed-off-by: Sophia Atkinson --- list.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/list.md b/list.md index d2be973..25d62a2 100644 --- a/list.md +++ b/list.md @@ -1,5 +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 From 25f6495209a9ca4d015bb3c75829596e54be6cf8 Mon Sep 17 00:00:00 2001 From: Sophia Atkinson Date: Sat, 12 Nov 2022 00:50:17 -0800 Subject: [PATCH 22/22] Update 'scripts/wpinstall.sh' --- scripts/wpinstall.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/wpinstall.sh b/scripts/wpinstall.sh index 3aea5e3..ee2215d 100644 --- a/scripts/wpinstall.sh +++ b/scripts/wpinstall.sh @@ -35,4 +35,5 @@ 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 \ No newline at end of file +rm -rf latest.zip +chmod -R 775 $INSTALL_DIR \ No newline at end of file