Documentation
¶
Index ¶
- Variables
- func CopyMapToOtherLocation(helper up.Helper, source, dest []string)
- func CopyToOtherLocation(helper up.Helper, fieldType up.YAMLType, source, dest []string)
- type AnalyticsConfig
- type AppserviceConfig
- type BackfillConfig
- type BackfillQueueConfig
- type BackfillThreadsConfig
- type BotUserConfig
- type BridgeConfig
- type CleanupAction
- type CleanupOnLogout
- type CleanupOnLogouts
- type Config
- type DirectMediaConfig
- type DoublePuppetConfig
- type EncryptionConfig
- type HomeserverConfig
- type HomeserverSoftware
- type ManagementRoomTexts
- type MatrixConfig
- type PermissionConfig
- type Permissions
- type PortalCreateFilter
- type PortalCreateFilterItem
- type PortalCreateFilterMode
- type ProvisioningConfig
- type PublicMediaConfig
- type RelayConfig
- func (rc *RelayConfig) FormatMessage(content *event.MessageEventContent, sender any) (*event.MessageEventContent, error)
- func (rc *RelayConfig) FormatName(sender any) string
- func (rc *RelayConfig) GetUserDistinguisher(userID id.UserID) string
- func (rc *RelayConfig) UnmarshalYAML(node *yaml.Node) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PermissionLevelBlock = Permissions{} PermissionLevelRelay = Permissions{SendEvents: true} PermissionLevelCommands = Permissions{SendEvents: true, Commands: true, ManageRelay: true} PermissionLevelUser = Permissions{SendEvents: true, Commands: true, ManageRelay: true, Login: true, DoublePuppet: true} PermissionLevelAdmin = Permissions{SendEvents: true, Commands: true, ManageRelay: true, Login: true, DoublePuppet: true, Admin: true} )
View Source
var AllowedHomeserverSoftware = map[HomeserverSoftware]bool{ SoftwareStandard: true, SoftwareAsmux: true, SoftwareHungry: true, }
View Source
var HackyMigrateLegacyNetworkConfig func(up.Helper)
View Source
var SpacedBlocks = [][]string{
{"bridge"},
{"bridge", "bridge_matrix_leave"},
{"bridge", "cleanup_on_logout"},
{"bridge", "relay"},
{"bridge", "portal_create_filter"},
{"bridge", "permissions"},
{"database"},
{"homeserver"},
{"homeserver", "software"},
{"homeserver", "websocket"},
{"appservice"},
{"appservice", "hostname"},
{"appservice", "id"},
{"appservice", "ephemeral_events"},
{"appservice", "as_token"},
{"appservice", "username_template"},
{"matrix"},
{"analytics"},
{"provisioning"},
{"public_media"},
{"direct_media"},
{"backfill"},
{"double_puppet"},
{"encryption"},
{"env_config_prefix"},
{"logging"},
}
View Source
var Upgrader up.SpacedUpgrader = &up.StructUpgrader{ SimpleUpgrader: up.SimpleUpgrader(doUpgrade), Blocks: SpacedBlocks, }
Upgrader is a config upgrader that copies the default fields in the homeserver, appservice and logging blocks.
Functions ¶
func CopyMapToOtherLocation ¶
Types ¶
type AnalyticsConfig ¶ added in v0.21.0
type AppserviceConfig ¶
type AppserviceConfig struct {
Address string `yaml:"address"`
PublicAddress string `yaml:"public_address"`
Hostname string `yaml:"hostname"`
Port uint16 `yaml:"port"`
NoServer bool `yaml:"-"`
ID string `yaml:"id"`
Bot BotUserConfig `yaml:"bot"`
ASToken string `yaml:"as_token"`
HSToken string `yaml:"hs_token"`
EphemeralEvents bool `yaml:"ephemeral_events"`
AsyncTransactions bool `yaml:"async_transactions"`
UsernameTemplate string `yaml:"username_template"`
// contains filtered or unexported fields
}
func (*AppserviceConfig) FormatUsername ¶
func (asc *AppserviceConfig) FormatUsername(username string) string
func (*AppserviceConfig) GetRegistration ¶
func (asc *AppserviceConfig) GetRegistration() *appservice.Registration
GetRegistration copies the data from the bridge config into an *appservice.Registration struct. This can't be used with the homeserver, see GenerateRegistration for generating files for the homeserver.
type BackfillConfig ¶ added in v0.20.0
type BackfillConfig struct {
Enabled bool `yaml:"enabled"`
MaxInitialMessages int `yaml:"max_initial_messages"`
MaxCatchupMessages int `yaml:"max_catchup_messages"`
UnreadHoursThreshold int `yaml:"unread_hours_threshold"`
Threads BackfillThreadsConfig `yaml:"threads"`
Queue BackfillQueueConfig `yaml:"queue"`
}
type BackfillQueueConfig ¶ added in v0.20.0
type BackfillQueueConfig struct {
Enabled bool `yaml:"enabled"`
Manual bool `yaml:"manual"`
BatchSize int `yaml:"batch_size"`
BatchDelay int `yaml:"batch_delay"`
MaxBatches int `yaml:"max_batches"`
MaxBatchesOverride map[string]int `yaml:"max_batches_override"`
}
func (*BackfillQueueConfig) AnyEnabled ¶ added in v0.27.0
func (bcq *BackfillQueueConfig) AnyEnabled() bool
func (*BackfillQueueConfig) GetOverride ¶ added in v0.20.0
func (bqc *BackfillQueueConfig) GetOverride(names ...string) int
type BackfillThreadsConfig ¶ added in v0.20.0
type BackfillThreadsConfig struct {
MaxInitialMessages int `yaml:"max_initial_messages"`
}
type BotUserConfig ¶
type BotUserConfig struct {
Username string `yaml:"username"`
Displayname string `yaml:"displayname"`
Avatar string `yaml:"avatar"`
ParsedAvatar id.ContentURI `yaml:"-"`
}
func (*BotUserConfig) UnmarshalYAML ¶
func (buc *BotUserConfig) UnmarshalYAML(node *yaml.Node) error
type BridgeConfig ¶
type BridgeConfig struct {
CommandPrefix string `yaml:"command_prefix"`
PersonalFilteringSpaces bool `yaml:"personal_filtering_spaces"`
PrivateChatPortalMeta bool `yaml:"private_chat_portal_meta"`
AsyncEvents bool `yaml:"async_events"`
SplitPortals bool `yaml:"split_portals"`
ResendBridgeInfo bool `yaml:"resend_bridge_info"`
NoBridgeInfoStateKey bool `yaml:"no_bridge_info_state_key"`
BridgeStatusNotices string `yaml:"bridge_status_notices"`
TransientStateDebounce time.Duration `yaml:"transient_state_debounce"`
SendReconnectWait time.Duration `yaml:"send_reconnect_wait"`
UnknownErrorAutoReconnect time.Duration `yaml:"unknown_error_auto_reconnect"`
UnknownErrorMaxAutoReconnects int `yaml:"unknown_error_max_auto_reconnects"`
BridgeMatrixLeave bool `yaml:"bridge_matrix_leave"`
BridgeNotices bool `yaml:"bridge_notices"`
TagOnlyOnCreate bool `yaml:"tag_only_on_create"`
OnlyBridgeTags []event.RoomTag `yaml:"only_bridge_tags"`
MuteOnlyOnCreate bool `yaml:"mute_only_on_create"`
DeduplicateMatrixMessages bool `yaml:"deduplicate_matrix_messages"`
PortalEventBuffer int `yaml:"portal_event_buffer"`
CrossRoomReplies bool `yaml:"cross_room_replies"`
OutgoingMessageReID bool `yaml:"outgoing_message_re_id"`
RevertFailedStateChanges bool `yaml:"revert_failed_state_changes"`
KickMatrixUsers bool `yaml:"kick_matrix_users"`
EnableSendStateRequests bool `yaml:"enable_send_state_requests"`
PhoneNumbersInProfile bool `yaml:"phone_numbers_in_profile"`
CleanupOnLogout CleanupOnLogouts `yaml:"cleanup_on_logout"`
Relay RelayConfig `yaml:"relay"`
PortalCreateFilter PortalCreateFilter `yaml:"portal_create_filter"`
Permissions PermissionConfig `yaml:"permissions"`
Backfill BackfillConfig `yaml:"backfill"`
}
type CleanupAction ¶ added in v0.20.0
type CleanupAction string
const ( CleanupActionNull CleanupAction = "" CleanupActionNothing CleanupAction = "nothing" CleanupActionKick CleanupAction = "kick" CleanupActionUnbridge CleanupAction = "unbridge" CleanupActionDelete CleanupAction = "delete" )
type CleanupOnLogout ¶ added in v0.20.0
type CleanupOnLogout struct {
Private CleanupAction `yaml:"private"`
Relayed CleanupAction `yaml:"relayed"`
}
type CleanupOnLogouts ¶ added in v0.20.0
type CleanupOnLogouts struct {
Enabled bool `yaml:"enabled"`
Manual CleanupOnLogout `yaml:"manual"`
BadCredentials CleanupOnLogout `yaml:"bad_credentials"`
}
type Config ¶
type Config struct {
Network yaml.Node `yaml:"network"`
Bridge BridgeConfig `yaml:"bridge"`
Database dbutil.Config `yaml:"database"`
Homeserver HomeserverConfig `yaml:"homeserver"`
AppService AppserviceConfig `yaml:"appservice"`
Matrix MatrixConfig `yaml:"matrix"`
Analytics AnalyticsConfig `yaml:"analytics"`
Provisioning ProvisioningConfig `yaml:"provisioning"`
PublicMedia PublicMediaConfig `yaml:"public_media"`
DirectMedia DirectMediaConfig `yaml:"direct_media"`
Backfill BackfillConfig `yaml:"backfill"`
DoublePuppet DoublePuppetConfig `yaml:"double_puppet"`
Encryption EncryptionConfig `yaml:"encryption"`
Logging zeroconfig.Config `yaml:"logging"`
EnvConfigPrefix string `yaml:"env_config_prefix"`
ManagementRoomTexts ManagementRoomTexts `yaml:"management_room_texts"`
}
func (*Config) GenerateRegistration ¶
func (config *Config) GenerateRegistration() *appservice.Registration
GenerateRegistration generates a registration file for the homeserver.
func (*Config) MakeAppService ¶
func (config *Config) MakeAppService() *appservice.AppService
type DirectMediaConfig ¶
type DirectMediaConfig struct {
Enabled bool `yaml:"enabled"`
MediaIDPrefix string `yaml:"media_id_prefix"`
mediaproxy.BasicConfig `yaml:",inline"`
}
type DoublePuppetConfig ¶
type EncryptionConfig ¶
type EncryptionConfig struct {
Allow bool `yaml:"allow"`
Default bool `yaml:"default"`
Require bool `yaml:"require"`
Appservice bool `yaml:"appservice"`
MSC4190 bool `yaml:"msc4190"`
MSC4392 bool `yaml:"msc4392"`
SelfSign bool `yaml:"self_sign"`
PlaintextMentions bool `yaml:"plaintext_mentions"`
PickleKey string `yaml:"pickle_key"`
DeleteKeys struct {
DeleteOutboundOnAck bool `yaml:"delete_outbound_on_ack"`
DontStoreOutbound bool `yaml:"dont_store_outbound"`
RatchetOnDecrypt bool `yaml:"ratchet_on_decrypt"`
DeleteFullyUsedOnDecrypt bool `yaml:"delete_fully_used_on_decrypt"`
DeletePrevOnNewSession bool `yaml:"delete_prev_on_new_session"`
DeleteOnDeviceDelete bool `yaml:"delete_on_device_delete"`
PeriodicallyDeleteExpired bool `yaml:"periodically_delete_expired"`
DeleteOutdatedInbound bool `yaml:"delete_outdated_inbound"`
} `yaml:"delete_keys"`
VerificationLevels struct {
Receive id.TrustState `yaml:"receive"`
Send id.TrustState `yaml:"send"`
Share id.TrustState `yaml:"share"`
} `yaml:"verification_levels"`
AllowKeySharing bool `yaml:"allow_key_sharing"`
Rotation struct {
EnableCustom bool `yaml:"enable_custom"`
Milliseconds int64 `yaml:"milliseconds"`
Messages int `yaml:"messages"`
DisableDeviceChangeKeyRotation bool `yaml:"disable_device_change_key_rotation"`
} `yaml:"rotation"`
}
type HomeserverConfig ¶
type HomeserverConfig struct {
Address string `yaml:"address"`
Domain string `yaml:"domain"`
AsyncMedia bool `yaml:"async_media"`
PublicAddress string `yaml:"public_address,omitempty"`
Software HomeserverSoftware `yaml:"software"`
StatusEndpoint string `yaml:"status_endpoint"`
MessageSendCheckpointEndpoint string `yaml:"message_send_checkpoint_endpoint"`
Websocket bool `yaml:"websocket"`
WSProxy string `yaml:"websocket_proxy"`
WSPingInterval int `yaml:"ping_interval_seconds"`
RetryLimit int `yaml:"retry_limit"`
}
type HomeserverSoftware ¶
type HomeserverSoftware string
const ( SoftwareStandard HomeserverSoftware = "standard" SoftwareAsmux HomeserverSoftware = "asmux" SoftwareHungry HomeserverSoftware = "hungry" )
type ManagementRoomTexts ¶
type MatrixConfig ¶
type MatrixConfig struct {
MessageStatusEvents bool `yaml:"message_status_events"`
DeliveryReceipts bool `yaml:"delivery_receipts"`
MessageErrorNotices bool `yaml:"message_error_notices"`
SyncDirectChatList bool `yaml:"sync_direct_chat_list"`
FederateRooms bool `yaml:"federate_rooms"`
UploadFileThreshold int64 `yaml:"upload_file_threshold"`
GhostExtraProfileInfo bool `yaml:"ghost_extra_profile_info"`
}
type PermissionConfig ¶
type PermissionConfig map[string]*Permissions
func (PermissionConfig) Get ¶
func (pc PermissionConfig) Get(userID id.UserID) Permissions
func (PermissionConfig) IsConfigured ¶
func (pc PermissionConfig) IsConfigured() bool
type Permissions ¶
type Permissions struct {
SendEvents bool `yaml:"send_events"`
Commands bool `yaml:"commands"`
Login bool `yaml:"login"`
DoublePuppet bool `yaml:"double_puppet"`
Admin bool `yaml:"admin"`
ManageRelay bool `yaml:"manage_relay"`
MaxLogins int `yaml:"max_logins"`
}
func (*Permissions) MarshalYAML ¶
func (p *Permissions) MarshalYAML() (any, error)
func (*Permissions) UnmarshalYAML ¶
func (p *Permissions) UnmarshalYAML(perm *yaml.Node) error
type PortalCreateFilter ¶ added in v0.27.0
type PortalCreateFilter struct {
Mode PortalCreateFilterMode `yaml:"mode"`
List []*PortalCreateFilterItem `yaml:"list"`
AlwaysDenyFromLogin []networkid.UserLoginID `yaml:"always_deny_from_login"`
}
func (*PortalCreateFilter) ShouldAllow ¶ added in v0.27.0
func (pcf *PortalCreateFilter) ShouldAllow(source networkid.UserLoginID, key networkid.PortalKey) bool
type PortalCreateFilterItem ¶ added in v0.27.0
type PortalCreateFilterItem struct {
ID networkid.PortalID `yaml:"id"`
Receiver *networkid.UserLoginID `yaml:"receiver"`
}
func (*PortalCreateFilterItem) Equals ¶ added in v0.27.0
func (pcfi *PortalCreateFilterItem) Equals(other *PortalCreateFilterItem) bool
func (*PortalCreateFilterItem) Matches ¶ added in v0.27.0
func (pcfi *PortalCreateFilterItem) Matches(key networkid.PortalKey) bool
func (*PortalCreateFilterItem) UnmarshalYAML ¶ added in v0.27.0
func (pcfi *PortalCreateFilterItem) UnmarshalYAML(node *yaml.Node) error
type PortalCreateFilterMode ¶ added in v0.27.0
type PortalCreateFilterMode string
const ( PortalCreateFilterModeAllow PortalCreateFilterMode = "allow" PortalCreateFilterModeDeny PortalCreateFilterMode = "deny" )
type ProvisioningConfig ¶
type ProvisioningConfig struct {
AllowMatrixAuth bool `yaml:"allow_matrix_auth"`
DebugEndpoints bool `yaml:"debug_endpoints"`
EnableSessionTransfers bool `yaml:"enable_session_transfers"`
FailOnWebAuthn bool `yaml:"fail_on_webauthn"`
RequestIDHeader string `yaml:"request_id_header"`
TrustIncomingRequestID bool `yaml:"trust_incoming_request_id"`
}
type PublicMediaConfig ¶ added in v0.20.0
type RelayConfig ¶
type RelayConfig struct {
Enabled bool `yaml:"enabled"`
AdminOnly bool `yaml:"admin_only"`
PreferDefault bool `yaml:"prefer_default"`
AllowBridge bool `yaml:"allow_bridge"`
DefaultRelays []networkid.UserLoginID `yaml:"default_relays"`
UserDistinguishers []string `yaml:"user_distinguishers"`
MessageFormats map[event.MessageType]string `yaml:"message_formats"`
DisplaynameFormat string `yaml:"displayname_format"`
// contains filtered or unexported fields
}
func (*RelayConfig) FormatMessage ¶
func (rc *RelayConfig) FormatMessage(content *event.MessageEventContent, sender any) (*event.MessageEventContent, error)
func (*RelayConfig) FormatName ¶ added in v0.20.0
func (rc *RelayConfig) FormatName(sender any) string
func (*RelayConfig) GetUserDistinguisher ¶ added in v0.30.0
func (rc *RelayConfig) GetUserDistinguisher(userID id.UserID) string
func (*RelayConfig) UnmarshalYAML ¶
func (rc *RelayConfig) UnmarshalYAML(node *yaml.Node) error
Click to show internal directories.
Click to hide internal directories.