Skip to content

Commit 936df10

Browse files
Backlog/v12 instance setup (#2505)
* fix[backend](startup): setted up admin as default user email * fix[frontend](startup): switched the default admin email by 'admin' * fix[installer](startup): switched default credentials to admin:admin
1 parent 0cf18c1 commit 936df10

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

backend/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func main() {
3838

3939
modules := initModules(db, cfg)
4040

41-
adminEmail := env.String("UTMSTACK_ADMIN_EMAIL", "admin@localhost", false)
41+
adminEmail := env.String("UTMSTACK_ADMIN_EMAIL", "admin", false)
4242
created, err := modules.tenant.GetBootstrapUsecase().EnsureDefaultTenant(
4343
appCtx, adminEmail, env.String("UTMSTACK_ADMIN_PASSWORD", "", false))
4444
if err != nil {

frontend/src/features/onboarding/AdminSetupGate.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import { Input } from '@/shared/components/ui/input'
88
import { IS_FEDERATION } from '@/shared/config/mode'
99
import { useAuth } from '@/features/auth'
1010

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

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

2222
/**
2323
* First-run blocking gate (ported from v11): an admin still on the default email
24-
* (admin@localhost) must set a real address before using the app — password
24+
* ("admin") must set a real address before using the app — password
2525
* reset, notifications, alert emails and threat-intel registration all depend on
2626
* it. The modal can't be dismissed; after saving, the admin is guided to the
2727
* mail-server settings (non-blocking). Instance mode only — the federation

installer/services/postgres.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ func GetAdminEmail() (string, error) {
6969
containerID := containerIDs[0]
7070

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

0 commit comments

Comments
 (0)