repos / pico

pico services mono repo
git clone https://github.com/picosh/pico.git

pico / pkg / apps / feeds
Eric Bower  ·  2025-07-04

config.go

 1package feeds
 2
 3import (
 4	"strings"
 5
 6	"github.com/picosh/pico/pkg/shared"
 7	"github.com/picosh/utils"
 8)
 9
10func NewConfigSite(service string) *shared.ConfigSite {
11	debug := utils.GetEnv("FEEDS_DEBUG", "0")
12	domain := utils.GetEnv("FEEDS_DOMAIN", "feeds.pico.sh")
13	port := utils.GetEnv("FEEDS_WEB_PORT", "3000")
14	protocol := utils.GetEnv("FEEDS_PROTOCOL", "https")
15	dbURL := utils.GetEnv("DATABASE_URL", "")
16	sendgridKey := utils.GetEnv("SENDGRID_API_KEY", "")
17	withPipe := strings.ToLower(utils.GetEnv("PICO_PIPE_ENABLED", "true")) == "true"
18
19	return &shared.ConfigSite{
20		Debug:       debug == "1",
21		SendgridKey: sendgridKey,
22		Domain:      domain,
23		Port:        port,
24		Protocol:    protocol,
25		DbURL:       dbURL,
26		Space:       "feeds",
27		AllowedExt:  []string{".txt"},
28		HiddenPosts: []string{"_header.txt", "_readme.txt"},
29		Logger:      shared.CreateLogger(service, withPipe),
30	}
31}