config

package
v0.0.0-...-927c03f Latest Latest
Warning

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

Go to latest
Published: May 16, 2025 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BuildInfo   *debug.BuildInfo
	Version     string
	VersionLink string
	UserAgent   = userAgentPrefix
	Hostname    = "no-hostname"
)

Functions

func Load

func Load(ctx context.Context) error

Types

type Config

type Config struct {
	Database         string
	HTTPBind         string `default:":8080"`
	BaseURL          string
	SessionKey       string
	Keycloak         Keycloak
	FreeIPA          FreeIPA `env:"FREEIPA"`
	UserGroups       UserGroups
	SupportContact   string
	Stripe           Stripe
	Matrix           Matrix
	InviteCodeLength int `default:"10"`

	DirectoryImplementation string `default:"freeipa"`
}
var C Config

type FreeIPA

type FreeIPA struct {
	Host      string
	Username  string
	Password  string
	DevMode   bool   // DevMode disables TLS validation and directs requests at 127.0.0.1:8443 (while preserving request hostname)
	DefaultSn string `default:"hacker"` // the default sn (surname) to assign to new users
}

type Keycloak

type Keycloak struct {
	ClientID     string `env:"CLIENT_ID"`
	ClientSecret string
	URL          string `env:"URL"`
	Realm        string
	Scopes       []string
	// contains filtered or unexported fields
}

func (Keycloak) GetConfig

func (o Keycloak) GetConfig(postAuthPath string) *oauth2.Config

func (Keycloak) GetLogoutURL

func (o Keycloak) GetLogoutURL() string

func (*Keycloak) Load

func (o *Keycloak) Load(ctx context.Context) error

func (Keycloak) UserInfo

func (o Keycloak) UserInfo(ctx context.Context, tokenSource oauth2.TokenSource) (*oidc.UserInfo, error)

type Matrix

type Matrix struct {
	BotUser          string
	BotPassword      string // TODO: find a better way to do machine auth
	BotHomeserver    string // TODO: find better names for BotHomeserver/HumanHomeserver to make it clear that BotHomeserver wants a URL (https://) and HumanHomeserver wants the sender part of an MXID
	HumanHomeserver  string
	Rooms            MatrixRooms
	LobbyMaxLurkDays int `default:"7"`
}

func (Matrix) Enabled

func (m Matrix) Enabled() bool

type MatrixRooms

type MatrixRooms struct {
	Lobby        id.RoomID
	Space        id.RoomID
	MembersOnly  []id.RoomID
	DefaultRooms []id.RoomID
}

type Stripe

type Stripe struct {
	Key                  string
	MembershipPriceID    string
	WebhookSigningSecret string
}

type UserGroups

type UserGroups struct {
	Members               string `default:"members"`
	Admins                string `default:"admins"`
	ApprovedForMembership string `default:"approved-for-membership"`
}

make sure to add any new entires here to the allGroups slice of `initializeGroups()` in keycloakx/groups.go

Jump to

Keyboard shortcuts

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