diff --git a/config/runtime.exs b/config/runtime.exs index eb01872..f42a9d1 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -65,6 +65,11 @@ if config_env() == :prod do config :swapi, :cloudflare_web_analytics_enabled, true config :swapi, :cloudflare_web_analytics_token, System.get_env("CLOUDFLARE_WEB_ANALYTICS_TOKEN") + # Configure default check_origin + if check_origin = System.get_env("CHECK_ORIGIN") do + config :swapi, SWAPIWeb.Endpoint, check_origin: Jason.decode!(check_origin) + end + # ## SSL Support # # To get SSL working, you will need to add the `https` key diff --git a/fly-dev.toml b/fly-dev.toml index 0d5e99b..6329d6d 100644 --- a/fly-dev.toml +++ b/fly-dev.toml @@ -15,6 +15,7 @@ kill_signal = "SIGTERM" DATABASE_PATH = "/app/swapi.db" PHX_HOST = "swapi-dev.profiq.com" PORT = "8080" + CHECK_ORIGIN = '["swapi-dev.profiq.com", "swapi-elixir-dev.fly.dev"]' [http_service] internal_port = 8080 diff --git a/fly.toml b/fly.toml index 4123a3d..9d4f776 100644 --- a/fly.toml +++ b/fly.toml @@ -15,6 +15,7 @@ kill_signal = "SIGTERM" DATABASE_PATH = "/app/swapi.db" PHX_HOST = "swapi.profiq.com" PORT = "8080" + CHECK_ORIGIN = '["swapi.profiq.com", "swapi-elixir.fly.dev"]' [http_service] internal_port = 8080