alpha
Login
or
Join now
willdot.net
/
distributed-pds
forked from
willdot.net/cocoon
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
A fork of the Cocoon PDS but being made more distributed.
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
add a fallback proxy config
author
Hailey
date
9 months ago
(Sep 21, 2025, 10:06 PM -0700)
commit
4648d474
4648d474d1d852fa86641ebeae4f7530dceec7ae
parent
43785005
4378500576f8d5e20a36186f72a421ba4f46ec16
+11
3 changed files
Expand all
Collapse all
Unified
Split
cmd
cocoon
main.go
server
handle_proxy.go
server.go
+5
cmd/cocoon/main.go
Reviewed
···
136
136
EnvVars: []string{"COCOON_BLOCKSTORE_VARIANT"},
137
137
Value: "sqlite",
138
138
},
139
139
+
&cli.StringFlag{
140
140
+
Name: "fallback-proxy",
141
141
+
EnvVars: []string{"COCOON_FALLBACK_PROXY"},
142
142
+
},
139
143
},
140
144
Commands: []*cli.Command{
141
145
runServe,
···
186
190
},
187
191
SessionSecret: cmd.String("session-secret"),
188
192
BlockstoreVariant: server.MustReturnBlockstoreVariant(cmd.String("blockstore-variant")),
193
193
+
FallbackProxy: cmd.String("fallback-proxy"),
189
194
})
190
195
if err != nil {
191
196
fmt.Printf("error creating cocoon: %v", err)
+3
server/handle_proxy.go
Reviewed
···
19
19
20
20
func (s *Server) getAtprotoProxyEndpointFromRequest(e echo.Context) (string, string, error) {
21
21
svc := e.Request().Header.Get("atproto-proxy")
22
22
+
if svc == "" && s.config.FallbackProxy != "" {
23
23
+
svc = s.config.FallbackProxy
24
24
+
}
22
25
23
26
svcPts := strings.Split(svc, "#")
24
27
if len(svcPts) != 2 {
+3
server/server.go
Reviewed
···
75
75
oauthProvider *provider.Provider
76
76
evtman *events.EventManager
77
77
passport *identity.Passport
78
78
+
fallbackProxy string
78
79
79
80
dbName string
80
81
s3Config *S3Config
···
118
119
SmtpEmail string
119
120
SmtpName string
120
121
BlockstoreVariant BlockstoreVariant
122
122
+
FallbackProxy string
121
123
}
122
124
123
125
type CustomValidator struct {
···
350
352
SmtpName: args.SmtpName,
351
353
SmtpEmail: args.SmtpEmail,
352
354
BlockstoreVariant: args.BlockstoreVariant,
355
355
+
FallbackProxy: args.FallbackProxy,
353
356
},
354
357
evtman: events.NewEventManager(events.NewMemPersister()),
355
358
passport: identity.NewPassport(h, identity.NewMemCache(10_000)),