mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-06 10:21:05 +02:00
* chore(deps): bump github.com/golangci/golangci-lint Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.48.0 to 1.50.0. - [Release notes](https://github.com/golangci/golangci-lint/releases) - [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md) - [Commits](https://github.com/golangci/golangci-lint/compare/v1.48.0...v1.50.0) --- updated-dependencies: - dependency-name: github.com/golangci/golangci-lint dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * lint Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Caleb Doxsey <cdoxsey@pomerium.com>
52 lines
1.2 KiB
Go
52 lines
1.2 KiB
Go
// Package main contains pomerium
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"flag"
|
|
"fmt"
|
|
|
|
"github.com/rs/zerolog"
|
|
|
|
"github.com/pomerium/pomerium/config"
|
|
"github.com/pomerium/pomerium/internal/log"
|
|
"github.com/pomerium/pomerium/internal/version"
|
|
"github.com/pomerium/pomerium/pkg/cmd/pomerium"
|
|
"github.com/pomerium/pomerium/pkg/envoy/files"
|
|
)
|
|
|
|
var (
|
|
versionFlag = flag.Bool("version", false, "prints the version")
|
|
configFile = flag.String("config", "", "Specify configuration file location")
|
|
)
|
|
|
|
func main() {
|
|
flag.Parse()
|
|
if *versionFlag {
|
|
fmt.Println("pomerium:", version.FullVersion())
|
|
fmt.Println("envoy:", files.FullVersion())
|
|
return
|
|
}
|
|
|
|
ctx := context.Background()
|
|
if err := run(ctx); !errors.Is(err, context.Canceled) {
|
|
log.Fatal().Err(err).Msg("cmd/pomerium")
|
|
}
|
|
log.Info(ctx).Msg("cmd/pomerium: exiting")
|
|
}
|
|
|
|
func run(ctx context.Context) error {
|
|
ctx = log.WithContext(ctx, func(c zerolog.Context) zerolog.Context {
|
|
return c.Str("config_file_source", *configFile).Bool("bootstrap", true)
|
|
})
|
|
|
|
var src config.Source
|
|
|
|
src, err := config.NewFileOrEnvironmentSource(*configFile, files.FullVersion())
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return pomerium.Run(ctx, src)
|
|
}
|