Eric Bower
·
2025-06-20
config.go
1package pastes
2
3import (
4 "github.com/picosh/pico/pkg/shared"
5 "github.com/picosh/utils"
6)
7
8func NewConfigSite(service string) *shared.ConfigSite {
9 debug := utils.GetEnv("PASTES_DEBUG", "0")
10 domain := utils.GetEnv("PASTES_DOMAIN", "pastes.sh")
11 port := utils.GetEnv("PASTES_WEB_PORT", "3000")
12 dbURL := utils.GetEnv("DATABASE_URL", "")
13 protocol := utils.GetEnv("PASTES_PROTOCOL", "https")
14
15 return &shared.ConfigSite{
16 Debug: debug == "1",
17 Domain: domain,
18 Port: port,
19 Protocol: protocol,
20 DbURL: dbURL,
21 Space: "pastes",
22 Logger: shared.CreateLogger(service),
23 MaxAssetSize: int64(3 * utils.MB),
24 }
25}