Skip to content

Commit

Permalink
Fix BasicAuth #94
Browse files Browse the repository at this point in the history
  • Loading branch information
x-ji committed Oct 21, 2020
1 parent 125d40c commit 45f2525
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 23 deletions.
5 changes: 0 additions & 5 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ config :logger, :console,
# The local timezone where the app is deployed.
config :magpie, :timezone, "Europe/Berlin"

# Define a default. Only override in production where the app is accessible by the others
config :magpie,
:no_basic_auth,
true

# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{Mix.env()}.exs"
8 changes: 4 additions & 4 deletions config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ config :magpie, Magpie.Repo,
database: "magpie_dev",
pool_size: 10

# Used for basic_auth
config :magpie, :authentication,
username: "default",
password: "password"
# No real need for basic auth in dev
config :magpie,
:no_basic_auth,
false

config :magpie, :environment, :dev

Expand Down
10 changes: 10 additions & 0 deletions config/prod.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@ config :logger,
level: :info

config :magpie, :environment, :prod

# We don't have a basic auth on the demo app, so we need to allow for this flexibility
# Deliberate compile-time variable
config :magpie,
:no_basic_auth,
(if System.get_env("MAGPIE_NO_BASIC_AUTH") == "true" do
true
else
false
end)
9 changes: 0 additions & 9 deletions config/releases.exs
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,6 @@ config :magpie, :authentication,
username: System.fetch_env!("AUTH_USERNAME"),
password: System.fetch_env!("AUTH_PASSWORD")

# We don't have a basic auth on the demo app
config :magpie,
:no_basic_auth,
(if System.get_env("MAGPIE_NO_BASIC_AUTH") == "true" do
true
else
false
end)

config :logger,
backends:
(if System.get_env("USE_TIMBER") == "true" do
Expand Down
5 changes: 0 additions & 5 deletions config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ config :magpie, :sql_sandbox, true
# Print only warnings and errors during test
config :logger, level: :warn

# Need to test it in the test environment.
config :magpie,
:no_basic_auth,
false

# Used for basic_auth
config :magpie, :authentication,
username: "default",
Expand Down

0 comments on commit 45f2525

Please sign in to comment.