@@ -9,6 +9,8 @@ MYSQL_USER=${MYSQL_USER:-pdns}
9
9
MYSQL_PASSWORD=${MYSQL_PASSWORD:- pdns}
10
10
11
11
POWERADMIN_IFACE_LANG=${POWERADMIN_IFACE_LANG:- en_EN}
12
+ POWERADMIN_IFACE_STYLE=${POWERADMIN_IFACE_STYLE:- ignite}
13
+ POWERADMIN_IFACE_INDEX=${POWERADMIN_IFACE_INDEX:- cards}
12
14
POWERADMIN_HOSTMASTER=${POWERADMIN_HOSTMASTER:- }
13
15
POWERADMIN_NS1=${POWERADMIN_NS1:- }
14
16
POWERADMIN_NS2=${POWERADMIN_NS2:- }
@@ -24,11 +26,25 @@ PDNS_ALLOW_RECURSION=${PDNS_ALLOW_RECURSION:-127.0.0.1}
24
26
PDNS_RECURSOR=${PDNS_RECURSOR:- no}
25
27
26
28
27
- cp /usr/share/zoneinfo/${TZ} /etc/localtime; \
28
- ENV LANG ${POWERADMIN_IFACE_LANG} .UTF-8
29
- ENV LANGUAGE ${POWERADMIN_IFACE_LANG} .UTF-8
30
- ENV LC_ALL ${POWERADMIN_IFACE_LANG} .UTF-8
31
- ENV MUSL_LOCPATH /usr/share/i18n/locales/musl
29
+ cp /usr/share/zoneinfo/${TZ} /etc/localtime
30
+
31
+ LANG=${POWERADMIN_IFACE_LANG} .UTF-8
32
+ LANGUAGE=${POWERADMIN_IFACE_LANG} .UTF-8
33
+ LC_ALL=${POWERADMIN_IFACE_LANG} .UTF-8
34
+ MUSL_LOCPATH=/usr/share/i18n/locales/musl
35
+
36
+ export LANG
37
+ export LANGUAGE
38
+ export LC_ALL
39
+ export MUSL_LOCPATH
40
+
41
+ # ERROR 1074 (42000) Column length too big (max = 21844); use BLOB or TEXT instead
42
+ sed -i " s!VARCHAR(64000) DEFAULT NULL!TEXT(64000) DEFAULT NULL!g" /sql/pdns_schema.sql
43
+ # BUG Ungefined constant
44
+ sed -i " s!$this ->redirect('dnssec.php', [id => $zone_id ]);!$this ->redirect('dnssec.php', ['id' => $zone_id ]);!"
45
+
46
+ sed -i " s!latin1!utf8mb4!g" /sql/pdns_schema.sql
47
+ sed -i " s!latin1!utf8mb4!g" /sql/poweradmin.sql
32
48
33
49
sed -i " s!MYSQL_HOST!${MYSQL_HOST} !" /etc/powerdns/conf.d/gmysql.conf
34
50
sed -i " s!MYSQL_PORT!${MYSQL_PORT} !" /etc/powerdns/conf.d/gmysql.conf
@@ -44,6 +60,8 @@ sed -i "s!MYSQL_PASSWORD!${MYSQL_PASSWORD}!" /var/www/html/poweradmin/inc/config
44
60
45
61
sed -i " s!POWERADMIN_SESSION_KEY!${POWERADMIN_SESSION_KEY} !" /var/www/html/poweradmin/inc/config.inc.php
46
62
sed -i " s!POWERADMIN_IFACE_LANG!${POWERADMIN_IFACE_LANG} !" /var/www/html/poweradmin/inc/config.inc.php
63
+ sed -i " s!POWERADMIN_IFACE_STYLE!${POWERADMIN_IFACE_STYLE} !" /var/www/html/poweradmin/inc/config.inc.php
64
+ sed -i " s!POWERADMIN_IFACE_INDEX!${POWERADMIN_IFACE_INDEX} !" /var/www/html/poweradmin/inc/config.inc.php
47
65
sed -i " s!POWERADMIN_HOSTMASTER!${POWERADMIN_HOSTMASTER} !" /var/www/html/poweradmin/inc/config.inc.php
48
66
sed -i " s!POWERADMIN_NS1!${POWERADMIN_NS1} !" /var/www/html/poweradmin/inc/config.inc.php
49
67
sed -i " s!POWERADMIN_NS2!${POWERADMIN_NS2} !" /var/www/html/poweradmin/inc/config.inc.php
63
81
mysql -h ${MYSQL_HOST} -u ${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE} < /sql/poweradmin.sql
64
82
fi
65
83
84
+ echo " check powerdns database table"
66
85
CHECK_TABLE=` mysql -h ${MYSQL_HOST} -u ${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE} -e " CHECK TABLE domains;" | grep " doesn't exist" | awk {' print $3' }`
67
- if [ ${CHECK_TABLE} == " Error" ]; then
86
+ if [ " ${CHECK_TABLE} " == " Error" ]; then
87
+ echo " update tables powerdns schema"
68
88
mysql -h ${MYSQL_HOST} -u ${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE} < /sql/pdns_schema.sql
69
89
fi
70
90
91
+ echo " check poweradmin database table"
71
92
CHECK_TABLE=` mysql -h ${MYSQL_HOST} -u ${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE} -e " CHECK TABLE users;" | grep " doesn't exist" | awk {' print $3' }`
72
- if [ ${CHECK_TABLE} == " Error" ]; then
93
+ if [ " ${CHECK_TABLE} " == " Error" ]; then
94
+ echo " update tables poweradmin schema"
73
95
mysql -h ${MYSQL_HOST} -u ${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE} < /sql/poweradmin.sql
74
96
fi
75
- rm -rf /sql
97
+ # mysql -h ${MYSQL_HOST} -u ${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE} < /sql/cascade.sql
98
+ # rm -rf /sql
76
99
100
+ #
101
+ # bcrypt 12 (admin/admin)
102
+ #
77
103
# INSERT INTO users ( id, username, `password`, fullname, email, description, perm_templ, active, use_ldap )
78
- # VALUES ( 1, 'admin', '21232f297a57a5a743894a0e4a801fc3', 'Administrator', '[email protected] ', 'Administrator with full rights.', 1, 1, 0 );
104
+ # VALUES ( 1, 'admin', '21232f297a57a5a743894a0e4a801fc3', 'Administrator', '[email protected] ', 'Administrator with full rights.', 1, 1, 0 );
79
105
# INSERT INTO perm_templ ( id, name, descr ) VALUES ( 1, 'Administrator', 'Administrator template with full rights.' );
80
-
81
-
82
- # Setup web access
83
- if [ ! -f /etc/powerdns/conf.d/webserver.conf ] && [ -n " $POWERDNS_WEBSERVER_ALLOW_FROM " ]; then
84
- # Check if we got a password
85
- if [ -z " $POWERDNS_WEBSERVER_PASSWORD " ]; then
86
- POWERDNS_WEBSERVER_PASSWORD=$( pwgen 16 1)
87
- fdc_notice " PowerDNS webserver password: $POWERDNS_WEBSERVER_PASSWORD "
88
- fi
89
- # Check if we got a API key
90
- if [ -z " $POWERDNS_API_KEY " ]; then
91
- POWERDNS_API_KEY=$( pwgen 16 1)
92
- fdc_notice " PowerDNS webserver API key: $POWERDNS_API_KEY "
93
- fi
94
-
95
- cat << EOF > /etc/powerdns/conf.d/webserver.conf
96
- webserver = yes
97
- webserver-address = 0.0.0.0
98
- webserver-allow-from = $POWERDNS_WEBSERVER_ALLOW_FROM
99
- webserver-loglevel = normal
100
- webserver-password = $POWERDNS_WEBSERVER_PASSWORD
101
- webserver-port=8081
102
- api = yes
103
- api-key = $POWERDNS_API_KEY
104
- EOF
105
- fi
106
-
106
+ #
107
+
108
+ #
109
+ # # Setup web access
110
+ # if [ ! -f /etc/powerdns/conf.d/webserver.conf ] && [ -n "$POWERDNS_WEBSERVER_ALLOW_FROM" ]; then
111
+ # # Check if we got a password
112
+ # if [ -z "$POWERDNS_WEBSERVER_PASSWORD" ]; then
113
+ # POWERDNS_WEBSERVER_PASSWORD=$(pwgen 16 1)
114
+ # fdc_notice "PowerDNS webserver password: $POWERDNS_WEBSERVER_PASSWORD"
115
+ # fi
116
+ # # Check if we got a API key
117
+ # if [ -z "$POWERDNS_API_KEY" ]; then
118
+ # POWERDNS_API_KEY=$(pwgen 16 1)
119
+ # fdc_notice "PowerDNS webserver API key: $POWERDNS_API_KEY"
120
+ # fi
121
+ #
122
+ # cat <<EOF > /etc/powerdns/conf.d/webserver.conf
123
+ # webserver = yes
124
+ # webserver-address = 0.0.0.0
125
+ # webserver-allow-from = $POWERDNS_WEBSERVER_ALLOW_FROM
126
+ # webserver-loglevel = normal
127
+ # webserver-password = $POWERDNS_WEBSERVER_PASSWORD
128
+ # webserver-port=8081
129
+ # api = yes
130
+ # api-key = $POWERDNS_API_KEY
131
+ # EOF
132
+ # fi
133
+ #
107
134
exec " $@ "
0 commit comments