mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-30 09:27:19 +02:00
core/zero: add support for managed mode from config file (#4756)
This commit is contained in:
parent
eb729a53f8
commit
6810091d38
4 changed files with 68 additions and 9 deletions
|
@ -17,13 +17,13 @@ import (
|
|||
)
|
||||
|
||||
// Run runs the pomerium zero command.
|
||||
func Run(ctx context.Context) error {
|
||||
func Run(ctx context.Context, configFile string) error {
|
||||
err := setupLogger()
|
||||
if err != nil {
|
||||
return fmt.Errorf("error setting up logger: %w", err)
|
||||
}
|
||||
|
||||
token := getToken()
|
||||
token := getToken(configFile)
|
||||
if token == "" {
|
||||
return errors.New("no token provided")
|
||||
}
|
||||
|
@ -37,8 +37,8 @@ func Run(ctx context.Context) error {
|
|||
}
|
||||
|
||||
// IsManagedMode returns true if Pomerium should start in managed mode using this command.
|
||||
func IsManagedMode() bool {
|
||||
return getToken() != ""
|
||||
func IsManagedMode(configFile string) bool {
|
||||
return getToken(configFile) != ""
|
||||
}
|
||||
|
||||
func withInterrupt(ctx context.Context) context.Context {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue