Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.2.4

- You can now disable public sign-up by setting `AUTH_ALLOW_REGISTRATION=false`
- The changelog is now accessible from your profile settings
- Fix: Magic link sign-in no longer creates new accounts when registration is disabled

## 0.2.3

- Maintenance trackers can now be set to reminder-only. You can get notified when service is due without polluting your timeline
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ services:
- PUBLIC_APP_ORIGINS=http://localhost
- AUTH_COOKIE_SECURE=false
- AUTH_SECRET=change-me-in-production-min-32-chars
- AUTH_ALLOW_REGISTRATION=true
- STORAGE_ADAPTER=local
- BODY_SIZE_LIMIT=20971520
restart: unless-stopped
Expand Down
1 change: 1 addition & 0 deletions motomate/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ DATABASE_URL=./data/motomate.db
# Auth
AUTH_SECRET=change-me-in-production-min-32-chars
AUTH_COOKIE_SECURE=false
AUTH_ALLOW_REGISTRATION=true

# Storage: 'local' or 's3'
STORAGE_ADAPTER=local
Expand Down
7 changes: 7 additions & 0 deletions motomate/src/lib/auth/registration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { env } from '$env/dynamic/private';
import { hasAnyUser } from '$lib/db/repositories/users.js';

export async function isRegistrationOpen(): Promise<boolean> {
if (env.AUTH_ALLOW_REGISTRATION !== 'false') return true;
return !(await hasAnyUser());
}
5 changes: 5 additions & 0 deletions motomate/src/lib/db/repositories/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ export async function markOnboardingDone(userId: string): Promise<void> {
.where(eq(users.id, userId));
}

export async function hasAnyUser(): Promise<boolean> {
const row = await db.query.users.findFirst();
return row !== undefined;
}

