don't merge: add certificate path conf for prosody
This commit is contained in:
parent
b1af112f15
commit
7605046cb0
|
@ -3,12 +3,14 @@ local DOMAIN = assert(ENV_SNIKKET_DOMAIN, "Please set the SNIKKET_DOMAIN environ
|
||||||
local RETENTION_DAYS = tonumber(ENV_SNIKKET_RETENTION_DAYS) or 7;
|
local RETENTION_DAYS = tonumber(ENV_SNIKKET_RETENTION_DAYS) or 7;
|
||||||
local UPLOAD_STORAGE_GB = tonumber(ENV_SNIKKET_UPLOAD_STORAGE_GB);
|
local UPLOAD_STORAGE_GB = tonumber(ENV_SNIKKET_UPLOAD_STORAGE_GB);
|
||||||
|
|
||||||
|
local CERT_PATH = ENV_SNIKKET_CERTFILE or "/etc/prosody/certs/"..DOMAIN..".crt";
|
||||||
|
local KEY_PATH = ENV_SNIKKET_KEYFILE or "/etc/prosody/certs/"..DOMAIN..".key";
|
||||||
|
|
||||||
if prosody.process_type == "prosody" and not prosody.config_loaded then
|
if prosody.process_type == "prosody" and not prosody.config_loaded then
|
||||||
-- Wait at startup for certificates
|
-- Wait at startup for certificates
|
||||||
local lfs, socket = require "lfs", require "socket";
|
local lfs, socket = require "lfs", require "socket";
|
||||||
local cert_path = "/etc/prosody/certs/"..DOMAIN..".crt";
|
|
||||||
local counter = 0;
|
local counter = 0;
|
||||||
while not lfs.attributes(cert_path, "mode") do
|
while not lfs.attributes(CERT_PATH, "mode") do
|
||||||
counter = counter + 1;
|
counter = counter + 1;
|
||||||
if counter == 1 or counter%6 == 0 then
|
if counter == 1 or counter%6 == 0 then
|
||||||
print("Waiting for certificates...");
|
print("Waiting for certificates...");
|
||||||
|
@ -206,6 +208,9 @@ end
|
||||||
VirtualHost (DOMAIN)
|
VirtualHost (DOMAIN)
|
||||||
authentication = "internal_hashed"
|
authentication = "internal_hashed"
|
||||||
|
|
||||||
|
certificate = CERT_PATH;
|
||||||
|
key = KEY_PATH;
|
||||||
|
|
||||||
http_files_dir = "/var/www"
|
http_files_dir = "/var/www"
|
||||||
http_paths = {
|
http_paths = {
|
||||||
files = "/";
|
files = "/";
|
||||||
|
|
Loading…
Reference in New Issue