2024-04-07 00:28:29 +07:00
|
|
|
package config
|
|
|
|
|
2024-04-27 17:48:21 +07:00
|
|
|
import (
|
|
|
|
"path"
|
2024-05-21 22:27:11 +07:00
|
|
|
"time"
|
2024-04-27 17:48:21 +07:00
|
|
|
|
|
|
|
"github.com/adrg/xdg"
|
|
|
|
)
|
|
|
|
|
2024-05-11 22:02:04 +07:00
|
|
|
var Version string = "unknown"
|
|
|
|
|
2024-04-07 12:11:25 +07:00
|
|
|
var DefaultConfig = map[string]any{
|
2024-04-09 23:17:23 +07:00
|
|
|
"flags.containerized": false,
|
|
|
|
|
|
|
|
"log.enable": true,
|
|
|
|
"log.source": true,
|
|
|
|
"log.format": "pretty",
|
|
|
|
"log.level": "info",
|
|
|
|
"log.output": "stderr",
|
|
|
|
"log.file.enable": true,
|
|
|
|
"log.file.path": "redmage.log",
|
2024-04-07 00:28:29 +07:00
|
|
|
|
|
|
|
"db.driver": "sqlite3",
|
|
|
|
"db.string": "data.db",
|
|
|
|
"db.automigrate": true,
|
2024-04-07 12:11:25 +07:00
|
|
|
|
2024-05-22 19:18:26 +07:00
|
|
|
"pubsub.db.name": "pubsub.db",
|
|
|
|
"pubsub.db.timeout": "5s",
|
|
|
|
"pubsub.ack.deadline": "30m",
|
2024-04-27 15:16:14 +07:00
|
|
|
|
2024-04-14 00:32:55 +07:00
|
|
|
"download.concurrency.images": 5,
|
|
|
|
"download.concurrency.subreddits": 3,
|
2024-04-26 22:13:04 +07:00
|
|
|
|
2024-04-27 17:48:21 +07:00
|
|
|
"download.directory": path.Join(xdg.UserDirs.Pictures, "redmage"),
|
2024-04-26 22:13:04 +07:00
|
|
|
"download.timeout.headers": "10s",
|
|
|
|
"download.timeout.idle": "5s",
|
|
|
|
"download.timeout.idlespeed": "10KB",
|
|
|
|
"download.useragent": "redmage",
|
2024-04-09 23:17:23 +07:00
|
|
|
|
2024-04-07 16:06:33 +07:00
|
|
|
"http.port": "8080",
|
|
|
|
"http.host": "0.0.0.0",
|
|
|
|
"http.shutdown_timeout": "5s",
|
2024-04-08 21:50:52 +07:00
|
|
|
"http.hotreload": false,
|
2024-04-12 22:47:22 +07:00
|
|
|
|
|
|
|
"telemetry.openobserve.enable": false,
|
|
|
|
"telemetry.openobserve.log.enable": true,
|
|
|
|
"telemetry.openobserve.log.level": "info",
|
|
|
|
"telemetry.openobserve.log.source": true,
|
|
|
|
"telemetry.openobserve.log.endpoint": "http://localhost:5080/api/default/default/_json",
|
|
|
|
"telemetry.openobserve.log.concurrency": 4,
|
|
|
|
"telemetry.openobserve.log.buffer.size": 2 * 1024, // 2kb
|
2024-04-14 17:30:04 +07:00
|
|
|
"telemetry.openobserve.log.buffer.timeout": "2s",
|
2024-04-12 22:47:22 +07:00
|
|
|
"telemetry.openobserve.log.username": "root@example.com",
|
|
|
|
"telemetry.openobserve.log.password": "Complexpass#123",
|
2024-04-13 00:15:31 +07:00
|
|
|
|
|
|
|
"telemetry.openobserve.trace.enable": true,
|
|
|
|
"telemetry.openobserve.trace.url": "http://localhost:5080/api/default/v1/traces",
|
|
|
|
"telemetry.openobserve.trace.auth": "Basic AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
|
|
|
|
|
|
|
"telemetry.trace.ratio": 1,
|
|
|
|
|
2024-05-07 20:51:00 +07:00
|
|
|
"web.dependencies.htmx.version": "1.9.12",
|
|
|
|
"web.dependencies.dayjs.version": "1.11.10",
|
|
|
|
"web.dependencies.alpinejs.version": "3.13.10",
|
2024-05-01 15:51:52 +07:00
|
|
|
|
2024-05-11 22:02:04 +07:00
|
|
|
"runtime.version": Version,
|
2024-04-13 00:15:31 +07:00
|
|
|
"runtime.environment": "development",
|
2024-05-21 22:27:11 +07:00
|
|
|
|
|
|
|
"scheduler.timeout": time.Second * 10,
|
2024-04-07 00:28:29 +07:00
|
|
|
}
|