diff --git a/CHANGELOG.md b/CHANGELOG.md index 71ed3f50..0d4a8def 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# v0.8.2 +- Fix bug with public registration + # v0.8.1 - Update dependencies - Show topbar on form submit/page refresh diff --git a/config/config.exs b/config/config.exs index bada0d66..ae084c7c 100644 --- a/config/config.exs +++ b/config/config.exs @@ -11,6 +11,8 @@ config :cannery, ecto_repos: [Cannery.Repo], generators: [binary_id: true] +config :cannery, Cannery.Accounts, registration: System.get_env("REGISTRATION", "invite") + # Configures the endpoint config :cannery, CanneryWeb.Endpoint, url: [scheme: "https", host: System.get_env("HOST") || "localhost", port: "443"], @@ -18,8 +20,7 @@ config :cannery, CanneryWeb.Endpoint, secret_key_base: "KH59P0iZixX5gP/u+zkxxG8vAAj6vgt0YqnwEB5JP5K+E567SsqkCz69uWShjE7I", render_errors: [view: CanneryWeb.ErrorView, accepts: ~w(html json), layout: false], pubsub_server: Cannery.PubSub, - live_view: [signing_salt: "zOLgd3lr"], - registration: System.get_env("REGISTRATION") || "invite" + live_view: [signing_salt: "zOLgd3lr"] config :cannery, Cannery.Application, automigrate: false diff --git a/config/runtime.exs b/config/runtime.exs index 95fdd435..47783183 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -44,6 +44,8 @@ config :cannery, Cannery.Repo, pool_size: String.to_integer(System.get_env("POOL_SIZE", "10")), socket_options: maybe_ipv6 +config :cannery, Cannery.Accounts, registration: System.get_env("REGISTRATION", "invite") + config :cannery, CanneryWeb.Endpoint, url: [scheme: "https", host: host, port: 443], http: [ @@ -52,8 +54,7 @@ config :cannery, CanneryWeb.Endpoint, ip: interface, port: String.to_integer(System.get_env("PORT", "4000")) ], - server: true, - registration: System.get_env("REGISTRATION", "invite") + server: true if config_env() == :prod do # The secret key base is used to sign/encrypt cookies and other secrets. diff --git a/lib/cannery/accounts.ex b/lib/cannery/accounts.ex index 77037d4f..a04e2323 100644 --- a/lib/cannery/accounts.ex +++ b/lib/cannery/accounts.ex @@ -384,7 +384,7 @@ defmodule Cannery.Accounts do """ @spec allow_registration?() :: boolean() def allow_registration? do - Application.get_env(:Cannery, CanneryWeb.Endpoint)[:registration] == "public" or + Application.get_env(:cannery, Cannery.Accounts)[:registration] == "public" or list_users_by_role(:admin) |> Enum.empty?() end diff --git a/lib/cannery_web/live/home_live.ex b/lib/cannery_web/live/home_live.ex index fb958318..3f8a589a 100644 --- a/lib/cannery_web/live/home_live.ex +++ b/lib/cannery_web/live/home_live.ex @@ -105,8 +105,7 @@ defmodule CanneryWeb.HomeLive do
- <%= Application.get_env(:cannery, CanneryWeb.Endpoint)[:registration] - |> case do + <%= case Application.get_env(:cannery, Cannery.Accounts)[:registration] do "public" -> gettext("Public Signups") _ -> gettext("Invite Only") end %> diff --git a/mix.exs b/mix.exs index 6ef83d3e..885715f8 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule Cannery.MixProject do def project do [ app: :cannery, - version: "0.8.1", + version: "0.8.2", elixir: "1.14.1", elixirc_paths: elixirc_paths(Mix.env()), compilers: Mix.compilers(), diff --git a/priv/gettext/de/LC_MESSAGES/default.po b/priv/gettext/de/LC_MESSAGES/default.po index 9dc33064..8a800cbd 100644 --- a/priv/gettext/de/LC_MESSAGES/default.po +++ b/priv/gettext/de/LC_MESSAGES/default.po @@ -199,7 +199,7 @@ msgstr "Instanzinformationen" msgid "Invite Disabled" msgstr "Einladung deaktiviert" -#: lib/cannery_web/live/home_live.ex:111 +#: lib/cannery_web/live/home_live.ex:110 #, elixir-autogen, elixir-format msgid "Invite Only" msgstr "Nur mit Einladung" @@ -355,7 +355,7 @@ msgstr "Kaufpreis:" msgid "Primer type" msgstr "Zündertyp" -#: lib/cannery_web/live/home_live.ex:110 +#: lib/cannery_web/live/home_live.ex:109 #, elixir-autogen, elixir-format msgid "Public Signups" msgstr "Öffentliche Registrierung" @@ -752,22 +752,22 @@ msgstr "Deutsch" msgid "Language" msgstr "Sprache" -#: lib/cannery_web/live/home_live.ex:136 +#: lib/cannery_web/live/home_live.ex:135 #, elixir-autogen, elixir-format msgid "Get involved!" msgstr "Mach mit!" -#: lib/cannery_web/live/home_live.ex:157 +#: lib/cannery_web/live/home_live.ex:156 #, elixir-autogen, elixir-format msgid "Help translate" msgstr "Hilf beim Übersetzen" -#: lib/cannery_web/live/home_live.ex:168 +#: lib/cannery_web/live/home_live.ex:167 #, elixir-autogen, elixir-format msgid "Report bugs or request features" msgstr "Sende Bugs oder Erweiterungsvorschläge" -#: lib/cannery_web/live/home_live.ex:146 +#: lib/cannery_web/live/home_live.ex:145 #, elixir-autogen, elixir-format msgid "View the source code" msgstr "Quellcode ansehen" diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index 10d71b9e..9614f191 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -184,7 +184,7 @@ msgstr "" msgid "Invite Disabled" msgstr "" -#: lib/cannery_web/live/home_live.ex:111 +#: lib/cannery_web/live/home_live.ex:110 #, elixir-autogen, elixir-format msgid "Invite Only" msgstr "" @@ -340,7 +340,7 @@ msgstr "" msgid "Primer type" msgstr "" -#: lib/cannery_web/live/home_live.ex:110 +#: lib/cannery_web/live/home_live.ex:109 #, elixir-autogen, elixir-format msgid "Public Signups" msgstr "" @@ -735,22 +735,22 @@ msgstr "" msgid "Language" msgstr "" -#: lib/cannery_web/live/home_live.ex:136 +#: lib/cannery_web/live/home_live.ex:135 #, elixir-autogen, elixir-format msgid "Get involved!" msgstr "" -#: lib/cannery_web/live/home_live.ex:157 +#: lib/cannery_web/live/home_live.ex:156 #, elixir-autogen, elixir-format msgid "Help translate" msgstr "" -#: lib/cannery_web/live/home_live.ex:168 +#: lib/cannery_web/live/home_live.ex:167 #, elixir-autogen, elixir-format msgid "Report bugs or request features" msgstr "" -#: lib/cannery_web/live/home_live.ex:146 +#: lib/cannery_web/live/home_live.ex:145 #, elixir-autogen, elixir-format msgid "View the source code" msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po index bc6c94a3..de608340 100644 --- a/priv/gettext/en/LC_MESSAGES/default.po +++ b/priv/gettext/en/LC_MESSAGES/default.po @@ -184,7 +184,7 @@ msgstr "" msgid "Invite Disabled" msgstr "" -#: lib/cannery_web/live/home_live.ex:111 +#: lib/cannery_web/live/home_live.ex:110 #, elixir-autogen, elixir-format msgid "Invite Only" msgstr "" @@ -340,7 +340,7 @@ msgstr "" msgid "Primer type" msgstr "" -#: lib/cannery_web/live/home_live.ex:110 +#: lib/cannery_web/live/home_live.ex:109 #, elixir-autogen, elixir-format msgid "Public Signups" msgstr "" @@ -735,22 +735,22 @@ msgstr "" msgid "Language" msgstr "" -#: lib/cannery_web/live/home_live.ex:136 +#: lib/cannery_web/live/home_live.ex:135 #, elixir-autogen, elixir-format msgid "Get involved!" msgstr "" -#: lib/cannery_web/live/home_live.ex:157 +#: lib/cannery_web/live/home_live.ex:156 #, elixir-autogen, elixir-format msgid "Help translate" msgstr "" -#: lib/cannery_web/live/home_live.ex:168 +#: lib/cannery_web/live/home_live.ex:167 #, elixir-autogen, elixir-format msgid "Report bugs or request features" msgstr "" -#: lib/cannery_web/live/home_live.ex:146 +#: lib/cannery_web/live/home_live.ex:145 #, elixir-autogen, elixir-format msgid "View the source code" msgstr "" diff --git a/priv/gettext/es/LC_MESSAGES/default.po b/priv/gettext/es/LC_MESSAGES/default.po index f21533a5..38da1b99 100644 --- a/priv/gettext/es/LC_MESSAGES/default.po +++ b/priv/gettext/es/LC_MESSAGES/default.po @@ -199,7 +199,7 @@ msgstr "Información de Instancia" msgid "Invite Disabled" msgstr "Invitación Desactivada" -#: lib/cannery_web/live/home_live.ex:111 +#: lib/cannery_web/live/home_live.ex:110 #, elixir-autogen, elixir-format msgid "Invite Only" msgstr "Solo Invitación" @@ -355,7 +355,7 @@ msgstr "Precio pagado:" msgid "Primer type" msgstr "Tipo de espoleta" -#: lib/cannery_web/live/home_live.ex:110 +#: lib/cannery_web/live/home_live.ex:109 #, elixir-autogen, elixir-format msgid "Public Signups" msgstr "Registro Público" @@ -753,22 +753,22 @@ msgstr "Alemán" msgid "Language" msgstr "Idioma" -#: lib/cannery_web/live/home_live.ex:136 +#: lib/cannery_web/live/home_live.ex:135 #, elixir-autogen, elixir-format msgid "Get involved!" msgstr "¡Implícate!" -#: lib/cannery_web/live/home_live.ex:157 +#: lib/cannery_web/live/home_live.ex:156 #, elixir-autogen, elixir-format msgid "Help translate" msgstr "Ayuda a traducir" -#: lib/cannery_web/live/home_live.ex:168 +#: lib/cannery_web/live/home_live.ex:167 #, elixir-autogen, elixir-format msgid "Report bugs or request features" msgstr "Informar de errores o solicitar funciones" -#: lib/cannery_web/live/home_live.ex:146 +#: lib/cannery_web/live/home_live.ex:145 #, elixir-autogen, elixir-format msgid "View the source code" msgstr "Ver código fuente" diff --git a/priv/gettext/fr/LC_MESSAGES/default.po b/priv/gettext/fr/LC_MESSAGES/default.po index 7316ea47..a69f48ab 100644 --- a/priv/gettext/fr/LC_MESSAGES/default.po +++ b/priv/gettext/fr/LC_MESSAGES/default.po @@ -199,7 +199,7 @@ msgstr "Information de l’instance" msgid "Invite Disabled" msgstr "Invitation désactivée" -#: lib/cannery_web/live/home_live.ex:111 +#: lib/cannery_web/live/home_live.ex:110 #, elixir-autogen, elixir-format msgid "Invite Only" msgstr "Uniquement sur invitation" @@ -355,7 +355,7 @@ msgstr "Prix payé :" msgid "Primer type" msgstr "Type d’amorce" -#: lib/cannery_web/live/home_live.ex:110 +#: lib/cannery_web/live/home_live.ex:109 #, elixir-autogen, elixir-format msgid "Public Signups" msgstr "Enregistrements publics" @@ -754,22 +754,22 @@ msgstr "Allemand" msgid "Language" msgstr "Langue" -#: lib/cannery_web/live/home_live.ex:136 +#: lib/cannery_web/live/home_live.ex:135 #, elixir-autogen, elixir-format msgid "Get involved!" msgstr "Impliquez-vous !" -#: lib/cannery_web/live/home_live.ex:157 +#: lib/cannery_web/live/home_live.ex:156 #, elixir-autogen, elixir-format msgid "Help translate" msgstr "Aider à la traduction" -#: lib/cannery_web/live/home_live.ex:168 +#: lib/cannery_web/live/home_live.ex:167 #, elixir-autogen, elixir-format msgid "Report bugs or request features" msgstr "Remonter des bugs ou une demande de fonctionnalité" -#: lib/cannery_web/live/home_live.ex:146 +#: lib/cannery_web/live/home_live.ex:145 #, elixir-autogen, elixir-format msgid "View the source code" msgstr "Voir le code source" diff --git a/priv/gettext/ga/LC_MESSAGES/default.po b/priv/gettext/ga/LC_MESSAGES/default.po index ee184024..084b261b 100644 --- a/priv/gettext/ga/LC_MESSAGES/default.po +++ b/priv/gettext/ga/LC_MESSAGES/default.po @@ -195,7 +195,7 @@ msgstr "" msgid "Invite Disabled" msgstr "" -#: lib/cannery_web/live/home_live.ex:111 +#: lib/cannery_web/live/home_live.ex:110 #, elixir-autogen, elixir-format msgid "Invite Only" msgstr "" @@ -351,7 +351,7 @@ msgstr "" msgid "Primer type" msgstr "" -#: lib/cannery_web/live/home_live.ex:110 +#: lib/cannery_web/live/home_live.ex:109 #, elixir-autogen, elixir-format msgid "Public Signups" msgstr "" @@ -746,22 +746,22 @@ msgstr "" msgid "Language" msgstr "" -#: lib/cannery_web/live/home_live.ex:136 +#: lib/cannery_web/live/home_live.ex:135 #, elixir-autogen, elixir-format msgid "Get involved!" msgstr "" -#: lib/cannery_web/live/home_live.ex:157 +#: lib/cannery_web/live/home_live.ex:156 #, elixir-autogen, elixir-format msgid "Help translate" msgstr "" -#: lib/cannery_web/live/home_live.ex:168 +#: lib/cannery_web/live/home_live.ex:167 #, elixir-autogen, elixir-format msgid "Report bugs or request features" msgstr "" -#: lib/cannery_web/live/home_live.ex:146 +#: lib/cannery_web/live/home_live.ex:145 #, elixir-autogen, elixir-format msgid "View the source code" msgstr ""