+5
-16
bskyweb/cmd/bskyweb/main.go
+5
-16
bskyweb/cmd/bskyweb/main.go
···
34
34
Action: serve,
35
35
Flags: []cli.Flag{
36
36
&cli.StringFlag{
37
-
Name: "pds-host",
38
-
Usage: "method, hostname, and port of PDS instance",
39
-
Value: "http://localhost:4849",
40
-
EnvVars: []string{"ATP_PDS_HOST"},
41
-
},
42
-
&cli.StringFlag{
43
-
Name: "handle",
44
-
Usage: "for PDS login",
45
-
Required: true,
46
-
EnvVars: []string{"ATP_AUTH_HANDLE"},
47
-
},
48
-
&cli.StringFlag{
49
-
Name: "password",
50
-
Usage: "for PDS login",
51
-
Required: true,
52
-
EnvVars: []string{"ATP_AUTH_PASSWORD"},
37
+
Name: "appview-host",
38
+
Usage: "method, hostname, and port of PDS instance",
39
+
Value: "http://localhost:2584",
40
+
// retain old PDS env var for easy transition
41
+
EnvVars: []string{"ATP_APPVIEW_HOST", "ATP_PDS_HOST"},
53
42
},
54
43
&cli.StringFlag{
55
44
Name: "mailmodo-api-key",
+3
-22
bskyweb/cmd/bskyweb/server.go
+3
-22
bskyweb/cmd/bskyweb/server.go
···
14
14
"syscall"
15
15
"time"
16
16
17
-
comatproto "github.com/bluesky-social/indigo/api/atproto"
18
17
appbsky "github.com/bluesky-social/indigo/api/bsky"
19
18
cliutil "github.com/bluesky-social/indigo/cmd/gosky/util"
20
19
"github.com/bluesky-social/indigo/xrpc"
···
38
37
func serve(cctx *cli.Context) error {
39
38
debug := cctx.Bool("debug")
40
39
httpAddress := cctx.String("http-address")
41
-
pdsHost := cctx.String("pds-host")
42
-
atpHandle := cctx.String("handle")
43
-
atpPassword := cctx.String("password")
40
+
appviewHost := cctx.String("appview-host")
44
41
mailmodoAPIKey := cctx.String("mailmodo-api-key")
45
42
mailmodoListName := cctx.String("mailmodo-list-name")
46
43
···
50
47
// Mailmodo client.
51
48
mailmodo := NewMailmodo(mailmodoAPIKey, mailmodoListName)
52
49
53
-
// create a new session
54
-
// TODO: does this work with no auth at all?
50
+
// create a new session (no auth)
55
51
xrpcc := &xrpc.Client{
56
52
Client: cliutil.NewHttpClient(),
57
-
Host: pdsHost,
58
-
Auth: &xrpc.AuthInfo{
59
-
Handle: atpHandle,
60
-
},
53
+
Host: appviewHost,
61
54
}
62
-
63
-
auth, err := comatproto.ServerCreateSession(context.TODO(), xrpcc, &comatproto.ServerCreateSession_Input{
64
-
Identifier: xrpcc.Auth.Handle,
65
-
Password: atpPassword,
66
-
})
67
-
if err != nil {
68
-
return err
69
-
}
70
-
xrpcc.Auth.AccessJwt = auth.AccessJwt
71
-
xrpcc.Auth.RefreshJwt = auth.RefreshJwt
72
-
xrpcc.Auth.Did = auth.Did
73
-
xrpcc.Auth.Handle = auth.Handle
74
55
75
56
// httpd
76
57
var (
+1
-3
bskyweb/example.dev.env
+1
-3
bskyweb/example.dev.env