export async function deleteUser(userId: string): Promise<void> {
await db.delete(users).where(eq(users.id, userId));
}
17 changes: 14 additions & 3 deletions motomate/src/lib/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"rateLimited": "Zu viele Versuche. Bitte versuche es später erneut.",
"invalidFormat": "Ungültiges E-Mail- oder Passwortformat",
"invalidCredentials": "Ungültige E-Mail oder Passwort",
"invalidEmail": "Bitte gib eine gültige E-Mail-Adresse ein"
"invalidEmail": "Bitte gib eine gültige E-Mail-Adresse ein",
"registrationClosed": "Die Registrierung ist geschlossen. Wenden Sie sich an Ihren Administrator."
}
},
"register": {
Expand All @@ -55,7 +56,10 @@
"passwordMismatch": "Passwörter stimmen nicht überein",
"submit": "Konto erstellen",
"hasAccount": "Bereits ein Konto?",
"login": "Anmelden"
"login": "Anmelden",
"closedTitle": "Registrierung geschlossen",
"closedBody": "Neue Konten werden derzeit nicht angenommen. Wenden Sie sich an Ihren Administrator.",
"closedAction": "Zur Anmeldung"
},
"magicLink": {
"verifying": "Wir melden Sie an…",
Expand Down Expand Up @@ -927,7 +931,14 @@
"workflows": "Workflows",
"sourceCode": "Quellcode",
"reportIssue": "Problem melden",
"tapAgain": "Nochmal tippen zum Offnen"
"tapAgain": "Nochmal tippen zum Offnen",
"changelog": "Changelog"
},
"changelog": {
"title": "Was ist neu?",
"subtitle": "Sieh nach, was sich in den neuesten Versionen geändert hat.",
"refresh": "Aktualisieren",
"noContent": "Keine Änderungen gefunden. Versuche es später erneut."
}
},
"units": {
Expand Down
15 changes: 13 additions & 2 deletions motomate/src/lib/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"rateLimited": "Too many attempts. Please try again later.",
"invalidFormat": "Invalid email or password format",
"invalidCredentials": "Invalid email or password",
"invalidEmail": "Please enter a valid email address"
"invalidEmail": "Please enter a valid email address",
"registrationClosed": "Unfortunately, you can't sign up right now. Contact your administrator for access."
}
},
"register": {
Expand All @@ -55,7 +56,10 @@
"passwordMismatch": "Passwords do not match",
"submit": "Create account",
"hasAccount": "Already have an account?",
"login": "Log in"
"login": "Log in",
"closedTitle": "Registration closed",
"closedBody": "New accounts are not accepted at this time. Contact your administrator for access.",
"closedAction": "Go to log in"
},
"magicLink": {
"title": "Magic link",
Expand Down Expand Up @@ -737,6 +741,7 @@
"account": "Account",
"notifications": "Notifications",
"workflows": "Workflows",
"changelog": "Changelog",
"sourceCode": "Source Code",
"reportIssue": "Report an Issue",
"tapAgain": "Tap again to open"
Expand Down Expand Up @@ -929,6 +934,12 @@
"prevPage": "Previous",
"nextPage": "Next",
"pageOf": "Page {page} of {total}"
},
"changelog": {
"title": "What's new?",
"subtitle": "See what changed in the latest versions.",
"refresh": "Refresh",
"noContent": "No changes found. Try again later."
}
},
"layout": {
Expand Down
17 changes: 14 additions & 3 deletions motomate/src/lib/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"rateLimited": "Demasiados intentos. Por favor, inténtalo de nuevo más tarde.",
"invalidFormat": "Formato de correo electrónico o contraseña inválido",
"invalidCredentials": "Correo electrónico o contraseña inválidos",
"invalidEmail": "Por favor, introduce una dirección de correo electrónico válida"
"invalidEmail": "Por favor, introduce una dirección de correo electrónico válida",
"registrationClosed": "El registro está cerrado. Contacta con tu administrador para obtener acceso."
}
},
"register": {
Expand All @@ -55,7 +56,10 @@
"passwordMismatch": "Las contraseñas no coinciden",
"submit": "Crear cuenta",
"hasAccount": "¿Ya tienes cuenta?",
"login": "Iniciar sesión"
"login": "Iniciar sesión",
"closedTitle": "Registro cerrado",
"closedBody": "Los nuevos registros no están abiertos. Contacta con tu administrador para obtener acceso.",
"closedAction": "Ir a iniciar sesión"
},
"magicLink": {
"verifying": "Iniciando sesión…",
Expand Down Expand Up @@ -927,7 +931,14 @@
"workflows": "Flujos de trabajo",
"sourceCode": "Codigo fuente",
"reportIssue": "Reportar un problema",
"tapAgain": "Toca de nuevo para abrir"
"tapAgain": "Toca de nuevo para abrir",
"changelog": "Changelog"
},
"changelog": {
"title": "¿Qué hay de nuevo?",
"subtitle": "Consulta qué ha cambiado en las últimas versiones.",
"refresh": "Actualizar",
"noContent": "No se encontraron cambios. Inténtalo más tarde."
}
},
"units": {
Expand Down
17 changes: 14 additions & 3 deletions motomate/src/lib/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"rateLimited": "Trop de tentatives. Veuillez réessayer plus tard.",
"invalidFormat": "Format d'e-mail ou de mot de passe invalide",
"invalidCredentials": "E-mail ou mot de passe invalide",
"invalidEmail": "Veuillez entrer une adresse e-mail valide"
"invalidEmail": "Veuillez entrer une adresse e-mail valide",
"registrationClosed": "L'inscription est fermée. Contactez votre administrateur pour obtenir l'accès."
}
},
"register": {
Expand All @@ -55,7 +56,10 @@
"passwordMismatch": "Les mots de passe ne correspondent pas",
"submit": "Créer un compte",
"hasAccount": "Déjà un compte ?",
"login": "Se connecter"
"login": "Se connecter",
"closedTitle": "Inscription fermée",
"closedBody": "Les nouveaux comptes ne sont pas acceptés pour l'instant. Contactez votre administrateur pour obtenir l'accès.",
"closedAction": "Aller à la connexion"
},
"magicLink": {
"verifying": "Connexion en cours…",
Expand Down Expand Up @@ -927,7 +931,14 @@
"workflows": "Flux de travail",
"sourceCode": "Code source",
"reportIssue": "Signaler un probleme",
"tapAgain": "Appuyez a nouveau pour ouvrir"
"tapAgain": "Appuyez a nouveau pour ouvrir",
"changelog": "Changelog"
},
"changelog": {
"title": "Quoi de neuf ?",
"subtitle": "Découvrez ce qui a changé dans les dernières versions.",
"refresh": "Actualiser",
"noContent": "Aucune modification trouvée. Réessayez plus tard."
}
},
"units": {
Expand Down
17 changes: 14 additions & 3 deletions motomate/src/lib/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"rateLimited": "Troppi tentativi. Riprova più tardi.",
"invalidFormat": "Formato email o password non valido",
"invalidCredentials": "Email o password non validi",
"invalidEmail": "Inserisci un indirizzo email valido"
"invalidEmail": "Inserisci un indirizzo email valido",
"registrationClosed": "La registrazione è chiusa. Contatta il tuo amministratore per l'accesso."
}
},
"register": {
Expand All @@ -55,7 +56,10 @@
"passwordMismatch": "Le password non corrispondono",
"submit": "Crea account",
"hasAccount": "Hai già un account?",
"login": "Accedi"
"login": "Accedi",
"closedTitle": "Registrazione chiusa",
"closedBody": "I nuovi account non sono accettati al momento. Contatta il tuo amministratore per l'accesso.",
"closedAction": "Vai al login"
},
"magicLink": {
"verifying": "Accesso in corso…",
Expand Down Expand Up @@ -928,7 +932,14 @@
"workflows": "Flussi di lavoro",
"sourceCode": "Codice sorgente",
"reportIssue": "Segnala un problema",
"tapAgain": "Tocca di nuovo per aprire"
"tapAgain": "Tocca di nuovo per aprire",
"changelog": "Changelog"
},
"changelog": {
"title": "Cosa c'è di nuovo?",
"subtitle": "Scopri cosa è cambiato nelle ultime versioni.",
"refresh": "Aggiorna",
"noContent": "Nessuna modifica trovata. Riprova più tardi."
}
},
"units": {
Expand Down
17 changes: 14 additions & 3 deletions motomate/src/lib/i18n/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"rateLimited": "Te veel pogingen. Probeer het later opnieuw.",
"invalidFormat": "Ongeldig e-mailadres of wachtwoordformaat",
"invalidCredentials": "Ongeldig e-mailadres of wachtwoord",
"invalidEmail": "Voer een geldig e-mailadres in"
"invalidEmail": "Voer een geldig e-mailadres in",
"registrationClosed": "Aanmelden is nu niet mogelijk. Neem contact op met uw beheerder voor toegang."
}
},
"register": {
Expand All @@ -55,7 +56,10 @@
"passwordMismatch": "Wachtwoorden komen niet overeen",
"submit": "Account maken",
"hasAccount": "Heb je al een account?",
"login": "Inloggen"
"login": "Inloggen",
"closedTitle": "Registratie gesloten",
"closedBody": "Nieuwe accounts worden momenteel niet geaccepteerd. Neem contact op met uw beheerder voor toegang.",
"closedAction": "Ga naar inloggen"
},
"magicLink": {
"verifying": "Je wordt ingelogd…",
Expand Down Expand Up @@ -927,7 +931,14 @@
"workflows": "Regels",
"sourceCode": "Broncode",
"reportIssue": "Probleem melden",
"tapAgain": "Tik nogmaals om te openen"
"tapAgain": "Tik nogmaals om te openen",
"changelog": "Bekijk changelog"
},
"changelog": {
"title": "Wat is er nieuw?",
"subtitle": "Bekijk wat er veranderd is in de nieuwste versies.",
"refresh": "Vernieuwen",
"noContent": "Geen gewijzigen gevonden. Probeer het later opnieuw."
}
},
"units": {
Expand Down
17 changes: 14 additions & 3 deletions motomate/src/lib/i18n/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"rateLimited": "Demasiadas tentativas. Por favor, tenta novamente mais tarde.",
"invalidFormat": "Formato de e-mail ou palavra-passe inválido",
"invalidCredentials": "E-mail ou palavra-passe inválidos",
"invalidEmail": "Por favor, introduz um endereço de e-mail válido"
"invalidEmail": "Por favor, introduz um endereço de e-mail válido",
"registrationClosed": "O registo está fechado. Contacte o seu administrador para obter acesso."
}
},
"register": {
Expand All @@ -55,7 +56,10 @@
"passwordMismatch": "As senhas não coincidem",
"submit": "Criar conta",
"hasAccount": "Já tem uma conta?",
"login": "Iniciar sessão"
"login": "Iniciar sessão",
"closedTitle": "Registo fechado",
"closedBody": "Novos registos não são aceites neste momento. Contacte o seu administrador para obter acesso.",
"closedAction": "Ir para o login"
},
"magicLink": {
"verifying": "A iniciar sessão…",
Expand Down Expand Up @@ -927,7 +931,14 @@
"workflows": "Fluxos de trabalho",
"sourceCode": "Codigo fonte",
"reportIssue": "Reportar um problema",
"tapAgain": "Toque novamente para abrir"
"tapAgain": "Toque novamente para abrir",
"changelog": "Changelog"
},
"changelog": {
"title": "O que há de novo?",
"subtitle": "Veja o que mudou nas versões mais recentes.",
"refresh": "Atualizar",
"noContent": "Nenhuma alteração encontrada. Tente novamente mais tarde."
}
},
"units": {
Expand Down
Loading
Loading