Skip to content

Commit

Permalink
Allow IPv4 addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Knuchel committed Nov 25, 2023
1 parent 8fc95ad commit 94c8897
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Technical requirements

export PHX_SERVER=true
# export PHX_PROTOCOL=ipv4
export PHX_HOST=localhost
export PORT=4000
export SECRET_KEY_BASE=CHANGE_ME
Expand Down
1 change: 1 addition & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ Here is the full list of environment variables you can use to set up Azimutt app
These are the basic variables you will **need** to set up Azimutt:

- `PHX_SERVER` (optional): if `true`, start the Phoenix server in server mode
- `PHX_PROTOCOL` (optional, values: `ipv6` or `ipv4`, default: `ipv6`): if `ipv4`, the Phoenix server will listen to IPv4, otherwise IPv6
- `PHX_HOST` (required): host of the deployed website (ex: `localhost` or `azimutt.app`), it's used to build absolute urls
- `PORT` (required): the port the server will listen to (ex: `4000`)
- `SECRET_KEY_BASE` (required): the secret used for server encryption (cookies and others), should be at least 64 bytes and you probably want a random value for it
Expand Down
2 changes: 1 addition & 1 deletion backend/config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if config_env() == :prod || config_env() == :staging do
# Set it to {0, 0, 0, 0, 0, 0, 0, 1} for local network only access.
# See the documentation on https://hexdocs.pm/plug_cowboy/Plug.Cowboy.html
# for details about using IPv6 vs IPv4 and loopback vs public addresses.
ip: {0, 0, 0, 0, 0, 0, 0, 0},
ip: if(System.get_env("PHX_PROTOCOL") == "ipv4", do: {0, 0, 0, 0}, else: {0, 0, 0, 0, 0, 0, 0, 0}),
port: port
],
secret_key_base: System.fetch_env!("SECRET_KEY_BASE")
Expand Down

0 comments on commit 94c8897

Please sign in to comment.