config

package
v0.0.0-...-3bed8bd Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SpacedBlocks = [][]string{
	{"homeserver", "software"},
	{"homeserver", "websocket"},
	{"appservice"},
	{"appservice", "database"},
	{"appservice", "id"},
	{"appservice", "ephemeral_events"},
	{"appservice", "as_token"},
	{"analytics"},
	{"imessage"},
	{"bridge"},
	{"bridge", "nac_validation_data_url"},
	{"bridge", "delivery_receipts"},
	{"bridge", "double_puppet_server_map"},
	{"bridge", "encryption"},
	{"bridge", "provisioning"},
	{"bridge", "permissions"},
	{"logging"},
}

Functions

func DoUpgrade

func DoUpgrade(helper *up.Helper)

Types

type AnalyticsConfig

type AnalyticsConfig struct {
	Host   string `yaml:"host" json:"host"`
	Token  string `yaml:"token" json:"token"`
	UserID string `yaml:"user_id" json:"user_id"`
}

type BridgeConfig

type BridgeConfig struct {
	UsernameTemplate    string `yaml:"username_template"`
	DisplaynameTemplate string `yaml:"displayname_template"`

	NACValidationDataURL   string `yaml:"nac_validation_data_url"`
	NACValidationDataToken string `yaml:"nac_validation_data_token"`
	NACValidationIsRelay   bool   `yaml:"nac_validation_is_relay"`

	DoublePuppetConfig bridgeconfig.DoublePuppetConfig `yaml:",inline"`

	PersonalFilteringSpaces  bool   `yaml:"personal_filtering_spaces"`
	DeliveryReceipts         bool   `yaml:"delivery_receipts"`
	MessageStatusEvents      bool   `yaml:"message_status_events"`
	SendErrorNotices         bool   `yaml:"send_error_notices"`
	EnableBridgeNotices      bool   `yaml:"enable_bridge_notices"`
	UnimportantBridgeNotices bool   `yaml:"unimportant_bridge_notices"`
	MaxHandleSeconds         int    `yaml:"max_handle_seconds"`
	ConvertHEIF              bool   `yaml:"convert_heif"`
	ConvertTIFF              bool   `yaml:"convert_tiff"`
	ConvertMOV               bool   `yaml:"convert_mov"`
	CommandPrefix            string `yaml:"command_prefix"`
	FederateRooms            bool   `yaml:"federate_rooms"`
	PrivateChatPortalMeta    string `yaml:"private_chat_portal_meta"`
	MatrixThreads            bool   `yaml:"matrix_threads"`

	Encryption bridgeconfig.EncryptionConfig `yaml:"encryption"`

	Provisioning struct {
		Prefix         string `yaml:"prefix"`
		SharedSecret   string `yaml:"shared_secret"`
		DebugEndpoints bool   `yaml:"debug_endpoints"`
	} `yaml:"provisioning"`

	Permissions bridgeconfig.PermissionConfig `yaml:"permissions"`
	// contains filtered or unexported fields
}

func (BridgeConfig) EnableMessageErrorNotices

func (bc BridgeConfig) EnableMessageErrorNotices() bool

func (BridgeConfig) EnableMessageStatusEvents

func (bc BridgeConfig) EnableMessageStatusEvents() bool

func (BridgeConfig) FormatDisplayname

func (bc BridgeConfig) FormatDisplayname(name string) string

func (BridgeConfig) FormatUsername

func (bc BridgeConfig) FormatUsername(username string) string

func (BridgeConfig) GetCommandPrefix

func (bc BridgeConfig) GetCommandPrefix() string

func (BridgeConfig) GetDoublePuppetConfig

func (bc BridgeConfig) GetDoublePuppetConfig() bridgeconfig.DoublePuppetConfig

func (BridgeConfig) GetEncryptionConfig

func (bc BridgeConfig) GetEncryptionConfig() bridgeconfig.EncryptionConfig

func (BridgeConfig) GetManagementRoomTexts

func (bc BridgeConfig) GetManagementRoomTexts() bridgeconfig.ManagementRoomTexts

func (BridgeConfig) GetResendBridgeInfo

func (bc BridgeConfig) GetResendBridgeInfo() bool

func (*BridgeConfig) UnmarshalYAML

func (bc *BridgeConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

func (BridgeConfig) Validate

func (bc BridgeConfig) Validate() error

type Config

type Config struct {
	*bridgeconfig.BaseConfig `yaml:",inline"`

	Analytics AnalyticsConfig `yaml:"analytics"`
	IMessage  IMessageConfig  `yaml:"imessage"`
	Bridge    BridgeConfig    `yaml:"bridge"`
}

func (*Config) CanAutoDoublePuppet

func (config *Config) CanAutoDoublePuppet(userID id.UserID) bool

type IMessageConfig

type IMessageConfig struct {
	DeviceName          string                  `yaml:"device_name" json:"device_name"`
	LoginTest           IMessageLoginTestConfig `yaml:"login_test"`
	EnablePairECSending bool                    `yaml:"enable_pair_ec_sending" json:"enable_pair_ec_sending"`
	LookupRatelimit     RatelimitConfig         `yaml:"lookup_ratelimit"`
}

type IMessageLoginTestConfig

type IMessageLoginTestConfig struct {
	Identifiers                 []string `yaml:"identifiers" json:"identifiers"`
	LookupTestOnLogin           bool     `yaml:"lookup_test_on_login" json:"lookup_test_on_login"`
	RerouteOnLoginTestFailURL   string   `yaml:"reroute_on_login_test_fail_url" json:"reroute_on_login_test_fail_url"`
	LookupTestAfterLoginSeconds int      `yaml:"lookup_test_after_login_seconds" json:"lookup_test_after_login_seconds"`
}

func (*IMessageLoginTestConfig) GetRandomTestIdentifier

func (c *IMessageLoginTestConfig) GetRandomTestIdentifier() string

type RatelimitConfig

type RatelimitConfig struct {
	Every time.Duration `yaml:"every" json:"every"`
	Burst int           `yaml:"burst" json:"burst"`
}

func (*RatelimitConfig) Compile

func (rc *RatelimitConfig) Compile() *rate.Limiter

type UsernameTemplateArgs

type UsernameTemplateArgs struct {
	UserID id.UserID
}

Jump to

Keyboard shortcuts

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