Skip to content

Commit

Permalink
remove port numbers from code
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Nov 14, 2024
1 parent f1cd0d0 commit 61b778d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ defmodule CA do
that runs TCP and HTTP connections under Erlang/OTP supervision.
"""
use Application
def port(app) do Application.fetch_env!(:ca, app) end
def start(_type, _args) do
:logger.add_handlers(:ca)
Supervisor.start_link([
{ CA.CMP, port: Application.fetch_env!(:ca, :cmp) },
{ CA.CMC, port: Application.fetch_env!(:ca, :cmc) },
{ CA.OCSP, port: Application.fetch_env!(:ca, :ocsp) },
{ CA.TSP, port: Application.fetch_env!(:ca, :tsp) },
{ CA.EST, port: Application.fetch_env!(:ca, :est), plug: CA.EST,
scheme: :http, thousand_island_options: [num_acceptors: 1] }
{ CA.CMP, port: port(:cmp) },
{ CA.CMC, port: port(:cmc) },
{ CA.OCSP, port: port(:ocsp) },
{ CA.TSP, port: port(:tsp) },
{ CA.EST, port: port(:est), plug: CA.EST, scheme: :http,
thousand_island_options: [num_acceptors: 1] }
], strategy: :one_for_one, name: CA.Supervisor)
end

Expand Down

0 comments on commit 61b778d

Please sign in to comment.