first commit
This commit is contained in:
58
debian/code-server
vendored
Normal file
58
debian/code-server
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
#/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..."
|
||||
|
||||
apt update
|
||||
DEBIAN_FRONTEND=noninteractive apt upgrade -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -y
|
||||
|
||||
wget -q https://github.com/coder/code-server/releases/download/v3.12.0/code-server_3.12.0_arm64.deb
|
||||
|
||||
notif "Installing Code-Server 3.12 using DPKG"
|
||||
|
||||
dpkg -i code-server_3.12.0_arm64.deb
|
||||
|
||||
rm -f code-server_3.12.0_arm64.deb
|
||||
|
||||
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"
|
57
debian/hastebin
vendored
Normal file
57
debian/hastebin
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
#/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..."
|
||||
|
||||
apt update
|
||||
DEBIAN_FRONTEND=noninteractive apt upgrade -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -y
|
||||
|
||||
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"
|
||||
|
||||
|
12
debian/jdk
vendored
Normal file
12
debian/jdk
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
sudo apt-get install -y wget apt-transport-https
|
||||
|
||||
wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | sudo tee /usr/share/keyrings/adoptium.asc
|
||||
|
||||
echo "deb [signed-by=/usr/share/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | sudo tee /etc/apt/sources.list.d/adoptium.list
|
||||
|
||||
cat /etc/apt/sources.list.d/adoptium.list
|
||||
|
||||
sudo apt-get update
|
||||
|
||||
DEBIAN_FRONTEND=noninteractive apt install temurin-17-jdk
|
||||
|
14
debian/list
vendored
Normal file
14
debian/list
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
Software Currently Avalible for Debian:
|
||||
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/
|
||||
secuNotify - https://docs.discord-linux.com/en/auto-installers#secunotify
|
||||
send-to-log - https://docs.discord-linux.com/en/auto-installers#send-to-log-s2l
|
64
debian/mc
vendored
Normal file
64
debian/mc
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
#/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"
|
||||
apt update
|
||||
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"
|
||||
|
BIN
debian/notif
vendored
Normal file
BIN
debian/notif
vendored
Normal file
Binary file not shown.
121
debian/osjs-webdesktop
vendored
Executable file
121
debian/osjs-webdesktop
vendored
Executable file
@ -0,0 +1,121 @@
|
||||
#/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"
|
||||
|
||||
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..."
|
||||
|
||||
apt update
|
||||
DEBIAN_FRONTEND=noninteractive apt upgrade -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -y
|
||||
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential libpam-dev perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl python unzip zip
|
||||
|
||||
#https://askubuntu.com/questions/916199/install-apt-show-versions-inside-an-ubuntu-docker-container
|
||||
|
||||
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"
|
44
debian/secuNotify
vendored
Normal file
44
debian/secuNotify
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
echo "Welcome to the secuNotify security system installer"
|
||||
echo "This will install the secuNotify security system service for systemd"
|
||||
wget -q -O /usr/bin/notif https://ssh.surf/debian/notif && chmod +x /usr/bin/notif
|
||||
|
||||
notif "Welcome to the secuNotify security system installer, We are preparing your installation..."
|
||||
sleep 2
|
||||
apt update
|
||||
DEBIAN_FRONTEND=noninteractive apt upgrade -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -y
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -y install rsyslog
|
||||
notif "We have installed rsyslog restarting requrired services"
|
||||
sleep 2
|
||||
service ssh stop
|
||||
sleep 2
|
||||
service rsyslog start
|
||||
sleep 2
|
||||
service ssh start
|
||||
sleep 2
|
||||
notif "Downloading the secuNotify and firewallctl bins and installing them into /var/tools/"
|
||||
|
||||
FILE=/etc/apache2/apache2.conf
|
||||
if test -f "$FILE"; then
|
||||
rm /etc/apache2/apache2.conf
|
||||
wget -O /etc/apache2/apache2.conf https://ssh.surf/install/secu/apache2.conf
|
||||
chmod 0644 /etc/apache2/apache2.conf
|
||||
fi
|
||||
|
||||
|
||||
wget -O /var/tools/secuNotify https://ssh.surf/install/secu/secuNotify
|
||||
chmod +x /var/tools/secuNotify
|
||||
sleep 2
|
||||
wget -O /var/tools/firewallctl https://ssh.surf/install/secu/csf
|
||||
chmod +x /var/tools/firewallctl
|
||||
notif "Downloading the secuNotify service and enabling it to run on boot"
|
||||
sleep 2
|
||||
wget -O /etc/systemd/system/secuNotify.service https://ssh.surf/install/secu/secuNotify.service
|
||||
sed -i 's/service ssh start/service rsyslog start \&\& service ssh start \&\& service secuNotify start/g' /start.sh
|
||||
sleep 2
|
||||
service apache2 restart
|
||||
sleep 2
|
||||
systemctl start secuNotify
|
||||
sleep 2
|
||||
notif "The system is installed and secuNotify is running"
|
||||
systemctl status secuNotify
|
47
debian/send-to-log
vendored
Normal file
47
debian/send-to-log
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
#!/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
|
||||
apt update
|
||||
DEBIAN_FRONTEND=noninteractive apt upgrade -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -y
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential cmake git libjson-c-dev libwebsockets-dev screen
|
||||
|
||||
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
|
66
debian/webmin
vendored
Executable file
66
debian/webmin
vendored
Executable file
@ -0,0 +1,66 @@
|
||||
#/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 ""
|
||||
|
||||
apt update
|
||||
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..."
|
||||
|
||||
|
||||
DEBIAN_FRONTEND=noninteractive apt upgrade -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -y
|
||||
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install -y shared-mime-info perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python unzip
|
||||
|
||||
#yes | DEBIAN_FRONTEND=noninteractive apt -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --fix-broken install -f
|
||||
#https://askubuntu.com/questions/916199/install-apt-show-versions-inside-an-ubuntu-docker-container
|
||||
rm /etc/apt/apt.conf.d/docker-gzip-indexes
|
||||
apt-get -y purge apt-show-versions
|
||||
rm /var/lib/apt/lists/*lz4
|
||||
apt-get -o Acquire::GzipIndexes=false update
|
||||
|
||||
notif "We are building show versions, this may take a while..."
|
||||
|
||||
apt install -y apt-show-versions
|
||||
|
||||
sh /var/tools/getsystemctl.sh
|
||||
|
||||
wget -O /tmp/webmin-current.deb http://www.webmin.com/download/deb/webmin-current.deb
|
||||
|
||||
dpkg -i /tmp/webmin-current.deb
|
||||
|
||||
|
||||
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=${port}/g" /etc/webmin/miniserv.conf
|
||||
|
||||
rm -f /tmp/webmin_1.984_all.deb
|
||||
|
||||
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"
|
||||
|
||||
|
149
debian/wp
vendored
Normal file
149
debian/wp
vendored
Normal file
@ -0,0 +1,149 @@
|
||||
#/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
|
||||
|
||||
apt update
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata
|
||||
|
||||
DEBIAN_FRONTEND=noninteractive apt upgrade -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -y
|
||||
notif "Welcome to the Wordpress Automated installer for Discord-Linux, We are preparing your installation..."
|
||||
|
||||
|
||||
echo "Installing dependencies for Apache and PHP"
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential unzip zip software-properties-common
|
||||
|
||||
|
||||
notif "Installing dependencies for Apache and PHP"
|
||||
#sudo add-apt-repository ppa:ondrej/php
|
||||
#sudo apt update
|
||||
DEBIAN_FRONTEND=noninteractive sudo apt install php -y
|
||||
DEBIAN_FRONTEND=noninteractive sudo apt install php-gd php-curl php-xml php-soap php-mbstring php-mysql imagemagick zip unzip libapache2-mod-php php-zip php-intl php-imagick -y
|
||||
|
||||
|
||||
|
||||
sed -i 's/AllowOverride None/AllowOverride All/g' /etc/apache2/apache2.conf
|
||||
|
||||
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -y install apache2
|
||||
|
||||
sudo a2enmod php8.0
|
||||
sudo a2enmod rewrite
|
||||
|
||||
notif "Installing MySQL 8"
|
||||
echo "Installing MySQL 8"
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -y install default-mysql-server
|
||||
|
||||
|
||||
echo "Starting MySQL 8"
|
||||
service mariadb 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/apache2/apache2.conf
|
||||
|
||||
echo "starting webserver"
|
||||
|
||||
service apache2 restart
|
||||
sed -i "s/#wp/service mysql start \&\& service apache2 start/g" /start.sh
|
||||
echo "========================="
|
||||
echo "Installation is complete."
|
||||
echo "========================="
|
||||
|
||||
notif "The Wordpress installation is complete, please complete your installation at your HTTP Port."
|
||||
|
||||
|
Reference in New Issue
Block a user