feat: new configuration system (and schema) (#2819)

This commit is contained in:
Adam Cooke
2024-02-26 12:41:57 +00:00
committed by GitHub
parent 1c5ff5a9a6
commit 0163ac3d10
77 changed files with 1840 additions and 593 deletions
+5 -4
View File
@@ -1,11 +1,12 @@
# frozen_string_literal: true
require_relative "../lib/postal/config"
threads_count = Postal.config.web_server&.max_threads&.to_i || 5
threads_count = Postal::Config.web_server.max_threads
threads threads_count, threads_count
bind_address = Postal.config.web_server&.bind_address || "127.0.0.1"
bind_port = Postal.config.web_server&.port&.to_i || ENV["PORT"] || 5000
bind_address = ENV.fetch("BIND_ADDRESS", Postal::Config.web_server.default_bind_address)
bind_port = ENV.fetch("PORT", Postal::Config.web_server.default_port)
bind "tcp://#{bind_address}:#{bind_port}"
environment Postal.config.rails&.environment || "development"
environment Postal::Config.rails.environment || "development"
prune_bundler
quiet false