aboutsummaryrefslogtreecommitdiff
blob: cc7ec7744b56b6280d60eda16f44fb73292fd4fc (plain)
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
package config

import (
	"os"
	"strings"
)

func MailDirPath() string {
	mailDir := getEnv("ARCHIVES_MAILDIR_PATH", "/var/archives/.maildir/")
	if !strings.HasSuffix(mailDir, "/") {
		mailDir = mailDir + "/"
	}
	return mailDir
}

func Port() string {
	return getEnv("ARCHIVES_PORT", "5000")
}

func PostgresUser() string {
	return getEnv("ARCHIVES_POSTGRES_USER", "admin")
}

func PostgresPass() string {
	return getEnv("ARCHIVES_POSTGRES_PASS", "admin")
}

func PostgresDb() string {
	return getEnv("ARCHIVES_POSTGRES_DB", "garchives")
}

func PostgresHost() string {
	return getEnv("ARCHIVES_POSTGRES_HOST", "localhost")
}

func PostgresPort() string {
	return getEnv("ARCHIVES_POSTGRES_PORT", "5432")
}

func CacheControl() string {
	return getEnv("ARCHIVES_CACHE_CONTROL", "max-age=300")
}

func IndexMailingLists() [][]string {
	return [][]string{
		{"gentoo-dev", "is the main technical development mailing list of Gentoo"},
		{"gentoo-project", "contains non-technical discussion and propositions for the Gentoo Council"},
		{"gentoo-announce", "contains important news for all Gentoo stakeholders"},
		{"gentoo-user", "is our main support and Gentoo-related talk mailing list"},
		{"gentoo-commits", " - Lots of commits"},
		{"gentoo-dev-announce", "conveys important changes to all developers and interested users"}}
}

func AllPublicMailingLists() []string {
	var allMailingLists []string
	allMailingLists = append(allMailingLists, CurrentMailingLists()...)
	allMailingLists = append(allMailingLists, FrozenArchives()...)
	return allMailingLists
}

func CurrentMailingLists() []string {
	return []string{
		"eudev",
		"gentoo-accessibility",
		"gentoo-admin",
		"gentoo-alpha",
		"gentoo-alt",
		"gentoo-amd64",
		"gentoo-announce",
		"gentoo-automated-testing",
		"gentoo-bsd",
		"gentoo-catalyst",
		"gentoo-cluster",
		"gentoo-commits",
		"gentoo-containers",
		"gentoo-desktop",
		"gentoo-dev",
		"gentoo-dev-announce",
		"gentoo-devhelp",
		"gentoo-doc",
		"gentoo-doc-cvs",
		"gentoo-embedded",
		"gentoo-foundation-announce",
		"gentoo-genkernel",
		"gentoo-github-gentoo",
		"gentoo-guis",
		"gentoo-hardened",
		"gentoo-hppa",
		"gentoo-java",
		"gentoo-kernel",
		"gentoo-keys",
		"gentoo-licenses",
		"gentoo-lisp",
		"gentoo-mips",
		"gentoo-mirrors",
		"gentoo-musl",
		"gentoo-nfp",
		"gentoo-openstack",
		"gentoo-perl",
		"gentoo-pms",
		"gentoo-portage-dev",
		"gentoo-powerpc",
		"gentoo-ppc-stable",
		"gentoo-pr",
		"gentoo-project",
		"gentoo-proxy-maint",
		"gentoo-python",
		"gentoo-qa",
		"gentoo-releng",
		"gentoo-releng-autobuilds",
		"gentoo-science",
		"gentoo-scm",
		"gentoo-security",
		"gentoo-server",
		"gentoo-soc",
		"gentoo-sparc",
		"gentoo-systemd",
		"gentoo-translators",
		"gentoo-user",
		"gentoo-user-br",
		"gentoo-user-cs",
		"gentoo-user-de",
		"gentoo-user-el",
		"gentoo-user-es",
		"gentoo-user-fr",
		"gentoo-user-hu",
		"gentoo-user-id",
		"gentoo-user-kr",
		"gentoo-user-pl",
		"gentoo-user-ru",
		"gentoo-user-tr"}
}

func FrozenArchives() []string {
	return []string{
		"gentoo-arm",
		"gentoo-au",
		"gentoo-council",
		"gentoo-cygwin",
		"gentoo-desktop-research",
		"gentoo-dev-lang",
		"gentoo-devrel",
		"gentoo-doc-de",
		"gentoo-doc-el",
		"gentoo-doc-es",
		"gentoo-doc-fi",
		"gentoo-doc-fr",
		"gentoo-doc-hu",
		"gentoo-doc-id",
		"gentoo-doc-lt",
		"gentoo-doc-nl",
		"gentoo-doc-pl",
		"gentoo-doc-ru",
		"gentoo-docs-it",
		"gentoo-extreme-security",
		"gentoo-forum-translations",
		"gentoo-gnustep",
		"gentoo-gwn",
		"gentoo-gwn-de",
		"gentoo-gwn-es",
		"gentoo-gwn-fr",
		"gentoo-gwn-nl",
		"gentoo-gwn-pl",
		"gentoo-ia64",
		"gentoo-installer",
		"gentoo-kbase",
		"gentoo-laptop",
		"gentoo-media",
		"gentoo-nx",
		"gentoo-osx",
		"gentoo-performance",
		"gentoo-ppc-dev",
		"gentoo-ppc-user",
		"gentoo-proctors",
		"gentoo-scire",
		"gentoo-trustees",
		"gentoo-uk",
		"gentoo-vdr",
		"gentoo-web-user",
		"gentoo-xbox",
		"gnap-dev",
		"tenshi-announce",
		"tenshi-user",
		"www-redesign"}
}

func getEnv(key string, fallback string) string {
	if os.Getenv(key) != "" {
		return os.Getenv(key)
	} else {
		return fallback
	}
}