diff --git a/changelog.md b/changelog.md index 1edef63..7593abc 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,6 @@ +# v0.1.8 +- Fix bug with public registration + # v0.1.7 - Update dependencies - Show topbar on form submit/page refresh diff --git a/config/config.exs b/config/config.exs index 9992795..af29e4e 100644 --- a/config/config.exs +++ b/config/config.exs @@ -11,6 +11,8 @@ config :memex, ecto_repos: [Memex.Repo], generators: [binary_id: true] +config :memex, Memex.Accounts, registration: System.get_env("REGISTRATION", "invite") + # Configures the endpoint config :memex, MemexWeb.Endpoint, url: [scheme: "https", host: System.get_env("HOST") || "localhost", port: "443"], @@ -18,8 +20,7 @@ config :memex, MemexWeb.Endpoint, secret_key_base: "KH59P0iZixX5gP/u+zkxxG8vAAj6vgt0YqnwEB5JP5K+E567SsqkCz69uWShjE7I", render_errors: [view: MemexWeb.ErrorView, accepts: ~w(html json), layout: false], pubsub_server: Memex.PubSub, - live_view: [signing_salt: "zOLgd3lr"], - registration: System.get_env("REGISTRATION") || "invite" + live_view: [signing_salt: "zOLgd3lr"] config :memex, Memex.Application, automigrate: false diff --git a/config/runtime.exs b/config/runtime.exs index 5705347..78f569b 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -42,6 +42,8 @@ config :memex, Memex.Repo, pool_size: String.to_integer(System.get_env("POOL_SIZE", "10")), socket_options: maybe_ipv6 +config :memex, Memex.Accounts, registration: System.get_env("REGISTRATION", "invite") + config :memex, MemexWeb.Endpoint, url: [scheme: "https", host: host, port: 443], http: [ @@ -50,8 +52,7 @@ config :memex, MemexWeb.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/memex/accounts.ex b/lib/memex/accounts.ex index 8009cbc..a47cd8e 100644 --- a/lib/memex/accounts.ex +++ b/lib/memex/accounts.ex @@ -384,7 +384,7 @@ defmodule Memex.Accounts do """ @spec allow_registration?() :: boolean() def allow_registration? do - Application.get_env(:Memex, MemexWeb.Endpoint)[:registration] == "public" or + Application.get_env(:memex, Memex.Accounts)[:registration] == "public" or list_users_by_role(:admin) |> Enum.empty?() end diff --git a/lib/memex_web/live/home_live.html.heex b/lib/memex_web/live/home_live.html.heex index b8391c2..947e353 100644 --- a/lib/memex_web/live/home_live.html.heex +++ b/lib/memex_web/live/home_live.html.heex @@ -109,8 +109,7 @@
  • <%= gettext("registration:") %>

    - <%= Application.get_env(:memex, Endpoint)[:registration] - |> case do + <%= case Application.get_env(:memex, Memex.Accounts)[:registration] do "public" -> gettext("public signups") _ -> gettext("invite only") end %> diff --git a/mix.exs b/mix.exs index 4d21f76..4965541 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule Memex.MixProject do def project do [ app: :memex, - version: "0.1.7", + version: "0.1.8", elixir: "~> 1.14", 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 4b3852c..219ce68 100644 --- a/priv/gettext/de/LC_MESSAGES/default.po +++ b/priv/gettext/de/LC_MESSAGES/default.po @@ -163,12 +163,12 @@ msgstr "" msgid "features" msgstr "" -#: lib/memex_web/live/home_live.html.heex:138 +#: lib/memex_web/live/home_live.html.heex:137 #, elixir-autogen, elixir-format msgid "get involved!" msgstr "" -#: lib/memex_web/live/home_live.html.heex:159 +#: lib/memex_web/live/home_live.html.heex:158 #, elixir-autogen, elixir-format msgid "help translate" msgstr "" @@ -183,7 +183,7 @@ msgstr "" msgid "invite disabled" msgstr "" -#: lib/memex_web/live/home_live.html.heex:115 +#: lib/memex_web/live/home_live.html.heex:114 #, elixir-autogen, elixir-format msgid "invite only" msgstr "" @@ -266,7 +266,7 @@ msgstr "" msgid "provide context around a single topic and hotlink to your notes" msgstr "" -#: lib/memex_web/live/home_live.html.heex:114 +#: lib/memex_web/live/home_live.html.heex:113 #, elixir-autogen, elixir-format msgid "public signups" msgstr "" @@ -281,7 +281,7 @@ msgstr "" msgid "registration:" msgstr "" -#: lib/memex_web/live/home_live.html.heex:170 +#: lib/memex_web/live/home_live.html.heex:169 #, elixir-autogen, elixir-format msgid "report bugs or request features" msgstr "" @@ -330,12 +330,12 @@ msgstr "" msgid "users" msgstr "" -#: lib/memex_web/live/home_live.html.heex:121 +#: lib/memex_web/live/home_live.html.heex:120 #, elixir-autogen, elixir-format msgid "version:" msgstr "" -#: lib/memex_web/live/home_live.html.heex:148 +#: lib/memex_web/live/home_live.html.heex:147 #, elixir-autogen, elixir-format msgid "view the source code" msgstr "" diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index fef56b6..7ac1b9c 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -152,12 +152,12 @@ msgstr "" msgid "features" msgstr "" -#: lib/memex_web/live/home_live.html.heex:138 +#: lib/memex_web/live/home_live.html.heex:137 #, elixir-autogen, elixir-format msgid "get involved!" msgstr "" -#: lib/memex_web/live/home_live.html.heex:159 +#: lib/memex_web/live/home_live.html.heex:158 #, elixir-autogen, elixir-format msgid "help translate" msgstr "" @@ -172,7 +172,7 @@ msgstr "" msgid "invite disabled" msgstr "" -#: lib/memex_web/live/home_live.html.heex:115 +#: lib/memex_web/live/home_live.html.heex:114 #, elixir-autogen, elixir-format msgid "invite only" msgstr "" @@ -255,7 +255,7 @@ msgstr "" msgid "provide context around a single topic and hotlink to your notes" msgstr "" -#: lib/memex_web/live/home_live.html.heex:114 +#: lib/memex_web/live/home_live.html.heex:113 #, elixir-autogen, elixir-format msgid "public signups" msgstr "" @@ -270,7 +270,7 @@ msgstr "" msgid "registration:" msgstr "" -#: lib/memex_web/live/home_live.html.heex:170 +#: lib/memex_web/live/home_live.html.heex:169 #, elixir-autogen, elixir-format msgid "report bugs or request features" msgstr "" @@ -319,12 +319,12 @@ msgstr "" msgid "users" msgstr "" -#: lib/memex_web/live/home_live.html.heex:121 +#: lib/memex_web/live/home_live.html.heex:120 #, elixir-autogen, elixir-format msgid "version:" msgstr "" -#: lib/memex_web/live/home_live.html.heex:148 +#: lib/memex_web/live/home_live.html.heex:147 #, elixir-autogen, elixir-format msgid "view the source code" msgstr ""