-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
866 lines (794 loc) · 32.9 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
#!/bin/bash
# Color
BLUE='\033[0;34m'
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NC='\033[0m'
MAGENTA='\033[0;35m'
CYAN='\033[0;36m'
RESET='\033[0m'
warning(){
echo -e '\e[31m'"$1"'\e[0m';
}
# Display welcome message
display_welcome() {
echo -e ""
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e "${RED}[+] [+]${NC}"
echo -e "${RED}[+] AUTO INSTALLER THEMA [+]${NC}"
echo -e "${RED}[+] © GARAXYZ - ASSISTEN [+]${NC}"
echo -e "${RED}[+] [+]${NC}"
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e ""
echo -e "script ini di buat untuk mempermudah penginstalasian thema pterodactyle,"
echo -e "dilarang keras untuk memperjual belikan."
echo -e ""
echo -e "𝗪𝗛𝗔𝗧𝗦𝗔𝗣𝗣 :"
echo -e "0877-8633-6665"
echo -e "𝗬𝗢𝗨𝗧𝗨𝗕𝗘 :"
echo -e "@Fahriofficial"
echo -e "𝗖𝗥𝗘𝗗𝗜𝗧𝗦 :"
echo -e "@GaraXyz - Assisten"
sleep 4
clear
}
#Update and install jq
install_jq() {
echo -e " "
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e "${BLUE}[+] UPDATE & INSTALL JQ [+]${NC}"
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e " "
sudo apt update && sudo apt install -y jq
if [ $? -eq 0 ]; then
echo -e " "
echo -e "${GREEN}[+] =============================================== [+]${NC}"
echo -e "${GREEN}[+] INSTALL JQ BERHASIL [+]${NC}"
echo -e "${GREEN}[+] =============================================== [+]${NC}"
else
echo -e " "
echo -e "${RED}[+] =============================================== [+]${NC}"
echo -e "${RED}[+] INSTALL JQ GAGAL [+]${NC}"
echo -e "${RED}[+] =============================================== [+]${NC}"
exit 1
fi
echo -e " "
sleep 1
clear
}
#Check user token
check_token() {
echo -e " "
echo -e "${RED}[+] =============================================== [+]${NC}"
echo -e "${BLUE}[+] LICENSY GARAXYZ - ASSISTEN [+]${NC}"
echo -e "${RED}[+] =============================================== [+]${NC}"
echo -e " "
echo -e "${YELLOW}MASUKAN AKSES TOKEN :${NC}"
read -r USER_TOKEN
if [ "$USER_TOKEN" = "fahristock" ]; then
echo -e "${GREEN}AKSES BERHASIL${NC}}"
else
echo -e "${GREEN}Buy dulu Weh Ke GaraXyz - Assisten No 6287786336665${NC}"
exit 1
fi
clear
}
# Install theme
install_theme() {
while true; do
echo -e " "
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e "${BLUE}[+] SELECT THEME [+]${NC}"
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e " "
echo -e "PILIH THEME YANG INGIN DI INSTALL"
echo "1. stellar"
echo "2. billing"
echo "3. enigma"
echo "x. kembali"
echo -e "masukan pilihan (1/2/3/x) :"
read -r SELECT_THEME
case "$SELECT_THEME" in
1)
THEME_URL=$(echo -e "https://github.com/Fahrihosting1/thema/main/C2.zip")
break
;;
2)
THEME_URL=$(echo -e "\x68\x74\x74\x70\x73\x3A\x2F\x2F\x67\x69\x74\x68\x75\x62\x2E\x63\x6F\x6D\x2F\x44\x49\x54\x5A\x5A\x31\x31\x32\x2F\x66\x6F\x78\x78\x68\x6F\x73\x74\x74\x2F\x72\x61\x77\x2F\x6D\x61\x69\x6E\x2F\x43\x31\x2E\x7A\x69\x70")
break
;;
3)
THEME_URL=$(echo -e "\x68\x74\x74\x70\x73\x3A\x2F\x2F\x67\x69\x74\x68\x75\x62\x2E\x63\x6F\x6D\x2F\x44\x49\x54\x5A\x5A\x31\x31\x32\x2F\x66\x6F\x78\x78\x68\x6F\x73\x74\x74\x2F\x72\x61\x77\x2F\x6D\x61\x69\x6E\x2F\x43\x33\x2E\x7A\x69\x70")
break
;;
x)
return
;;
*)
echo -e "${RED}Pilihan tidak valid, silahkan coba lagi.${NC}"
;;
esac
done
if [ -e /root/pterodactyl ]; then
sudo rm -rf /root/pterodactyl
fi
wget -q "$THEME_URL"
sudo unzip -o "$(basename "$THEME_URL")"
if [ "$SELECT_THEME" -eq 1 ]; then
echo -e " "
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e "${BLUE}[+] INSTALLASI THEMA [+]${NC}"
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e " "
sudo cp -rfT /root/pterodactyl /var/www/pterodactyl
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt install -y nodejs
sudo npm i -g yarn
cd /var/www/pterodactyl
yarn add react-feather
php artisan migrate
yarn build:production
php artisan view:clear
sudo rm /root/C2.zip
sudo rm -rf /root/pterodactyl
echo -e " "
echo -e "${GREEN}[+] =============================================== [+]${NC}"
echo -e "${GREEN}[+] INSTALL SUCCESS [+]${NC}"
echo -e "${GREEN}[+] =============================================== [+]${NC}"
echo -e ""
sleep 2
clear
exit 0
elif [ "$SELECT_THEME" -eq 2 ]; then
echo -e " "
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e "${BLUE}[+] INSTALLASI THEMA [+]${NC}"
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e " "
sudo cp -rfT /root/pterodactyl /var/www/pterodactyl
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt install -y nodejs
npm i -g yarn
cd /var/www/pterodactyl
yarn add react-feather
php artisan billing:install stable
php artisan migrate
yarn build:production
php artisan view:clear
sudo rm /root/C1.zip
sudo rm -rf /root/pterodactyl
echo -e " "
echo -e "${GREEN}[+] =============================================== [+]${NC}"
echo -e "${GREEN}[+] INSTALL SUCCESS [+]${NC}"
echo -e "${GREEN}[+] =============================================== [+]${NC}"
echo -e " "
sleep 2
clear
return
elif [ "$SELECT_THEME" -eq 3 ]; then
echo -e " "
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e "${BLUE}[+] INSTALLASI THEMA [+]${NC}"
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e " "
# Menanyakan informasi kepada pengguna untuk tema Enigma
echo -e "${YELLOW}Masukkan link wa (https://wa.me...) : ${NC}"
read LINK_WA
echo -e "${YELLOW}Masukkan link group (https://.....) : ${NC}"
read LINK_GROUP
echo -e "${YELLOW}Masukkan link channel (https://...) : ${NC}"
read LINK_CHNL
# Mengganti placeholder dengan nilai dari pengguna
sudo sed -i "s|LINK_WA|$LINK_WA|g" /root/pterodactyl/resources/scripts/components/dashboard/DashboardContainer.tsx
sudo sed -i "s|LINK_GROUP|$LINK_GROUP|g" /root/pterodactyl/resources/scripts/components/dashboard/DashboardContainer.tsx
sudo sed -i "s|LINK_CHNL|$LINK_CHNL|g" /root/pterodactyl/resources/scripts/components/dashboard/DashboardContainer.tsx
sudo cp -rfT /root/pterodactyl /var/www/pterodactyl
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt install -y nodejs
sudo npm i -g yarn
cd /var/www/pterodactyl
yarn add react-feather
php artisan migrate
yarn build:production
php artisan view:clear
sudo rm /root/C3.zip
sudo rm -rf /root/pterodactyl
echo -e " "
echo -e "${GREEN}[+] =============================================== [+]${NC}"
echo -e "${GREEN}[+] INSTALL SUCCESS [+]${NC}"
echo -e "${GREEN}[+] =============================================== [+]${NC}"
echo -e ""
sleep 5
else
echo ""
echo "Pilihan tidak valid. silahkan pilih 1/2/3."
fi
}
# Uninstall theme
uninstall_theme() {
echo -e " "
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e "${BLUE}[+] DELETE THEME [+]${NC}"
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e " "
bash <(curl https://raw.githubusercontent.com/VallzHost/installer-theme/main/repair.sh)
echo -e " "
echo -e "${GREEN}[+] =============================================== [+]${NC}"
echo -e "${GREEN}[+] DELETE THEME SUKSES [+]${NC}"
echo -e "${GREEN}[+] =============================================== [+]${NC}"
echo -e " "
sleep 2
clear
}
install_themeEnigma() {
echo -e " "
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e "${BLUE}[+] INSTALLASI THEMA [+]${NC}"
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e " "
# Menanyakan informasi kepada pengguna untuk tema Enigma
echo -e "${YELLOW}Masukkan link wa (https://wa.me...) : ${NC}"
read LINK_WA
echo -e "${YELLOW}Masukkan link group (https://.....) : ${NC}"
read LINK_GROUP
echo -e "${YELLOW}Masukkan link channel (https://...) : ${NC}"
read LINK_CHNL
# Mengganti placeholder dengan nilai dari pengguna
sudo sed -i "s|LINK_WA|$LINK_WA|g" /root/pterodactyl/resources/scripts/components/dashboard/DashboardContainer.tsx
sudo sed -i "s|LINK_GROUP|$LINK_GROUP|g" /root/pterodactyl/resources/scripts/components/dashboard/DashboardContainer.tsx
sudo sed -i "s|LINK_CHNL|$LINK_CHNL|g" /root/pterodactyl/resources/scripts/components/dashboard/DashboardContainer.tsx
sudo cp -rfT /root/pterodactyl /var/www/pterodactyl
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt install -y nodejs
sudo npm i -g yarn
cd /var/www/pterodactyl
yarn add react-feather
php artisan migrate
yarn build:production
php artisan view:clear
sudo rm /root/C3.zip
sudo rm -rf /root/pterodactyl
echo -e " "
echo -e "${GREEN}[+] =============================================== [+]${NC}"
echo -e "${GREEN}[+] INSTALL SUCCESS [+]${NC}"
echo -e "${GREEN}[+] =============================================== [+]${NC}"
echo -e ""
sleep 5
clear
exit 0
}
install_themeSteeler() {
#!/bin/bash
echo -e " "
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e "${BLUE}[+] INSTALLASI THEMA [+]${NC}"
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e " "
sudo cp -rfT /root/pterodactyl /var/www/pterodactyl
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt install -y nodejs
sudo npm i -g yarn
cd /var/www/pterodactyl
yarn add react-feather
php artisan migrate
yarn build:production
php artisan view:clear
sudo rm /main/C2.zip
sudo rm -rf /root/pterodactyl
echo -e " "
echo -e "${GREEN}[+] =============================================== [+]${NC}"
echo -e "${GREEN}[+] INSTALL SUCCESS [+]${NC}"
echo -e "${GREEN}[+] =============================================== [+]${NC}"
echo -e ""
sleep 2
clear
exit 0
}
create_node() {
echo -e " "
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e "${BLUE}[+] CRRATE NODE [+]${NC}"
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e " "
#!/bin/bash
#!/bin/bash
# Minta input dari pengguna
read -p "Masukkan nama lokasi: " location_name
read -p "Masukkan deskripsi lokasi: " location_description
read -p "Masukkan domain: " domain
read -p "Masukkan nama node: " node_name
read -p "Masukkan RAM (dalam MB): " ram
read -p "Masukkan jumlah maksimum disk space (dalam MB): " disk_space
read -p "Masukkan Locid: " locid
# Ubah ke direktori pterodactyl
cd /var/www/pterodactyl || { echo "Direktori tidak ditemukan"; exit 1; }
# Membuat lokasi baru
php artisan p:location:make <<EOF
$location_name
$location_description
EOF
# Membuat node baru
php artisan p:node:make <<EOF
$node_name
$location_description
$locid
https
$domain
yes
no
no
$ram
$ram
$disk_space
$disk_space
100
8080
2022
/var/lib/pterodactyl/volumes
EOF
echo -e " "
echo -e "${GREEN}[+] =============================================== [+]${NC}"
echo -e "${GREEN}[+] CREATE NODE & LOCATION SUKSES [+]${NC}"
echo -e "${GREEN}[+] =============================================== [+]${NC}"
echo -e " "
sleep 2
clear
exit 0
}
uninstall_panel() {
echo -e " "
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e "${BLUE}[+] UNINSTALL PANEL [+]${NC}"
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e " "
bash <(curl -s https://pterodactyl-installer.se) <<EOF
y
y
y
y
EOF
echo -e " "
echo -e "${GREEN}[+] =============================================== [+]${NC}"
echo -e "${GREEN}[+] UNINSTALL PANEL SUKSES [+]${NC}"
echo -e "${GREEN}[+] =============================================== [+]${NC}"
echo -e " "
sleep 2
clear
exit 0
}
### PHPMyAdmin Installation ###
phpmyadmin(){
apt install dnsutils -y
echo ""
echo "[!] Before installation, we need some information."
echo ""
phpmyadmin_fqdn
}
phpmyadmin_finish(){
cd
echo -e "PHPMyAdmin Installation\n\nSummary of the installation\n\nPHPMyAdmin URL: $PHPMYADMIN_FQDN\nPreselected webserver: NGINX\nSSL: $PHPMYADMIN_SSLSTATUS\nUser: $PHPMYADMIN_USER_LOCAL\nPassword: $PHPMYADMIN_PASSWORD\nEmail: $PHPMYADMIN_EMAIL" > phpmyadmin_credentials.txt
clear
echo "[!] Installation of PHPMyAdmin done"
echo ""
echo " Summary of the installation"
echo " PHPMyAdmin URL: $PHPMYADMIN_FQDN"
echo " Preselected webserver: NGINX"
echo " SSL: $PHPMYADMIN_SSLSTATUS"
echo " User: $PHPMYADMIN_USER_LOCAL"
echo " Password: $PHPMYADMIN_PASSWORD"
echo " Email: $PHPMYADMIN_EMAIL"
echo ""
echo " These credentials will has been saved in a file called"
echo " phpmyadmin_credentials.txt in your current directory"
echo ""
}
phpmyadminweb(){
rm -rf /etc/nginx/sites-enabled/default || exit || echo "An error occurred. NGINX is not installed." || exit
apt install mariadb-server -y
PHPMYADMIN_PASSWORD=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1`
mariadb -u root -e "CREATE USER '$PHPMYADMIN_USER_LOCAL'@'localhost' IDENTIFIED BY '$PHPMYADMIN_PASSWORD';" && mariadb -u root -e "GRANT ALL PRIVILEGES ON *.* TO '$PHPMYADMIN_USER_LOCAL'@'localhost' WITH GRANT OPTION;"
if [ "$PHPMYADMIN_SSLSTATUS" = "true" ]; then
rm -rf /etc/nginx/sites-enabled/default
curl -o /etc/nginx/sites-enabled/phpmyadmin.conf https://raw.githubusercontent.com/Fahrihosting1/thema/main/configs/phpmyadmin-ssl.conf
sed -i -e "s@<domain>@${PHPMYADMIN_FQDN}@g" /etc/nginx/sites-enabled/phpmyadmin.conf
systemctl stop nginx || exit || echo "An error occurred. NGINX is not installed." || exit
certbot certonly --standalone -d $PHPMYADMIN_FQDN --staple-ocsp --no-eff-email -m $PHPMYADMIN_EMAIL --agree-tos || exit || echo "An error occurred. Certbot not installed." || exit
systemctl start nginx || exit || echo "An error occurred. NGINX is not installed." || exit
phpmyadmin_finish
fi
if [ "$PHPMYADMIN_SSLSTATUS" = "false" ]; then
curl -o /etc/nginx/sites-enabled/phpmyadmin.conf https://raw.githubusercontent.com/Fahrihosting1/thema/main/configs/phpmyadmin.conf || exit || echo "An error occurred. cURL is not installed." || exit
sed -i -e "s@<domain>@${PHPMYADMIN_FQDN}@g" /etc/nginx/sites-enabled/phpmyadmin.conf || exit || echo "An error occurred. NGINX is not installed." || exit
systemctl restart nginx || exit || echo "An error occurred. NGINX is not installed." || exit
phpmyadmin_finish
fi
}
phpmyadmin_fqdn(){
send_phpmyadmin_summary
echo "[!] Please enter FQDN. You will access PHPMyAdmin with this."
read -r PHPMYADMIN_FQDN
[ -z "$PHPMYADMIN_FQDN" ] && echo "FQDN can't be empty."
IP=$(dig +short myip.opendns.com @resolver2.opendns.com -4)
DOMAIN=$(dig +short ${PHPMYADMIN_FQDN})
if [ "${IP}" != "${DOMAIN}" ]; then
echo ""
echo "Your FQDN does not resolve to the IP of this machine."
echo "Continuing anyway in 10 seconds.. CTRL+C to stop."
sleep 10s
phpmyadmin_ssl
else
phpmyadmin_ssl
fi
}
phpmyadmininstall(){
apt update
apt install nginx certbot -y
mkdir /var/www/phpmyadmin && cd /var/www/phpmyadmin || exit || echo "An error occurred. Could not create directory." || exit
cd /var/www/phpmyadmin
if [ "$dist" = "ubuntu" ] && [ "$version" = "20.04" ]; then
apt -y install software-properties-common curl apt-transport-https ca-certificates gnupg
LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | bash
apt update
add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
fi
if [ "$dist" = "debian" ] && [ "$version" = "11" ]; then
apt -y install software-properties-common curl ca-certificates gnupg2 lsb-release
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/sury-php.list
curl -fsSL https://packages.sury.org/php/apt.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/sury-keyring.gpg
apt update -y
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | bash
fi
if [ "$dist" = "debian" ] && [ "$version" = "12" ]; then
apt -y install software-properties-common curl ca-certificates gnupg2 lsb-release
apt install -y apt-transport-https lsb-release ca-certificates wget
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" | tee /etc/apt/sources.list.d/php.list
apt update -y
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | bash
fi
wget https://files.phpmyadmin.net/phpMyAdmin/5.2.1/phpMyAdmin-5.2.1-all-languages.tar.gz
tar xzf phpMyAdmin-5.2.1-all-languages.tar.gz
mv /var/www/phpmyadmin/phpMyAdmin-5.2.1-all-languages/* /var/www/phpmyadmin
chown -R www-data:www-data *
mkdir config
chmod o+rw config
cp config.sample.inc.php config/config.inc.php
chmod o+w config/config.inc.php
rm -rf /var/www/phpmyadmin/config
phpmyadminweb
}
phpmyadmin_summary(){
clear
echo ""
echo "[!] Summary:"
echo " PHPMyAdmin URL: $PHPMYADMIN_FQDN"
echo " Preselected webserver: NGINX"
echo " SSL: $PHPMYADMIN_SSLSTATUS"
echo " User: $PHPMYADMIN_USER_LOCAL"
echo " Email: $PHPMYADMIN_EMAIL"
echo ""
echo " These credentials have been saved in a file called"
echo " phpmyadmin_credentials.txt in your current directory"
echo ""
echo " Do you want to start the installation? (Y/N)"
read -r PHPMYADMIN_INSTALLATION
if [[ "$PHPMYADMIN_INSTALLATION" =~ [Yy] ]]; then
phpmyadmininstall
fi
if [[ "$PHPMYADMIN_INSTALLATION" =~ [Nn] ]]; then
echo "[!] Installation has been aborted."
exit 1
fi
}
send_phpmyadmin_summary(){
clear
echo ""
if [ -d "/var/www/phpymyadmin" ]; then
warning "[!] WARNING: There seems to already be an installation of PHPMyAdmin installed! This script will fail!"
fi
echo ""
echo "[!] Summary:"
echo " PHPMyAdmin URL: $PHPMYADMIN_FQDN"
echo " Preselected webserver: NGINX"
echo " SSL: $PHPMYADMIN_SSLSTATUS"
echo " User: $PHPMYADMIN_USER_LOCAL"
echo " Email: $PHPMYADMIN_EMAIL"
echo ""
}
phpmyadmin_ssl(){
send_phpmyadmin_summary
echo "[!] Do you want to use SSL for PHPMyAdmin? This is recommended. (Y/N)"
read -r SSL_CONFIRM
if [[ "$SSL_CONFIRM" =~ [Yy] ]]; then
PHPMYADMIN_SSLSTATUS=true
phpmyadmin_email
fi
if [[ "$SSL_CONFIRM" =~ [Nn] ]]; then
PHPMYADMIN_SSLSTATUS=false
phpmyadmin_email
fi
}
phpmyadmin_user(){
send_phpmyadmin_summary
echo "[!] Please enter username for admin account."
read -r PHPMYADMIN_USER_LOCAL
phpmyadmin_summary
}
phpmyadmin_email(){
send_phpmyadmin_summary
if [ "$PHPMYADMIN_SSLSTATUS" = "true" ]; then
echo "[!] Please enter your email. It will be shared with Lets Encrypt."
read -r PHPMYADMIN_EMAIL
phpmyadmin_user
fi
if [ "$PHPMYADMIN_SSLSTATUS" = "false" ]; then
phpmyadmin_user
PHPMYADMIN_EMAIL="Unavailable"
fi
}
configure_wings() {
echo -e " "
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e "${BLUE}[+] CONFIGURE WINGS [+]${NC}"
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e " "
#!/bin/bash
# Minta input token dari pengguna
read -p "Masukkan token Configure menjalankan wings: " wings
eval "$wings"
# Menjalankan perintah systemctl start wings
sudo systemctl start wings
echo -e " "
echo -e "${GREEN}[+] =============================================== [+]${NC}"
echo -e "${GREEN}[+] CONFIGURE WINGS SUKSES [+]${NC}"
echo -e "${GREEN}[+] =============================================== [+]${NC}"
echo -e " "
sleep 2
clear
exit 0
}
### Switching Domains ###
switch(){
if [ "$SSLSWITCH" = "true" ]; then
echo ""
echo "[!] Change domains"
echo ""
echo " The script is now changing your Pterodactyl Domain."
echo " This may take a couple seconds for the SSL part, as SSL certificates are being generated."
rm /etc/nginx/sites-enabled/pterodactyl.conf
curl -o /etc/nginx/sites-enabled/pterodactyl.conf https://raw.githubusercontent.com/Fahrihosting1/thema/main/configs/pterodactyl-nginx-ssl.conf || exit || warning "Pterodactyl Panel not installed!"
sed -i -e "s@<domain>@${DOMAINSWITCH}@g" /etc/nginx/sites-enabled/pterodactyl.conf
systemctl stop nginx
certbot certonly --standalone -d $DOMAINSWITCH --staple-ocsp --no-eff-email -m $EMAILSWITCHDOMAINS --agree-tos || exit || warning "Errors accured."
systemctl start nginx
echo ""
echo "[!] Change domains"
echo ""
echo " Your domain has been switched to $DOMAINSWITCH"
echo " This script does not update your APP URL, you can"
echo " update it in /var/www/pterodactyl/.env"
echo ""
echo " If using Cloudflare certifiates for your Panel, please read this:"
echo " The script uses Lets Encrypt to complete the change of your domain,"
echo " if you normally use Cloudflare Certificates,"
echo " you can change it manually in its config which is in the same place as before."
echo ""
fi
if [ "$SSLSWITCH" = "false" ]; then
echo "[!] Switching your domain.. This wont take long!"
rm /etc/nginx/sites-enabled/pterodactyl.conf || exit || echo "An error occurred. Could not delete file." || exit
curl -o /etc/nginx/sites-enabled/pterodactyl.conf https://raw.githubusercontent.com/Fahrihosting1/thema/main/configs/pterodactyl-nginx.conf || exit || warning "Pterodactyl Panel not installed!"
sed -i -e "s@<domain>@${DOMAINSWITCH}@g" /etc/nginx/sites-enabled/pterodactyl.conf
systemctl restart nginx
echo ""
echo "[!] Change domains"
echo ""
echo " Your domain has been switched to $DOMAINSWITCH"
echo " This script does not update your APP URL, you can"
echo " update it in /var/www/pterodactyl/.env"
fi
}
switchemail(){
echo ""
echo "[!] Change domains"
echo " To install your new domain certificate to your Panel, your email address must be shared with Let's Encrypt."
echo " They will send you an email when your certificate is about to expire. A certificate lasts 90 days at a time and you can renew your certificates for free and easily, even with this script."
echo ""
echo " When you created your certificate for your panel before, they also asked you for your email address. It's the exact same thing here, with your new domain."
echo " Therefore, enter your email. If you do not feel like giving your email, then the script can not continue. Press CTRL + C to exit."
echo ""
echo " Please enter your email"
read -r EMAILSWITCHDOMAINS
switch
}
switchssl(){
echo -e "${BLUE}[+]===================================================[+]${NC}"
echo "[+] [!] Select the one that describes your situation best [+]"
echo -e "${RED}[+] [1] I want SSL on my Panel on my new domain. [+]${NC}"
echo -e "${RED}[+] [2] I don't want SSL on my Panel on my new domain [+]${NC}"
echo -e "${BLUE}[+]===================================================[+]${NC}"
read -r option
case $option in
1 ) option=1
SSLSWITCH=true
switchemail
;;
2 ) option=2
SSLSWITCH=false
switch
;;
* ) echo ""
echo "Please enter a valid option."
esac
}
switchdomains(){
echo -e ""
echo -e "${BLUE}[+] =================== [+]${NC}"
echo -e "${RED}[!] Change domains. [+]${NC}"
echo -e "${BLUE}[+] =================== [+]${NC}"
echo -e "Please enter the domain (panel.mydomain.ltd) you want to switch to."
read -r DOMAINSWITCH
switchssl
}
installTheme(){
echo -e "${GREEN}Installing ${YELLOW}sudo${GREEN} if not installed${RESET}"
apt install sudo -y > /dev/null 2>&1
cd /var/www/ > /dev/null 2>&1
echo -e "${GREEN}Unpack the themebackup...${RESET}"
tar -cvf Pterodactyl_Nightcore_Themebackup.tar.gz pterodactyl > /dev/null 2>&1
echo -e "${GREEN}Installing theme... ${RESET}"
cd /var/www/pterodactyl > /dev/null 2>&1
echo -e "${GREEN}Removing old theme if exist${RESET}"
rm -r Pterodactyl_Nightcore_Theme > /dev/null 2>&1
echo -e "${GREEN}Download the Theme${RESET}"
git clone https://github.com/Fahrihosting1/thema.git > /dev/null 2>&1
cd thema > /dev/null 2>&1
echo -e "${GREEN}Removing old theme resources if exist${RESET}"
rm /var/www/pterodactyl/resources/scripts/Pterodactyl_Nightcore_Theme.css > /dev/null 2>&1
rm /var/www/pterodactyl/resources/scripts/index.tsx > /dev/null 2>&1
echo -e "${GREEN}Moving the new theme files to directory${RESET}"
mv index.tsx /var/www/pterodactyl/resources/scripts/index.tsx > /dev/null 2>&1
mv Pterodactyl_Nightcore_Theme.css /var/www/pterodactyl/resources/scripts/Pterodactyl_Nightcore_Theme.css > /dev/null 2>&1
cd /var/www/pterodactyl > /dev/null 2>&1
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash - > /dev/null 2>&1
apt update -y > /dev/null 2>&1
apt install nodejs -y > /dev/null 2>&1
NODE_VERSION=$(node -v)
REQUIRED_VERSION="v16.20.2"
if [ "$NODE_VERSION" != "$REQUIRED_VERSION" ]; then
echo -e "${GREEN}Node.js version is not ${YELLOW}${REQUIRED_VERSION}${GREEN}. Version: ${YELLOW}${NODE_VERSION}${RESET}"
echo -e "${GREEN}Set version to ${YELLOW}v16.20.2${GREEN}... ${RESET}"
sudo npm install -g n > /dev/null 2>&1
sudo n 16 > /dev/null 2>&1
node -v > /dev/null 2>&1
npm -v > /dev/null 2>&1
echo -e "${GREEN}Now the default version is ${YELLOW}${REQUIRED_VERSION}"
else
echo -e "${GREEN}Node.js Version is compatible: ${YELLOW}${NODE_VERSION} ${RESET}"
fi
apt install npm -y > /dev/null 2>&1
npm i -g yarn > /dev/null 2>&1
yarn > /dev/null 2>&1
cd /var/www/pterodactyl > /dev/null 2>&1
echo -e "${GREEN}Rebuilding the Panel...${RESET}"
yarn build:production > /dev/null 2>&1
echo -e "${GREEN}Optimizing the Panel...${RESET}"
sudo php artisan optimize:clear > /dev/null 2>&1
}
installThemeQuestion(){
while true; do
read -p "Are you sure that you want to install the theme [y/n]? " yn
case $yn in
[Yy]* ) installTheme; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
}
repair(){
bash <(curl https://raw.githubusercontent.com/Fahrihosting1/thema/main/repair.sh)
}
hackback_panel() {
echo -e " "
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e "${BLUE}[+] HACK BACK PANEL [+]${NC}"
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e " "
# Minta input dari pengguna
read -p "Masukkan Username Panel: " user
read -p "password login " psswd
#!/bin/bash
cd /var/www/pterodactyl || { echo "Direktori tidak ditemukan"; exit 1; }
# Membuat lokasi baru
php artisan p:user:make <<EOF
yes
$user
$user
$user
$passwd
EOF
echo -e " "
echo -e "${GREEN}[+] =============================================== [+]${NC}"
echo -e "${GREEN}[+] AKUN TELAH DI ADD [+]${NC}"
echo -e "${GREEN}[+] =============================================== [+]${NC}"
echo -e " "
sleep 2
exit 0
}
# Main script
display_welcome
install_jq
check_token
while true; do
clear
echo -e " "
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e "${BLUE}[+] SELECT OPTION [+]${NC}"
echo -e "${BLUE}[+] =============================================== [+]${NC}"
echo -e " "
echo -e "${RED}SELECT OPTION MENU :${NC}"
echo "1. Install theme"
echo "2. Uninstall theme"
echo "3. Configure Wings"
echo "4. Create Node"
echo "5. Uninstall Panel"
echo "6. Setteler Theme"
echo "7. Hack Back Panel"
echo "8. Enigma Thema"
echo "9. Install PHPMyAdmin"
echo "10. Remove PHPMyAdmin"
echo "11. Switch Pterodactyl Domain"
echo "12. Install Thema Dark"
echo "x. Exit"
echo -e "Masukkan pilihan (1/2/x):"
read -r MENU_CHOICE
clear
case "$MENU_CHOICE" in
1)
install_theme
;;
2)
uninstall_theme
;;
3)
configure_wings
;;
4)
create_node
;;
5)
uninstall_panel
;;
6)
install_themeSteeler
;;
7)
hackback_panel
;;
8)
install_themeEnigma
;;
9)
phpmyadmin
;;
10)
removephpmyadmin
;;
11)
switchdomains
;;
12)
installThemeQuestion
;;
x)
echo "Keluar dari skrip."
exit 0
;;
*)
echo "Pilihan tidak valid, silahkan coba lagi."
;;
esac
done