From cc63fc325160c84fc4ef871572ea427ac6926a66 Mon Sep 17 00:00:00 2001 From: denis Date: Fri, 6 Sep 2024 06:03:01 -0400 Subject: [PATCH] Add puffer.sh --- puffer.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 puffer.sh diff --git a/puffer.sh b/puffer.sh new file mode 100644 index 0000000..01a1492 --- /dev/null +++ b/puffer.sh @@ -0,0 +1,43 @@ +#!/bin/bash +if [ "$(id -u)" -ne 0 ]; then + echo "This script must be run as root. Please use 'sudo' or switch to the root user." + exit 1 +fi +read -p "Enter your domain name (e.g., panel.example.com): " domain +curl -s https://packagecloud.io/install/repositories/pufferpanel/pufferpanel/script.deb.sh | bash & +wait +apt-get install pufferpanel -y +pufferpanel user add +systemctl enable --now pufferpanel +apt-get update +apt-get install nginx +cat < "/etc/nginx/sites-enabled/pufferpanel.conf" +server { + listen 80; + root /var/www/pufferpanel; + + server_name $domain; + + location ~ ^/\\.well-known { + root /var/www/html; + allow all; + } + + location / { + proxy_pass http://localhost:8080; + proxy_set_header X-Real-IP \$remote_addr; + proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; + proxy_set_header X-Nginx-Proxy true; + proxy_http_version 1.1; + proxy_set_header Upgrade \$http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host \$host; + client_max_body_size 100M; + } +} +EOL +systemctl restart nginx +apt-get update +apt-get install certbot python3-certbot-nginx -y +certbot --nginx -d $domain +echo "pufferpanel installed, you should be able to reach it at https://$domain, and login with the admin user you specified earlier" \ No newline at end of file