repos / pico

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

pico / pkg / apps / feeds
Eric Bower  ·  2026-01-25

config.go

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