mirror of
https://github.com/tommytran732/Pterodactyl-Script
synced 2024-11-22 10:31:34 -05:00
please don't call me a grammar nazi
just making your script look amazin <3
This commit is contained in:
parent
491522ecda
commit
75f32840d8
118
install.sh
118
install.sh
@ -11,13 +11,13 @@ warn(){
|
|||||||
version=v1.0
|
version=v1.0
|
||||||
|
|
||||||
preflight(){
|
preflight(){
|
||||||
output "Pterodactyl Installation & Upgrade script ${version}"
|
output "Pterodactyl Installation & Upgrade Script ${version}"
|
||||||
output "Copyright © 2020 Thien Tran <contact@thientran.io>."
|
output "Copyright © 2020 Thien Tran <contact@thientran.io>."
|
||||||
output "Please join my Discord for community support: https://thientran.io/discord"
|
output "Please join my Discord for community support: https://thientran.io/discord"
|
||||||
output ""
|
output ""
|
||||||
|
|
||||||
output "Please note that this script is meant to be installed on a fresh OS. Installing it on a non-fresh OS may cause problems."
|
output "Please note that this script is meant to be installed on a fresh OS. Installing it on a non-fresh OS may cause problems."
|
||||||
output "Automatic Operating System Detection initialized."
|
output "Automatic operating system detection initialized..."
|
||||||
|
|
||||||
os_check
|
os_check
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ preflight(){
|
|||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
output "Automatic Architecture Detection initialized."
|
output "Automatic architecture detection initialized..."
|
||||||
MACHINE_TYPE=`uname -m`
|
MACHINE_TYPE=`uname -m`
|
||||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||||
output "64-bit server detected! Good to go."
|
output "64-bit server detected! Good to go."
|
||||||
@ -36,7 +36,7 @@ preflight(){
|
|||||||
exit 4
|
exit 4
|
||||||
fi
|
fi
|
||||||
|
|
||||||
output "Automatic Virtualization Detection initialized."
|
output "Automatic virtualization detection initialized..."
|
||||||
if [ "$lsb_dist" = "ubuntu" ]; then
|
if [ "$lsb_dist" = "ubuntu" ]; then
|
||||||
apt-get update --fix-missing
|
apt-get update --fix-missing
|
||||||
apt-get -y install software-properties-common
|
apt-get -y install software-properties-common
|
||||||
@ -57,15 +57,15 @@ preflight(){
|
|||||||
output "Virtualization: Xen-HVM detected."
|
output "Virtualization: Xen-HVM detected."
|
||||||
elif [ "$virt_serv" = "xen xen-hvm aws" ]; then
|
elif [ "$virt_serv" = "xen xen-hvm aws" ]; then
|
||||||
output "Virtualization: Xen-HVM on AWS detected."
|
output "Virtualization: Xen-HVM on AWS detected."
|
||||||
warn "When doing allocation for the node, please use the internal ip as Google Cloud uses NAT."
|
warn "When creating allocations for this node, please use the internal IP as Google Cloud uses NAT routing."
|
||||||
warn "Resuming in 10 seconds."
|
warn "Resuming in 10 seconds..."
|
||||||
sleep 10
|
sleep 10
|
||||||
else
|
else
|
||||||
output "Virtualization: $virt_serv detected."
|
output "Virtualization: $virt_serv detected."
|
||||||
fi
|
fi
|
||||||
output ""
|
output ""
|
||||||
if [ "$virt_serv" != "" ] && [ "$virt_serv" != "kvm" ] && [ "$virt_serv" != "vmware" ] && [ "$virt_serv" != "hyperv" ] && [ "$virt_serv" != "openvz lxc" ] && [ "$virt_serv" != "xen xen-hvm" ] && [ "$virt_serv" != "xen xen-hvm aws" ]; then
|
if [ "$virt_serv" != "" ] && [ "$virt_serv" != "kvm" ] && [ "$virt_serv" != "vmware" ] && [ "$virt_serv" != "hyperv" ] && [ "$virt_serv" != "openvz lxc" ] && [ "$virt_serv" != "xen xen-hvm" ] && [ "$virt_serv" != "xen xen-hvm aws" ]; then
|
||||||
warn "Unsupported Virtualization method. Please consult with your provider whether your server can run Docker or not. Proceed at your own risk."
|
warn "Unsupported type of virtualization detected. Please consult with your hosting provider whether your server can run Docker or not. Proceed at your own risk."
|
||||||
warn "No support would be given if your server breaks at any point in the future."
|
warn "No support would be given if your server breaks at any point in the future."
|
||||||
warn "Proceed?\n[1] Yes.\n[2] No."
|
warn "Proceed?\n[1] Yes.\n[2] No."
|
||||||
read choice
|
read choice
|
||||||
@ -81,13 +81,13 @@ preflight(){
|
|||||||
|
|
||||||
output "Kernel Detection Initialized."
|
output "Kernel Detection Initialized."
|
||||||
if echo $(uname -r) | grep -q xxxx; then
|
if echo $(uname -r) | grep -q xxxx; then
|
||||||
output "OVH Kernel Detected. The script will not work. Please install your server with a generic/distribution kernel."
|
output "OVH kernel detected. The script will not work. Please reinstall your server using a generic/distribution kernel."
|
||||||
output "When you are reinstalling your server, click on 'custom installation' and click on 'use distribution' kernel after that."
|
output "When you are reinstalling your server, click on 'custom installation' and click on 'use distribution' kernel after that."
|
||||||
output "You might also want to do custom partritioning, remove the /home partrition and give / all the remaining space."
|
output "You might also want to do custom partritioning, remove the /home partrition and give / all the remaining space."
|
||||||
output "Please do not hesitate to contact us if you need help regarding this issue."
|
output "Please do not hesitate to contact us if you need help regarding this issue."
|
||||||
exit 6
|
exit 6
|
||||||
elif echo $(uname -r) | grep -q pve; then
|
elif echo $(uname -r) | grep -q pve; then
|
||||||
output "Proxmox LXE Kernel Detected. You have chosen to continue in the last step, therefore we are proceeding at your own risk."
|
output "Proxmox LXE kernel detected. You have chosen to continue in the last step, therefore we are proceeding at your own risk."
|
||||||
output "Proceeding with a risky operation..."
|
output "Proceeding with a risky operation..."
|
||||||
elif echo $(uname -r) | grep -q stab; then
|
elif echo $(uname -r) | grep -q stab; then
|
||||||
if echo $(uname -r) | grep -q 2.6; then
|
if echo $(uname -r) | grep -q 2.6; then
|
||||||
@ -95,14 +95,14 @@ preflight(){
|
|||||||
exit 6
|
exit 6
|
||||||
fi
|
fi
|
||||||
elif echo $(uname -r) | grep -q gcp; then
|
elif echo $(uname -r) | grep -q gcp; then
|
||||||
output "Google Cloud Platform Detected."
|
output "Google Cloud Platform detected."
|
||||||
warn "Please make sure you have static ip setup, otherwise the system will not work after a reboot."
|
warn "Please make sure you have a static IP setup, otherwise the system will not work after a reboot."
|
||||||
warn "Please also make sure the google firewall allows the ports needed for the server to function normally."
|
warn "Please also make sure the GCP firewall allows the ports needed for the server to function normally."
|
||||||
warn "When doing allocation for the node, please use the internal ip as Google Cloud uses NAT."
|
warn "When creating allocations for this node, please use the internal IP as Google Cloud uses NAT routing."
|
||||||
warn "Resuming in 10 seconds."
|
warn "Resuming in 10 seconds..."
|
||||||
sleep 10
|
sleep 10
|
||||||
else
|
else
|
||||||
output "Did not detect any bad kernel. Moving forward."
|
output "Did not detect any bad kernel. Moving forward..."
|
||||||
output ""
|
output ""
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -125,12 +125,12 @@ os_check(){
|
|||||||
fi
|
fi
|
||||||
elif [ "$lsb_dist" = "debian" ]; then
|
elif [ "$lsb_dist" = "debian" ]; then
|
||||||
if [ "$dist_version" != "10" ] &&[ "$dist_version" != "9" ]; then
|
if [ "$dist_version" != "10" ] &&[ "$dist_version" != "9" ]; then
|
||||||
output "Unsupported Debian version. Only Debian 10, and 9 are supported.."
|
output "Unsupported Debian version. Only Debian 10, and 9 are supported."
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
elif [ "$lsb_dist" = "fedora" ]; then
|
elif [ "$lsb_dist" = "fedora" ]; then
|
||||||
if [ "$dist_version" != "32" ] && [ "$dist_version" != "31" ]; then
|
if [ "$dist_version" != "32" ] && [ "$dist_version" != "31" ]; then
|
||||||
output "Unsupported Fedora version. Only 32 and 31 is supported."
|
output "Unsupported Fedora version. Only Fedora 32 and 31 are supported."
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
elif [ "$lsb_dist" = "centos" ]; then
|
elif [ "$lsb_dist" = "centos" ]; then
|
||||||
@ -144,7 +144,7 @@ os_check(){
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
elif [ "$lsb_dist" != "ubuntu" ] && [ "$lsb_dist" != "debian" ] && [ "$lsb_dist" != "centos" ]; then
|
elif [ "$lsb_dist" != "ubuntu" ] && [ "$lsb_dist" != "debian" ] && [ "$lsb_dist" != "centos" ]; then
|
||||||
output "Unsupported Operating System."
|
output "Unsupported operating system."
|
||||||
output ""
|
output ""
|
||||||
output "Supported OS:"
|
output "Supported OS:"
|
||||||
output "Ubuntu: 20.04 18.04, 16.04"
|
output "Ubuntu: 20.04 18.04, 16.04"
|
||||||
@ -166,13 +166,13 @@ install_options(){
|
|||||||
output "[6] Upgrade 0.6.x daemon to 0.6.13."
|
output "[6] Upgrade 0.6.x daemon to 0.6.13."
|
||||||
output "[7] Upgrade the panel to 0.7.17 and daemon to 0.6.13"
|
output "[7] Upgrade the panel to 0.7.17 and daemon to 0.6.13"
|
||||||
output "[8] Upgrade the standalone SFTP server to 1.0.4."
|
output "[8] Upgrade the standalone SFTP server to 1.0.4."
|
||||||
output "[9] Make Pterodactyl compatible with the mobile app. (Only use this after you have installed the panel. Check out https://pterodactyl.cloud for the mobile app.)"
|
output "[9] Make Pterodactyl compatible with the mobile app (only use this after you have installed the panel - check out https://pterodactyl.cloud for more information)."
|
||||||
output "[10] Update Mobile compatibility."
|
output "[10] Update mobile compatibility."
|
||||||
output "[11] Install or Update to phpMyAdmin 5.0.2 (Only use this after you have installed the panel.)"
|
output "[11] Install or update to phpMyAdmin 5.0.2 (only use this after you have installed the panel)."
|
||||||
output "[12] Install a standalone database host (For use on Daemon only installations only.)"
|
output "[12] Install a standalone database host (only for use on daemon-only installations)."
|
||||||
output "[13] Change Pterodactyl theme."
|
output "[13] Change Pterodactyl theme."
|
||||||
output "[14] Emergency MariaDB root password reset."
|
output "[14] Emergency MariaDB root password reset."
|
||||||
output "[15] Emergency Database host information reset."
|
output "[15] Emergency database host information reset."
|
||||||
read choice
|
read choice
|
||||||
case $choice in
|
case $choice in
|
||||||
1 ) installoption=1
|
1 ) installoption=1
|
||||||
@ -203,7 +203,7 @@ install_options(){
|
|||||||
output "You have activated mobile app compatibility."
|
output "You have activated mobile app compatibility."
|
||||||
;;
|
;;
|
||||||
10 ) installoption=10
|
10 ) installoption=10
|
||||||
output "you have selected to update the mobile app compatibility."
|
output "You have selected to update the mobile app compatibility."
|
||||||
;;
|
;;
|
||||||
11 ) installoption=11
|
11 ) installoption=11
|
||||||
output "You have selected to install or update phpMyAdmin."
|
output "You have selected to install or update phpMyAdmin."
|
||||||
@ -226,7 +226,7 @@ install_options(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
webserver_options() {
|
webserver_options() {
|
||||||
output "Please select which web server you would like to use:\n[1] Nginx (Recommended).\n[2] Apache2/Httpd."
|
output "Please select which web server you would like to use:\n[1] Nginx (recommended).\n[2] Apache2/httpd."
|
||||||
read choice
|
read choice
|
||||||
case $choice in
|
case $choice in
|
||||||
1 ) webserver=1
|
1 ) webserver=1
|
||||||
@ -234,7 +234,7 @@ webserver_options() {
|
|||||||
output ""
|
output ""
|
||||||
;;
|
;;
|
||||||
2 ) webserver=2
|
2 ) webserver=2
|
||||||
output "You have selected Apache2 / Httpd."
|
output "You have selected Apache2/httpd."
|
||||||
output ""
|
output ""
|
||||||
;;
|
;;
|
||||||
* ) output "You did not enter a valid selection."
|
* ) output "You did not enter a valid selection."
|
||||||
@ -243,7 +243,7 @@ webserver_options() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
theme_options() {
|
theme_options() {
|
||||||
output "Would you like to install Fonix's themes?"
|
output "Would you like to install one of Fonix's themes?"
|
||||||
output "[1] No."
|
output "[1] No."
|
||||||
output "[2] Super Pink and Fluffy."
|
output "[2] Super Pink and Fluffy."
|
||||||
output "[3] Tango Twist."
|
output "[3] Tango Twist."
|
||||||
@ -305,7 +305,7 @@ required_infos() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dns_check(){
|
dns_check(){
|
||||||
output "Please enter your FQDN (panel.yourdomain.com):"
|
output "Please enter your FQDN (panel.domain.tld):"
|
||||||
read FQDN
|
read FQDN
|
||||||
|
|
||||||
output "Resolving DNS."
|
output "Resolving DNS."
|
||||||
@ -314,12 +314,12 @@ dns_check(){
|
|||||||
if [ "${SERVER_IP}" != "${DOMAIN_RECORD}" ]; then
|
if [ "${SERVER_IP}" != "${DOMAIN_RECORD}" ]; then
|
||||||
output ""
|
output ""
|
||||||
output "The entered domain does not resolve to the primary public IP of this server."
|
output "The entered domain does not resolve to the primary public IP of this server."
|
||||||
output "Please make an A record pointing to your server's ip. For example, if you make an A record called 'panel' pointing to your server's ip, your FQDN is panel.yourdomain.tld"
|
output "Please make an A record pointing to your server's IP. For example, if you make an A record called 'panel' pointing to your server's IP, your FQDN is panel.domain.tld"
|
||||||
output "If you are using Cloudflare, please disable the orange cloud."
|
output "If you are using CloudFlare, please disable the orange cloud."
|
||||||
output "If you do not have a domain, you can get a free one at https://www.freenom.com/en/index.html?lang=en."
|
output "If you do not have a domain, you can get a free one at https://freenom.com"
|
||||||
dns_check
|
dns_check
|
||||||
else
|
else
|
||||||
output "Domain resolved correctly. Good to go."
|
output "Domain resolved correctly. Good to go..."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -517,7 +517,7 @@ install_dependencies(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
install_pterodactyl() {
|
install_pterodactyl() {
|
||||||
output "Creating the databases and setting root password."
|
output "Creating the databases and setting root password..."
|
||||||
password=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`
|
password=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`
|
||||||
adminpassword=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`
|
adminpassword=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`
|
||||||
rootpassword=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`
|
rootpassword=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`
|
||||||
@ -561,7 +561,7 @@ install_pterodactyl() {
|
|||||||
tar --strip-components=1 -xzvf panel.tar.gz
|
tar --strip-components=1 -xzvf panel.tar.gz
|
||||||
chmod -R 755 storage/* bootstrap/cache/
|
chmod -R 755 storage/* bootstrap/cache/
|
||||||
|
|
||||||
output "Installing Pterodactyl."
|
output "Installing Pterodactyl..."
|
||||||
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
|
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
|
||||||
cp .env.example .env
|
cp .env.example .env
|
||||||
/usr/local/bin/composer install --no-dev --optimize-autoloader
|
/usr/local/bin/composer install --no-dev --optimize-autoloader
|
||||||
@ -584,7 +584,7 @@ install_pterodactyl() {
|
|||||||
restorecon -R /var/www/pterodactyl
|
restorecon -R /var/www/pterodactyl
|
||||||
fi
|
fi
|
||||||
|
|
||||||
output "Creating panel queue listeners"
|
output "Creating panel queue listeners..."
|
||||||
(crontab -l ; echo "* * * * * php /var/www/pterodactyl/artisan schedule:run >> /dev/null 2>&1")| crontab -
|
(crontab -l ; echo "* * * * * php /var/www/pterodactyl/artisan schedule:run >> /dev/null 2>&1")| crontab -
|
||||||
service cron restart
|
service cron restart
|
||||||
|
|
||||||
@ -655,15 +655,15 @@ upgrade_pterodactyl(){
|
|||||||
semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/pterodactyl/storage(/.*)?"
|
semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/pterodactyl/storage(/.*)?"
|
||||||
restorecon -R /var/www/pterodactyl
|
restorecon -R /var/www/pterodactyl
|
||||||
fi
|
fi
|
||||||
output "Your panel has been updated to version 0.7.17."
|
output "Your panel has successfully been updated to version 0.7.17."
|
||||||
php artisan up
|
php artisan up
|
||||||
php artisan queue:restart
|
php artisan queue:restart
|
||||||
}
|
}
|
||||||
|
|
||||||
nginx_config() {
|
nginx_config() {
|
||||||
output "Disabling default configuration"
|
output "Disabling default configuration..."
|
||||||
rm -rf /etc/nginx/sites-enabled/default
|
rm -rf /etc/nginx/sites-enabled/default
|
||||||
output "Configuring Nginx Webserver"
|
output "Configuring Nginx Webserver..."
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
server_tokens off;
|
server_tokens off;
|
||||||
@ -752,9 +752,9 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
apache_config() {
|
apache_config() {
|
||||||
output "Disabling default configuration"
|
output "Disabling default configuration..."
|
||||||
rm -rf /etc/nginx/sites-enabled/default
|
rm -rf /etc/nginx/sites-enabled/default
|
||||||
output "Configuring Apache2"
|
output "Configuring Apache2 web server..."
|
||||||
echo '
|
echo '
|
||||||
<VirtualHost *:80>
|
<VirtualHost *:80>
|
||||||
ServerName '"$FQDN"'
|
ServerName '"$FQDN"'
|
||||||
@ -784,7 +784,7 @@ echo '
|
|||||||
}
|
}
|
||||||
|
|
||||||
nginx_config_redhat(){
|
nginx_config_redhat(){
|
||||||
output "Configuring Nginx Webserver"
|
output "Configuring Nginx web server..."
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
server_tokens off;
|
server_tokens off;
|
||||||
@ -877,7 +877,7 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
apache_config_redhat() {
|
apache_config_redhat() {
|
||||||
output "Configuring Apache2"
|
output "Configuring Apache2 web server..."
|
||||||
echo '
|
echo '
|
||||||
<VirtualHost *:80>
|
<VirtualHost *:80>
|
||||||
ServerName '"$FQDN"'
|
ServerName '"$FQDN"'
|
||||||
@ -901,7 +901,7 @@ echo '
|
|||||||
}
|
}
|
||||||
|
|
||||||
php_config(){
|
php_config(){
|
||||||
output "Configuring PHP socket."
|
output "Configuring PHP socket..."
|
||||||
bash -c 'cat > /etc/php-fpm.d/www-pterodactyl.conf' <<-'EOF'
|
bash -c 'cat > /etc/php-fpm.d/www-pterodactyl.conf' <<-'EOF'
|
||||||
[pterodactyl]
|
[pterodactyl]
|
||||||
user = nginx
|
user = nginx
|
||||||
@ -945,7 +945,7 @@ setup_pterodactyl(){
|
|||||||
|
|
||||||
install_daemon() {
|
install_daemon() {
|
||||||
cd /root
|
cd /root
|
||||||
output "Installing Pterodactyl Daemon dependencies."
|
output "Installing Pterodactyl Daemon dependencies..."
|
||||||
if [ "$lsb_dist" = "ubuntu" ] || [ "$lsb_dist" = "debian" ]; then
|
if [ "$lsb_dist" = "ubuntu" ] || [ "$lsb_dist" = "debian" ]; then
|
||||||
apt-get -y install curl tar unzip
|
apt-get -y install curl tar unzip
|
||||||
elif [ "$lsb_dist" = "fedora" ] || [ "$lsb_dist" = "centos" ] || [ "$lsb_dist" = "rhel" ]; then
|
elif [ "$lsb_dist" = "fedora" ] || [ "$lsb_dist" = "centos" ] || [ "$lsb_dist" = "rhel" ]; then
|
||||||
@ -961,7 +961,7 @@ install_daemon() {
|
|||||||
|
|
||||||
service docker start
|
service docker start
|
||||||
systemctl enable docker
|
systemctl enable docker
|
||||||
output "Enabling Swap support for Docker & Installing NodeJS."
|
output "Enabling SWAP support for Docker & installing NodeJS..."
|
||||||
sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="[^"]*/& swapaccount=1/' /etc/default/grub
|
sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="[^"]*/& swapaccount=1/' /etc/default/grub
|
||||||
if [ "$lsb_dist" = "ubuntu" ] || [ "$lsb_dist" = "debian" ]; then
|
if [ "$lsb_dist" = "ubuntu" ] || [ "$lsb_dist" = "debian" ]; then
|
||||||
update-grub
|
update-grub
|
||||||
@ -994,7 +994,7 @@ install_daemon() {
|
|||||||
yum -y autoremove
|
yum -y autoremove
|
||||||
yum -y clean packages
|
yum -y clean packages
|
||||||
fi
|
fi
|
||||||
output "Installing the Pterodactyl Daemon."
|
output "Installing the Pterodactyl daemon..."
|
||||||
mkdir -p /srv/daemon /srv/daemon-data
|
mkdir -p /srv/daemon /srv/daemon-data
|
||||||
cd /srv/daemon
|
cd /srv/daemon
|
||||||
curl -L https://github.com/pterodactyl/daemon/releases/download/v0.6.13/daemon.tar.gz | tar --strip-components=1 -xzv
|
curl -L https://github.com/pterodactyl/daemon/releases/download/v0.6.13/daemon.tar.gz | tar --strip-components=1 -xzv
|
||||||
@ -1019,7 +1019,7 @@ EOF
|
|||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl enable wings
|
systemctl enable wings
|
||||||
|
|
||||||
output "Daemon installation is nearly complete, Please go to the panel and get your 'Auto deploy' command in the node configuration tab."
|
output "Daemon installation is nearly complete, please go to the panel and get your 'Auto Deploy' command in the node configuration tab."
|
||||||
output "Paste your auto deploy command below: "
|
output "Paste your auto deploy command below: "
|
||||||
read AUTODEPLOY
|
read AUTODEPLOY
|
||||||
${AUTODEPLOY}
|
${AUTODEPLOY}
|
||||||
@ -1045,19 +1045,19 @@ install_standalone_sftp(){
|
|||||||
yum -y install jq
|
yum -y install jq
|
||||||
fi
|
fi
|
||||||
if [ ! -f /srv/daemon/config/core.json ]; then
|
if [ ! -f /srv/daemon/config/core.json ]; then
|
||||||
warn "YOU MUST CONFIGURE YOUR DAEMON PROPERLY BEFORE INSTALLING THE STANDALONE SFTP SERVER!!!"
|
warn "YOU MUST CONFIGURE YOUR DAEMON PROPERLY BEFORE INSTALLING THE STANDALONE SFTP SERVER!"
|
||||||
exit 11
|
exit 11
|
||||||
fi
|
fi
|
||||||
cd /srv/daemon
|
cd /srv/daemon
|
||||||
if [ $(cat /srv/daemon/config/core.json | jq -r '.sftp.enabled') == "null" ]; then
|
if [ $(cat /srv/daemon/config/core.json | jq -r '.sftp.enabled') == "null" ]; then
|
||||||
output "Updating config to enable sftp-server."
|
output "Updating config to enable sftp-server..."
|
||||||
cat /srv/daemon/config/core.json | jq '.sftp.enabled |= false' > /tmp/core
|
cat /srv/daemon/config/core.json | jq '.sftp.enabled |= false' > /tmp/core
|
||||||
cat /tmp/core > /srv/daemon/config/core.json
|
cat /tmp/core > /srv/daemon/config/core.json
|
||||||
rm -rf /tmp/core
|
rm -rf /tmp/core
|
||||||
elif [ $(cat /srv/daemon/config/core.json | jq -r '.sftp.enabled') == "false" ]; then
|
elif [ $(cat /srv/daemon/config/core.json | jq -r '.sftp.enabled') == "false" ]; then
|
||||||
output "Config already set up for golang sftp server."
|
output "Config already set up for Golang SFTP server."
|
||||||
else
|
else
|
||||||
output "You may have purposly set the sftp to true and that will fail."
|
output "You may have purposely set the SFTP to true which will cause this to fail."
|
||||||
fi
|
fi
|
||||||
service wings restart
|
service wings restart
|
||||||
output "Installing standalone SFTP server."
|
output "Installing standalone SFTP server."
|
||||||
@ -1083,12 +1083,12 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
upgrade_standalone_sftp(){
|
upgrade_standalone_sftp(){
|
||||||
output "Turning off the standalone SFTP server."
|
output "Turning off the standalone SFTP server..."
|
||||||
service pterosftp stop
|
service pterosftp stop
|
||||||
curl -Lo sftp-server https://github.com/pterodactyl/sftp-server/releases/download/v1.0.4/sftp-server
|
curl -Lo sftp-server https://github.com/pterodactyl/sftp-server/releases/download/v1.0.4/sftp-server
|
||||||
chmod +x sftp-server
|
chmod +x sftp-server
|
||||||
service pterosftp start
|
service pterosftp start
|
||||||
output "Your standalone SFTP server has been updated to v1.0.4"
|
output "Your standalone SFTP server has successfully been updated to v1.0.4."
|
||||||
}
|
}
|
||||||
|
|
||||||
install_mobile(){
|
install_mobile(){
|
||||||
@ -1101,7 +1101,7 @@ install_mobile(){
|
|||||||
|
|
||||||
|
|
||||||
install_phpmyadmin(){
|
install_phpmyadmin(){
|
||||||
output "Installing phpMyAdmin."
|
output "Installing phpMyAdmin..."
|
||||||
cd /var/www/pterodactyl/public
|
cd /var/www/pterodactyl/public
|
||||||
rm -rf phpmyadmin
|
rm -rf phpmyadmin
|
||||||
wget https://files.phpmyadmin.net/phpMyAdmin/5.0.2/phpMyAdmin-5.0.2-all-languages.zip
|
wget https://files.phpmyadmin.net/phpMyAdmin/5.0.2/phpMyAdmin-5.0.2-all-languages.zip
|
||||||
@ -1147,7 +1147,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
ssl_certs(){
|
ssl_certs(){
|
||||||
output "Installing LetsEncrypt and creating an SSL certificate."
|
output "Installing Let's Encrypt and creating an SSL certificate..."
|
||||||
cd /root
|
cd /root
|
||||||
if [ "$lsb_dist" = "ubuntu" ] || [ "$lsb_dist" = "debian" ]; then
|
if [ "$lsb_dist" = "ubuntu" ] || [ "$lsb_dist" = "debian" ]; then
|
||||||
if [ "$lsb_dist" = "debian" ] && [ "$dist_version" = "8" ]; then
|
if [ "$lsb_dist" = "debian" ] && [ "$dist_version" = "8" ]; then
|
||||||
@ -1272,7 +1272,7 @@ enabled = true
|
|||||||
EOF
|
EOF
|
||||||
service fail2ban restart
|
service fail2ban restart
|
||||||
|
|
||||||
output "Configuring your firewall."
|
output "Configuring your firewall..."
|
||||||
if [ "$lsb_dist" = "ubuntu" ] || [ "$lsb_dist" = "debian" ]; then
|
if [ "$lsb_dist" = "ubuntu" ] || [ "$lsb_dist" = "debian" ]; then
|
||||||
apt-get -y install ufw
|
apt-get -y install ufw
|
||||||
ufw allow 22
|
ufw allow 22
|
||||||
@ -1332,14 +1332,14 @@ block_icmp(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
javapipe_kernel(){
|
javapipe_kernel(){
|
||||||
output "Apply JavaPipe's kernel configurations? (https://javapipe.com/blog/iptables-ddos-protection/)"
|
output "Apply JavaPipe's kernel configurations (https://javapipe.com/blog/iptables-ddos-protection)?"
|
||||||
output "[1] Yes."
|
output "[1] Yes."
|
||||||
output "[2] No."
|
output "[2] No."
|
||||||
read javapipe
|
read javapipe
|
||||||
case $javapipe in
|
case $javapipe in
|
||||||
1) sh -c "$(curl -sSL https://raw.githubusercontent.com/tommytran732/Anti-DDOS-Iptables/master/javapipe_kernel.sh)"
|
1) sh -c "$(curl -sSL https://raw.githubusercontent.com/tommytran732/Anti-DDOS-Iptables/master/javapipe_kernel.sh)"
|
||||||
;;
|
;;
|
||||||
2) output "Javapipe kernel modifications not applied."
|
2) output "JavaPipe kernel modifications not applied."
|
||||||
;;
|
;;
|
||||||
* ) output "You did not enter a valid selection."
|
* ) output "You did not enter a valid selection."
|
||||||
javapipe_kernel
|
javapipe_kernel
|
||||||
@ -1357,7 +1357,7 @@ install_database() {
|
|||||||
dnf -y install MariaDB-server
|
dnf -y install MariaDB-server
|
||||||
fi
|
fi
|
||||||
|
|
||||||
output "Creating the databases and setting root password."
|
output "Creating the databases and setting root password..."
|
||||||
password=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`
|
password=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`
|
||||||
adminpassword=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`
|
adminpassword=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`
|
||||||
rootpassword=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`
|
rootpassword=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`
|
||||||
|
Loading…
Reference in New Issue
Block a user