forked from shibao/cannery
fix bug with public registration
This commit is contained in:
parent
2f8af8ae4f
commit
084173909e
@ -1,3 +1,6 @@
|
|||||||
|
# v0.8.2
|
||||||
|
- Fix bug with public registration
|
||||||
|
|
||||||
# v0.8.1
|
# v0.8.1
|
||||||
- Update dependencies
|
- Update dependencies
|
||||||
- Show topbar on form submit/page refresh
|
- Show topbar on form submit/page refresh
|
||||||
|
@ -11,6 +11,8 @@ config :cannery,
|
|||||||
ecto_repos: [Cannery.Repo],
|
ecto_repos: [Cannery.Repo],
|
||||||
generators: [binary_id: true]
|
generators: [binary_id: true]
|
||||||
|
|
||||||
|
config :cannery, Cannery.Accounts, registration: System.get_env("REGISTRATION", "invite")
|
||||||
|
|
||||||
# Configures the endpoint
|
# Configures the endpoint
|
||||||
config :cannery, CanneryWeb.Endpoint,
|
config :cannery, CanneryWeb.Endpoint,
|
||||||
url: [scheme: "https", host: System.get_env("HOST") || "localhost", port: "443"],
|
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",
|
secret_key_base: "KH59P0iZixX5gP/u+zkxxG8vAAj6vgt0YqnwEB5JP5K+E567SsqkCz69uWShjE7I",
|
||||||
render_errors: [view: CanneryWeb.ErrorView, accepts: ~w(html json), layout: false],
|
render_errors: [view: CanneryWeb.ErrorView, accepts: ~w(html json), layout: false],
|
||||||
pubsub_server: Cannery.PubSub,
|
pubsub_server: Cannery.PubSub,
|
||||||
live_view: [signing_salt: "zOLgd3lr"],
|
live_view: [signing_salt: "zOLgd3lr"]
|
||||||
registration: System.get_env("REGISTRATION") || "invite"
|
|
||||||
|
|
||||||
config :cannery, Cannery.Application, automigrate: false
|
config :cannery, Cannery.Application, automigrate: false
|
||||||
|
|
||||||
|
@ -44,6 +44,8 @@ config :cannery, Cannery.Repo,
|
|||||||
pool_size: String.to_integer(System.get_env("POOL_SIZE", "10")),
|
pool_size: String.to_integer(System.get_env("POOL_SIZE", "10")),
|
||||||
socket_options: maybe_ipv6
|
socket_options: maybe_ipv6
|
||||||
|
|
||||||
|
config :cannery, Cannery.Accounts, registration: System.get_env("REGISTRATION", "invite")
|
||||||
|
|
||||||
config :cannery, CanneryWeb.Endpoint,
|
config :cannery, CanneryWeb.Endpoint,
|
||||||
url: [scheme: "https", host: host, port: 443],
|
url: [scheme: "https", host: host, port: 443],
|
||||||
http: [
|
http: [
|
||||||
@ -52,8 +54,7 @@ config :cannery, CanneryWeb.Endpoint,
|
|||||||
ip: interface,
|
ip: interface,
|
||||||
port: String.to_integer(System.get_env("PORT", "4000"))
|
port: String.to_integer(System.get_env("PORT", "4000"))
|
||||||
],
|
],
|
||||||
server: true,
|
server: true
|
||||||
registration: System.get_env("REGISTRATION", "invite")
|
|
||||||
|
|
||||||
if config_env() == :prod do
|
if config_env() == :prod do
|
||||||
# The secret key base is used to sign/encrypt cookies and other secrets.
|
# The secret key base is used to sign/encrypt cookies and other secrets.
|
||||||
|
@ -384,7 +384,7 @@ defmodule Cannery.Accounts do
|
|||||||
"""
|
"""
|
||||||
@spec allow_registration?() :: boolean()
|
@spec allow_registration?() :: boolean()
|
||||||
def allow_registration? do
|
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?()
|
list_users_by_role(:admin) |> Enum.empty?()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -105,8 +105,7 @@ defmodule CanneryWeb.HomeLive do
|
|||||||
<li class="flex flex-row justify-center space-x-2">
|
<li class="flex flex-row justify-center space-x-2">
|
||||||
<b>Registration:</b>
|
<b>Registration:</b>
|
||||||
<p>
|
<p>
|
||||||
<%= Application.get_env(:cannery, CanneryWeb.Endpoint)[:registration]
|
<%= case Application.get_env(:cannery, Cannery.Accounts)[:registration] do
|
||||||
|> case do
|
|
||||||
"public" -> gettext("Public Signups")
|
"public" -> gettext("Public Signups")
|
||||||
_ -> gettext("Invite Only")
|
_ -> gettext("Invite Only")
|
||||||
end %>
|
end %>
|
||||||
|
2
mix.exs
2
mix.exs
@ -4,7 +4,7 @@ defmodule Cannery.MixProject do
|
|||||||
def project do
|
def project do
|
||||||
[
|
[
|
||||||
app: :cannery,
|
app: :cannery,
|
||||||
version: "0.8.1",
|
version: "0.8.2",
|
||||||
elixir: "1.14.1",
|
elixir: "1.14.1",
|
||||||
elixirc_paths: elixirc_paths(Mix.env()),
|
elixirc_paths: elixirc_paths(Mix.env()),
|
||||||
compilers: Mix.compilers(),
|
compilers: Mix.compilers(),
|
||||||
|
@ -199,7 +199,7 @@ msgstr "Instanzinformationen"
|
|||||||
msgid "Invite Disabled"
|
msgid "Invite Disabled"
|
||||||
msgstr "Einladung deaktiviert"
|
msgstr "Einladung deaktiviert"
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:111
|
#: lib/cannery_web/live/home_live.ex:110
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Invite Only"
|
msgid "Invite Only"
|
||||||
msgstr "Nur mit Einladung"
|
msgstr "Nur mit Einladung"
|
||||||
@ -355,7 +355,7 @@ msgstr "Kaufpreis:"
|
|||||||
msgid "Primer type"
|
msgid "Primer type"
|
||||||
msgstr "Zündertyp"
|
msgstr "Zündertyp"
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:110
|
#: lib/cannery_web/live/home_live.ex:109
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Public Signups"
|
msgid "Public Signups"
|
||||||
msgstr "Öffentliche Registrierung"
|
msgstr "Öffentliche Registrierung"
|
||||||
@ -752,22 +752,22 @@ msgstr "Deutsch"
|
|||||||
msgid "Language"
|
msgid "Language"
|
||||||
msgstr "Sprache"
|
msgstr "Sprache"
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:136
|
#: lib/cannery_web/live/home_live.ex:135
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Get involved!"
|
msgid "Get involved!"
|
||||||
msgstr "Mach mit!"
|
msgstr "Mach mit!"
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:157
|
#: lib/cannery_web/live/home_live.ex:156
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Help translate"
|
msgid "Help translate"
|
||||||
msgstr "Hilf beim Übersetzen"
|
msgstr "Hilf beim Übersetzen"
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:168
|
#: lib/cannery_web/live/home_live.ex:167
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Report bugs or request features"
|
msgid "Report bugs or request features"
|
||||||
msgstr "Sende Bugs oder Erweiterungsvorschläge"
|
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
|
#, elixir-autogen, elixir-format
|
||||||
msgid "View the source code"
|
msgid "View the source code"
|
||||||
msgstr "Quellcode ansehen"
|
msgstr "Quellcode ansehen"
|
||||||
|
@ -184,7 +184,7 @@ msgstr ""
|
|||||||
msgid "Invite Disabled"
|
msgid "Invite Disabled"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:111
|
#: lib/cannery_web/live/home_live.ex:110
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Invite Only"
|
msgid "Invite Only"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -340,7 +340,7 @@ msgstr ""
|
|||||||
msgid "Primer type"
|
msgid "Primer type"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:110
|
#: lib/cannery_web/live/home_live.ex:109
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Public Signups"
|
msgid "Public Signups"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -735,22 +735,22 @@ msgstr ""
|
|||||||
msgid "Language"
|
msgid "Language"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:136
|
#: lib/cannery_web/live/home_live.ex:135
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Get involved!"
|
msgid "Get involved!"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:157
|
#: lib/cannery_web/live/home_live.ex:156
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Help translate"
|
msgid "Help translate"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:168
|
#: lib/cannery_web/live/home_live.ex:167
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Report bugs or request features"
|
msgid "Report bugs or request features"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:146
|
#: lib/cannery_web/live/home_live.ex:145
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "View the source code"
|
msgid "View the source code"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -184,7 +184,7 @@ msgstr ""
|
|||||||
msgid "Invite Disabled"
|
msgid "Invite Disabled"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:111
|
#: lib/cannery_web/live/home_live.ex:110
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Invite Only"
|
msgid "Invite Only"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -340,7 +340,7 @@ msgstr ""
|
|||||||
msgid "Primer type"
|
msgid "Primer type"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:110
|
#: lib/cannery_web/live/home_live.ex:109
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Public Signups"
|
msgid "Public Signups"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -735,22 +735,22 @@ msgstr ""
|
|||||||
msgid "Language"
|
msgid "Language"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:136
|
#: lib/cannery_web/live/home_live.ex:135
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Get involved!"
|
msgid "Get involved!"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:157
|
#: lib/cannery_web/live/home_live.ex:156
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Help translate"
|
msgid "Help translate"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:168
|
#: lib/cannery_web/live/home_live.ex:167
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Report bugs or request features"
|
msgid "Report bugs or request features"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:146
|
#: lib/cannery_web/live/home_live.ex:145
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "View the source code"
|
msgid "View the source code"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -199,7 +199,7 @@ msgstr "Información de Instancia"
|
|||||||
msgid "Invite Disabled"
|
msgid "Invite Disabled"
|
||||||
msgstr "Invitación Desactivada"
|
msgstr "Invitación Desactivada"
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:111
|
#: lib/cannery_web/live/home_live.ex:110
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Invite Only"
|
msgid "Invite Only"
|
||||||
msgstr "Solo Invitación"
|
msgstr "Solo Invitación"
|
||||||
@ -355,7 +355,7 @@ msgstr "Precio pagado:"
|
|||||||
msgid "Primer type"
|
msgid "Primer type"
|
||||||
msgstr "Tipo de espoleta"
|
msgstr "Tipo de espoleta"
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:110
|
#: lib/cannery_web/live/home_live.ex:109
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Public Signups"
|
msgid "Public Signups"
|
||||||
msgstr "Registro Público"
|
msgstr "Registro Público"
|
||||||
@ -753,22 +753,22 @@ msgstr "Alemán"
|
|||||||
msgid "Language"
|
msgid "Language"
|
||||||
msgstr "Idioma"
|
msgstr "Idioma"
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:136
|
#: lib/cannery_web/live/home_live.ex:135
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Get involved!"
|
msgid "Get involved!"
|
||||||
msgstr "¡Implícate!"
|
msgstr "¡Implícate!"
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:157
|
#: lib/cannery_web/live/home_live.ex:156
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Help translate"
|
msgid "Help translate"
|
||||||
msgstr "Ayuda a traducir"
|
msgstr "Ayuda a traducir"
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:168
|
#: lib/cannery_web/live/home_live.ex:167
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Report bugs or request features"
|
msgid "Report bugs or request features"
|
||||||
msgstr "Informar de errores o solicitar funciones"
|
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
|
#, elixir-autogen, elixir-format
|
||||||
msgid "View the source code"
|
msgid "View the source code"
|
||||||
msgstr "Ver código fuente"
|
msgstr "Ver código fuente"
|
||||||
|
@ -199,7 +199,7 @@ msgstr "Information de l’instance"
|
|||||||
msgid "Invite Disabled"
|
msgid "Invite Disabled"
|
||||||
msgstr "Invitation désactivée"
|
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
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Invite Only"
|
msgid "Invite Only"
|
||||||
msgstr "Uniquement sur invitation"
|
msgstr "Uniquement sur invitation"
|
||||||
@ -355,7 +355,7 @@ msgstr "Prix payé :"
|
|||||||
msgid "Primer type"
|
msgid "Primer type"
|
||||||
msgstr "Type d’amorce"
|
msgstr "Type d’amorce"
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:110
|
#: lib/cannery_web/live/home_live.ex:109
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Public Signups"
|
msgid "Public Signups"
|
||||||
msgstr "Enregistrements publics"
|
msgstr "Enregistrements publics"
|
||||||
@ -754,22 +754,22 @@ msgstr "Allemand"
|
|||||||
msgid "Language"
|
msgid "Language"
|
||||||
msgstr "Langue"
|
msgstr "Langue"
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:136
|
#: lib/cannery_web/live/home_live.ex:135
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Get involved!"
|
msgid "Get involved!"
|
||||||
msgstr "Impliquez-vous !"
|
msgstr "Impliquez-vous !"
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:157
|
#: lib/cannery_web/live/home_live.ex:156
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Help translate"
|
msgid "Help translate"
|
||||||
msgstr "Aider à la traduction"
|
msgstr "Aider à la traduction"
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:168
|
#: lib/cannery_web/live/home_live.ex:167
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Report bugs or request features"
|
msgid "Report bugs or request features"
|
||||||
msgstr "Remonter des bugs ou une demande de fonctionnalité"
|
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
|
#, elixir-autogen, elixir-format
|
||||||
msgid "View the source code"
|
msgid "View the source code"
|
||||||
msgstr "Voir le code source"
|
msgstr "Voir le code source"
|
||||||
|
@ -195,7 +195,7 @@ msgstr ""
|
|||||||
msgid "Invite Disabled"
|
msgid "Invite Disabled"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:111
|
#: lib/cannery_web/live/home_live.ex:110
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Invite Only"
|
msgid "Invite Only"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -351,7 +351,7 @@ msgstr ""
|
|||||||
msgid "Primer type"
|
msgid "Primer type"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:110
|
#: lib/cannery_web/live/home_live.ex:109
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Public Signups"
|
msgid "Public Signups"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -746,22 +746,22 @@ msgstr ""
|
|||||||
msgid "Language"
|
msgid "Language"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:136
|
#: lib/cannery_web/live/home_live.ex:135
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Get involved!"
|
msgid "Get involved!"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:157
|
#: lib/cannery_web/live/home_live.ex:156
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Help translate"
|
msgid "Help translate"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:168
|
#: lib/cannery_web/live/home_live.ex:167
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Report bugs or request features"
|
msgid "Report bugs or request features"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/cannery_web/live/home_live.ex:146
|
#: lib/cannery_web/live/home_live.ex:145
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "View the source code"
|
msgid "View the source code"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
Loading…
Reference in New Issue
Block a user