Skip to content

Commit 32557db

Browse files
jaapmarcusScIT-Raphaelwojsmol
authored
[Feature] Install PHPMyAdmin from source directly (hestiacp#1493)
* Use PHPmyadmin from source for new installs Migrate PHPmyadmin script for old installs * Update config.inc.php * Update read message * Update install/deb/phpmyadmin/config.inc.php Co-authored-by: Wojciech Smoliński <wojsmol@wp.pl> * Update install/upgrade/manual/migrate_phpmyadmin.sh Co-authored-by: Wojciech Smoliński <wojsmol@wp.pl> Co-authored-by: Raphael Schneeberger <rs@scit.ch> Co-authored-by: Wojciech Smoliński <wojsmol@wp.pl>
1 parent 3fa91ec commit 32557db

File tree

6 files changed

+257
-296
lines changed

6 files changed

+257
-296
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
/* PHPmyadmin config for Hestia 1.3.3 > */
3+
/* vim: set expandtab sw=4 ts=4 sts=4: */
4+
/**
5+
* All directives are explained in documentation in the doc/ folder
6+
* or at <https://docs.phpmyadmin.net/>.
7+
*
8+
* @package PhpMyAdmin
9+
*/
10+
declare(strict_types=1);
11+
12+
/**
13+
* This is needed for cookie based authentication to encrypt password in
14+
* cookie. Needs to be 32 chars long.
15+
*/
16+
$cfg['blowfish_secret'] = '%blowfish_secret%'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
17+
18+
/**
19+
* Directories for saving/loading files from server
20+
*/
21+
$cfg['UploadDir'] = '';
22+
$cfg['SaveDir'] = '';
23+
24+
/**
25+
* You can find more configuration options in the documentation
26+
* in the doc/ folder or at <https://docs.phpmyadmin.net/>.
27+
*/
28+
$i = 0;
29+
foreach (glob('/etc/phpmyadmin/conf.d/*.php') as $filename)
30+
{
31+
include($filename);
32+
/*Don't remove / alter code here below this will add SSO support for all servers*/
33+
//Add Hestia SSO code here
34+
$i++;
35+
}

install/deb/phpmyadmin/pma.sh

Lines changed: 6 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,8 @@
1313
PASS=$(gen_pass)
1414

1515
#ubuntu phpmyadmin path
16-
pmapath1="/etc/phpmyadmin/config.inc.php"
17-
pmapath2="/usr/share/phpmyadmin/config.sample.inc.php"
16+
pmapath1="/etc/phpmyadmin/conf.d/01-localhost.php"
1817

19-
#delete old and paste new value
20-
sed -i '/pmadb/d' $pmapath1
21-
sed -i '/controluser/d' $pmapath1
22-
sed -i '/bookmarktable/d' $pmapath1
23-
sed -i '/relation/d' $pmapath1
24-
sed -i '/userconfig/d' $pmapath1
25-
sed -i '/table_info/d' $pmapath1
26-
sed -i '/column_info/d' $pmapath1
27-
sed -i '/history/d' $pmapath1
28-
sed -i '/recent/d' $pmapath1
29-
sed -i '/table_uiprefs/d' $pmapath1
30-
sed -i '/tracking/d' $pmapath1
31-
sed -i '/table_coords/d' $pmapath1
32-
sed -i '/pdf_pages/d' $pmapath1
33-
sed -i '/designer_coords/d' $pmapath1
34-
sed -i '/controlpass/d' $pmapath1
35-
sed -i '/\$i = 1; /d' $pmapath1
36-
echo "\$i = 1;" >> $pmapath1
37-
sed -i '/savedsearches/d' $pmapath1
38-
sed -i '/navigationhiding/d' $pmapath1
39-
sed -i '/users/d' $pmapath1
40-
sed -i '/controlpass/d' $pmapath1
41-
sed -i '/favorite/d' $pmapath1
42-
sed -i '/usergroups/d' $pmapath1
43-
sed -i '/central_columns/d' $pmapath1
44-
sed -i '/designer_settings/d' $pmapath1
45-
sed -i '/export_templates/d' $pmapath1
4618
echo "\$cfg['Servers'][\$i]['favorite'] = 'pma__favorite';" >> $pmapath1
4719
echo "\$cfg['Servers'][\$i]['usergroups'] = 'pma__usergroups';" >> $pmapath1
4820
echo "\$cfg['Servers'][\$i]['central_columns'] = 'pma__central_columns';" >> $pmapath1
@@ -68,65 +40,16 @@ echo "\$cfg['Servers'][\$i]['table_coords'] = 'pma__table_coords';" >> $pmapath1
6840
echo "\$cfg['Servers'][\$i]['pdf_pages'] = 'pma__pdf_pages';" >> $pmapath1
6941
echo "\$cfg['Servers'][\$i]['designer_coords'] = 'pma__designer_coords';" >> $pmapath1
7042

71-
sed -i '/pmadb/d' $pmapath2
72-
sed -i '/controluser/d' $pmapath2
73-
sed -i '/bookmarktable/d' $pmapath2
74-
sed -i '/relation/d' $pmapath2
75-
sed -i '/userconfig/d' $pmapath2
76-
sed -i '/table_info/d' $pmapath2
77-
sed -i '/column_info/d' $pmapath2
78-
sed -i '/history/d' $pmapath2
79-
sed -i '/recent/d' $pmapath2
80-
sed -i '/table_uiprefs/d' $pmapath2
81-
sed -i '/tracking/d' $pmapath2
82-
sed -i '/table_coords/d' $pmapath2
83-
sed -i '/pdf_pages/d' $pmapath2
84-
sed -i '/designer_coords/d' $pmapath2
85-
sed -i '/controlpass/d' $pmapath2
86-
sed -i '/savedsearches/d' $pmapath2
87-
sed -i '/navigationhiding/d' $pmapath2
88-
sed -i '/users/d' $pmapath2
89-
sed -i '/controlpass/d' $pmapath2
90-
sed -i '/favorite/d' $pmapath2
91-
sed -i '/usergroups/d' $pmapath2
92-
sed -i '/central_columns/d' $pmapath2
93-
sed -i '/designer_settings/d' $pmapath2
94-
sed -i '/export_templates/d' $pmapath2
95-
echo "\$cfg['Servers'][\$i]['favorite'] = 'pma__favorite';" >> $pmapath2
96-
echo "\$cfg['Servers'][\$i]['usergroups'] = 'pma__usergroups';" >> $pmapath2
97-
echo "\$cfg['Servers'][\$i]['central_columns'] = 'pma__central_columns';" >> $pmapath2
98-
echo "\$cfg['Servers'][\$i]['designer_settings'] = 'pma__designer_settings';" >> $pmapath2
99-
echo "\$cfg['Servers'][\$i]['export_templates'] = 'pma__export_templates';" >> $pmapath2
100-
echo "\$cfg['Servers'][\$i]['savedsearches'] = 'pma__savedsearches';" >> $pmapath2
101-
echo "\$cfg['Servers'][\$i]['navigationhiding'] = 'pma__navigationhiding';" >> $pmapath2
102-
echo "\$cfg['Servers'][\$i]['users'] = 'pma__users';" >> $pmapath2
103-
echo "\$cfg['Servers'][\$i]['usergroups'] = 'pma__usergroups';" >> $pmapath2
104-
echo "\$cfg['Servers'][\$i]['pmadb'] = 'phpmyadmin';" >> $pmapath2
105-
echo "\$cfg['Servers'][\$i]['controluser'] = 'pma';" >> $pmapath2
106-
echo "\$cfg['Servers'][\$i]['controlpass'] = '$PASS';" >> $pmapath2
107-
echo "\$cfg['Servers'][\$i]['bookmarktable'] = 'pma__bookmark';" >> $pmapath2
108-
echo "\$cfg['Servers'][\$i]['relation'] = 'pma__relation';" >> $pmapath2
109-
echo "\$cfg['Servers'][\$i]['userconfig'] = 'pma__userconfig';" >> $pmapath2
110-
echo "\$cfg['Servers'][\$i]['table_info'] = 'pma__table_info';" >> $pmapath2
111-
echo "\$cfg['Servers'][\$i]['column_info'] = 'pma__column_info';" >> $pmapath2
112-
echo "\$cfg['Servers'][\$i]['history'] = 'pma__history';" >> $pmapath2
113-
echo "\$cfg['Servers'][\$i]['recent'] = 'pma__recent';" >> $pmapath2
114-
echo "\$cfg['Servers'][\$i]['table_uiprefs'] = 'pma__table_uiprefs';" >> $pmapath2
115-
echo "\$cfg['Servers'][\$i]['tracking'] = 'pma__tracking';" >> $pmapath2
116-
echo "\$cfg['Servers'][\$i]['table_coords'] = 'pma__table_coords';" >> $pmapath2
117-
echo "\$cfg['Servers'][\$i]['pdf_pages'] = 'pma__pdf_pages';" >> $pmapath2
118-
echo "\$cfg['Servers'][\$i]['designer_coords'] = 'pma__designer_coords';" >> $pmapath2
119-
12043
#SOME WORK with DATABASE (table / user)
12144
PMADB=phpmyadmin
12245
PMAUSER=pma
12346

12447
#DROP USER and TABLE
125-
mysql -uroot <<MYSQL_PMA1
126-
DROP USER '$PMAUSER'@'localhost';
127-
DROP DATABASE $PMADB;
128-
FLUSH PRIVILEGES;
129-
MYSQL_PMA1
48+
# mysql -uroot <<MYSQL_PMA1
49+
# DROP USER '$PMAUSER'@'localhost';
50+
# DROP DATABASE $PMADB;
51+
# FLUSH PRIVILEGES;
52+
# MYSQL_PMA1
13053

13154
#CREATE PMA USER
13255
mysql -uroot <<MYSQL_PMA2

install/deb/pma/config.inc.php

Lines changed: 0 additions & 146 deletions
This file was deleted.

0 commit comments

Comments
 (0)