first commit

This commit is contained in:
Raven Scott
2022-05-31 18:28:17 -05:00
commit 754955ce15
119 changed files with 5925 additions and 0 deletions

53
alma/code-server Normal file
View File

@ -0,0 +1,53 @@
#/bin/bash
echo "Welcome to the Discord-Linux CodeServer Automated installer"
echo "This installer will automatically select a port on your container."
echo "I will let you know how to access your installation when installation is complete."
echo ""
echo "downloading the Notification Bot"
wget -q -O /usr/bin/notif https://ssh.surf/debian/notif && chmod +x /usr/bin/notif
echo "Done"
notif "Welcome to the Code-Server Automated installer for Discord-Linux ARM, We are preparing your installation..."
notif "Installing Code-Server 3.12 using DPKG"
wget https://github.com/coder/code-server/releases/download/v3.12.0/code-server-3.12.0-arm64.rpm
rpm -U code-server-3.12.0-arm64.rpm
rm -f code-server-3.12.0-arm64.rpm
notif "Downloading our configurations"
wget -q -O /var/tools/startCodeServer.json https://ssh.surf/install/code-server/startCodeServer.json
wget -q -O /var/tools/startCodeServer.sh https://ssh.surf/install/code-server/startCodeServer.sh
chmod +x /var/tools/startCodeServer.sh
mkdir -vp /root/.config/code-server/
wget -q -O /root/.config/code-server/config.yaml https://ssh.surf/install/code-server/config.yaml
PASS=$(openssl rand -hex 12)
sed -i "s/replaceme/${PASS}/g" ~/.config/code-server/config.yaml
sed -i "s/#code-server/cd \/var\/tools \&\& pm2 start startCodeServer.json \&\& relayPort 8080/g" /start.sh
notif "Requesting port from API Server"
hostname=$(hostname)
echo "Grabbing a port from your container from our API"
port=$(curl -s https://findport.ssh.surf/?id=$hostname)
sed -i "s/127.0.0.1:8080/0.0.0.0:${port}/g" /root/.config/code-server/config.yaml
pm2 start /var/tools/startCodeServer.json
notif "The installation has completed. You may access your install at: http://ssh.surf:$port with the password $PASS"

55
alma/hastebin Normal file
View File

@ -0,0 +1,55 @@
#/bin/bash
echo "Welcome to the Discord-Linux HasteBin Automated installer"
echo "This installer will automatically select a port on your container."
echo "I will let you know how to access your Webmin installation when installation is complete."
echo ""
echo "downloading the Notification Bot"
wget -q -O /usr/bin/notif https://ssh.surf/debian/notif && chmod +x /usr/bin/notif
echo "Done"
notif "Welcome to the HasteBin Automated installer for Discord-Linux, We are preparing your installation..."
sleep 3
cd /home
notif "Cloning into /home/haste-server"
git clone https://github.com/seejohnrun/haste-server.git
cd haste-server
npm install
npm update
notif "Requesting port from API Server"
hostname=$(hostname)
echo "Grabbing a port from your container from our API"
port=$(curl -s https://findport.ssh.surf/?id=$hostname)
sed -i "s/7777/${port}/g" config.js
notif "Configuring HasteBin and starting it's server"
wget -O hasteBinStart.json https://ssh.surf/install/hastebin
cd /home/haste-server && pm2 start hasteBinStart.json
sed -i "s/#hastebin/cd \/home\/haste-server \&\& pm2 start hasteBinStart.json/g" /start.sh
echo "Your installation has completed, you may access your installation at: http://ssh.surf:$port"
echo ""
echo ""
echo "You may also create a subdomain for your installation by usoing the following commands in discord"
echo "+dns register yoursubdomainhere"
echo "+dns vhost $port"
echo "The installation will then be avalible over encrypted SSL at https://yoursubdomainhere.ssh.surf"
echo "Sending discord notification to your account:"
notif "Your hastebin installation has completed, you may access your installation at: http://ssh.surf:$port"

11
alma/jdk Normal file
View File

@ -0,0 +1,11 @@
cat <<EOF > /etc/yum.repos.d/adoptium.repo
[Adoptium]
name=Adoptium
baseurl=https://packages.adoptium.net/artifactory/rpm/centos/8/$(uname -m)
enabled=1
gpgcheck=1
gpgkey=https://packages.adoptium.net/artifactory/api/gpg/key/public
EOF
yum remove java-1.8.0-openjdk-headless -y
yum update -y # update if you haven't already -y
yum install temurin-17-jdk -y

12
alma/list Normal file
View File

@ -0,0 +1,12 @@
Software Currently Avalible for AlmaLinux:
To install use: auto-install packageName
PackageName - Software URL
webmin - https://www.webmin.com/
osjs-webdesktop - https://www.os-js.org/
wp - https://wordpress.org/
hastebin - https://www.toptal.com/developers/hastebin/about.md
code-server - https://github.com/coder/code-server
jdk - https://adoptium.net/
mc - https://papermc.io/

63
alma/mc Normal file
View File

@ -0,0 +1,63 @@
#/bin/bash
echo "Welcome to the Discord-Linux MineCraft Server Automated installer"
echo "This will install MineCraft Sever on your system"
echo "A random port on your container will be selected."
printf "\n"
echo "Running this sever does require the Discord-Linux Power Plan"
echo "You may purchase this plan here: https://store.discord-linux.com/product/discord-power-upgrade/"
printf "\n"
echo "Sleeping for 30 seconds, please close this process if you do not wish to continue"
sleep 30
wget -q -O - https://ssh.surf/notify | bash
notif "Welcome to the MineCraft Server installer for Discord-Linux, the installation is starting and will complete in 45 seconds"
useradd mc
mkdir -vp /home/mc
chown mc:mc /home/mc
wget -O /home/mc/server.jar https://api.papermc.io/v2/projects/paper/versions/1.18.2/builds/357/downloads/paper-1.18.2-357.jar
wget -O /home/mc/minecraft-server.json https://ssh.surf/install/mc/minecraft-server.json
wget -q -O /home/mc/eula.txt https://ssh.surf/install/mc/eula
chown -R mc:mc
su - mc -c "cd /home/mc/ && pm2 start minecraft-server.json"
echo "sleeping 30 seconds to allow the server to generate"
sleep 30
echo "Shutting down the MC server for port configuration"
su - mc -c "cd /home/mc/ && pm2 delete all"
echo "killing any possible running instances of java"
pkill java -9
hostname=$(hostname)
echo "Grabbing a port from your container from our API"
port=$(curl -s https://findport.ssh.surf/?id=$hostname)
sleep 10
echo "Setting port in our config"
sed -i "s/25565/${port}/g" /home/mc/server.properties
sed -i "s/max-players=20/max-players=4/g" /home/mc/server.properties
sed -i "s/A Minecraft Server/An MC Server running on Discord-Linux/g" /home/mc/server.properties
echo "Starting the server for final launch"
su - mc -c "cd /home/mc/ && pm2 start minecraft-server.json"
chown mc:mc /home/mc
echo "========================="
echo "Installation is complete."
echo "========================="
echo "Your installation has completed, connect to your MineCraft Server using the following: ssh.surf:$port"
notif "Your installation has completed, connect to your MineCraft Server using the following: ssh.surf:$port"
echo "Please allow up to 5 minutes for the server to start up"

116
alma/osjs-webdesktop Executable file
View File

@ -0,0 +1,116 @@
#/bin/bash
echo "Welcome to the Discord-Linux OSjs Automated installer"
echo "This installer will automatically select a port on your container."
echo "I will let you know how to access your installation when this process is complete."
echo ""
echo ""
echo ""
echo "Sleeping for 5 seconds, please close this process if you do not wish to continue"
yum groupinstall 'Development Tools' -y
yum install pam-devel -y
sleep 5
echo "downloading the Notification Bot"
wget -q -O /usr/bin/notif https://ssh.surf/debian/notif && chmod +x /usr/bin/notif
echo "Done"
notif "Welcome to the OSjs Automated installer for Discord-Linux, we will begin by updating your system. Please wait..."
sh /var/tools/getsystemctl.sh
notif "The system has been updated and systemD has been patched, we are now starting to install the required NPM's for OSjs"
mkdir -vp /webos
cd /webos && git clone https://github.com/os-js/OS.js.git
mv /webos/OS.js /webos/OSjs
cd /webos/OSjs && rm -f package-lock.json
echo "Installing main packages..."
npm install
npm update
notif "The Core OSjs Packages have been installed, we are now starting to install the Applications for OSJS Via NPM"
npm install @osjs/textpad-application
npm install --save --production @osjs/draw-application
npm install --save --production @osjs/filemanager-application
npm install @osjs/settings-application
npm install @osjs/writer-application
npm install --save --production @osjs/xterm-application
npm install --save --production @osjs/ace-application
npm install @osjs/xpra-application
npm install @osjs/vnc-application
npm install @osjs/epub-application
npm install @osjs/webodf-application
npm install @osjs/wolfenstein3d-application
npm install @osjs/tetris-application
npm install @osjs/standard-theme
npm install @osjs/standard-dark-theme
npm install @osjs/gnome-icons
npm install @osjs/freedesktop-sounds
npm install --save --production @osjs/pam-auth
echo "Fixing detected vulns"
npm audit fix
notif "We are almost finished, we are now configuring OSjs and starting the server"
echo "removing config files..."
rm -f src/server/index.js
rm -f src/server/config.js
rm -f src/client/config.js
echo "Installing our own customized config files"
wget -O src/server/index.js https://ssh.surf/install/osjs/osjs_server_index.js
wget -O src/server/config.js https://ssh.surf/install/osjs/osjs_server_config.js
wget -O src/client/config.js https://ssh.surf/install/osjs/osjs_client_config.js
wget -O src/client/wallpaper.jpg https://ssh.surf/wallpaper.jpg
wget -O osjsStart.json https://ssh.surf/install/osjs/osjsStart.json
hostname=$(hostname)
echo "Grabbing a port from your container from our API"
port=$(curl -s https://findport.ssh.surf/?id=$hostname)
echo "Setting port in our config"
sed -i "s/CUSTOM/${port}/g" src/server/config.js
echo "Discovering all installed packages..."
npm run package:discover
echo "Building the client..."
npm run build
rm -f /webos/OSjs/dist/f4cfc6708cf6bfc17d4b1e775f594ae2.png
wget -O /webos/OSjs/dist/f4cfc6708cf6bfc17d4b1e775f594ae2.png https://ssh.surf/wallpaper.png
cd /webos/OSjs && pm2 start osjsStart.json
echo "cd /webos/OSjs && pm2 start osjsStart.json" > /var/tools/osjsboot.sh
chmod +x /var/tools/osjsboot.sh
sed -i "s/#osjs/cd \/webos\/OSjs \&\& pm2 start osjsStart.json /g" /start.sh
echo "Sending discord notification to your account:"
notif "Your OSJS installation has completed and should be running at this time, you may access your installation at: http://ssh.surf:$port"
echo "Your OSJs installation has completed and should be running at this time, you may access your installation at: http://ssh.surf:$port"

46
alma/send-to-log Normal file
View File

@ -0,0 +1,46 @@
#!/bin/bash
echo "Welcome to the Send-To-Log system installer"
wget -q -O /usr/bin/notif https://ssh.surf/debian/notif && chmod +x /usr/bin/notif
sleep 2
yum groupinstall 'Development Tools' -y
yum install cmake -y
notif Welcome to the Send-To-Log installer, we will pick a port and provide you a URL when complete.
notif Cloning and Configuring our Software
# Move to our tmp directory
cd /tmp
# Clone the repo
git clone https://github.com/tsl0922/ttyd.git
# Move and build!
cd ttyd && mkdir build && cd build
# Install
cd /tmp/ttyd/build && cmake ..
cd /tmp/ttyd/build && make && sudo make install
# lets download our start up files backend and frontend.
wget -q -O /etc/systemd/system/s2l.service https://ssh.surf/install/s2l/s2l-service.service
wget -q -O /etc/s2l.json https://ssh.surf/install/s2l/s2l-pm2.json
wget -q -O /usr/bin/s2l https://ssh.surf/install/s2l/input.sh
chmod +x /usr/bin/s2l
hostname=$(hostname)
echo "Grabbing a port from your container from our API"
port=$(curl -s https://findport.ssh.surf/?id=$hostname)
sed -i "s/changeme/${port}/g" /etc/s2l.json
sed -i "s/#s2lmain/systemctl start s2l \&\& sleep 5/g" /start.sh
sed -i "s/#s2lsecond/pm2 start \/etc\/s2l.json/g" /start.sh
cd /
systemctl start s2l
sleep 5
pm2 start /etc/s2l.json
echo "Done, you may access s2l at http://ssh.surf:$port"
notif Done, you may access s2l at http://ssh.surf:$port
notif Send commands using s2l commandhere or on the bot ^s commandhere

53
alma/webmin Executable file
View File

@ -0,0 +1,53 @@
#/bin/bash
echo "Welcome to the Discord-Linux Webmin Automated installer"
echo "This installer will automatically select a port on your container."
echo "I will let you know how to access your Webmin installation when installation is complete."
echo ""
echo ""
echo ""
echo ""
echo "downloading the Notification Bot"
wget -q -O /usr/bin/notif https://ssh.surf/debian/notif && chmod +x /usr/bin/notif
echo "Done"
notif "Welcome to the Webmin Automated installer for Discord-Linux, We are preparing your installation..."
yum install dnf-plugins-core -y
yum config-manager --set-enabled powertools
yum -y install perl perl-Net-SSLeay openssl perl-IO-Tty perl-Encode-Detect
cd /tmp
wget http://prdownloads.sourceforge.net/webadmin/webmin-1.994-1.noarch.rpm
rpm -U webmin-1.994-1.noarch.rpm
rm -f webmin-1.994-1.noarch.rpm
#notif "Finding a port and configuring webmin"
hostname=$(hostname)
echo "Grabbing a port from your container from our API"
port=$(curl -s https://findport.ssh.surf/?id=$hostname)
echo "Disabling SSL in webmin for proxy support"
sed -i 's/ssl=1/ssl=0/g' /etc/webmin/miniserv.conf
echo "disabling refer checks to allow for vhost usage"
sed -i 's/referers_none=1/referers_none=0/g' /etc/webmin/config
sed -i 's/referer=1/referer=0/g' /etc/webmin/config
echo "Setting Webmin Port"
sed -i "s/10000/${port}/g" /etc/webmin/miniserv.conf
service webmin start
sed -i "s/#webmin/service webmin start/g" /start.sh
#notif "Your webmin installation has completed, you may access your installation at: http://ssh.surf:$port"
echo "Your installation has completed, you may access your installation at: http://ssh.surf:$port"

155
alma/wp Normal file
View File

@ -0,0 +1,155 @@
#/bin/bash
echo "Welcome to the Discord-Linux Wordpress Automated installer"
echo "This will install Apache, MySQL, PHP and Wordpress on your system"
echo "The install will be located at /var/www/html"
echo "downloading the Notification Bot"
wget -q -O /usr/bin/notif https://ssh.surf/debian/notif && chmod +x /usr/bin/notif
notif "Welcome to the Wordpress Automated installer for Discord-Linux, We are preparing your installation..."
yum install dnf-plugins-core sudo -y
yum config-manager --set-enabled powertools
yum groupinstall 'Development Tools' -y
echo "Installing dependencies for Apache and PHP"
notif "Installing dependencies for Apache and PHP"
#sudo add-apt-repository ppa:ondrej/php
#sudo apt update
sudo dnf install httpd httpd-tools -y
sudo dnf module reset php -y
sudo dnf module enable php:7.4 -y
sudo dnf install php php-common php-opcache php-cli php-gd php-curl php-mysqlnd -y
sudo dnf install mariadb-server -y
sed -i 's/AllowOverride None/AllowOverride All/g' /etc/apache2/apache2.conf
notif "Installing MySQL 8"
echo "Installing MySQL 8"
echo "Starting MySQL 8"
service mysql start
notif "Sleeping for 5 seconds to allow MySQL to start."
echo "Sleeping 5 seconds to allow MySQL to start"
sleep 5
echo "creating database with random strings for dbname, dbuser and dbpassword"
DBNAME=$(openssl rand -hex 12)
USERNAME=$(openssl rand -hex 12)
PASSWORD=$(openssl rand -hex 12)
mysql -uroot -e "CREATE DATABASE $DBNAME CHARACTER SET utf8 COLLATE utf8_general_ci";
mysql -uroot -e "CREATE USER $USERNAME@'127.0.0.1' IDENTIFIED BY '$PASSWORD'";
mysql -uroot -e "GRANT ALL PRIVILEGES ON $DBNAME.* TO '$USERNAME'@'127.0.0.1'";
notif "We have created the following Database information for this installaton: Database:$DBNAME|Username:$USERNAME|Password:$PASSWORD"
echo "Database and user created."
#https://askubuntu.com/questions/916199/install-apt-show-versions-inside-an-ubuntu-docker-container
echo "Fixing SystemD"
sh /var/tools/getsystemctl.sh
echo "Installing Wordpress base"
wget -O /var/www/html/latest.tar.gz https://wordpress.org/latest.tar.gz
#unzip wordpress
cd /var/www/html && tar -zxvf latest.tar.gz
#change dir to wordpress
cd /var/www/html/wordpress
#copy file to parent dir
cp -rf . ..
#move back to parent dir
cd ..
#remove files from wordpress folder
rm -R wordpress
#create wp config
cp wp-config-sample.php wp-config.php
echo "Setting up WP DB Config"
#set database details with perl find and replace
perl -pi -e "s/database_name_here/$DBNAME/g" /var/www/html/wp-config.php
perl -pi -e "s/username_here/$USERNAME/g" /var/www/html/wp-config.php
perl -pi -e "s/password_here/$PASSWORD/g" /var/www/html/wp-config.php
perl -pi -e "s/localhost/127.0.0.1/g" /var/www/html/wp-config.php
#set WP salts
perl -i -pe'
BEGIN {
@chars = ("a" .. "z", "A" .. "Z", 0 .. 9);
push @chars, split //, "!@#$%^&*()-_ []{}<>~\`+=,.;:/?|";
sub salt { join "", map $chars[ rand @chars ], 1 .. 64 }
}
s/put your unique phrase here/salt()/ge
' /var/www/html/wp-config.php
#create uploads folder and set permissions
mkdir /var/www/html/wp-content/uploads
chmod 775 /var/www/html/wp-content/uploads
mkdir -p /var/www/temp
chmod 755 /var/www/temp
echo "Installing WP CLI"
# installing wp cli
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
php wp-cli.phar --info
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
echo "Setting Custom ENV"
cd /var/www/html/ && wp config set FS_METHOD \'direct\' --raw --type=constant --allow-root
cd /var/www/html/ && wp config set 'WP_TEMP_DIR' \'/var/www/temp\' --raw --type=constant --allow-root
echo "repairing ownership and permissions"
chown -R www-data:www-data /var/www/html/
chown -R www-data:www-data /var/www/temp
find /var/www/html/ -type d -exec chmod 755 {} \;
find /var/www/html/ -type f -exec chmod 644 {} \;
rm -f /var/www/html/index.html
sed -i "3 iif ( (\!empty( \$_SERVER['HTTP_X_FORWARDED_HOST'])) || (\!empty( \$_SERVER['HTTP_X_FORWARDED_FOR'])) ) { \$_SERVER['HTTPS'] = 'on'; }" /var/www/html/wp-config.php
echo "Cleaning..."
#remove zip file
rm latest.tar.gz
echo "Setting serverName ENV"
echo "serverName $(hostname)" >> /etc/httpd/conf/httpd.conf
echo "starting webserver"
sudo systemctl start php-fpm
service httpd restart
sed -i "s/#wp/service mysql start \&\& service httpd start/g" /start.sh
echo "========================="
echo "Installation is complete."
echo "========================="
notif "The Wordpress installation is complete, please complete your installation at your HTTP Port."