feat: verified sign-up and several organizations per account
ci / image (pull_request) Successful in 3m59s
ci / build (pull_request) Successful in 5m46s
ci / test (pull_request) Successful in 12m32s
ci / lint (pull_request) Successful in 14m9s

New accounts confirm their email address before signing in: sign-up
mails a link valid for 24 hours, and its page confirms only when the
visitor presses the button, so mail scanners opening links do not sign
in. Confirming signs the account in; unconfirmed accounts are told so
only after giving the right password, can ask for a new link, and are
deleted after a week. UPTIME_SIGNUP_VERIFY requires confirmation always
in the cloud edition and self-hosted wherever mail can be sent; without
a mail server, sign-up that needs it stays closed.

One account per mailbox: users.email_key drops +suffixes, and dots for
Gmail, and is unique, including for accounts created through
invitations and SSO, which count as confirmed. A client address (IPv6:
its /64) may create UPTIME_SIGNUPS_PER_IP accounts a day, 2 by default;
refused sign-ups do not count.

Sign-up asks only for name, email and password. Accounts without an
organization are led to create one; signed-in users create further
organizations from the switcher, within the per-account limit, and
POST /api/v1/orgs does the same.

Closes #112
Closes #113

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-22 21:59:12 +01:00
1 parent d644312f25
commit 87b2f2a256
29 files changed
+1698 -377

No files matched your search

+5
View File
@@ -47,6 +47,7 @@ type Querier interface {
ClearStatusPageGroups(ctx context.Context, pageID uuid.UUID) error
ClearStatusPageMonitors(ctx context.Context, pageID uuid.UUID) error
CountMonitors(ctx context.Context, orgID uuid.UUID) (int64, error)
CountOwnedOrgs(ctx context.Context, userID uuid.UUID) (int64, error)
CountRoleAssignments(ctx context.Context, roleID uuid.UUID) (int64, error)
CountStatusPages(ctx context.Context, orgID uuid.UUID) (int64, error)
CountUnusedRecoveryCodes(ctx context.Context, userID uuid.UUID) (int64, error)
@@ -99,6 +100,7 @@ type Querier interface {
DeleteSuccessEvidence(ctx context.Context, arg DeleteSuccessEvidenceParams) error
DeleteUser(ctx context.Context, id uuid.UUID) (int64, error)
DisableTOTP(ctx context.Context, id uuid.UUID) error
EmailKeyTaken(ctx context.Context, emailKey *string) (bool, error)
EnableTOTP(ctx context.Context, arg EnableTOTPParams) error
EnqueueNotification(ctx context.Context, arg EnqueueNotificationParams) error
// An empty name names a new region after its key and keeps an existing name.
@@ -224,6 +226,7 @@ type Querier interface {
MaintenanceForMonitors(ctx context.Context, ids []uuid.UUID) ([]MaintenanceForMonitorsRow, error)
MakeAdmin(ctx context.Context, id uuid.UUID) error
MarkDomainVerified(ctx context.Context, id uuid.UUID) error
MarkEmailVerified(ctx context.Context, id uuid.UUID) (User, error)
MarkInvitationAccepted(ctx context.Context, id uuid.UUID) (int64, error)
MarkNotificationFailed(ctx context.Context, arg MarkNotificationFailedParams) error
MarkNotificationSent(ctx context.Context, id uuid.UUID) error
@@ -262,6 +265,8 @@ type Querier interface {
// Delivered and given-up notifications; pending ones are still being worked.
PurgeNotifications(ctx context.Context, createdAt time.Time) (int64, error)
PurgeOrgCheckData(ctx context.Context, org uuid.UUID) error
// Accounts never confirmed; they belong to no organization.
PurgeUnverifiedUsers(ctx context.Context, createdAt time.Time) (int64, error)
// Raw results bucketed by width since a point in time, for short ranges.
RangeBuckets(ctx context.Context, arg RangeBucketsParams) ([]RangeBucketsRow, error)
// The daily aggregate rebucketed by width, for ranges of months.