Mailu / Mailu

Insular email distribution - mail server as Docker images
https://mailu.io
Other
5.93k stars 838 forks source link

unknown directive "set_by_lua" #227

Closed phoen1x closed 7 years ago

phoen1x commented 7 years ago

Could you please check the stable branch. There seems to a bug related to a cherry pick from issue #225

After upgrading my instance I ran into

http_1       | nginx: [emerg] unknown directive "set_by_lua" in /etc/nginx/nginx.conf:46

which seems to be cause by the missing directive

include /etc/nginx/modules/http_lua.conf;

Also see file history of nginx.conf.default

I fixed my instance by cherry picking the following files from the master branch

kaiyou commented 7 years ago

Thank you for reporting, I missed a commit indeed when cherry picking.

kaiyou commented 7 years ago

Just cherry picked the missing include, could you test once the build is finished?

phoen1x commented 7 years ago

After pulling the changes and rebuilding my custom Docker containers everything seems to work fine. THX for the quick fix.

I leave this issue open because there seems to be another bug in the start.sh of the stable branch

if [[ -z ENABLE_CERTBOT || -f /certs/cert.pem ]]

I saw a missing $ before ENABLE_CERTBOT and Atom complains about a POSIX error

the master branch looks like that

if [ -z $ENABLE_CERTBOT ] || [ -f /certs/cert.pem ]

A quick Test with

#!/bin/sh

if [[ -z ENABLE_CERTBOT ]]
then
    echo "1 unset"
else
    echo "1 set"
fi

if [ -z ENABLE_CERTBOT ]
then
    echo "2 unset"
else
    echo "2 set"
fi

if [ -z $ENABLE_CERTBOT ]
then
    echo "3 unset"
else
    echo "3 set"
fi

shows wrong results in test 1 and 2

linux$ echo $ENABLE_CERTBOT

linux$ ./test.sh
./test.sh: 3: ./test.sh: [[: not found
1 set
2 set
3 unset
phoen1x commented 7 years ago

I'm closing this issue due to @dosimeter reference. The addressed error unknown directive "set_by_lua" is fixed. The minor bug mentioned here should be addressed in another issue.