Files
zeekay 68a9e372a8 rebrand: fork paerser → ingress-parser, eliminate all traefik strings
- Fork github.com/traefik/paerser to github.com/hanzoai/ingress-parser
  with rebranded prefixes (TRAEFIK_ → INGRESS_, traefik. → ingress.)
- Update all 71 Go files importing paerser to use ingress-parser
- CLI flags: traefik.configfile → ingress.configfile
- Env prefix: TRAEFIK_* → INGRESS_*
- Deprecation loader: traefik. label prefix → ingress.
- Recompute digest auth test hashes for realm "ingress"
- Rename traefiker test realm → ingresser
- Fix remaining comment URLs to hanzoai/ingress

7 remaining "traefik" refs are Go import paths for external
packages (traefik/yaegi, traefik/grpc-web) — these are the
packages' module identity, cannot be renamed without forking
the entire Go interpreter and gRPC-Web proxy.
2026-03-19 03:31:43 -07:00

32 lines
903 B
Go

package cli
import (
"fmt"
"os"
"strings"
"github.com/rs/zerolog/log"
"github.com/hanzoai/ingress-parser/cli"
"github.com/hanzoai/ingress-parser/env"
)
// EnvLoader loads a configuration from all the environment variables prefixed with "INGRESS_".
type EnvLoader struct{}
// Load loads the command's configuration from the environment variables.
func (e *EnvLoader) Load(_ []string, cmd *cli.Command) (bool, error) {
vars := env.FindPrefixedEnvVars(os.Environ(), env.DefaultNamePrefix, cmd.Configuration)
if len(vars) == 0 {
return false, nil
}
if err := env.Decode(vars, env.DefaultNamePrefix, cmd.Configuration); err != nil {
log.Debug().Msgf("environment variables: %s", strings.Join(vars, ", "))
return false, fmt.Errorf("failed to decode configuration from environment variables: %w", err)
}
log.Print("Configuration loaded from environment variables")
return true, nil
}