-
Notifications
You must be signed in to change notification settings - Fork 1
/
entrypoint.sh
executable file
·37 lines (31 loc) · 1.03 KB
/
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
#!/bin/sh
GMAIL_User=`cat $GMAIL_User_FILE`
GMAIL_Password=`cat $GMAIL_Password_FILE`
CAPTCHA_PRIVATE_KEY=`cat $CAPTCHA_PRIVATE_KEY_FILE`
CAPTCHA_PUBLIC_KEY=`cat $CAPTCHA_PUBLIC_KEY_FILE`
# entrypoint script for configuring sendmail for php
cat <<EOF >> /etc/msmtprc
account default
host smtp.gmail.com
port 587
tls on
tls_starttls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
tls_certcheck on
auth on
user ${GMAIL_User}
password ${GMAIL_Password}
from "[email protected]"
logfile /var/log/msmtp.log
EOF
cat <<EOF >> /usr/local/etc/php/conf.d/mail.ini
[mail function]
sendmail_path = "/usr/bin/msmtp -t"
EOF
# inject CAPTCHA_PRIVATE_KEY into formmail.php
sed -i -e "s+.*\$RECAPTCHA_PRIVATE_KEY =.*+\$RECAPTCHA_PRIVATE_KEY = \"${CAPTCHA_PRIVATE_KEY}\";+" /var/www/html/2024/formmail.php
sed -i -e "s+data-sitekey=\"[_a-zA-Z0-9]*\"+data-sitekey=\"${CAPTCHA_PUBLIC_KEY}\"+" /var/www/html/2024/registrierung.html
# call the original entrypoint script
docker-php-entrypoint
# call the command given in the (original) Dockerfile as CMD
exec "$@"