Couple of fixes, adding php-json

This commit is contained in:
Bandie 2021-01-13 00:19:11 +01:00
parent 1265f2b339
commit ed67c68a1a
Signed by: Bandie
GPG Key ID: 843D7FA93BA46312
4 changed files with 6 additions and 6 deletions

View File

@ -1,7 +1,7 @@
FROM alpine:latest
MAINTAINER Bandie <bandie@chaospott.de>
RUN apk add --no-cache php nginx php-fpm msmtp tzdata
RUN apk add --no-cache php nginx php-fpm php-json msmtp tzdata
RUN adduser -D -g 'www' www
RUN mkdir /www

View File

@ -20,7 +20,7 @@ sed -i "s/\$SMTP_HOST/$SMTP_HOST/g;s/\$SMTP_PORT/$SMTP_PORT/g;s/\$SMTP_FROM/$SMT
sed -i "s/\$SMTP_HOST/$SMTP_HOST/g;s/\$SMTP_PORT/$SMTP_PORT/g;s/\$SMTP_FROM/$SMTP_FROM/g;s/\$SMTP_USER/$SMTP_USER/g;s/\$SMTP_PASSWORD/$SMTP_PASSWORD/g;s/\$SMTP_ENCRYPTION/$SMTP_ENCRYPTION/g" /etc/aliases
sed -i "s/%%SECRETKEY%%/$SECRET_KEY/g;s/%%RECIPIENTS_PR%%/$RECIPIENTS_PR/g" /www/config.php
sed -i "s/%%SECRETKEY%%/$SECRET_KEY/g;s/%%RECIPIENTS_PR%%/$RECIPIENTS_PR/g;s/%%SMTP_FROM%%/$SMTP_FROM/g" /www/config.php
sed -i "s/%%DOMAIN_NAME%%/$DOMAIN_NAME/g" /etc/nginx/nginx.conf

View File

@ -6,3 +6,5 @@ $recipients = [
%%RECIPIENTS_PR%%
]
];
$from = '%%SMTP_FROM%%';

View File

@ -1,5 +1,5 @@
<?php
require_once('config.php');
include('config.php');
// check for POST request
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
@ -50,11 +50,9 @@ $message = $decoded['sender']['login']
. ".\n" .
$decoded['pull_request']['html_url'];
log("SUBJECT: " . $subject . "; " . $message);
foreach($recipients['pr'] as $recp) {
mail($recp, $subject, $message);
mail($recp, $subject, $message, $from);
}
// success, do something