+5
-16
bskyweb/cmd/bskyweb/main.go
+5
-16
bskyweb/cmd/bskyweb/main.go
···
34
Action: serve,
35
Flags: []cli.Flag{
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"},
53
},
54
&cli.StringFlag{
55
Name: "mailmodo-api-key",
···
34
Action: serve,
35
Flags: []cli.Flag{
36
&cli.StringFlag{
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"},
42
},
43
&cli.StringFlag{
44
Name: "mailmodo-api-key",
+3
-22
bskyweb/cmd/bskyweb/server.go
+3
-22
bskyweb/cmd/bskyweb/server.go
···
14
"syscall"
15
"time"
16
17
-
comatproto "github.com/bluesky-social/indigo/api/atproto"
18
appbsky "github.com/bluesky-social/indigo/api/bsky"
19
cliutil "github.com/bluesky-social/indigo/cmd/gosky/util"
20
"github.com/bluesky-social/indigo/xrpc"
···
38
func serve(cctx *cli.Context) error {
39
debug := cctx.Bool("debug")
40
httpAddress := cctx.String("http-address")
41
-
pdsHost := cctx.String("pds-host")
42
-
atpHandle := cctx.String("handle")
43
-
atpPassword := cctx.String("password")
44
mailmodoAPIKey := cctx.String("mailmodo-api-key")
45
mailmodoListName := cctx.String("mailmodo-list-name")
46
···
50
// Mailmodo client.
51
mailmodo := NewMailmodo(mailmodoAPIKey, mailmodoListName)
52
53
-
// create a new session
54
-
// TODO: does this work with no auth at all?
55
xrpcc := &xrpc.Client{
56
Client: cliutil.NewHttpClient(),
57
-
Host: pdsHost,
58
-
Auth: &xrpc.AuthInfo{
59
-
Handle: atpHandle,
60
-
},
61
}
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
75
// httpd
76
var (
···
14
"syscall"
15
"time"
16
17
appbsky "github.com/bluesky-social/indigo/api/bsky"
18
cliutil "github.com/bluesky-social/indigo/cmd/gosky/util"
19
"github.com/bluesky-social/indigo/xrpc"
···
37
func serve(cctx *cli.Context) error {
38
debug := cctx.Bool("debug")
39
httpAddress := cctx.String("http-address")
40
+
appviewHost := cctx.String("appview-host")
41
mailmodoAPIKey := cctx.String("mailmodo-api-key")
42
mailmodoListName := cctx.String("mailmodo-list-name")
43
···
47
// Mailmodo client.
48
mailmodo := NewMailmodo(mailmodoAPIKey, mailmodoListName)
49
50
+
// create a new session (no auth)
51
xrpcc := &xrpc.Client{
52
Client: cliutil.NewHttpClient(),
53
+
Host: appviewHost,
54
}
55
56
// httpd
57
var (
+1
-3
bskyweb/example.dev.env
+1
-3
bskyweb/example.dev.env