Commit bfd2803a by Christophe Angeli

add crond to supervisor

parent 93e716c3
...@@ -2,16 +2,14 @@ ...@@ -2,16 +2,14 @@
set -e set -e
# config # config
sed -i "s/^.*'R_DB_HOST'.*$/define('R_DB_HOST', '${POSTGRES_HOST}');/g" \ sed -i \
${ROOT_DIR}/server/php/config.inc.php -e "s/^.*'R_DB_HOST'.*$/define('R_DB_HOST', '${POSTGRES_HOST}');/g" \
sed -i "s/^.*'R_DB_PORT'.*$/define('R_DB_PORT', '5432');/g" \ -e "s/^.*'R_DB_PORT'.*$/define('R_DB_PORT', '5432');/g" \
${ROOT_DIR}/server/php/config.inc.php -e "s/^.*'R_DB_USER'.*$/define('R_DB_USER', '${POSTGRES_USER}');/g" \
sed -i "s/^.*'R_DB_USER'.*$/define('R_DB_USER', '${POSTGRES_USER}');/g" \ -e "s/^.*'R_DB_PASSWORD'.*$/define('R_DB_PASSWORD', '${POSTGRES_PASSWORD}');/g" \
${ROOT_DIR}/server/php/config.inc.php -e "s/^.*'R_DB_NAME'.*$/define('R_DB_NAME', '${POSTGRES_DB}');/g" \
sed -i "s/^.*'R_DB_PASSWORD'.*$/define('R_DB_PASSWORD', '${POSTGRES_PASSWORD}');/g" \ ${ROOT_DIR}/server/php/config.inc.php
${ROOT_DIR}/server/php/config.inc.php sed -i "$ a date.timezone = $(cat /etc/timezone)" /etc/php7/php.ini
sed -i "s/^.*'R_DB_NAME'.*$/define('R_DB_NAME', '${POSTGRES_DB}');/g" \
${ROOT_DIR}/server/php/config.inc.php
# postfix # postfix
postconf -e smtputf8_enable=no postconf -e smtputf8_enable=no
...@@ -24,25 +22,27 @@ echo "[${SMTP_SERVER}]:${SMTP_PORT} ${SMTP_USERNAME}:${SMTP_PASSWORD}" > /etc/po ...@@ -24,25 +22,27 @@ echo "[${SMTP_SERVER}]:${SMTP_PORT} ${SMTP_USERNAME}:${SMTP_PASSWORD}" > /etc/po
postmap /etc/postfix/sasl_passwd postmap /etc/postfix/sasl_passwd
echo "www-data@${SMTP_DOMAIN} ${SMTP_USERNAME}" > /etc/postfix/sender_canonical echo "www-data@${SMTP_DOMAIN} ${SMTP_USERNAME}" > /etc/postfix/sender_canonical
postmap /etc/postfix/sender_canonical postmap /etc/postfix/sender_canonical
sed -i '/mydomain.*/d' /etc/postfix/main.cf sed -i \
sed -i '/myhostname.*/d' /etc/postfix/main.cf -e '/mydomain.*/d' \
sed -i '/myorigin.*/d' /etc/postfix/main.cf -e '/myhostname.*/d' \
sed -i '/mydestination.*/d' /etc/postfix/main.cf -e '/myorigin.*/d' \
sed -i "$ a mydomain = ${SMTP_DOMAIN}" /etc/postfix/main.cf -e '/mydestination.*/d' \
sed -i "$ a myhostname = localhost" /etc/postfix/main.cf -e "$ a mydomain = ${SMTP_DOMAIN}" \
sed -i '$ a myorigin = $mydomain' /etc/postfix/main.cf -e "$ a myhostname = localhost" \
sed -i '$ a mydestination = localhost, $myhostname, localhost.$mydomain' /etc/postfix/main.cf -e '$ a myorigin = $mydomain' \
sed -i '$ a sender_canonical_maps = hash:/etc/postfix/sender_canonical' /etc/postfix/main.cf -e '$ a mydestination = localhost, $myhostname, localhost.$mydomain' \
sed -i "s/#relayhost =.*$/relayhost = [${SMTP_SERVER}]:${SMTP_PORT}/" /etc/postfix/main.cf -e '$ a sender_canonical_maps = hash:/etc/postfix/sender_canonical' \
sed -i '/smtp_.*/d' /etc/postfix/main.cf -e "s/#relayhost =.*$/relayhost = [${SMTP_SERVER}]:${SMTP_PORT}/" \
sed -i '$ a smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache' /etc/postfix/main.cf -e '/smtp_.*/d' \
sed -i '$ a smtp_sasl_auth_enable = yes' /etc/postfix/main.cf -e '$ a smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache' \
sed -i '$ a smtp_sasl_security_options = noanonymous' /etc/postfix/main.cf -e '$ a smtp_sasl_auth_enable = yes' \
sed -i '$ a smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd' /etc/postfix/main.cf -e '$ a smtp_sasl_security_options = noanonymous' \
sed -i '$ a smtp_use_tls = yes' /etc/postfix/main.cf -e '$ a smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd' \
sed -i '$ a smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt' /etc/postfix/main.cf -e '$ a smtp_use_tls = yes' \
sed -i '$ a smtp_tls_wrappermode = yes' /etc/postfix/main.cf -e '$ a smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt' \
sed -i '$ a smtp_tls_security_level = encrypt' /etc/postfix/main.cf -e '$ a smtp_tls_wrappermode = yes' \
-e '$ a smtp_tls_security_level = encrypt' \
/etc/postfix/main.cf
# init db # init db
export PGHOST=${POSTGRES_HOST} export PGHOST=${POSTGRES_HOST}
...@@ -71,6 +71,5 @@ echo "*/30 * * * * ${ROOT_DIR}/server/php/shell/imap.sh" >> /var/spool/cron/cron ...@@ -71,6 +71,5 @@ echo "*/30 * * * * ${ROOT_DIR}/server/php/shell/imap.sh" >> /var/spool/cron/cron
echo "*/5 * * * * ${ROOT_DIR}/server/php/shell/webhook.sh" >> /var/spool/cron/crontabs/root echo "*/5 * * * * ${ROOT_DIR}/server/php/shell/webhook.sh" >> /var/spool/cron/crontabs/root
echo "*/5 * * * * ${ROOT_DIR}/server/php/shell/card_due_notification.sh" >> /var/spool/cron/crontabs/root echo "*/5 * * * * ${ROOT_DIR}/server/php/shell/card_due_notification.sh" >> /var/spool/cron/crontabs/root
# service start # start
crond
/usr/bin/supervisord -c /supervisord.conf /usr/bin/supervisord -c /supervisord.conf
[supervisord] [supervisord]
nodaemon=true nodaemon=true
[program:crond]
command=/usr/sbin/crond -f
[program:postfix] [program:postfix]
command=/usr/sbin/postfix -c /etc/postfix start command=/usr/sbin/postfix -c /etc/postfix start
startsecs=0 startsecs=0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment