-
Notifications
You must be signed in to change notification settings - Fork 73
/
conf_domain.go
76 lines (74 loc) · 1.84 KB
/
conf_domain.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package config
type DomainRepoConfig struct {
MinimumRepoConfig `yaml:",inline"`
HomeserverConfig `yaml:",inline"`
Downloads DownloadsConfig `yaml:"downloads"`
Thumbnails ThumbnailsConfig `yaml:"thumbnails"`
UrlPreviews UrlPreviewsConfig `yaml:"urlPreviews"`
}
func NewDefaultDomainConfig() DomainRepoConfig {
return DomainRepoConfig{
MinimumRepoConfig: NewDefaultMinimumRepoConfig(),
HomeserverConfig: HomeserverConfig{
Name: "UNDEFINED",
ClientServerApi: "https://UNDEFINED",
BackoffAt: 10,
AdminApiKind: "matrix",
},
Downloads: DownloadsConfig{
MaxSizeBytes: 104857600, // 100mb
FailureCacheMinutes: 15,
DefaultRangeChunkSizeBytes: 10485760, // 10mb
},
UrlPreviews: UrlPreviewsConfig{
Enabled: true,
NumWords: 50,
NumTitleWords: 30,
MaxLength: 200,
MaxTitleLength: 150,
MaxPageSizeBytes: 10485760, // 10mb
FilePreviewTypes: []string{
"image/*",
},
DisallowedNetworks: []string{
"127.0.0.1/8",
"10.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16",
"100.64.0.0/10",
"169.254.0.0/16",
"::1/128",
"fe80::/64",
"fc00::/7",
},
AllowedNetworks: []string{
"0.0.0.0/0", // "Everything"
},
DefaultLanguage: "en-US,en",
UserAgent: "matrix-media-repo",
OEmbed: false,
},
Thumbnails: ThumbnailsConfig{
MaxSourceBytes: 10485760, // 10mb
MaxAnimateSizeBytes: 10485760, // 10mb
MaxPixels: 32000000, // 32M
AllowAnimated: true,
DefaultAnimated: false,
StillFrame: 0.5,
Sizes: []ThumbnailSize{
{32, 32},
{96, 96},
{320, 240},
{640, 480},
{800, 600},
},
DynamicSizing: false,
Types: []string{
"image/jpeg",
"image/jpg",
"image/png",
"image/gif",
},
},
}
}