Diff

util/startup.lua @ 13627:2db7b3b65363

core.configmanager: Add function for getting secrets from separate files Idea is to enable easily retrieving of secret values from files outside of the config, e.g. via the method used by systemd credentials. CREDENTIALS_DIRECTORY is expected to be set by the process manager invoking Prosody, so being unset and unavailable from prosodyctl is going to be normal and a warning is reported in that case. Care will have to be taken to make it clear that prosodyctl check will not work with such values. An error is thrown if the directory is unavailable when running under Prosody.
author Kim Alvefur <zash@zash.se>
date Thu, 16 Jan 2025 15:21:34 +0100
parent 13564:a350f6332bd8
child 13630:8228f5094f7a
line wrap: on
line diff
--- a/util/startup.lua	Thu Jan 16 15:05:00 2025 +0100
+++ b/util/startup.lua	Thu Jan 16 15:21:34 2025 +0100
@@ -266,8 +266,13 @@
 	full_sessions = prosody.full_sessions;
 	hosts = prosody.hosts;
 
-	prosody.paths = { source = CFG_SOURCEDIR, config = CFG_CONFIGDIR or ".",
-	                  plugins = CFG_PLUGINDIR or "plugins", data = "data" };
+	prosody.paths = {
+		source = CFG_SOURCEDIR;
+		config = CFG_CONFIGDIR or ".";
+		plugins = CFG_PLUGINDIR or "plugins";
+		data = "data";
+		secrets = os.getenv("CREDENTIALS_DIRECTORY");
+	};
 
 	prosody.arg = _G.arg;