this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor config var names; dotenv

Use consistent and descriptive environment variable names and CLI
argument long values. Totally open to adding short versions of these as
well.

Use database connection string helper from cliutils.

For all commands: load dotenv (if found); configure name and description
of CLI App object; main is just a wrapper around run(), to make testing
possible.

+233 -120
+14 -9
cmd/beemo/main.go
··· 33 33 } 34 34 } 35 35 36 - app := &cli.App{ 36 + run(os.Args) 37 + } 38 + 39 + func run(args []string) { 40 + 41 + app := cli.App{ 37 42 Name: "beemo", 38 43 Usage: "bluesky moderation reporting bot", 39 44 } 40 45 41 46 app.Flags = []cli.Flag{ 42 47 &cli.StringFlag{ 43 - Name: "pds", 44 - Usage: "hostname and port of PDS instance", 48 + Name: "pds-host", 49 + Usage: "method, hostname, and port of PDS instance", 45 50 Value: "http://localhost:4849", 46 51 EnvVars: []string{"ATP_PDS_HOST"}, 47 52 }, ··· 58 63 EnvVars: []string{"ATP_AUTH_PASSWORD"}, 59 64 }, 60 65 &cli.StringFlag{ 61 - Name: "admin-token", 62 - Usage: "admin authentication token for PDS", 66 + Name: "admin-password", 67 + Usage: "admin authentication password for PDS", 63 68 Required: true, 64 - EnvVars: []string{"ATP_ADMIN_TOKEN"}, 69 + EnvVars: []string{"ATP_AUTH_ADMIN_PASSWORD"}, 65 70 }, 66 71 &cli.StringFlag{ 67 72 Name: "slack-webhook-url", ··· 97 102 // create a new session 98 103 xrpcc := &xrpc.Client{ 99 104 Client: cliutil.NewHttpClient(), 100 - Host: cctx.String("pds"), 105 + Host: cctx.String("pds-host"), 101 106 Auth: &xrpc.AuthInfo{Handle: cctx.String("handle")}, 102 107 } 103 108 ··· 113 118 xrpcc.Auth.Did = auth.Did 114 119 xrpcc.Auth.Handle = auth.Handle 115 120 116 - adminToken := cctx.String("admin-token") 121 + adminToken := cctx.String("admin-password") 117 122 if len(adminToken) > 0 { 118 123 xrpcc.AdminToken = &adminToken 119 124 } ··· 154 159 if createdAt.After(since) { 155 160 // ok, we found a "new" report, need to notify 156 161 msg := fmt.Sprintf("===== New moderation report received =====\n") 157 - msg += fmt.Sprintf("PDS: `%s`\t", cctx.String("pds")) 162 + msg += fmt.Sprintf("PDS: `%s`\t", cctx.String("pds-host")) 158 163 msg += fmt.Sprintf("report id: `%d`\t", report.Id) 159 164 msg += fmt.Sprintf("recent unresolved: `%d`\n", len(mrr.Reports)) 160 165 msg += fmt.Sprintf("createdAt: `%s`\n", report.CreatedAt)
+30 -23
cmd/bigsky/main.go
··· 63 63 Name: "jaeger", 64 64 }, 65 65 &cli.StringFlag{ 66 - Name: "db", 66 + Name: "db-url", 67 + Usage: "database connection string for BGS database", 67 68 Value: "sqlite://./data/bigsky/bgs.sqlite", 68 69 EnvVars: []string{"DATABASE_URL"}, 69 70 }, 70 71 &cli.StringFlag{ 71 - Name: "carstoredb", 72 + Name: "carstore-db-url", 73 + Usage: "database connection string for carstore database", 72 74 Value: "sqlite://./data/bigsky/carstore.sqlite", 73 75 EnvVars: []string{"CARSTORE_DATABASE_URL"}, 74 76 }, 77 + &cli.BoolFlag{ 78 + Name: "db-tracing", 79 + }, 75 80 &cli.StringFlag{ 76 - Name: "carstore", 77 - Value: "data/bigsky/carstore", 78 - EnvVars: []string{"CARSTORE_DIRECTORY"}, 79 - }, 80 - &cli.BoolFlag{ 81 - Name: "dbtracing", 81 + Name: "data-dir", 82 + Usage: "path of directory for CAR files and other data", 83 + Value: "data/bigsky", 84 + EnvVars: []string{"DATA_DIR"}, 82 85 }, 83 86 &cli.StringFlag{ 84 - Name: "plc", 85 - Usage: "hostname of the plc server (including https:// prefix)", 87 + Name: "plc-host", 88 + Usage: "method, hostname, and port of PLC registry", 86 89 Value: "https://plc.directory", 87 90 EnvVars: []string{"ATP_PLC_HOST"}, 88 91 }, ··· 119 122 } 120 123 121 124 // ensure data directory exists; won't error if it does 122 - os.MkdirAll("data/bigsky/", os.ModePerm) 125 + datadir := cctx.String("data-dir") 126 + csdir := filepath.Join(datadir, "carstore") 127 + os.MkdirAll(datadir, os.ModePerm) 128 + 129 + dburl := cctx.String("db-url") 130 + db, err := cliutil.SetupDatabase(dburl) 131 + if err != nil { 132 + return err 133 + } 123 134 124 - dbstr := cctx.String("db") 125 - db, err := cliutil.SetupDatabase(dbstr) 135 + csdburl := cctx.String("carstore-db-url") 136 + csdb, err := cliutil.SetupDatabase(csdburl) 126 137 if err != nil { 127 138 return err 128 139 } 129 140 130 - if cctx.Bool("dbtracing") { 141 + if cctx.Bool("db-tracing") { 131 142 if err := db.Use(tracing.NewPlugin()); err != nil { 132 143 return err 133 144 } 134 - } 135 - 136 - carstoredbstr := cctx.String("carstoredb") 137 - cardb, err := cliutil.SetupDatabase(carstoredbstr) 138 - if err != nil { 139 - return err 145 + if err := csdb.Use(tracing.NewPlugin()); err != nil { 146 + return err 147 + } 140 148 } 141 149 142 - csdir := cctx.String("carstore") 143 150 os.MkdirAll(filepath.Dir(csdir), os.ModePerm) 144 - cstore, err := carstore.NewCarStore(cardb, csdir) 151 + cstore, err := carstore.NewCarStore(csdb, csdir) 145 152 if err != nil { 146 153 return err 147 154 } 148 155 149 - didr := &api.PLCServer{Host: cctx.String("plc")} 156 + didr := &api.PLCServer{Host: cctx.String("plc-host")} 150 157 cachedidr := plc.NewCachingDidResolver(didr, time.Minute*5, 1000) 151 158 152 159 kmgr := indexer.NewKeyManager(cachedidr, nil)
+12 -7
cmd/fakermaker/main.go
··· 40 40 } 41 41 } 42 42 43 - app := &cli.App{ 43 + run(os.Args) 44 + } 45 + 46 + func run(args []string) { 47 + 48 + app := cli.App{ 44 49 Name: "fakermaker", 45 50 Usage: "bluesky fake account/content generator", 46 51 } 47 52 48 53 app.Flags = []cli.Flag{ 49 54 &cli.StringFlag{ 50 - Name: "pds", 51 - Usage: "hostname and port of PDS instance", 55 + Name: "pds-host", 56 + Usage: "method, hostname, and port of PDS instance", 52 57 Value: "http://localhost:4849", 53 58 EnvVars: []string{"ATP_PDS_HOST"}, 54 59 }, 55 60 &cli.StringFlag{ 56 - Name: "admin-token", 57 - Usage: "admin authentication token for PDS", 61 + Name: "admin-password", 62 + Usage: "admin authentication password for PDS", 58 63 Required: true, 59 64 EnvVars: []string{"ATP_AUTH_ADMIN_PASSWORD"}, 60 65 }, ··· 210 215 } 211 216 212 217 func accountXrpcClient(cctx *cli.Context, ac *AccountContext) (*xrpc.Client, error) { 213 - pdsHost := cctx.String("pds") 218 + pdsHost := cctx.String("pds-host") 214 219 //httpClient := cliutil.NewHttpClient() 215 220 httpClient := &http.Client{Timeout: 5 * time.Second} 216 221 ua := "IndigoFakerMaker" ··· 247 252 return err 248 253 } 249 254 xrpcc := atpc.C 250 - adminToken := cctx.String("admin-token") 255 + adminToken := cctx.String("admin-password") 251 256 if len(adminToken) > 0 { 252 257 xrpcc.AdminToken = &adminToken 253 258 }
+31 -6
cmd/gosky/main.go
··· 22 22 "github.com/bluesky-social/indigo/repo" 23 23 "github.com/gorilla/websocket" 24 24 "github.com/ipfs/go-cid" 25 + logging "github.com/ipfs/go-log" 26 + "github.com/joho/godotenv" 25 27 "github.com/lestrrat-go/jwx/jwa" 26 28 "github.com/lestrrat-go/jwx/jwk" 27 29 "github.com/polydawn/refmt/cbor" ··· 31 33 "github.com/whyrusleeping/go-did" 32 34 ) 33 35 36 + var log = logging.Logger("gosky") 37 + 34 38 func main() { 35 - app := cli.NewApp() 39 + 40 + // only try dotenv if it exists 41 + if _, err := os.Stat(".env"); err == nil { 42 + err := godotenv.Load() 43 + if err != nil { 44 + log.Fatal("Error loading .env file") 45 + } 46 + } 47 + 48 + run(os.Args) 49 + } 50 + 51 + func run(args []string) { 52 + 53 + app := cli.App{ 54 + Name: "gosky", 55 + Usage: "client CLI for atproto and bluesky", 56 + } 36 57 37 58 app.Flags = []cli.Flag{ 38 59 &cli.StringFlag{ 39 - Name: "pds", 40 - Value: "https://bsky.social", 60 + Name: "pds-host", 61 + Usage: "method, hostname, and port of PDS instance", 62 + Value: "http://localhost:4849", 63 + EnvVars: []string{"ATP_PDS_HOST"}, 41 64 }, 42 65 &cli.StringFlag{ 43 - Name: "auth", 44 - Value: "bsky.auth", 66 + Name: "auth-file", 67 + Usage: "path to JSON file with ATP auth info", 68 + Value: "bsky.auth", 69 + EnvVars: []string{"ATP_AUTH_FILE"}, 45 70 }, 46 71 } 47 72 app.Commands = []*cli.Command{ ··· 517 542 return err 518 543 } 519 544 520 - if err := os.WriteFile(cctx.String("auth"), b, 0600); err != nil { 545 + if err := os.WriteFile(cctx.String("auth-file"), b, 0600); err != nil { 521 546 return err 522 547 } 523 548
+18 -10
cmd/gosky/util/util.go
··· 87 87 88 88 func GetXrpcClient(cctx *cli.Context, authreq bool) (*xrpc.Client, error) { 89 89 h := "http://localhost:4989" 90 - if pdsurl := cctx.String("pds"); pdsurl != "" { 90 + if pdsurl := cctx.String("pds-host"); pdsurl != "" { 91 91 h = pdsurl 92 92 } 93 93 ··· 112 112 } 113 113 114 114 func loadAuthFromEnv(cctx *cli.Context, req bool) (*xrpc.AuthInfo, error) { 115 - if a := cctx.String("auth"); a != "" { 115 + if a := cctx.String("auth-file"); a != "" { 116 116 if ai, err := ReadAuth(a); err != nil && req { 117 117 return nil, err 118 118 } else { ··· 150 150 return &auth, nil 151 151 } 152 152 153 - func SetupDatabase(dbval string) (*gorm.DB, error) { 153 + func SetupDatabase(dburl string) (*gorm.DB, error) { 154 154 var dial gorm.Dialector 155 - if strings.HasPrefix(dbval, "sqlite://") { 156 - dial = sqlite.Open(dbval[len("sqlite://"):]) 157 - } else if strings.HasPrefix(dbval, "postgresql://") { 158 - // can pass entire URL, with prefix 159 - dial = postgres.Open(dbval) 155 + // NOTE(bnewbold): might also handle file:// as sqlite, but let's keep it 156 + // explicit for now 157 + if strings.HasPrefix(dburl, "sqlite://") { 158 + sqliteSuffix := dburl[len("sqlite://"):] 159 + // if this isn't ":memory:", ensure that directory exists (eg, if db 160 + // file is being initialized) 161 + if !strings.Contains(sqliteSuffix, ":?") { 162 + os.MkdirAll(filepath.Dir(sqliteSuffix), os.ModePerm) 163 + } 164 + dial = sqlite.Open(sqliteSuffix) 165 + } else if strings.HasPrefix(dburl, "postgresql://") { 166 + // can pass entire URL, with prefix, to gorm driver 167 + dial = postgres.Open(dburl) 160 168 } else { 161 - // TODO: this might print password 162 - return nil, fmt.Errorf("unsupported or unrecognized DATABASE_URL value: %s", dbval) 169 + // TODO(bnewbold): this might print password? 170 + return nil, fmt.Errorf("unsupported or unrecognized DATABASE_URL value: %s", dburl) 163 171 } 164 172 165 173 db, err := gorm.Open(dial, &gorm.Config{
+85 -47
cmd/laputa/main.go
··· 11 11 12 12 "github.com/bluesky-social/indigo/api" 13 13 "github.com/bluesky-social/indigo/carstore" 14 + cliutil "github.com/bluesky-social/indigo/cmd/gosky/util" 14 15 "github.com/bluesky-social/indigo/pds" 15 16 "github.com/bluesky-social/indigo/plc" 17 + 18 + logging "github.com/ipfs/go-log" 19 + "github.com/joho/godotenv" 16 20 "github.com/lestrrat-go/jwx/v2/jwk" 17 21 "github.com/urfave/cli/v2" 18 - "gorm.io/driver/postgres" 19 - "gorm.io/driver/sqlite" 20 - "gorm.io/gorm" 21 - 22 22 "go.opentelemetry.io/otel" 23 23 "go.opentelemetry.io/otel/attribute" 24 24 "go.opentelemetry.io/otel/exporters/jaeger" ··· 28 28 "gorm.io/plugin/opentelemetry/tracing" 29 29 ) 30 30 31 + var log = logging.Logger("laputa") 32 + 31 33 func main() { 32 - app := cli.NewApp() 34 + 35 + // only try dotenv if it exists 36 + if _, err := os.Stat(".env"); err == nil { 37 + err := godotenv.Load() 38 + if err != nil { 39 + log.Fatal("Error loading .env file") 40 + } 41 + } 42 + 43 + run(os.Args) 44 + } 45 + 46 + func run(args []string) { 47 + 48 + app := cli.App{ 49 + Name: "laputa", 50 + Usage: "bluesky PDS in golang", 51 + } 33 52 34 53 app.Flags = []cli.Flag{ 35 54 &cli.BoolFlag{ 36 55 Name: "jaeger", 37 56 }, 38 - &cli.BoolFlag{ 39 - // Temp flag for testing, eventually will just pass db connection strings here 40 - Name: "postgres", 57 + &cli.StringFlag{ 58 + Name: "db-url", 59 + Value: "sqlite://./data/laputa/pds.sqlite", 60 + EnvVars: []string{"DATABASE_URL"}, 61 + }, 62 + &cli.StringFlag{ 63 + Name: "carstore-db-url", 64 + Value: "sqlite://./data/laputa/carstore.sqlite", 65 + EnvVars: []string{"CARSTORE_DATABASE_URL"}, 41 66 }, 42 67 &cli.BoolFlag{ 43 - Name: "dbtracing", 68 + Name: "db-tracing", 44 69 }, 45 70 &cli.StringFlag{ 46 - Name: "pdshost", 47 - Usage: "hostname of the pds", 71 + Name: "name", 72 + Usage: "hostname of this PDS instance", 48 73 Value: "localhost:4989", 49 74 }, 50 75 &cli.StringFlag{ 51 - Name: "plc", 52 - Usage: "hostname of the plc", 76 + Name: "plc-host", 77 + Usage: "method, hostname, and port of PLC registry", 78 + Value: "https://plc.directory", 79 + EnvVars: []string{"ATP_PLC_HOST"}, 80 + }, 81 + &cli.StringFlag{ 82 + Name: "data-dir", 83 + Usage: "path of directory for CAR files and other data", 84 + Value: "data/laputa", 85 + EnvVars: []string{"DATA_DIR"}, 86 + }, 87 + &cli.StringFlag{ 88 + Name: "jwt-secret", 89 + Usage: "secret used for authenticating JWT tokens", 90 + Value: "jwtsecretplaceholder", 91 + EnvVars: []string{"ATP_JWT_SECRET"}, 92 + }, 93 + &cli.StringFlag{ 94 + Name: "handle-domains", 95 + Usage: "comma-separated list of domain suffixes for handle registration", 96 + Value: ".test", 97 + EnvVars: []string{"ATP_PDS_HANDLE_DOMAINS"}, 53 98 }, 54 99 } 55 100 ··· 80 125 otel.SetTracerProvider(tp) 81 126 } 82 127 83 - pgdb := cctx.Bool("postgres") 84 - dbtracing := cctx.Bool("dbtracing") 128 + dbtracing := cctx.Bool("db-tracing") 129 + datadir := cctx.String("data-dir") 130 + csdir := filepath.Join(datadir, "carstore") 131 + keypath := filepath.Join(datadir, "server.key") 132 + jwtsecret := []byte(cctx.String("jwt-secret")) 85 133 86 - // ensure data directory exists; won't error if it does 87 - os.MkdirAll("data/pds/", os.ModePerm) 134 + // TODO(bnewbold): split this on comma, and have PDS support multiple 135 + // domain suffixes that can be registered 136 + pdsdomain := cctx.String("handle-domains") 88 137 89 - var pdsdial gorm.Dialector 90 - if pgdb { 91 - dsn := "host=localhost user=postgres password=password dbname=pdsdb port=5432 sslmode=disable" 92 - pdsdial = postgres.Open(dsn) 93 - } else { 94 - pdsdial = sqlite.Open("data/pds/pds.sqlite") 95 - } 96 - db, err := gorm.Open(pdsdial, &gorm.Config{}) 138 + // ensure data directories exist; won't error if it does 139 + os.MkdirAll(csdir, os.ModePerm) 140 + 141 + // default postgres setup: postgresql://postgres:password@localhost:5432/pdsdb?sslmode=disable 142 + db, err := cliutil.SetupDatabase(cctx.String("db-url")) 97 143 if err != nil { 98 144 return err 99 145 } 100 146 101 - if dbtracing { 102 - if err := db.Use(tracing.NewPlugin()); err != nil { 103 - return err 104 - } 105 - } 106 - 107 - var cardial gorm.Dialector 108 - if pgdb { 109 - dsn2 := "host=localhost user=postgres password=password dbname=cardb port=5432 sslmode=disable" 110 - cardial = postgres.Open(dsn2) 111 - } else { 112 - cardial = sqlite.Open("data/pds/carstore.sqlite") 113 - } 114 - carstdb, err := gorm.Open(cardial, &gorm.Config{}) 147 + // default postgres setup: postgresql://postgres:password@localhost:5432/cardb?sslmode=disable 148 + csdb, err := cliutil.SetupDatabase(cctx.String("carstore-db-url")) 115 149 if err != nil { 116 150 return err 117 151 } 118 152 119 153 if dbtracing { 120 - if err := carstdb.Use(tracing.NewPlugin()); err != nil { 154 + if err := db.Use(tracing.NewPlugin()); err != nil { 155 + return err 156 + } 157 + if err := csdb.Use(tracing.NewPlugin()); err != nil { 121 158 return err 122 159 } 123 160 } 124 161 125 - cs, err := carstore.NewCarStore(carstdb, "data/pds/carstore") 162 + cstore, err := carstore.NewCarStore(csdb, csdir) 126 163 if err != nil { 127 164 return err 128 165 } 129 166 130 167 var didr plc.PLCClient 131 - if plchost := cctx.String("plc"); plchost != "" { 168 + if plchost := cctx.String("plc-host"); plchost != "" { 132 169 didr = &api.PLCServer{Host: plchost} 133 170 } else { 134 171 didr = plc.NewFakeDid(db) 135 172 } 136 173 137 - pdshost := cctx.String("pdshost") 138 - srv, err := pds.NewServer(db, cs, "data/pds/server.key", ".test", pdshost, didr, []byte("jwtsecretplaceholder")) 174 + pdshost := cctx.String("name") 175 + srv, err := pds.NewServer(db, cstore, keypath, pdsdomain, pdshost, didr, jwtsecret) 139 176 if err != nil { 140 177 return err 141 178 } ··· 150 187 Name: "gen-key", 151 188 Flags: []cli.Flag{ 152 189 &cli.StringFlag{ 153 - Name: "filename", 154 - Value: "data/pds/server.key", 190 + Name: "output", 191 + Aliases: []string{"o"}, 192 + Value: "data/laputa/server.key", 155 193 }, 156 194 }, 157 195 Action: func(cctx *cli.Context) error { ··· 176 214 return fmt.Errorf("failed to marshal key into JSON: %w", err) 177 215 } 178 216 179 - fname := cctx.String("filename") 217 + fname := cctx.String("output") 180 218 // ensure data directory exists; won't error if it does 181 219 os.MkdirAll(filepath.Dir(fname), os.ModePerm) 182 220
+30 -5
cmd/stress/main.go
··· 21 21 "github.com/ipfs/go-datastore" 22 22 blockstore "github.com/ipfs/go-ipfs-blockstore" 23 23 cbor "github.com/ipfs/go-ipld-cbor" 24 + logging "github.com/ipfs/go-log" 24 25 "github.com/ipld/go-car" 26 + "github.com/joho/godotenv" 25 27 cli "github.com/urfave/cli/v2" 26 28 ) 29 + 30 + var log = logging.Logger("stress") 27 31 28 32 func main() { 29 - app := cli.NewApp() 33 + 34 + // only try dotenv if it exists 35 + if _, err := os.Stat(".env"); err == nil { 36 + err := godotenv.Load() 37 + if err != nil { 38 + log.Fatal("Error loading .env file") 39 + } 40 + } 41 + 42 + run(os.Args) 43 + } 44 + 45 + func run(args []string) { 46 + 47 + app := cli.App{ 48 + Name: "stress", 49 + Usage: "load generation tool for PDS instances", 50 + } 30 51 31 52 app.Commands = []*cli.Command{ 32 53 postingCmd, ··· 51 72 Value: 1, 52 73 }, 53 74 &cli.StringFlag{ 54 - Name: "pds", 55 - Value: "http://localhost:4989", 75 + Name: "pds-host", 76 + Usage: "method, hostname, and port of PDS instance", 77 + Value: "http://localhost:4849", 78 + EnvVars: []string{"ATP_PDS_HOST"}, 56 79 }, 57 80 }, 58 81 Action: func(cctx *cli.Context) error { ··· 127 150 Value: 50, 128 151 }, 129 152 &cli.StringFlag{ 130 - Name: "pds", 131 - Value: "http://localhost:4989", 153 + Name: "pds-host", 154 + Usage: "method, hostname, and port of PDS instance", 155 + Value: "http://localhost:4849", 156 + EnvVars: []string{"ATP_PDS_HOST"}, 132 157 }, 133 158 }, 134 159 Action: func(cctx *cli.Context) error {
+2 -2
testscripts/cleanup.sh
··· 1 1 #!/bin/bash 2 - rm -rf data/pds/ 3 - mkdir -p data/pds/carstore 2 + rm -rf data/laputa/ 3 + mkdir -p data/laputa/carstore
+11 -11
testscripts/pdstest.sh
··· 4 4 5 5 6 6 echo "1. Creating Account" 7 - ./gosky --pds="http://localhost:4989" newAccount test@foo.com testman.test password > test.auth 7 + ./gosky --pds-host="http://localhost:4989" newAccount test@foo.com testman.test password > test.auth 8 8 9 9 echo "2. Some Content" 10 - ./gosky --pds="http://localhost:4989" --auth="test.auth" post "cats are really cool and the best" 11 - ./gosky --pds="http://localhost:4989" --auth="test.auth" post "paul frazee needs to buy a sweater" 10 + ./gosky --pds-host="http://localhost:4989" --auth-file="test.auth" post "cats are really cool and the best" 11 + ./gosky --pds-host="http://localhost:4989" --auth-file="test.auth" post "paul frazee needs to buy a sweater" 12 12 13 13 echo "3. View That Content" 14 - ./gosky --pds="http://localhost:4989" --auth="test.auth" feed --raw --author=self 14 + ./gosky --pds-host="http://localhost:4989" --auth-file="test.auth" feed --raw --author=self 15 15 16 16 17 17 echo "4. Make a second account" 18 - ./gosky --pds="http://localhost:4989" newAccount test2@foo.com friendbot.test password > test2.auth 18 + ./gosky --pds-host="http://localhost:4989" newAccount test2@foo.com friendbot.test password > test2.auth 19 19 20 20 echo "5. Post on second account" 21 - ./gosky --pds="http://localhost:4989" --auth="test2.auth" post "Im a big fan of the snow" 21 + ./gosky --pds-host="http://localhost:4989" --auth-file="test2.auth" post "Im a big fan of the snow" 22 22 23 23 echo "6. Upvote content" 24 - posturi=$(./gosky --pds=http://localhost:4989 --auth=test.auth feed --raw --author=self | jq -r .post.uri | head -n1) 25 - ./gosky --pds="http://localhost:4989" --auth="test2.auth" vote $posturi up 24 + posturi=$(./gosky --pds-host=http://localhost:4989 --auth-file=test.auth feed --raw --author=self | jq -r .post.uri | head -n1) 25 + ./gosky --pds-host="http://localhost:4989" --auth-file="test2.auth" vote $posturi up 26 26 27 27 echo "7. Check notifications" 28 - ./gosky --pds="http://localhost:4989" --auth="test.auth" notifs 28 + ./gosky --pds-host="http://localhost:4989" --auth-file="test.auth" notifs 29 29 30 30 echo "8. Follow" 31 - ./gosky --pds="http://localhost:4989" --auth="test2.auth" follows add $(cat test.auth | jq -r .did) 31 + ./gosky --pds-host="http://localhost:4989" --auth-file="test2.auth" follows add $(cat test.auth | jq -r .did) 32 32 33 33 echo "9. Check notifications" 34 - ./gosky --pds="http://localhost:4989" --auth="test.auth" notifs 34 + ./gosky --pds-host="http://localhost:4989" --auth-file="test.auth" notifs 35 35 36 36 37 37