MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / DefaultConfig

Function DefaultConfig

internal/conf/config.go:143–258  ·  view source on GitHub ↗
(dataDir string)

Source from the content-addressed store, hash-verified

141}
142
143func DefaultConfig(dataDir string) *Config {
144 tempDir := filepath.Join(dataDir, "temp")
145 indexDir := filepath.Join(dataDir, "bleve")
146 logPath := filepath.Join(dataDir, "log/log.log")
147 dbPath := filepath.Join(dataDir, "data.db")
148 return &Config{
149 Scheme: Scheme{
150 Address: "0.0.0.0",
151 UnixFile: "",
152 HttpPort: 5244,
153 HttpsPort: -1,
154 ForceHttps: false,
155 CertFile: "",
156 KeyFile: "",
157 },
158 JwtSecret: random.String(16),
159 TokenExpiresIn: 48,
160 TempDir: tempDir,
161 Database: Database{
162 Type: "sqlite3",
163 Port: 0,
164 TablePrefix: "x_",
165 DBFile: dbPath,
166 },
167 Meilisearch: Meilisearch{
168 Host: "http://localhost:7700",
169 Index: "openlist",
170 },
171 BleveDir: indexDir,
172 Log: LogConfig{
173 Enable: true,
174 Name: logPath,
175 MaxSize: 50,
176 MaxBackups: 30,
177 MaxAge: 28,
178 Filter: LogFilterConfig{
179 Enable: false,
180 Filters: []Filter{
181 {Path: "/ping"},
182 {Method: "HEAD"},
183 {Path: "/dav/", Method: "PROPFIND"},
184 },
185 },
186 },
187 AutoMemoryLimit: 4,
188 MaxConnections: 0,
189 MaxConcurrency: 64,
190 TlsInsecureSkipVerify: false,
191 Tasks: TasksConfig{
192 Download: TaskConfig{
193 Workers: 5,
194 MaxRetry: 1,
195 // TaskPersistant: true,
196 },
197 Transfer: TaskConfig{
198 Workers: 5,
199 MaxRetry: 2,
200 // TaskPersistant: true,

Callers 3

initFunction · 0.92
InitConfigFunction · 0.92

Calls 1

StringFunction · 0.92

Tested by 2

initFunction · 0.74