From 612c760755360e588dd9333bff877d81125d8206 Mon Sep 17 00:00:00 2001 From: Kieran Date: Tue, 27 Aug 2024 20:08:53 -0700 Subject: [PATCH] [Enhancement] Allow IPv6 (#372) * Added option to enable IPv6 in runtime config * Updated README --- README.md | 3 ++- config/runtime.exs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7733563..c63cb98 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,8 @@ If you change this setting and it works well for you, please leave a comment on | `LOG_LEVEL` | No | `debug` | Can be set to `info` but `debug` is strongly recommended | | `BASIC_AUTH_USERNAME` | No | | See [authentication docs](https://github.com/kieraneglin/pinchflat/wiki/Username-and-Password) | | `BASIC_AUTH_PASSWORD` | No | | See [authentication docs](https://github.com/kieraneglin/pinchflat/wiki/Username-and-Password) | -| `EXPOSE_FEED_ENDPOINTS` | No | | See [RSS feed docs](https://github.com/kieraneglin/pinchflat/wiki/Podcast-RSS-Feeds) | +| `EXPOSE_FEED_ENDPOINTS` | No | `false` | See [RSS feed docs](https://github.com/kieraneglin/pinchflat/wiki/Podcast-RSS-Feeds) | +| `ENABLE_IPV6` | No | `false` | Setting to _any_ non-blank value will enable IPv6 | | `JOURNAL_MODE` | No | `wal` | Set to `delete` if your config directory is stored on a network share (not recommended) | | `TZ_DATA_DIR` | No | `/etc/elixir_tzdata_data` | The container path where the timezone database is stored | | `BASE_ROUTE_PATH` | No | `/` | The base path for route generation. Useful when running behind certain reverse proxies | diff --git a/config/runtime.exs b/config/runtime.exs index 1a3c0de..f820498 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -66,6 +66,7 @@ if config_env() == :prod do journal_mode = String.to_existing_atom(System.get_env("JOURNAL_MODE", "wal")) # For running PF in a subdirectory via a reverse proxy base_route_path = System.get_env("BASE_ROUTE_PATH", "/") + enable_ipv6 = String.length(System.get_env("ENABLE_IPV6", "")) > 0 config :logger, level: String.to_existing_atom(System.get_env("LOG_LEVEL", "debug")) @@ -120,7 +121,7 @@ if config_env() == :prod 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}, + ip: if(enable_ipv6, do: {0, 0, 0, 0}, else: {0, 0, 0, 0, 0, 0, 0, 0}), port: String.to_integer(System.get_env("PORT") || "4000") ], url: [path: base_route_path],