mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:07:31 +00:00
fix: refactor setup (#1152)
* add setup steps * refactoring * omitempty * cleanup * fixes
This commit is contained in:
@@ -3,11 +3,13 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
|
||||
metrics "github.com/caos/zitadel/internal/telemetry/metrics/config"
|
||||
"github.com/caos/zitadel/internal/v2/command"
|
||||
"github.com/caos/zitadel/internal/v2/query"
|
||||
|
||||
"github.com/caos/logging"
|
||||
|
||||
admin_es "github.com/caos/zitadel/internal/admin/repository/eventsourcing"
|
||||
"github.com/caos/zitadel/internal/api"
|
||||
internal_authz "github.com/caos/zitadel/internal/api/authz"
|
||||
@@ -176,8 +178,15 @@ func startSetup(configPaths []string, localDevMode bool) {
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
setup, err := setup.StartSetupV2(conf.Eventstore, conf.SystemDefaults)
|
||||
logging.Log("SERVE-fD252").OnError(err).Panic("failed to start setup")
|
||||
err = setup.ExecuteV2(ctx, conf.SetUp)
|
||||
logging.Log("SERVE-djs3R").OnError(err).Panic("failed to execute setup")
|
||||
es, err := es_int.Start(conf.Eventstore)
|
||||
logging.Log("MAIN-Ddt3").OnError(err).Fatal("cannot start eventstore")
|
||||
|
||||
commands, err := command.StartCommandSide(&command.Config{
|
||||
Eventstore: es.V2(),
|
||||
SystemDefaults: conf.SystemDefaults,
|
||||
})
|
||||
logging.Log("MAIN-dsjrr").OnError(err).Fatal("cannot start command side")
|
||||
|
||||
err = setup.Execute(ctx, conf.SetUp, conf.SystemDefaults.IamID, commands)
|
||||
logging.Log("MAIN-djs3R").OnError(err).Panic("failed to execute setup steps")
|
||||
}
|
||||
|
@@ -26,10 +26,10 @@ SetUp:
|
||||
Step1:
|
||||
GlobalOrg: 'Global'
|
||||
IAMProject: 'Zitadel'
|
||||
# DefaultLoginPolicy:
|
||||
# AllowUsernamePassword: true
|
||||
# AllowRegister: true
|
||||
# AllowExternalIdp: true
|
||||
DefaultLoginPolicy:
|
||||
AllowUsernamePassword: true
|
||||
AllowRegister: true
|
||||
AllowExternalIdp: true
|
||||
# Orgs:
|
||||
# - Name: 'Global'
|
||||
# Domain: 'global.caos.ch'
|
||||
@@ -96,8 +96,8 @@ SetUp:
|
||||
PrimaryColor: '#222324'
|
||||
SecondaryColor: '#ffffff'
|
||||
Step7:
|
||||
DefaultSecondFactor: 1 #SecondFactorTypeOTP
|
||||
OTP: true
|
||||
Step8:
|
||||
DefaultSecondFactor: 2 #SecondFactorTypeU2F
|
||||
U2F: true
|
||||
Step9:
|
||||
Passwordless: true
|
Reference in New Issue
Block a user