Documentation
¶
Index ¶
- Constants
- Variables
- func AddDomainForTesting(domain string, config *DomainRepoConfig)
- func CheckDeprecations()
- func PrintDomainInfo()
- func Watch() *fsnotify.Watcher
- type AccessTokenConfig
- type AppserviceConfig
- type AppserviceUserNamespaceConfig
- type ArchivingConfig
- type DatabaseConfig
- type DatastoreConfig
- type DbPoolConfig
- type DomainRepoConfig
- type DownloadsConfig
- type FeatureConfig
- type FederationConfig
- type GeneralConfig
- type HomeserverConfig
- type IdenticonsConfig
- type MainDownloadsConfig
- type MainRepoConfig
- type MainThumbnailsConfig
- type MainUrlPreviewsConfig
- type MetricsConfig
- type MinimumRepoConfig
- type PGOConfig
- type PluginConfig
- type QuarantineConfig
- type QuotaUserConfig
- type QuotasConfig
- type RateLimitBucketsConfig
- type RateLimitConfig
- type RateLimitDownloadBucketConfig
- type RedisConfig
- type RedisShardConfig
- type SentryConfig
- type SharedSecretConfig
- type TasksConfig
- type ThumbnailSize
- type ThumbnailsConfig
- type TimeoutsConfig
- type UploadsConfig
- type UrlPreviewsConfig
Constants ¶
View Source
const DefaultAssetsPath = "./assets"
View Source
const DefaultMigrationsPath = "./migrations"
View Source
const DefaultTemplatesPath = "./templates"
Variables ¶
View Source
var Path = "media-repo.yaml"
View Source
var Runtime = &runtimeConfig{}
Functions ¶
func AddDomainForTesting ¶ added in v1.3.5
func AddDomainForTesting(domain string, config *DomainRepoConfig)
func CheckDeprecations ¶
func CheckDeprecations()
func PrintDomainInfo ¶
func PrintDomainInfo()
Types ¶
type AccessTokenConfig ¶
type AccessTokenConfig struct {
MaxCacheTimeSeconds int `yaml:"maxCacheTimeSeconds"`
UseAppservices bool `yaml:"useLocalAppserviceConfig"`
Appservices []AppserviceConfig `yaml:"appservices,flow"`
}
type AppserviceConfig ¶
type AppserviceConfig struct {
Id string `yaml:"id"`
AppserviceToken string `yaml:"asToken"`
SenderUserId string `yaml:"senderUserId"`
UserNamespaces []AppserviceUserNamespaceConfig `yaml:"userNamespaces,flow"`
}
type AppserviceUserNamespaceConfig ¶
type AppserviceUserNamespaceConfig struct {
Regex string `yaml:"regex"`
}
type ArchivingConfig ¶
type DatabaseConfig ¶
type DatabaseConfig struct {
Postgres string `yaml:"postgres"`
Pool *DbPoolConfig `yaml:"pool"`
}
type DatastoreConfig ¶
type DatastoreConfig struct {
Id string `yaml:"id"`
Type string `yaml:"type"`
MediaKinds []string `yaml:"forKinds,flow"`
Options map[string]string `yaml:"opts,flow"`
}
func UniqueDatastores ¶
func UniqueDatastores() []DatastoreConfig
type DbPoolConfig ¶
type DomainRepoConfig ¶
type DomainRepoConfig struct {
MinimumRepoConfig `yaml:",inline"`
HomeserverConfig `yaml:",inline"`
Downloads DownloadsConfig `yaml:"downloads"`
Thumbnails ThumbnailsConfig `yaml:"thumbnails"`
UrlPreviews UrlPreviewsConfig `yaml:"urlPreviews"`
}
func AllDomains ¶
func AllDomains() []*DomainRepoConfig
func DomainConfigFrom ¶
func DomainConfigFrom(c MainRepoConfig) DomainRepoConfig
func GetDomain ¶
func GetDomain(domain string) *DomainRepoConfig
func NewDefaultDomainConfig ¶
func NewDefaultDomainConfig() DomainRepoConfig
type DownloadsConfig ¶
type FeatureConfig ¶
type FeatureConfig struct {
}
type FederationConfig ¶
type GeneralConfig ¶
type GeneralConfig struct {
BindAddress string `yaml:"bindAddress"`
Port int `yaml:"port"`
LogDirectory string `yaml:"logDirectory"`
LogColors bool `yaml:"logColors"`
JsonLogs bool `yaml:"jsonLogs"`
LogLevel string `yaml:"logLevel"`
TrustAnyForward bool `yaml:"trustAnyForwardedAddress"`
UseForwardedHost bool `yaml:"useForwardedHost"`
FreezeUnauthenticatedMedia bool `yaml:"freezeUnauthenticatedMedia"`
}
type HomeserverConfig ¶
type IdenticonsConfig ¶
type IdenticonsConfig struct {
Enabled bool `yaml:"enabled"`
}
type MainDownloadsConfig ¶
type MainDownloadsConfig struct {
DownloadsConfig `yaml:",inline"`
NumWorkers int `yaml:"numWorkers"`
ExpireDays int `yaml:"expireAfterDays"`
}
type MainRepoConfig ¶
type MainRepoConfig struct {
MinimumRepoConfig `yaml:",inline"`
General GeneralConfig `yaml:"repo"`
Homeservers []HomeserverConfig `yaml:"homeservers,flow"`
Admins []string `yaml:"admins,flow"`
Database DatabaseConfig `yaml:"database"`
Downloads MainDownloadsConfig `yaml:"downloads"`
Thumbnails MainThumbnailsConfig `yaml:"thumbnails"`
UrlPreviews MainUrlPreviewsConfig `yaml:"urlPreviews"`
RateLimit RateLimitConfig `yaml:"rateLimit"`
Metrics MetricsConfig `yaml:"metrics"`
Federation FederationConfig `yaml:"federation"`
Plugins []PluginConfig `yaml:"plugins,flow"`
Sentry SentryConfig `yaml:"sentry"`
Redis RedisConfig `yaml:"redis"`
Tasks TasksConfig `yaml:"tasks"`
PGO PGOConfig `yaml:"pgo"`
}
func Get ¶
func Get() *MainRepoConfig
func NewDefaultMainConfig ¶
func NewDefaultMainConfig() MainRepoConfig
type MainThumbnailsConfig ¶
type MainThumbnailsConfig struct {
ThumbnailsConfig `yaml:",inline"`
NumWorkers int `yaml:"numWorkers"`
ExpireDays int `yaml:"expireAfterDays"`
}
type MainUrlPreviewsConfig ¶
type MainUrlPreviewsConfig struct {
UrlPreviewsConfig `yaml:",inline"`
NumWorkers int `yaml:"numWorkers"`
ExpireDays int `yaml:"expireAfterDays"`
}
type MetricsConfig ¶
type MinimumRepoConfig ¶
type MinimumRepoConfig struct {
DataStores []DatastoreConfig `yaml:"datastores"`
Archiving ArchivingConfig `yaml:"archiving"`
Uploads UploadsConfig `yaml:"uploads"`
Identicons IdenticonsConfig `yaml:"identicons"`
Quarantine QuarantineConfig `yaml:"quarantine"`
TimeoutSeconds TimeoutsConfig `yaml:"timeouts"`
Features FeatureConfig `yaml:"featureSupport"`
AccessTokens AccessTokenConfig `yaml:"accessTokens"`
}
func NewDefaultMinimumRepoConfig ¶
func NewDefaultMinimumRepoConfig() MinimumRepoConfig
type PluginConfig ¶
type QuarantineConfig ¶
type QuotaUserConfig ¶
type QuotasConfig ¶
type QuotasConfig struct {
Enabled bool `yaml:"enabled"`
UserQuotas []QuotaUserConfig `yaml:"users,flow"`
}
type RateLimitBucketsConfig ¶ added in v1.3.5
type RateLimitBucketsConfig struct {
Downloads RateLimitDownloadBucketConfig `yaml:"downloads"`
}
type RateLimitConfig ¶
type RateLimitConfig struct {
RequestsPerSecond float64 `yaml:"requestsPerSecond"`
Enabled bool `yaml:"enabled"`
BurstCount int `yaml:"burst"`
Buckets RateLimitBucketsConfig `yaml:"buckets"`
}
type RateLimitDownloadBucketConfig ¶ added in v1.3.5
type RedisConfig ¶
type RedisConfig struct {
Enabled bool `yaml:"enabled"`
Shards []RedisShardConfig `yaml:"shards,flow"`
DbNum int `default:"0" yaml:"databaseNumber"`
}
type RedisShardConfig ¶
type SentryConfig ¶
type SharedSecretConfig ¶
type SharedSecretConfig struct {
}
type TasksConfig ¶
type TasksConfig struct {
NumWorkers int `yaml:"numWorkers"`
}
type ThumbnailSize ¶
type ThumbnailsConfig ¶
type ThumbnailsConfig struct {
MaxSourceBytes int64 `yaml:"maxSourceBytes"`
MaxPixels int `yaml:"maxPixels"`
Types []string `yaml:"types,flow"`
MaxAnimateSizeBytes int64 `yaml:"maxAnimateSizeBytes"`
Sizes []ThumbnailSize `yaml:"sizes,flow"`
DynamicSizing bool `yaml:"dynamicSizing"`
AllowAnimated bool `yaml:"allowAnimated"`
DefaultAnimated bool `yaml:"defaultAnimated"`
StillFrame float32 `yaml:"stillFrame"`
}
type TimeoutsConfig ¶
type UploadsConfig ¶
type UrlPreviewsConfig ¶
type UrlPreviewsConfig struct {
Enabled bool `yaml:"enabled"`
NumWords int `yaml:"numWords"`
NumTitleWords int `yaml:"numTitleWords"`
MaxLength int `yaml:"maxLength"`
MaxTitleLength int `yaml:"maxTitleLength"`
MaxPageSizeBytes int64 `yaml:"maxPageSizeBytes"`
FilePreviewTypes []string `yaml:"filePreviewTypes,flow"`
DisallowedNetworks []string `yaml:"disallowedNetworks,flow"`
AllowedNetworks []string `yaml:"allowedNetworks,flow"`
UnsafeCertificates bool `yaml:"previewUnsafeCertificates"`
DefaultLanguage string `yaml:"defaultLanguage"`
UserAgent string `yaml:"userAgent"`
OEmbed bool `yaml:"oEmbed"`
}
Click to show internal directories.
Click to hide internal directories.