diff --git a/config/config.exs b/config/config.exs index 2780bfc9..7a247255 100644 --- a/config/config.exs +++ b/config/config.exs @@ -18,6 +18,7 @@ config :mobilizon, :instance, version: "1.0.0-dev", hostname: System.get_env("MOBILIZON_INSTANCE_HOST") || "localhost", registrations_open: System.get_env("MOBILIZON_INSTANCE_REGISTRATIONS_OPEN") || false, + registration_email_whitelist: [], demo: System.get_env("MOBILIZON_INSTANCE_DEMO_MODE") || false, repository: Mix.Project.config()[:source_url], allow_relay: true, diff --git a/js/src/graphql/config.ts b/js/src/graphql/config.ts index 8b424ea3..a128eba3 100644 --- a/js/src/graphql/config.ts +++ b/js/src/graphql/config.ts @@ -6,6 +6,7 @@ query { name, description, registrationsOpen, + registrationsWhitelist, demoMode, countryCode, location { diff --git a/js/src/i18n/de.json b/js/src/i18n/de.json index 075eed19..c96474cd 100644 --- a/js/src/i18n/de.json +++ b/js/src/i18n/de.json @@ -12,7 +12,6 @@ "Add to my calendar": "Zu meinem Kalender hinzufügen", "Additional comments": "Zusätzliche Kommentare", "Administration": "Administration", - "All data will be deleted every 48 hours, so please don't use this for anything real.": "Alle Daten werden alle 48 Stunden gelöscht, also benutze diesen Service bitte nur zu Testzwecken.", "All the places have already been taken": "Alle Plätze sind besetzt|Ein Platz ist noch verfügbar|{places} Plätze sind noch verfügbar", "Allow all comments": "Erlaube alle Kommentare", "An error has occurred.": "Ein Fehler ist aufgetreten.", diff --git a/js/src/i18n/en_US.json b/js/src/i18n/en_US.json index 5894fa2f..c8c14d7e 100644 --- a/js/src/i18n/en_US.json +++ b/js/src/i18n/en_US.json @@ -7,17 +7,21 @@ "About this event": "About this event", "About this instance": "About this instance", "About": "About", + "Accepted": "Accepted", + "Add a note": "Add a note", "Add an address": "Add an address", + "Add an instance": "Add an instance", "Add some tags": "Add some tags", "Add to my calendar": "Add to my calendar", "Add": "Add", "Additional comments": "Additional comments", "Administration": "Administration", - "All data will be deleted every 48 hours, so please don't use this for anything real.": "All data will be deleted every 48 hours, so please don't use this for anything real.", "All the places have already been taken": "All the places have been taken|One place is still available|{places} places are still available", "Allow all comments": "Allow all comments", "An error has occurred.": "An error has occurred.", "Approve": "Approve", + "Are you sure you want to delete this comment? This action cannot be undone.": "Are you sure you want to delete this comment? This action cannot be undone.", + "Are you sure you want to delete this event? This action cannot be undone. You may want to engage the conversation with the event creator or edit its event instead.": "Are you sure you want to delete this event? This action cannot be undone. You may want to engage the conversation with the event creator or edit its event instead.", "Are you sure you want to cancel the event creation? You'll lose all modifications.": "Are you sure you want to cancel the event creation? You'll lose all modifications.", "Are you sure you want to cancel the event edition? You'll lose all modifications.": "Are you sure you want to cancel the event edition? You'll lose all modifications.", "Are you sure you want to cancel your participation at event \"{title}\"?": "Are you sure you want to cancel your participation at event \"{title}\"?", @@ -40,6 +44,9 @@ "Click to select": "Click to select", "Click to upload": "Click to upload", "Close comments for all (except for admins)": "Close comments for all (except for admins)", + "Close": "Close", + "Closed": "Closed", + "Comment deleted": "Comment deleted", "Comment from @{username} reported": "Comment from @{username} reported", "Comments have been closed.": "Comments have been closed.", "Comments": "Comments", @@ -60,18 +67,25 @@ "Create": "Create", "Creator": "Creator", "Current identity has been changed to {identityName} in order to manage this event.": "Current identity has been changed to {identityName} in order to manage this event.", + "Dashboard": "Dashboard", "Date and time settings": "Date and time settings", "Date parameters": "Date parameters", + "Date": "Date", + "Delete Comment": "Delete Comment", + "Delete Event": "Delete Event", "Delete event": "Delete event", "Delete this identity": "Delete this identity", "Delete your identity": "Delete your identity", "Delete {eventTitle}": "Delete {eventTitle}", "Delete {preferredUsername}": "Delete {preferredUsername}", "Delete": "Delete", + "Deleting comment": "Deleting comment", + "Deleting event": "Deleting event", "Description": "Description", "Didn't receive the instructions ?": "Didn't receive the instructions ?", "Display name": "Display name", "Display participation price": "Display participation price", + "Domain": "Domain", "Draft": "Draft", "Drafts": "Drafts", "Edit": "Edit", @@ -96,12 +110,15 @@ "Event {eventTitle} reported": "Event {eventTitle} reported", "Event": "Event", "Events": "Events", + "Ex: test.mobilizon.org": "Ex: test.mobilizon.org", "Exclude": "Exclude", "Explore": "Explore", "Featured events": "Featured events", "Features": "Features", "Find an address": "Find an address", "Find an instance": "Find an instance", + "Followers": "Followers", + "Followings": "Followings", "For instance: London, Taekwondo, Architecture…": "For instance: London, Taekwondo, Architecture…", "Forgot your password ?": "Forgot your password ?", "From a birthday party with friends and family to a march for climate change, right now, our gatherings are trapped inside the tech giants’ platforms. How can we organize, how can we click “Attend,” without providing private data to Facebook or locking ourselves up inside MeetUp?": "From a birthday party with friends and family to a march for climate change, right now, our gatherings are trapped inside the tech giants’ platforms. How can we organize, how can we click “Attend,” without providing private data to Facebook or locking ourselves up inside MeetUp?", @@ -130,6 +147,7 @@ "Impossible to login, your email or password seems incorrect.": "Impossible to login, your email or password seems incorrect.", "In the meantime, please consider that the software is not (yet) finished. More information {onBlog}.": "In the meantime, please consider that the software is not (yet) finished. More information {onBlog}.", "Installing Mobilizon will allow communities to free themselves from the services of tech giants by creating their own event platform.": "Installing Mobilizon will allow communities to free themselves from the services of tech giants by creating their own event platform.", + "Instances": "Instances", "Join {instance}, a Mobilizon instance": "Join {instance}, a Mobilizon instance", "Last published event": "Last published event", "Last week": "Last week", @@ -147,6 +165,7 @@ "Login on Mobilizon!": "Login on Mobilizon!", "Login": "Login", "Manage participations": "Manage participations", + "Mark as resolved": "Mark as resolved", "Members": "Members", "Mobilizon is a free/libre software that will allow communities to create their own spaces to publish events in order to better emancipate themselves from tech giants.": "Mobilizon is a free/libre software that will allow communities to create their own spaces to publish events in order to better emancipate themselves from tech giants.", "Mobilizon is under development, we will add new features to this site during regular updates, until the release of version 1 of the software in the first half of 2020.": "Mobilizon is under development, we will add new features to this site during regular updates, until the release of version 1 of the software in the first half of 2020.", @@ -156,16 +175,26 @@ "My events": "My events", "My identities": "My identities", "Name": "Name", + "New note": "New note", "New password": "New password", "No actors found": "No actors found", "No address defined": "No address defined", + "No closed reports yet": "No closed reports yet", + "No comment": "No comment", "No comments yet": "No comments yet", "No end date": "No end date", "No events found": "No events found", "No group found": "No group found", "No groups found": "No groups found", + "No instance follows your instance yet.": "No instance follows your instance yet.", + "No instance to approve|Approve instance|Approve {number} instances": "No instance to approve|Approve instance|Approve {number} instances", + "No instance to reject|Reject instance|Reject {number} instances": "No instance to reject|Reject instance|Reject {number} instances", + "No instance to remove|Remove instance|Remove {number} instances": "No instances to remove|Remove instance|Remove {number} instances", + "No open reports yet": "No open reports yet", + "No resolved reports yet": "No resolved reports yet", "No results for \"{queryText}\"": "No results for \"{queryText}\"", "No user account with this email was found. Maybe you made a typo?": "No user account with this email was found. Maybe you made a typo?", + "Notes": "Notes", "Number of places": "Number of places", "OK": "OK", "Old password": "Old password", @@ -176,6 +205,7 @@ "One person is going": "No one is going | One person is going | {approved} persons are going", "Only accessible through link and search (private)": "Only accessible through link and search (private)", "Only alphanumeric characters and underscores are supported.": "Only alphanumeric characters and underscores are supported.", + "Open": "Open", "Opened reports": "Opened reports", "Organized by {name}": "Organized by {name}", "Organized": "Organized", @@ -194,6 +224,7 @@ "Password reset": "Password reset", "Password": "Password", "Past events": "Passed events", + "Pending": "Pending", "Pick an identity": "Pick an identity", "Please check your spam folder if you didn't receive the email.": "Please check your spam folder if you didn't receive the email.", "Please contact this instance's Mobilizon admin if you think this is a mistake.": "Please contact this instance's Mobilizon admin if you think this is a mistake.", @@ -219,15 +250,25 @@ "Register for an event by choosing one of your identities": "Register for an event by choosing one of your identities", "Register": "Register", "Registration is currently closed.": "Registration is currently closed.", + "Registrations are restricted by whitelisting.": "Registrations are restricted by whitelisting.", "Reject": "Reject", "Rejected participations": "Rejected participations", "Rejected": "Rejected", + "Reopen": "Reopen", + "Reply": "Reply", "Report this comment": "Report this comment", "Report this event": "Report this event", "Report": "Report", + "Reported by someone on {domain}": "Reported by someone on {domain}", + "Reported by {reporter}": "Reported by {reporter}", + "Reported by": "Reported by", + "Reported identity": "Reported identity", + "Reported": "Reported", + "Reports": "Reports", "Requests": "Requests", "Resend confirmation email": "Resend confirmation email", "Reset my password": "Reset my password", + "Resolved": "Resolved", "Save draft": "Save draft", "Save": "Save", "Search events, groups, etc.": "Search events, groups, etc.", @@ -273,13 +314,17 @@ "To confirm, type your event title \"{eventTitle}\"": "To confirm, type your event title \"{eventTitle}\"", "To confirm, type your identity username \"{preferredUsername}\"": "To confirm, type your identity username \"{preferredUsername}\"", "Transfer to {outsideDomain}": "Transfer to {outsideDomain}", + "Type": "Type", "Unfortunately, this instance isn't opened to registrations": "Unfortunately, this instance isn't opened to registrations", "Unfortunately, your participation request was rejected by the organizers.": "Unfortunately, your participation request was rejected by the organizers.", + "Unknown actor": "Unknown actor", "Unknown error.": "Unknown error.", + "Unknown": "Unknown", "Unsaved changes": "Unsaved changes", "Upcoming": "Upcoming", "Update event {name}": "Update event {name}", "Update my event": "Update my event", + "Updated": "Updated", "Username": "Username", "Users": "Users", "View a reply": "|View one reply|View {totalReplies} replies", @@ -307,6 +352,7 @@ "You can add tags by hitting the Enter key or by adding a comma": "You can add tags by hitting the Enter key or by adding a comma", "You can try another search term or drag and drop the marker on the map": "You can try another search term or drag and drop the marker on the map", "You can't remove your last identity.": "You can't remove your last identity.", + "You don't follow any instances yet.": "You don't follow any instances yet.", "You have been disconnected": "You have been disconnected", "You have cancelled your participation": "You have cancelled your participation", "You have one event in {days} days.": "You have no events in {days} days | You have one event in {days} days. | You have {count} events in {days} days", @@ -317,12 +363,16 @@ "Your account has been validated": "Your account has been validated", "Your account is being validated": "Your account is being validated", "Your account is nearly ready, {username}": "Your account is nearly ready, {username}", + "Your email is not whitelisted, you can't register.": "Your email is not whitelisted, you can't register.", "Your local administrator resumed its policy:": "Your local administrator resumed its policy:", "Your participation has been confirmed": "Your participation has been confirmed", + "Your participation has been rejected": "Your participation has been rejected", "Your participation has been requested": "Your participation has been requested", + "Your participation status has been changed": "Your participation status has been changed", "[This comment has been deleted]": "[This comment has been deleted]", "[deleted]": "[deleted]", "a decentralised federation protocol": "a decentralised federation protocol", + "as {identity}": "as {identity}", "e.g. 10 Rue Jangot": "e.g. 10 Rue Jangot", "firstDayOfWeek": "0", "iCal Feed": "iCal Feed", @@ -332,59 +382,10 @@ "resend confirmation email": "resend confirmation email", "respect of the fundamental freedoms": "respect of the fundamental freedoms", "with another identity…": "with another identity…", - "as {identity}": "as {identity}", "{approved} / {total} seats": "{approved} / {total} seats", "{count} participants": "No participants yet | One participant | {count} participants", "{count} requests waiting": "{count} requests waiting", "{license} guarantees {respect} of the people who will use it. Since {source}, anyone can audit it, which guarantees its transparency.": "{license} guarantees {respect} of the people who will use it. Since {source}, anyone can audit it, which guarantees its transparency.", "© The Mobilizon Contributors {date} - Made with Elixir, Phoenix, VueJS & with some love and some weeks": "© The Mobilizon Contributors {date} - Made with Elixir, Phoenix, VueJS & with some love and some weeks", - "© The OpenStreetMap Contributors": "© The OpenStreetMap Contributors", - "Reply": "Reply", - "Accepted": "Accepted", - "Pending": "Pending", - "No instance to remove|Remove instance|Remove {number} instances": "No instances to remove|Remove instance|Remove {number} instances", - "Dashboard": "Dashboard", - "Reports": "Reports", - "Mark as resolved": "Mark as resolved", - "Reopen": "Reopen", - "Close": "Close", - "Reported identity": "Reported identity", - "Reported by": "Reported by", - "Reported": "Reported", - "Updated": "Updated", - "Open": "Open", - "Closed": "Closed", - "Resolved": "Resolved", - "Unknown": "Unknown", - "No comment": "No comment", - "Notes": "Notes", - "New note": "New note", - "Add a note": "Add a note", - "Deleting event": "Deleting event", - "Are you sure you want to delete this event? This action cannot be undone. You may want to engage the conversation with the event creator or edit its event instead.": "Are you sure you want to delete this event? This action cannot be undone. You may want to engage the conversation with the event creator or edit its event instead.", - "Delete Event": "Delete Event", - "Type": "Type", - "Domain": "Domain", - "Date": "Date", - "No instance to approve|Approve instance|Approve {number} instances": "No instance to approve|Approve instance|Approve {number} instances", - "No instance to reject|Reject instance|Reject {number} instances": "No instance to reject|Reject instance|Reject {number} instances", - "No instance follows your instance yet.": "No instance follows your instance yet.", - "Followers": "Followers", - "Add an instance": "Add an instance", - "Ex: test.mobilizon.org": "Ex: test.mobilizon.org", - "You don't follow any instances yet.": "You don't follow any instances yet.", - "Followings": "Followings", - "Instances": "Instances", - "Reported by {reporter}": "Reported by {reporter}", - "No open reports yet": "No open reports yet", - "No resolved reports yet": "No resolved reports yet", - "No closed reports yet": "No closed reports yet", - "Reported by someone on {domain}": "Reported by someone on {domain}", - "Your participation has been rejected": "Your participation has been rejected", - "Your participation status has been changed": "Your participation status has been changed", - "Unknown actor": "Unknown actor", - "Deleting comment": "Deleting comment", - "Are you sure you want to delete this comment? This action cannot be undone.": "Are you sure you want to delete this comment? This action cannot be undone.", - "Delete Comment": "Delete Comment", - "Comment deleted": "Comment deleted" + "© The OpenStreetMap Contributors": "© The OpenStreetMap Contributors" } \ No newline at end of file diff --git a/js/src/i18n/fr_FR.json b/js/src/i18n/fr_FR.json index 6e86fb4f..264b40d1 100644 --- a/js/src/i18n/fr_FR.json +++ b/js/src/i18n/fr_FR.json @@ -16,7 +16,6 @@ "Add": "Ajouter", "Additional comments": "Commentaires additionnels", "Administration": "Administration", - "All data will be deleted every 48 hours, so please don't use this for anything real.": "Toutes les données seront effacées toutes les 48 heures, donc n'utilisez pas ce site à des fins autres que de démonstration.", "All the places have already been taken": "Toutes les places ont été prises|Une place est encore disponible|{places} places sont encore disponibles", "Allow all comments": "Autoriser tous les commentaires", "An error has occurred.": "Une erreur est survenue.", @@ -253,6 +252,7 @@ "Register for an event by choosing one of your identities": "S'inscrire à un événement en choisissant une de vos identités", "Register": "S'inscrire", "Registration is currently closed.": "Les inscriptions sont actuellement fermées.", + "Registrations are restricted by whitelisting.": "Les inscriptions sont restreintes par liste blanche.", "Reject": "Rejetter", "Rejected participations": "Participations rejetées", "Rejected": "Rejetés", @@ -365,6 +365,7 @@ "Your account has been validated": "Votre compte a été validé", "Your account is being validated": "Votre compte est en cours de validation", "Your account is nearly ready, {username}": "Votre compte est presque prêt, {username}", + "Your email is not whitelisted, you can't register.": "Votre email n'est pas sur la liste blanche, vous ne pouvez pas vous inscrire.", "Your local administrator resumed its policy:": "Votre administrateur local a résumé sa politique ainsi :", "Your participation has been confirmed": "Votre participation a été confirmée", "Your participation has been rejected": "Votre participation a été rejettée", diff --git a/js/src/i18n/nl.json b/js/src/i18n/nl.json index e172ca00..bb6ffd24 100644 --- a/js/src/i18n/nl.json +++ b/js/src/i18n/nl.json @@ -12,7 +12,6 @@ "Add to my calendar": "Aan mijn kalender toevoegen", "Additional comments": "Meer opmerkingen", "Administration": "Administratie", - "All data will be deleted every 48 hours, so please don't use this for anything real.": "Alle gegevens worden iedere 48 uur verwijderd, dus gebruik dit enkel als test.", "All the places have already been taken": "Ale plaatsen zijn bezet|Er is nog één plaats vrij|Er zijn nog {places} plaatsen vrij", "Allow all comments": "Alle opmerkingen toestaan", "An error has occurred.": "Er is een fout opgetreden.", diff --git a/js/src/i18n/oc.json b/js/src/i18n/oc.json index 7e35e83f..c61599f3 100644 --- a/js/src/i18n/oc.json +++ b/js/src/i18n/oc.json @@ -17,7 +17,6 @@ "Add": "Ajustar", "Additional comments": "Comentari adicional", "Administration": "Administracion", - "All data will be deleted every 48 hours, so please don't use this for anything real.": "Estant que totas las donadas son suprimidas cada 48 oras, utilizetz pas aquò per quicòm mai qu’una demostracion.", "All the places have already been taken": "Totas las plaças son presas|Una plaça es encara disponibla|{places} plaças son encara disponiblas", "Allow all comments": "Autorizar totes los comentaris", "An error has occurred.": "Una error s’es producha.", diff --git a/js/src/i18n/pl.json b/js/src/i18n/pl.json index 15e66791..5b5cf968 100644 --- a/js/src/i18n/pl.json +++ b/js/src/i18n/pl.json @@ -11,7 +11,6 @@ "Add to my calendar": "Dodaj do kalendarza", "Additional comments": "Dodatkowe komentarze", "Administration": "Administracja", - "All data will be deleted every 48 hours, so please don't use this for anything real.": "Wszystkie dane zostaną usunięte co 48 godzin, więc nie używaj tego do rzeczywistych działań.", "Allow all comments": "Pozwól na wszystkie komentarze", "An error has occurred.": "Wystąpił błąd.", "Approve": "Zatwierdź", diff --git a/js/src/i18n/sv.json b/js/src/i18n/sv.json index 9891037c..a88c8168 100644 --- a/js/src/i18n/sv.json +++ b/js/src/i18n/sv.json @@ -12,7 +12,6 @@ "Add to my calendar": "Lägg till i min kalender", "Additional comments": "Yttligare kommentarer", "Administration": "Administration", - "All data will be deleted every 48 hours, so please don't use this for anything real.": "All data kommer raderas varje 48e timme, så använd inte detta för något riktigt.", "All the places have already been taken": "Alla platser är bokade|Det finns en plats kvar|Det finns {places} kvar", "Allow all comments": "Tillåt alla kommentarer", "An error has occurred.": "Ett fel har uppstått.", diff --git a/js/src/router/guards/register-guard.ts b/js/src/router/guards/register-guard.ts index 5d693ebc..4a36ec16 100644 --- a/js/src/router/guards/register-guard.ts +++ b/js/src/router/guards/register-guard.ts @@ -12,7 +12,7 @@ export const beforeRegisterGuard: NavigationGuard = async function (to, from, ne const config: IConfig = data.config; - if (!config.registrationsOpen) { + if (!config.registrationsOpen && !config.registrationsWhitelist) { return next({ name: ErrorRouteName.ERROR, query: { code: ErrorCode.REGISTRATION_CLOSED }, diff --git a/js/src/types/config.model.ts b/js/src/types/config.model.ts index 01afee08..e99a3852 100644 --- a/js/src/types/config.model.ts +++ b/js/src/types/config.model.ts @@ -3,6 +3,7 @@ export interface IConfig { description: string; registrationsOpen: boolean; + registrationsWhitelist: boolean; demoMode: boolean; countryCode: string; location: { diff --git a/js/src/utils/errors.ts b/js/src/utils/errors.ts index 95f8ead3..f7909ce6 100644 --- a/js/src/utils/errors.ts +++ b/js/src/utils/errors.ts @@ -48,6 +48,11 @@ export const errors: IError[] = [ value: i18n.t("The current identity doesn't have any permission on this event. You should probably change it.") as string, suggestRefresh: false, }, + { + match: /Your email is not on the whitelist$/, + value: i18n.t("Your email is not whitelisted, you can't register.") as string, + suggestRefresh: false, + }, { match: /Cannot remove the last identity of a user/, value: i18n.t("You can't remove your last identity.") as string, diff --git a/js/src/views/User/Register.vue b/js/src/views/User/Register.vue index 8b220f2a..9f45e8b5 100644 --- a/js/src/views/User/Register.vue +++ b/js/src/views/User/Register.vue @@ -29,7 +29,6 @@