Renamed auth env vars and updated them to work in prod env
This commit is contained in:
parent
5c9933b684
commit
1b404086d5
3 changed files with 8 additions and 4 deletions
|
|
@ -28,7 +28,7 @@ docker run \
|
||||||
|
|
||||||
## Authentication
|
## Authentication
|
||||||
|
|
||||||
Currently HTTP basic auth is optionally supported. To use it, set the `AUTH_USERNAME` and `AUTH_PASSWORD` environment variables when starting the container. If you don't set both of these, no authentication will be required.
|
Currently HTTP basic auth is optionally supported. To use it, set the `BASIC_AUTH_USERNAME` and `BASIC_AUTH_PASSWORD` environment variables when starting the container. If you don't set both of these, no authentication will be required.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@ config :pinchflat,
|
||||||
# The user may or may not store metadata for their needs, but the app will always store its copy
|
# The user may or may not store metadata for their needs, but the app will always store its copy
|
||||||
metadata_directory: "/config/metadata",
|
metadata_directory: "/config/metadata",
|
||||||
tmpfile_directory: Path.join([System.tmp_dir!(), "pinchflat", "data"]),
|
tmpfile_directory: Path.join([System.tmp_dir!(), "pinchflat", "data"]),
|
||||||
# Setting AUTH_USERNAME and AUTH_PASSWORD implies you want to use basic auth.
|
# Setting BASIC_AUTH_USERNAME and BASIC_AUTH_PASSWORD implies you want to use basic auth.
|
||||||
# If either is unset, basic auth will not be used.
|
# If either is unset, basic auth will not be used.
|
||||||
basic_auth_username: System.get_env("AUTH_USERNAME"),
|
basic_auth_username: System.get_env("BASIC_AUTH_USERNAME"),
|
||||||
basic_auth_password: System.get_env("AUTH_PASSWORD"),
|
basic_auth_password: System.get_env("BASIC_AUTH_PASSWORD"),
|
||||||
file_watcher_poll_interval: 1000
|
file_watcher_poll_interval: 1000
|
||||||
|
|
||||||
# Configures the endpoint
|
# Configures the endpoint
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,10 @@ if System.get_env("PHX_SERVER") do
|
||||||
config :pinchflat, PinchflatWeb.Endpoint, server: true
|
config :pinchflat, PinchflatWeb.Endpoint, server: true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
config :pinchflat,
|
||||||
|
basic_auth_username: System.get_env("BASIC_AUTH_USERNAME"),
|
||||||
|
basic_auth_password: System.get_env("BASIC_AUTH_PASSWORD")
|
||||||
|
|
||||||
if config_env() == :prod do
|
if config_env() == :prod do
|
||||||
config_path =
|
config_path =
|
||||||
System.get_env("CONFIG_PATH") ||
|
System.get_env("CONFIG_PATH") ||
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue