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
remove fallback proxy header
author
Hailey
date
10 months ago
(Aug 27, 2025, 10:22 AM -0700)
commit
dda2dc4c
dda2dc4cd67129802552af685c33b5e3dc752cf9
parent
95eea86d
95eea86d64a5aa028e8f815cc80538b5d9e6ebeb
+22
-35
3 changed files
Expand all
Collapse all
Unified
Split
cmd
cocoon
main.go
server
handle_proxy.go
server.go
+2
-8
cmd/cocoon/main.go
Reviewed
···
132
132
EnvVars: []string{"COCOON_SESSION_SECRET"},
133
133
},
134
134
&cli.StringFlag{
135
135
-
Name: "default-atproto-proxy",
136
136
-
EnvVars: []string{"COCOON_DEFAULT_ATPROTO_PROXY"},
137
137
-
Value: "did:web:api.bsky.app#bsky_appview",
138
138
-
},
139
139
-
&cli.StringFlag{
140
135
Name: "blockstore-variant",
141
136
EnvVars: []string{"COCOON_BLOCKSTORE_VARIANT"},
142
137
Value: "sqlite",
···
189
184
AccessKey: cmd.String("s3-access-key"),
190
185
SecretKey: cmd.String("s3-secret-key"),
191
186
},
192
192
-
SessionSecret: cmd.String("session-secret"),
193
193
-
DefaultAtprotoProxy: cmd.String("default-atproto-proxy"),
194
194
-
BlockstoreVariant: server.MustReturnBlockstoreVariant(cmd.String("blockstore-variant")),
187
187
+
SessionSecret: cmd.String("session-secret"),
188
188
+
BlockstoreVariant: server.MustReturnBlockstoreVariant(cmd.String("blockstore-variant")),
195
189
})
196
190
if err != nil {
197
191
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 == "" {
23
23
-
svc = s.config.DefaultAtprotoProxy
24
24
-
}
25
22
26
23
svcPts := strings.Split(svc, "#")
27
24
if len(svcPts) != 2 {
+20
-24
server/server.go
Reviewed
···
104
104
105
105
SessionSecret string
106
106
107
107
-
DefaultAtprotoProxy string
108
108
-
109
107
BlockstoreVariant BlockstoreVariant
110
108
}
111
109
112
110
type config struct {
113
113
-
Version string
114
114
-
Did string
115
115
-
Hostname string
116
116
-
ContactEmail string
117
117
-
EnforcePeering bool
118
118
-
Relays []string
119
119
-
AdminPassword string
120
120
-
SmtpEmail string
121
121
-
SmtpName string
122
122
-
DefaultAtprotoProxy string
123
123
-
BlockstoreVariant BlockstoreVariant
111
111
+
Version string
112
112
+
Did string
113
113
+
Hostname string
114
114
+
ContactEmail string
115
115
+
EnforcePeering bool
116
116
+
Relays []string
117
117
+
AdminPassword string
118
118
+
SmtpEmail string
119
119
+
SmtpName string
120
120
+
BlockstoreVariant BlockstoreVariant
124
121
}
125
122
126
123
type CustomValidator struct {
···
343
340
plcClient: plcClient,
344
341
privateKey: &pkey,
345
342
config: &config{
346
346
-
Version: args.Version,
347
347
-
Did: args.Did,
348
348
-
Hostname: args.Hostname,
349
349
-
ContactEmail: args.ContactEmail,
350
350
-
EnforcePeering: false,
351
351
-
Relays: args.Relays,
352
352
-
AdminPassword: args.AdminPassword,
353
353
-
SmtpName: args.SmtpName,
354
354
-
SmtpEmail: args.SmtpEmail,
355
355
-
DefaultAtprotoProxy: args.DefaultAtprotoProxy,
356
356
-
BlockstoreVariant: args.BlockstoreVariant,
343
343
+
Version: args.Version,
344
344
+
Did: args.Did,
345
345
+
Hostname: args.Hostname,
346
346
+
ContactEmail: args.ContactEmail,
347
347
+
EnforcePeering: false,
348
348
+
Relays: args.Relays,
349
349
+
AdminPassword: args.AdminPassword,
350
350
+
SmtpName: args.SmtpName,
351
351
+
SmtpEmail: args.SmtpEmail,
352
352
+
BlockstoreVariant: args.BlockstoreVariant,
357
353
},
358
354
evtman: events.NewEventManager(events.NewMemPersister()),
359
355
passport: identity.NewPassport(h, identity.NewMemCache(10_000)),