config

package
v0.0.0-...-47656ca Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SpacedBlocks = [][]string{
	{"homeserver", "software"},
	{"appservice"},
	{"appservice", "hostname"},
	{"appservice", "database"},
	{"appservice", "id"},
	{"appservice", "as_token"},
	{"segment_key"},
	{"metrics"},
	{"groupme"},
	{"bridge"},
	{"bridge", "command_prefix"},
	{"bridge", "management_room_text"},
	{"bridge", "encryption"},
	{"bridge", "provisioning"},
	{"bridge", "permissions"},
	{"logging"},
}

Functions

func DoUpgrade

func DoUpgrade(helper *up.Helper)

Types

type BridgeConfig

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

	PersonalFilteringSpaces bool `yaml:"personal_filtering_spaces"`

	DeliveryReceipts    bool `yaml:"delivery_receipts"`
	MessageStatusEvents bool `yaml:"message_status_events"`
	MessageErrorNotices bool `yaml:"message_error_notices"`
	PortalMessageBuffer int  `yaml:"portal_message_buffer"`

	SyncWithCustomPuppets  bool `yaml:"sync_with_custom_puppets"`
	SyncDirectChatList     bool `yaml:"sync_direct_chat_list"`
	SyncManualMarkedUnread bool `yaml:"sync_manual_marked_unread"`
	DefaultBridgeReceipts  bool `yaml:"default_bridge_receipts"`

	HistorySync struct {
		CreatePortals bool `yaml:"create_portals"`
		Backfill      bool `yaml:"backfill"`

		DoublePuppetBackfill    bool `yaml:"double_puppet_backfill"`
		RequestFullSync         bool `yaml:"request_full_sync"`
		MaxInitialConversations int  `yaml:"max_initial_conversations"`
		UnreadHoursThreshold    int  `yaml:"unread_hours_threshold"`

		Immediate struct {
			WorkerCount int `yaml:"worker_count"`
			MaxEvents   int `yaml:"max_events"`
		} `yaml:"immediate"`

		Deferred []DeferredConfig `yaml:"deferred"`
	} `yaml:"history_sync"`

	DoublePuppetServerMap      map[string]string `yaml:"double_puppet_server_map"`
	DoublePuppetAllowDiscovery bool              `yaml:"double_puppet_allow_discovery"`
	LoginSharedSecretMap       map[string]string `yaml:"login_shared_secret_map"`

	ResendBridgeInfo bool `yaml:"resend_bridge_info"`

	PrivateChatPortalMeta bool `yaml:"private_chat_portal_meta"`
	FederateRooms         bool `yaml:"federate_rooms"`
	AllowUserInvite       bool `yaml:"allow_user_invite"`

	MessageHandlingTimeout struct {
		ErrorAfterStr string `yaml:"error_after"`
		DeadlineStr   string `yaml:"deadline"`

		ErrorAfter time.Duration `yaml:"-"`
		Deadline   time.Duration `yaml:"-"`
	} `yaml:"message_handling_timeout"`

	CommandPrefix string `yaml:"command_prefix"`

	ManagementRoomText bridgeconfig.ManagementRoomTexts `yaml:"management_room_text"`

	Encryption bridgeconfig.EncryptionConfig `yaml:"encryption"`

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

	Permissions bridgeconfig.PermissionConfig `yaml:"permissions"`

	ParsedUsernameTemplate *template.Template `yaml:"-"`
	// 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(gmid groupme.ID, member groupme.Member) string

func (BridgeConfig) FormatUsername

func (bc BridgeConfig) FormatUsername(username string) string

func (BridgeConfig) GetCommandPrefix

func (bc BridgeConfig) GetCommandPrefix() string

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"`

	SegmentKey    string `yaml:"segment_key"`
	SegmentUserID string `yaml:"segment_user_id"`

	Metrics struct {
		Enabled bool   `yaml:"enabled"`
		Listen  string `yaml:"listen"`
	} `yaml:"metrics"`

	// TODO need these?
	GroupMe struct {
		OSName            string `yaml:"os_name"`
		BrowserName       string `yaml:"browser_name"`
		ConnectionTimeout int    `yaml:"connection_timeout"`
	} `yaml:"groupme"`

	Bridge BridgeConfig `yaml:"bridge"`
}

func (*Config) CanAutoDoublePuppet

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

func (*Config) CanDoublePuppetBackfill

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

type DeferredConfig

type DeferredConfig struct {
	StartDaysAgo   int `yaml:"start_days_ago"`
	MaxBatchEvents int `yaml:"max_batch_events"`
	BatchDelay     int `yaml:"batch_delay"`
}

type RelaybotConfig

type RelaybotConfig struct {
	Enabled        bool                         `yaml:"enabled"`
	AdminOnly      bool                         `yaml:"admin_only"`
	MessageFormats map[event.MessageType]string `yaml:"message_formats"`
	// contains filtered or unexported fields
}

func (*RelaybotConfig) FormatMessage

func (rc *RelaybotConfig) FormatMessage(content *event.MessageEventContent, sender id.UserID, member event.MemberEventContent) (string, error)

func (*RelaybotConfig) UnmarshalYAML

func (rc *RelaybotConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

type Sender

type Sender struct {
	UserID string
	event.MemberEventContent
}

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