1
0
mirror of https://github.com/tommytran732/Pterodactyl-Script synced 2024-11-09 05:01:33 -05:00

Update install.sh

This commit is contained in:
Tommy 2021-11-02 05:34:53 -04:00 committed by GitHub
parent cbd972b309
commit 0bc617d5bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -729,7 +729,8 @@ install_phpmyadmin(){
cd /var/www/pterodactyl/public/phpmyadmin || exit cd /var/www/pterodactyl/public/phpmyadmin || exit
SERVER_IP=$(dig +short myip.opendns.com @resolver1.opendns.com -4) SERVER_IP=$(dig +short myip.opendns.com @resolver1.opendns.com -4)
BOWFISH=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 34 | head -n 1` BOWFISH=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 34 | head -n 1`
bash -c 'cat > /var/www/pterodactyl/public/phpMyAdmin/config.inc.php' <<EOF if [ "$lsb_dist" = "fedora" ] || [ "$lsb_dist" = "centos" ] || [ "$lsb_dist" = "rhel" ] || [ "$lsb_dist" = "rocky" ] || [ "$lsb_dist" = "almalinux" ]; then
bash -c 'cat > /etc/phpMyAdmin/config.inc.php' <<EOF
<?php <?php
/* Servers configuration */ /* Servers configuration */
\$i = 0; \$i = 0;
@ -746,19 +747,38 @@ install_phpmyadmin(){
\$cfg['blowfish_secret'] = '${BOWFISH}'; \$cfg['blowfish_secret'] = '${BOWFISH}';
\$cfg['DefaultLang'] = 'en'; \$cfg['DefaultLang'] = 'en';
\$cfg['ServerDefault'] = 1; \$cfg['ServerDefault'] = 1;
\$cfg['UploadDir'] = ''; \$cfg['UploadDir'] = '/var/lib/phpMyAdmin/upload';
\$cfg['SaveDir'] = ''; \$cfg['SaveDir'] = '/var/lib/phpMyAdmin/save';
\$cfg['CaptchaLoginPublicKey'] = '6LcJcjwUAAAAAO_Xqjrtj9wWufUpYRnK6BW8lnfn'; \$cfg['CaptchaLoginPublicKey'] = '6LcJcjwUAAAAAO_Xqjrtj9wWufUpYRnK6BW8lnfn';
\$cfg['CaptchaLoginPrivateKey'] = '6LcJcjwUAAAAALOcDJqAEYKTDhwELCkzUkNDQ0J5' \$cfg['CaptchaLoginPrivateKey'] = '6LcJcjwUAAAAALOcDJqAEYKTDhwELCkzUkNDQ0J5'
?> ?>
EOF EOF
output "Installation completed." chown -R nginx:nginx /var/www/pterodactyl
if [ "$lsb_dist" = "ubuntu" ] || [ "$lsb_dist" = "debian" ]; then if [ "$lsb_dist" = "ubuntu" ] || [ "$lsb_dist" = "debian" ]; then
chown -R www-data:www-data * /var/www/pterodactyl bash -c 'cat > /etc/phpmyadmin/config.inc.php' <<EOF
elif [ "$lsb_dist" = "fedora" ] || [ "$lsb_dist" = "centos" ] || [ "$lsb_dist" = "rhel" ] || [ "$lsb_dist" = "rocky" ] || [ "$lsb_dist" = "almalinux" ]; then <?php
chown -R nginx:nginx * /var/www/pterodactyl /* Servers configuration */
semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/pterodactyl/storage(/.*)?" \$i = 0;
restorecon -R /var/www/pterodactyl /* Server: MariaDB [1] */
\$i++;
\$cfg['Servers'][\$i]['verbose'] = 'MariaDB';
\$cfg['Servers'][\$i]['host'] = '${SERVER_IP}';
\$cfg['Servers'][\$i]['port'] = '';
\$cfg['Servers'][\$i]['socket'] = '';
\$cfg['Servers'][\$i]['auth_type'] = 'cookie';
\$cfg['Servers'][\$i]['user'] = 'root';
\$cfg['Servers'][\$i]['password'] = '';
/* End of servers configuration */
\$cfg['blowfish_secret'] = '${BOWFISH}';
\$cfg['DefaultLang'] = 'en';
\$cfg['ServerDefault'] = 1;
\$cfg['UploadDir'] = '/var/lib/phpmyadmin/upload';
\$cfg['SaveDir'] = '/var/lib/phpmyadmin/save';
\$cfg['CaptchaLoginPublicKey'] = '6LcJcjwUAAAAAO_Xqjrtj9wWufUpYRnK6BW8lnfn';
\$cfg['CaptchaLoginPrivateKey'] = '6LcJcjwUAAAAALOcDJqAEYKTDhwELCkzUkNDQ0J5'
?>
EOF
chown -R www-data:www-data /var/www/pterodactyl
fi fi
} }