forked from snowdreamtech/adminer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-entrypoint.sh
executable file
·94 lines (80 loc) · 5.83 KB
/
docker-entrypoint.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
#!/bin/sh
set -e
ADMINEREVO_PATH=/usr/share/webapps/adminerevo
# Random ADMINEREVO_SQLITE_PASSWORD Generator
if [ -z ${ADMINEREVO_SQLITE_PASSWORD} ]; then {
ADMINEREVO_SQLITE_PASSWORD=$(openssl rand -hex 16)
echo "ADMINEREVO_SQLITE_PASSWORD=${ADMINEREVO_SQLITE_PASSWORD}"
}
fi
# index.php
cat >${ADMINEREVO_PATH}/index.php <<EOF
<?php
function adminer_object() {
// required to run any plugin
include_once "./plugins/plugin.php";
// plugins autoloader
foreach (glob("plugins/*.php") as \$filename) {
include_once "./\$filename";
}
// designs autoloader
\$designs = array();
foreach (glob("designs/*", GLOB_ONLYDIR) as \$filename) {
\$designs["\$filename/adminer.css"] = basename(\$filename);
}
// enable extra drivers just by including them
include "./plugins/drivers/simpledb.php";
include "./plugins/drivers/firebird.php";
include "./plugins/drivers/clickhouse.php";
\$adminer = new AdminerPlugin([]);
\$plugins = array(
// specify enabled plugins here
// new AdminerDatabaseHide(array('information_schema' , 'mysql' , 'performance_schema' , 'sys')), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/database-hide.php
new AdminerDesigns(\$designs), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/designs.php
new AdminerDumpAlter(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/dump-alter.php
new AdminerDumpBz2(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/dump-bz2.php
new AdminerDumpDate(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/dump-date.php
new AdminerDumpJson(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/dump-json.php
new AdminerDumpXml(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/dump-xml.php
new AdminerDumpZip(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/dump-zip.php
// new AdminerEditCalendar(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/edit-calendar.php
new AdminerEditForeign(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/edit-foreign.php
new AdminerEditTextarea(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/edit-textarea.php
new AdminerEnumOption(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/enum-option.php
new AdminerEnumTypes(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/enum-types.php
new AdminerFileUpload("data/"),//https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/file-upload.php
new AdminerForeignSystem(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/foreign-system.php
//new AdminerFrames(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/frames.php
new AdminerImportFromDir(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/import-from-dir.php
new AdminerJsonColumn(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/json-column.php
// new AdminerLoginOtp(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/login-otp.php
// new AdminerLoginServers(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/login-servers.php
// TODO: inline the result of password_hash() so that the password is not visible in source codes
new AdminerLoginPasswordLess(password_hash("${ADMINEREVO_SQLITE_PASSWORD}", PASSWORD_DEFAULT)),// https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/login-password-less.php
// new AdminerLoginSsl(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/login-ssl.php
// new AdminerLoginTable(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/login-table.php
// new AdminerMasterSlave(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/master-slave.php
new AdminerPrettyJsonColumn(\$adminer),// https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/pretty-json-column.php
new AdminerSlugify(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/slugify.php
new AdminerSqlLog(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/sql-log.php
new AdminerStructComments(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/struct-comments.php
new AdminerTablesFilter(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/tables-filter.php
// new AdminerTinymce(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/tinymce.php
new AdminerTranslation(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/translation.php
new AdminerVersionNoverify(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/version-noverify.php
// new AdminerWymeditor(), // https://raw.githubusercontent.com/adminerevo/adminerevo/master/plugins/wymeditor.php
);
/* It is possible to combine customization and plugins:
class AdminerCustomization extends AdminerPlugin {
}
return new AdminerCustomization(\$plugins);
*/
\$adminer->plugins = \$plugins;
return \$adminer;
}
// include original Adminer or Adminer Editor
include "./adminer.php";
?>
EOF
# exec commands
exec "$@"