fix: don't override paths in dockerfile

This allows for these paths to continue to be set in the config file or environment variable while still maintaining the default of having the default paths in the same directory as the postal config file.
This commit is contained in:
Adam Cooke
2024-03-08 16:40:58 +00:00
parent 22dcd4901f
commit 9399e32234
5 changed files with 22 additions and 10 deletions
+16 -3
View File
@@ -68,7 +68,8 @@ module Postal
string :signing_key_path do
description "Path to the private key used for signing"
default "config/postal/signing.key"
default "$config-file-root/signing.key"
transform { |v| Postal.substitute_config_file_root(v) }
end
string :smtp_relays do
@@ -253,12 +254,14 @@ module Postal
string :tls_certificate_path do
description "The path to the SMTP server's TLS certificate"
default "config/postal/smtp.cert"
default "$config-file-root/smtp.cert"
transform { |v| Postal.substitute_config_file_root(v) }
end
string :tls_private_key_path do
description "The path to the SMTP server's TLS private key"
default "config/postal/smtp.key"
default "$config-file-root/smtp.key"
transform { |v| Postal.substitute_config_file_root(v) }
end
string :tls_ciphers do
@@ -502,4 +505,14 @@ module Postal
end
end
class << self
def substitute_config_file_root(string)
return if string.nil?
string.gsub(/\$config-file-root/i, File.dirname(Postal.config_file_path))
end
end
end