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
2 changes: 1 addition & 1 deletion backend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func main() {

modules := initModules(db, cfg)

adminEmail := env.String("UTMSTACK_ADMIN_EMAIL", "admin@localhost", false)
adminEmail := env.String("UTMSTACK_ADMIN_EMAIL", "admin", false)
created, err := modules.tenant.GetBootstrapUsecase().EnsureDefaultTenant(
appCtx, adminEmail, env.String("UTMSTACK_ADMIN_PASSWORD", "", false))
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/features/onboarding/AdminSetupGate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import { Input } from '@/shared/components/ui/input'
import { IS_FEDERATION } from '@/shared/config/mode'
import { useAuth } from '@/features/auth'

// The seeded admin ships with this placeholder address; treat it (and an empty
// The seeded admin ships with the placeholder "admin"; treat it (and an empty
// email) as "not configured yet".
const DEFAULT_ADMIN_EMAIL = 'admin@localhost'
const DEFAULT_ADMIN_EMAIL = 'admin'

function needsAdminEmail(email: string | undefined): boolean {
const e = (email ?? '').trim().toLowerCase()
Expand All @@ -21,7 +21,7 @@ const EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/

/**
* First-run blocking gate (ported from v11): an admin still on the default email
* (admin@localhost) must set a real address before using the app — password
* ("admin") must set a real address before using the app — password
* reset, notifications, alert emails and threat-intel registration all depend on
* it. The modal can't be dismissed; after saving, the admin is guided to the
* mail-server settings (non-blocking). Instance mode only — the federation
Expand Down
6 changes: 3 additions & 3 deletions installer/services/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ func GetAdminEmail() (string, error) {
containerID := containerIDs[0]

// The instance's administrator: the platform tenant's oldest active admin.
// "admin@localhost" is the placeholder the backend creates when nobody
// supplied an address, so it is not an answer.
// "admin" is the placeholder the backend creates when nobody supplied an
// address, so it is not an answer.
query := `SELECT u.email FROM "user" u ` +
`JOIN user_role ur ON ur.user_id = u.id ` +
`JOIN role r ON r.id = ur.role_id AND r.name = 'ROLE_ADMIN' ` +
`WHERE u.tenant_id = '` + defaultTenantID + `' ` +
`AND u.status = 'active' AND u.email <> 'admin@localhost' ` +
`AND u.status = 'active' AND u.email <> 'admin' ` +
`ORDER BY u.created_at LIMIT 1`
output, err := utils.RunCmdWithOutput("docker", "exec", containerID, "psql", "-U", "postgres", "-d", "utmstack", "-t", "-c", query)
if err != nil {
Expand Down
Loading