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
make default atproto proxy an env var
author
Hailey
date
11 months ago
(Jul 12, 2025, 12:06 PM -0700)
commit
646353f3
646353f3efef02c762ebcd412af4ecaaabc7cb8a
parent
dedf8103
dedf81030abb32b86f0a4f25b50cb57a6bddd5dc
+30
-20
3 changed files
Expand all
Collapse all
Unified
Split
cmd
cocoon
main.go
server
handle_proxy.go
server.go
+7
-1
cmd/cocoon/main.go
Reviewed
···
131
131
Name: "session-secret",
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
+
},
134
139
},
135
140
Commands: []*cli.Command{
136
141
runServe,
···
178
183
AccessKey: cmd.String("s3-access-key"),
179
184
SecretKey: cmd.String("s3-secret-key"),
180
185
},
181
181
-
SessionSecret: cmd.String("session-secret"),
186
186
+
SessionSecret: cmd.String("session-secret"),
187
187
+
DefaultAtprotoProxy: cmd.String("default-atproto-proxy"),
182
188
})
183
189
if err != nil {
184
190
fmt.Printf("error creating cocoon: %v", err)
+1
-1
server/handle_proxy.go
Reviewed
···
27
27
28
28
svc := e.Request().Header.Get("atproto-proxy")
29
29
if svc == "" {
30
30
-
svc = "did:web:api.bsky.app#bsky_appview" // TODO: should be a config var probably
30
30
+
svc = s.config.DefaultAtprotoProxy
31
31
}
32
32
33
33
svcPts := strings.Split(svc, "#")
+22
-18
server/server.go
Reviewed
···
102
102
S3Config *S3Config
103
103
104
104
SessionSecret string
105
105
+
106
106
+
DefaultAtprotoProxy string
105
107
}
106
108
107
109
type config struct {
108
108
-
Version string
109
109
-
Did string
110
110
-
Hostname string
111
111
-
ContactEmail string
112
112
-
EnforcePeering bool
113
113
-
Relays []string
114
114
-
AdminPassword string
115
115
-
SmtpEmail string
116
116
-
SmtpName string
110
110
+
Version string
111
111
+
Did string
112
112
+
Hostname string
113
113
+
ContactEmail string
114
114
+
EnforcePeering bool
115
115
+
Relays []string
116
116
+
AdminPassword string
117
117
+
SmtpEmail string
118
118
+
SmtpName string
119
119
+
DefaultAtprotoProxy string
117
120
}
118
121
119
122
type CustomValidator struct {
···
336
339
plcClient: plcClient,
337
340
privateKey: &pkey,
338
341
config: &config{
339
339
-
Version: args.Version,
340
340
-
Did: args.Did,
341
341
-
Hostname: args.Hostname,
342
342
-
ContactEmail: args.ContactEmail,
343
343
-
EnforcePeering: false,
344
344
-
Relays: args.Relays,
345
345
-
AdminPassword: args.AdminPassword,
346
346
-
SmtpName: args.SmtpName,
347
347
-
SmtpEmail: args.SmtpEmail,
342
342
+
Version: args.Version,
343
343
+
Did: args.Did,
344
344
+
Hostname: args.Hostname,
345
345
+
ContactEmail: args.ContactEmail,
346
346
+
EnforcePeering: false,
347
347
+
Relays: args.Relays,
348
348
+
AdminPassword: args.AdminPassword,
349
349
+
SmtpName: args.SmtpName,
350
350
+
SmtpEmail: args.SmtpEmail,
351
351
+
DefaultAtprotoProxy: args.DefaultAtprotoProxy,
348
352
},
349
353
evtman: events.NewEventManager(events.NewMemPersister()),
350
354
passport: identity.NewPassport(h, identity.NewMemCache(10_000)),