mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-21 23:44:30 +00:00
Merge branch 'listen-ip' into 'master'
Make instance listen by default only on local interface Closes #258 See merge request framasoft/mobilizon!872
This commit is contained in:
commit
a246470274
3 changed files with 17 additions and 2 deletions
|
@ -8,6 +8,7 @@ import Config
|
|||
# with brunch.io to recompile .js and .css sources.
|
||||
config :mobilizon, Mobilizon.Web.Endpoint,
|
||||
http: [
|
||||
ip: {127, 0, 0, 1},
|
||||
port: 4000
|
||||
],
|
||||
url: [
|
||||
|
|
|
@ -2,10 +2,21 @@
|
|||
|
||||
import Config
|
||||
|
||||
listen_ip = System.get_env("MOBILIZON_INSTANCE_LISTEN_IP", "::")
|
||||
|
||||
listen_ip =
|
||||
case :inet.parse_address(listen_ip) do
|
||||
{:ok, listen_ip} -> listen_ip
|
||||
_ -> raise "MOBILIZON_INSTANCE_LISTEN_IP does not match the expected IP format."
|
||||
end
|
||||
|
||||
config :mobilizon, Mobilizon.Web.Endpoint,
|
||||
server: true,
|
||||
url: [host: System.get_env("MOBILIZON_INSTANCE_HOST", "mobilizon.lan")],
|
||||
http: [port: System.get_env("MOBILIZON_INSTANCE_PORT", "4000")],
|
||||
http: [
|
||||
port: System.get_env("MOBILIZON_INSTANCE_PORT", "4000"),
|
||||
ip: listen_ip
|
||||
],
|
||||
secret_key_base: System.get_env("MOBILIZON_INSTANCE_SECRET_KEY_BASE", "changethis")
|
||||
|
||||
config :mobilizon, Mobilizon.Web.Auth.Guardian,
|
||||
|
|
|
@ -5,7 +5,10 @@ import Config
|
|||
config :mobilizon, Mobilizon.Web.Endpoint,
|
||||
server: <%= release %>,
|
||||
url: [host: "<%= instance_domain %>"],
|
||||
http: [port: <%= listen_port %>],
|
||||
http: [
|
||||
ip: {0, 0, 0, 0, 0, 0, 0, 1},
|
||||
port: <%= listen_port %>
|
||||
],
|
||||
secret_key_base: "<%= instance_secret %>"
|
||||
|
||||
config :mobilizon, Mobilizon.Web.Auth.Guardian,
|
||||
|
|
Loading…
Reference in a new issue