Eric Bower
·
2026-01-25
config.go
1package prose
2
3import (
4 "strings"
5
6 "github.com/picosh/pico/pkg/shared"
7)
8
9var MAX_FILE_SIZE = 3 * shared.MB
10
11func NewConfigSite(service string) *shared.ConfigSite {
12 debug := shared.GetEnv("PROSE_DEBUG", "0")
13 domain := shared.GetEnv("PROSE_DOMAIN", "prose.sh")
14 port := shared.GetEnv("PROSE_WEB_PORT", "3000")
15 protocol := shared.GetEnv("PROSE_PROTOCOL", "https")
16 dbURL := shared.GetEnv("DATABASE_URL", "")
17 maxSize := uint64(25 * shared.MB)
18 maxImgSize := int64(10 * shared.MB)
19 withPipe := strings.ToLower(shared.GetEnv("PICO_PIPE_ENABLED", "true")) == "true"
20
21 return &shared.ConfigSite{
22 Debug: debug == "1",
23 Domain: domain,
24 Port: port,
25 Protocol: protocol,
26 DbURL: dbURL,
27 Space: "prose",
28 AllowedExt: []string{
29 ".md",
30 ".lxt",
31 ".jpg",
32 ".jpeg",
33 ".png",
34 ".gif",
35 ".webp",
36 ".svg",
37 ".ico",
38 },
39 HiddenPosts: []string{"_readme.md", "_styles.css", "_footer.md", "_404.md", "robots.txt"},
40 Logger: shared.CreateLogger(service, withPipe),
41 MaxSize: maxSize,
42 MaxAssetSize: maxImgSize,
43 }
44}