app

package
v0.0.0-...-277766b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = &Config{
	Bind:                  []string{":8169"},
	Debug:                 false,
	MongoDbUri:            "cloud-id-broker-prod-dynamic@mongodb.sea4.crute.me/cloud-id-broker-prod",
	LogFile:               "",
	TrustedIPRanges:       []string{"172.19.0.0/22", "2602:803:4072::/48"},
	Hostnames:             []string{"aws-access.crute.me"},
	DisableBackgroundJobs: false,
	RateLimit:             30 * time.Second,
	RateLimitBurst:        30,
	IssuerEndpoint:        "https://aws-access.crute.me",
	JWTAudience:           "aws-access",
	AuthCookieDuration:    24 * time.Hour,
	GitHubOauthCreds:      "service/aws-access/github-oauth",
	DNSApiKeyVaultPath:    "service/aws-access/dns-api-key",
	AutocertEmail:         "letsencrypt-certs@pomonaconsulting.com",
	AutocertHost:          "https://dns-manage.crute.me/acmev2",
	NetboxHost:            "https://netbox.crute.me",
	NetboxApiKeyVaultPath: "infra/netbox-readonly",
}

Functions

This section is empty.

Types

type AppURL

type AppURL struct{}

AppURL is an interface to building URLs to the application. This exists because the Echo reverse URL functionality requires keeping references to handler functions for the ability to reverse URLs which doesn't work at all for the structure of this application. This interface is effectively named URLs. If Echo supports named URLs in the future this struct can be removed.

func (AppURL) Account

func (u AppURL) Account(c echo.Context, provider string, shortName *string) string

func (AppURL) AccountConsole

func (u AppURL) AccountConsole(c echo.Context, provider, shortName string, redir bool) string

func (AppURL) AccountCredentials

func (u AppURL) AccountCredentials(c echo.Context, provider, shortName string, region string) string

func (AppURL) User

func (u AppURL) User(c echo.Context, username *string) string

type Config

type Config struct {
	Bind                  []string      `flag:"bind" flag-scope:"web" flag-help:"Addresses and ports to bind http server"`
	Debug                 bool          `flag:"debug" flag-help:"Enable debug mode"`
	MongoDbUri            string        `flag:"mongodb-uri" flag-help:"URI for connection to mongodb"`
	LogFile               string        `flag:"log-file" flag-scope:"web" flag-help:"Log file for combined host logs"`
	TrustedIPRanges       []string      `flag:"trusted-ip-ranges" flag-scope:"web" flag-help:"Comma separated list of IP ranges for trusted XFF proxies"`
	Hostnames             []string      `flag:"hostname" flag-scope:"web" flag-help:"Hostname this server serves (can be specified multiple times)"`
	DisableBackgroundJobs bool          `flag:"disable-bg-jobs" flag-help:"Disable background jobs and only serve web pages"`
	RateLimit             time.Duration `flag:"rate-limit" flag-help:"Number seconds between requests for credential resources"`
	RateLimitBurst        int           `flag:"rate-limit-burst" flag-help:"Number of burst requests allowed to credential endpoints"`
	IssuerEndpoint        string        `flag:"issuer-endpoint" flag-help:"Oauth issuer endpoint"`
	JWTAudience           string        `flag:"jwt-audience" flag-help:"Audience for issued JWTs"`
	AuthCookieDuration    time.Duration `flag:"auth-cookie-duration" flag-help:"Expiration duration of the auth cookies"`
	GitHubOauthCreds      string        `flag:"github-oauth-vault-path" flag-help:"Vault material name for GitHub auth credentials"`
	DNSApiKeyVaultPath    string        `flag:"dns-api-vault-path" flag-help:"Vault material for DNS API key"`
	AutocertEmail         string        `flag:"autocert-email" flag-scope:"web" flag-help:"Autocert notification email"`
	AutocertHost          string        `flag:"autocert-host" flag-scope:"web" flag-help:"Autocert service url"`
	NetboxHost            string        `flag:"netbox-host" flag-scope:"web" flag-help:"Netbox service url"`
	NetboxApiKeyVaultPath string        `flag:"netbox-api-vault-path" flag-scope:"web" flag-help:"Vault material path for Netbox API key"`
}

type GitHubOauthCreds

type GitHubOauthCreds struct {
	ClientId     string `mapstructure:"client-id"`
	ClientSecret string `mapstructure:"client-secret"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL