forked from jlelse/GoBlog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.go
99 lines (96 loc) · 2.24 KB
/
app.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
package main
import (
"crypto/rsa"
"net/http"
"sync"
shutdowner "git.jlel.se/jlelse/go-shutdowner"
ts "git.jlel.se/jlelse/template-strings"
"github.com/dgraph-io/ristretto"
ct "github.com/elnormous/contenttype"
"github.com/go-fed/httpsig"
"github.com/hacdias/indieauth/v2"
rotatelogs "github.com/lestrrat-go/file-rotatelogs"
"github.com/yuin/goldmark"
"go.goblog.app/app/pkgs/minify"
"go.goblog.app/app/pkgs/plugins"
"golang.org/x/crypto/acme/autocert"
"golang.org/x/sync/singleflight"
"tailscale.com/tsnet"
)
type goBlog struct {
// ActivityPub
apPrivateKey *rsa.PrivateKey
apPubKeyBytes []byte
apPostSigner httpsig.Signer
apPostSignMutex sync.Mutex
webfingerResources map[string]*configBlog
webfingerAccts map[string]string
// ActivityStreams
asCheckMediaTypes []ct.MediaType
// Assets
assetFileNames map[string]string
assetFiles map[string]*assetFile
// Autocert
autocertManager *autocert.Manager
autocertInit sync.Once
// Blogroll
blogrollCacheGroup singleflight.Group
// Blogstats
blogStatsCacheGroup singleflight.Group
// Cache
cache *cache
// Config
cfg *config
// Database
db *database
// Errors
errorCheckMediaTypes []ct.MediaType
// Geo
photonMutex sync.Mutex
// Hooks
pPostHooks []postHookFunc
pUpdateHooks []postHookFunc
pDeleteHooks []postHookFunc
pUndeleteHooks []postHookFunc
hourlyHooks []hourlyHookFunc
// HTTP Client
httpClient *http.Client
// HTTP Routers
d http.Handler
// IndexNow
inKey []byte
inLoad sync.Once
// IndieAuth
ias *indieauth.Server
// Logs
logf *rotatelogs.RotateLogs
// Markdown
md, absoluteMd, titleMd goldmark.Markdown
// Media
compressorsInit sync.Once
compressors []mediaCompression
mediaStorageInit sync.Once
mediaStorage mediaStorage
// Minify
min minify.Minifier
// Plugins
pluginHost *plugins.PluginHost
// Reactions
reactionsInit sync.Once
reactionsCache *ristretto.Cache
reactionsSfg singleflight.Group
// Regex Redirects
regexRedirects []*regexRedirect
// Sessions
loginSessions, captchaSessions *dbSessionStore
// Shutdown
shutdown shutdowner.Shutdowner
// Template strings
ts *ts.TemplateStrings
// Tailscale
tsinit sync.Once
tss *tsnet.Server
// Tor
torAddress string
torHostname string
}