consoleweb

package
v1.58.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: AGPL-3.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const ContentLengthLimit = 4 * memory.KB

ContentLengthLimit describes 4KB limit.

Variables

View Source
var (
	// Error is satellite console error type.
	Error = errs.Class("consoleweb")
)

Functions

func NewUserIDRateLimiter added in v1.39.4

func NewUserIDRateLimiter(config web.RateLimiterConfig) *web.RateLimiter

NewUserIDRateLimiter constructs a RateLimiter that limits based on user ID.

Types

type Config

type Config struct {
	Address         string `help:"server address of the graphql api gateway and frontend app" devDefault:"127.0.0.1:0" releaseDefault:":10100"`
	StaticDir       string `help:"path to static resources" default:""`
	Watch           bool   `help:"whether to load templates on each request" default:"false" devDefault:"true"`
	ExternalAddress string `help:"external endpoint of the satellite if hosted" default:""`

	// TODO: remove after Vanguard release
	AuthToken       string `help:"auth token needed for access to registration token creation endpoint" default:"" testDefault:"very-secret-token"`
	AuthTokenSecret string `help:"secret used to sign auth tokens" releaseDefault:"" devDefault:"my-suppa-secret-key"`

	ContactInfoURL                  string  `help:"url link to contacts page" default:"https://forum.storj.io"`
	FrameAncestors                  string  `help:"allow domains to embed the satellite in a frame, space separated" default:"tardigrade.io storj.io"`
	LetUsKnowURL                    string  `help:"url link to let us know page" default:"https://storjlabs.atlassian.net/servicedesk/customer/portals"`
	SEO                             string  `help:"used to communicate with web crawlers and other web robots" default:"User-agent: *\nDisallow: \nDisallow: /cgi-bin/"`
	SatelliteName                   string  `help:"used to display at web satellite console" default:"Storj"`
	SatelliteOperator               string  `help:"name of organization which set up satellite" default:"Storj Labs" `
	TermsAndConditionsURL           string  `help:"url link to terms and conditions page" default:"https://storj.io/storage-sla/"`
	AccountActivationRedirectURL    string  `help:"url link for account activation redirect" default:""`
	PartneredSatellites             SatList `` /* 187-byte string literal not displayed */
	GeneralRequestURL               string  `` /* 127-byte string literal not displayed */
	ProjectLimitsIncreaseRequestURL string  `` /* 142-byte string literal not displayed */
	GatewayCredentialsRequestURL    string  `help:"url link for gateway credentials requests" default:"https://auth.storjshare.io" devDefault:""`
	IsBetaSatellite                 bool    `help:"indicates if satellite is in beta" default:"false"`
	BetaSatelliteFeedbackURL        string  `help:"url link for for beta satellite feedback" default:""`
	BetaSatelliteSupportURL         string  `help:"url link for for beta satellite support" default:""`
	DocumentationURL                string  `help:"url link to documentation" default:"https://docs.storj.io/"`
	CouponCodeBillingUIEnabled      bool    `help:"indicates if user is allowed to add coupon codes to account from billing" default:"false"`
	CouponCodeSignupUIEnabled       bool    `help:"indicates if user is allowed to add coupon codes to account from signup" default:"false"`
	FileBrowserFlowDisabled         bool    `help:"indicates if file browser flow is disabled" default:"false"`
	CSPEnabled                      bool    `help:"indicates if Content Security Policy is enabled" devDefault:"false" releaseDefault:"true"`
	LinksharingURL                  string  `help:"url link for linksharing requests" default:"https://link.storjshare.io" devDefault:""`
	PathwayOverviewEnabled          bool    `help:"indicates if the overview onboarding step should render with pathways" default:"true"`
	NewProjectDashboard             bool    `help:"indicates if new project dashboard should be used" default:"false"`
	NewObjectsFlow                  bool    `help:"indicates if new objects flow should be used" default:"true"`
	NewAccessGrantFlow              bool    `help:"indicates if new access grant flow should be used" default:"true"`
	NewBillingScreen                bool    `help:"indicates if new billing screens should be used" default:"false"`
	GeneratedAPIEnabled             bool    `help:"indicates if generated console api should be used" default:"false"`
	InactivityTimerEnabled          bool    `help:"indicates if session can be timed out due inactivity" default:"false"`
	InactivityTimerDelay            int     `help:"inactivity timer delay in seconds" default:"600"`
	OptionalSignupSuccessURL        string  `help:"optional url to external registration success page" default:""`
	HomepageURL                     string  `help:"url link to storj.io homepage" default:"https://www.storj.io"`

	OauthCodeExpiry         time.Duration `help:"how long oauth authorization codes are issued for" default:"10m"`
	OauthAccessTokenExpiry  time.Duration `help:"how long oauth access tokens are issued for" default:"24h"`
	OauthRefreshTokenExpiry time.Duration `help:"how long oauth refresh tokens are issued for" default:"720h"`

	// RateLimit defines the configuration for the IP and userID rate limiters.
	RateLimit web.RateLimiterConfig

	console.Config
}

Config contains configuration for console web server.

type SatList added in v1.29.1

type SatList string

SatList is a configuration value that contains a list of satellite names and addresses. Format should be [[name,address],[name,address],...] in valid JSON format.

Can be used as a flag.

func (*SatList) Set added in v1.29.1

func (sl *SatList) Set(s string) error

Set does validation on the configured JSON, but does not actually transform it - it will be passed to the client as-is.

func (*SatList) String added in v1.29.1

func (sl *SatList) String() string

String is required for pflag.Value.

func (SatList) Type added in v1.29.1

func (SatList) Type() string

Type implements pflag.Value.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server represents console web server.

architecture: Endpoint

func NewServer

func NewServer(logger *zap.Logger, config Config, service *console.Service, oidcService *oidc.Service, mailService *mailservice.Service, partners *rewards.PartnersService, analytics *analytics.Service, listener net.Listener, stripePublicKey string, pricing paymentsconfig.PricingValues, nodeURL storj.NodeURL) *Server

NewServer creates new instance of console server.

func (*Server) Close

func (server *Server) Close() error

Close closes server and underlying listener.

func (*Server) Run

func (server *Server) Run(ctx context.Context) (err error)

Run starts the server that host webapp and api endpoint.

Directories

Path Synopsis
gen

Jump to

Keyboard shortcuts

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