diff --git a/ct/pelican-panel.sh b/ct/pelican-panel.sh index 0ebc1502..4600cb75 100644 --- a/ct/pelican-panel.sh +++ b/ct/pelican-panel.sh @@ -60,9 +60,9 @@ RELEASE=$(wget -q https://github.com/pelican-dev/panel/releases/latest -O - | gr msg_info "Updating $APP to ${RELEASE}" cd /var/www/pelican php artisan down -curl -L https://github.com/pelican-dev/panel/releases/latest/download/panel.tar.gz -$STD tar -xzvf panel.tar.gz +curl -L https://github.com/pelican-dev/panel/releases/latest/download/panel.tar.gz | sudo tar -xzv chmod -R 755 storage/* bootstrap/cache +export COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev --optimize-autoloader php artisan view:clear php artisan config:clear diff --git a/install/pelican-panel-install.sh b/install/pelican-panel-install.sh index cd2b52fa..ed91f4dc 100644 --- a/install/pelican-panel-install.sh +++ b/install/pelican-panel-install.sh @@ -21,9 +21,10 @@ $STD apt-get install -y mc $STD apt-get install -y tar $STD apt-get install -y unzip $STD apt-get install -y git -$STD apt-get install -y software-properties-common -$STD apt-get install -y libapache2-mod-php +$STD apt-get install -y gnupg $STD apt-get install -y certbot +#$STD apt-get install -y libapache2-mod-php +#$STD apt-get install -y software-properties-common msg_ok "Installed Dependencies" read -r -p "Would you like to install Redis? (If you want to use external Redis server select 'N') " prompt @@ -33,7 +34,6 @@ if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" >/etc/apt/sources.list.d/redis.list $STD apt-get update $STD apt-get install -y redis - sed -i 's/^bind .*/bind 0.0.0.0/' /etc/redis/redis.conf systemctl enable -q --now redis-server.service msg_ok "Installed Redis" fi @@ -44,13 +44,12 @@ if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then $STD bash <(curl -fsSL https://r.mariadb.com/downloads/mariadb_repo_setup) $STD apt-get update $STD apt-get install -y mariadb-server - sed -i 's/^# *\(port *=.*\)/\1/' /etc/mysql/my.cnf - sed -i 's/^bind-address/#bind-address/g' /etc/mysql/mariadb.conf.d/50-server.cnf msg_ok "Installed MariaDB" fi msg_info "Installing PHP" -$STD add-apt-repository ppa:ondrej/php +wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg +echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list $STD apt-get update $STD apt-get install -y php8.3 php8.3-{gd,mysql,mbstring,bcmath,xml,curl,zip,intl,sqlite3,fpm} msg_ok "Installed PHP" @@ -63,7 +62,7 @@ while true; do CHOICE=$( whiptail --backtitle "Proxmox VE Helper Scripts" --title "SUPPORT" --menu "Select option" 11 58 2 \ "1" "Install Nginx" \ - "2" "Install Apache" 3>&2 2>&1 1>&3 + "2" "Install Apache" 3>&1 1>&2 2>&3 ) exit_status=$? if [ $exit_status == 1 ]; then @@ -75,25 +74,26 @@ while true; do 1) $STD apt-get update $STD apt-get install -y nginx - exit + break ;; 2) $STD apt-get update $STD apt-get install -y apache2 - exit + break ;; esac done +echo 'TEST' msg_info "Downloading Panel" mkdir -p /var/www/pelican cd /var/www/pelican -curl -L https://github.com/pelican-dev/panel/releases/latest/download/panel.tar.gz -$STD tar -xzvf panel.tar.gz +curl -L https://github.com/pelican-dev/panel/releases/latest/download/panel.tar.gz | sudo tar -xzv chmod -R 755 storage/* bootstrap/cache/ msg_ok "Downloaded Panel" msg_info "Installing Panel" +export COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev --optimize-autoloader php artisan p:environment:setup php artisan p:environment:database @@ -110,9 +110,9 @@ echo "* * * * * php /var/www/pelican/artisan schedule:run >> /dev/null 2>&1" >> chown -R www-data:www-data /var/www/pelican/* msg_ok "Setup Crontab and Permissions" -if FQDN=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set FQDN" 8 58 "panel.example.com" --title "FQDN" 3>&1 1>&2 2>&3); then +if FQDN=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set FQDN" 8 58 "pelican.example.com" --title "FQDN" 3>&1 1>&2 2>&3); then if [ -z "$FQDN" ]; then - FQDN="panel.example.com" + FQDN="pelican.example.com" else FQDN=$(echo ${FQDN,,} | tr -d ' ') fi @@ -144,13 +144,12 @@ server { listen 80; server_name $FQDN; - root /var/www/pelican/public; index index.html index.htm index.php; charset utf-8; location / { - try_files $uri $uri/ /index.php?$query_string; + try_files \$uri \$uri/ /index.php?\$query_string; } location = /favicon.ico { access_log off; log_not_found off; } @@ -171,7 +170,7 @@ server { fastcgi_index index.php; include fastcgi_params; fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M"; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name; fastcgi_param HTTP_PROXY ""; fastcgi_intercept_errors off; fastcgi_buffer_size 16k; @@ -188,7 +187,7 @@ server { EOF ln -s /etc/nginx/sites-available/pelican.conf /etc/nginx/sites-enabled/pelican.conf systemctl restart nginx - exit + break ;; 2) certbot certonly --standalone --preferred-challenges http -d $FQDN @@ -197,7 +196,7 @@ EOF server { listen 80; server_name $FQDN; - return 301 https://$server_name$request_uri; + return 301 https://\$server_name\$request_uri; } server { @@ -233,7 +232,7 @@ server { add_header Referrer-Policy same-origin; location / { - try_files $uri $uri/ /index.php?$query_string; + try_files \$uri \$uri/ /index.php?\$query_string; } location ~ \.php$ { @@ -242,7 +241,7 @@ server { fastcgi_index index.php; include fastcgi_params; fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M"; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name; fastcgi_param HTTP_PROXY ""; fastcgi_intercept_errors off; fastcgi_buffer_size 16k; @@ -260,7 +259,7 @@ server { EOF ln -s /etc/nginx/sites-available/pelican.conf /etc/nginx/sites-enabled/pelican.conf systemctl restart nginx - exit + break ;; esac done