X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=config%2Fprod.exs;h=968f596e00bc804bb71e06e112b2487f8939700f;hb=2dea4a8c041e48bbae2ec6f201b4c0e95b8131ae;hp=e281a4a03a6a8be35f234d058fbfd5bb2c64fd36;hpb=10c156d98fee44444ed6d1366e615ddcdb2ee68a;p=akkoma diff --git a/config/prod.exs b/config/prod.exs index e281a4a03..968f596e0 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -1,4 +1,4 @@ -use Mix.Config +import Config # For production, we often load configuration from external # sources, such as your system environment. For this reason, @@ -17,49 +17,11 @@ config :pleroma, Pleroma.Web.Endpoint, http: [port: 4000], protocol: "http" -# Supported adapters: https://github.com/swoosh/swoosh#adapters -mailer_settings = - case String.downcase(System.get_env("PLEROMA_SWOOSH_ADAPTER") || "") do - "mailgun" -> - [ - adapter: Swoosh.Adapters.Mailgun, - api_key: System.get_env("PLEROMA_MAILGUN_API_KEY"), - domain: System.get_env("PLEROMA_MAILGUN_DOMAIN") - ] - - "mandrill" -> - [ - adapter: Swoosh.Adapters.Mandrill, - api_key: System.get_env("PLEROMA_MANDRILL_API_KEY") - ] - - "sendgrid" -> - [ - adapter: Swoosh.Adapters.Sendgrid, - api_key: System.get_env("PLEROMA_SENDGRID_API_KEY") - ] - - "smtp" -> - [ - adapter: Swoosh.Adapters.SMTP, - relay: System.get_env("PLEROMA_SMTP_RELAY"), - username: System.get_env("PLEROMA_SMTP_USERNAME"), - password: System.get_env("PLEROMA_SMTP_PASSWORD"), - port: System.get_env("PLEROMA_SMTP_PORT") || 1025, - ssl: true, - tls: :always, - auth: :always, - retries: 3 - ] - - _ -> - [adapter: Swoosh.Adapters.Local] - end - -config :pleroma, Pleroma.Mailer, mailer_settings +config :phoenix, serve_endpoints: true # Do not print debug messages in production -config :logger, level: :info +config :logger, :console, level: :info +config :logger, :ex_syslogger, level: :info # ## SSL Support # @@ -101,4 +63,12 @@ config :logger, level: :info # Finally import the config/prod.secret.exs # which should be versioned separately. -import_config "prod.secret.exs" +if File.exists?("./config/prod.secret.exs") do + import_config "prod.secret.exs" +else + "`config/prod.secret.exs` not found. You may want to create one by running `mix pleroma.instance gen`" + |> IO.warn([]) +end + +if File.exists?("./config/prod.exported_from_db.secret.exs"), + do: import_config("prod.exported_from_db.secret.exs")