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 \ icu-data-full \
mariadb-connector-c \ mariadb-connector-c \
gcompat \ gcompat \
lua-sec \
mariadb-client \ mariadb-client \
perl \ perl \
perl-ntlm \ perl-ntlm \

View File

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