1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2025-01-26 05:27:29 +02:00

new dovecout lua auth - use https

This commit is contained in:
FreddleSpl0it 2023-03-15 16:19:30 +01:00 committed by DerLinkman
parent 1aeb36d40e
commit 1c73a16ca0
No known key found for this signature in database
GPG Key ID: F109FD97469550A2
2 changed files with 5 additions and 4 deletions

View File

@ -34,6 +34,7 @@ RUN addgroup -g 5000 vmail \
icu-data-full \
mariadb-connector-c \
gcompat \
lua-sec \
mariadb-client \
perl \
perl-ntlm \

View File

@ -136,8 +136,8 @@ function auth_password_verify(request, password)
json = require "json"
ltn12 = require "ltn12"
http = require "socket.http"
http.TIMEOUT = 5
https = require "ssl.https"
https.TIMEOUT = 5
mysql = require "luasql.mysql"
env = mysql.mysql()
con = env:connect("__DBNAME__","__DBUSER__","__DBPASS__","localhost")
@ -150,7 +150,7 @@ function auth_password_verify(request, password)
local res = {}
-- check against mailbox passwds
local b, c = http.request {
local b, c = https.request {
method = "POST",
url = "https://nginx/api/v1/process/login",
source = ltn12.source.string(req_json),
@ -181,7 +181,7 @@ function auth_password_verify(request, password)
req.protocol.ignore_hasaccess = true
end
local b, c = http.request {
local b, c = https.request {
method = "POST",
url = "https://nginx/api/v1/process/login",
source = ltn12.source.string(req_json),