Skip to content

Commit

Permalink
Merge pull request #28 from profiq/feature/check_origin
Browse files Browse the repository at this point in the history
Configure `check_origin` to enable live view on flyio domain
  • Loading branch information
dhrdlicka authored Jan 24, 2024
2 parents cd01016 + 52f1e7e commit 4ebfba4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions fly-dev.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4ebfba4

Please sign in to comment.