tangled
alpha
login
or
join now
stream.place
/
streamplace
74
fork
atom
Live video on the AT Protocol
74
fork
atom
overview
issues
1
pulls
pipelines
config: fix livepeer stuff
Eli Mallon
1 month ago
018ed419
520f4f6f
+33
-63
5 changed files
expand all
collapse all
unified
split
go.mod
go.sum
pkg
cmd
go_livepeer.go
streamplace.go
config
config.go
+3
-2
go.mod
···
8
9
replace github.com/AxisCommunications/go-dpop => github.com/streamplace/go-dpop v0.0.0-20250510031900-c897158a8ad4
10
0
0
11
tool github.com/bluesky-social/indigo/cmd/lexgen
12
13
require (
···
48
github.com/multiformats/go-multihash v0.2.3
49
github.com/orandin/slog-gorm v1.4.0
50
github.com/patrickmn/go-cache v2.1.0+incompatible
51
-
github.com/peterbourgon/ff/v3 v3.4.0
52
github.com/pion/interceptor v0.1.37
53
github.com/pion/rtcp v1.2.16
54
github.com/pion/webrtc/v4 v4.0.11
···
64
github.com/streamplace/oatproxy v0.0.0-20260130124113-420429019d3b
65
github.com/stretchr/testify v1.11.1
66
github.com/tdewolff/canvas v0.0.0-20250728095813-50d4cb1eee71
0
67
github.com/whyrusleeping/cbor-gen v0.3.1
68
github.com/whyrusleeping/go-did v0.0.0-20230824162731-404d1707d5d6
69
gitlab.com/gitlab-org/release-cli v0.18.0
···
475
github.com/ultraware/funlen v0.2.0 // indirect
476
github.com/ultraware/whitespace v0.2.0 // indirect
477
github.com/urfave/cli/v2 v2.27.7 // indirect
478
-
github.com/urfave/cli/v3 v3.6.2 // indirect
479
github.com/uudashr/gocognit v1.2.0 // indirect
480
github.com/uudashr/iface v1.3.1 // indirect
481
github.com/valyala/bytebufferpool v1.0.0 // indirect
···
8
9
replace github.com/AxisCommunications/go-dpop => github.com/streamplace/go-dpop v0.0.0-20250510031900-c897158a8ad4
10
11
+
replace github.com/livepeer/go-livepeer => ../go-livepeer
12
+
13
tool github.com/bluesky-social/indigo/cmd/lexgen
14
15
require (
···
50
github.com/multiformats/go-multihash v0.2.3
51
github.com/orandin/slog-gorm v1.4.0
52
github.com/patrickmn/go-cache v2.1.0+incompatible
0
53
github.com/pion/interceptor v0.1.37
54
github.com/pion/rtcp v1.2.16
55
github.com/pion/webrtc/v4 v4.0.11
···
65
github.com/streamplace/oatproxy v0.0.0-20260130124113-420429019d3b
66
github.com/stretchr/testify v1.11.1
67
github.com/tdewolff/canvas v0.0.0-20250728095813-50d4cb1eee71
68
+
github.com/urfave/cli/v3 v3.6.2
69
github.com/whyrusleeping/cbor-gen v0.3.1
70
github.com/whyrusleeping/go-did v0.0.0-20230824162731-404d1707d5d6
71
gitlab.com/gitlab-org/release-cli v0.18.0
···
477
github.com/ultraware/funlen v0.2.0 // indirect
478
github.com/ultraware/whitespace v0.2.0 // indirect
479
github.com/urfave/cli/v2 v2.27.7 // indirect
0
480
github.com/uudashr/gocognit v1.2.0 // indirect
481
github.com/uudashr/iface v1.3.1 // indirect
482
github.com/valyala/bytebufferpool v1.0.0 // indirect
-6
go.sum
···
923
github.com/libp2p/go-msgio v0.3.0/go.mod h1:nyRM819GmVaF9LX3l03RMh10QdOroF++NBbxAb0mmDM=
924
github.com/libp2p/go-netroute v0.2.2 h1:Dejd8cQ47Qx2kRABg6lPwknU7+nBnFRpko45/fFPuZ8=
925
github.com/libp2p/go-netroute v0.2.2/go.mod h1:Rntq6jUAH0l9Gg17w5bFGhcC9a+vk4KNXs6s7IljKYE=
926
-
github.com/livepeer/go-livepeer v0.8.7-0.20250811105915-31d2e1f89f81 h1:ObaUiy1Jl5n7yTG96sVnU+SDqntYRZi45qdebl6RoXk=
927
-
github.com/livepeer/go-livepeer v0.8.7-0.20250811105915-31d2e1f89f81/go.mod h1:3sDsXYtDJLKcwCE8TmYjjj6yz2mPQXBHa+24u2PfWh8=
928
github.com/livepeer/go-tools v0.3.6-0.20240130205227-92479de8531b h1:VQcnrqtCA2UROp7q8ljkh2XA/u0KRgVv0S1xoUvOweE=
929
github.com/livepeer/go-tools v0.3.6-0.20240130205227-92479de8531b/go.mod h1:hwJ5DKhl+pTanFWl+EUpw1H7ukPO/H+MFpgA7jjshzw=
930
github.com/livepeer/joy4 v0.1.2-0.20191121080656-b2fea45cbded h1:ZQlvR5RB4nfT+cOQee+WqmaDOgGtP2oDMhcVvR4L0yA=
···
1080
github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw=
1081
github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9 h1:1/WtZae0yGtPq+TI6+Tv1WTxkukpXeMlviSxvL7SRgk=
1082
github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9/go.mod h1:x3N5drFsm2uilKKuuYo6LdyD8vZAW55sH/9w+pbo1sw=
1083
-
github.com/peterbourgon/ff/v3 v3.4.0 h1:QBvM/rizZM1cB0p0lGMdmR7HxZeI/ZrBWB4DqLkMUBc=
1084
-
github.com/peterbourgon/ff/v3 v3.4.0/go.mod h1:zjJVUhx+twciwfDl0zBcFzl4dW8axCRyXE/eKY9RztQ=
1085
github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 h1:oYW+YCJ1pachXTQmzR3rNLYGGz4g/UgFcjb28p/viDM=
1086
github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0=
1087
github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM=
···
1317
github.com/streamplace/atproto-oauth-golang v0.0.0-20250619231223-a9c04fb888ac/go.mod h1:9LlKkqciiO5lRfbX0n4Wn5KNY9nvFb4R3by8FdW2TWc=
1318
github.com/streamplace/go-dpop v0.0.0-20250510031900-c897158a8ad4 h1:L1fS4HJSaAyNnkwfuZubgfeZy8rkWmA0cMtH5Z0HqNc=
1319
github.com/streamplace/go-dpop v0.0.0-20250510031900-c897158a8ad4/go.mod h1:bGUXY9Wd4mnd+XUrOYZr358J2f6z9QO/dLhL1SsiD+0=
1320
-
github.com/streamplace/oatproxy v0.0.0-20260112011721-d74b4913c93f h1:hhbQ8CtcAZVlLit/r7b9QDK7qEgOth4hgE13xV6ViBI=
1321
-
github.com/streamplace/oatproxy v0.0.0-20260112011721-d74b4913c93f/go.mod h1:pXi24hA7xBHj8eEywX6wGqJOR9FaEYlGwQ/72rN6okw=
1322
github.com/streamplace/oatproxy v0.0.0-20260130124113-420429019d3b h1:BB/R1egvkEqZhGeKL3tqAlTn0mkoOaaMY6r6s18XJYA=
1323
github.com/streamplace/oatproxy v0.0.0-20260130124113-420429019d3b/go.mod h1:pXi24hA7xBHj8eEywX6wGqJOR9FaEYlGwQ/72rN6okw=
1324
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
···
923
github.com/libp2p/go-msgio v0.3.0/go.mod h1:nyRM819GmVaF9LX3l03RMh10QdOroF++NBbxAb0mmDM=
924
github.com/libp2p/go-netroute v0.2.2 h1:Dejd8cQ47Qx2kRABg6lPwknU7+nBnFRpko45/fFPuZ8=
925
github.com/libp2p/go-netroute v0.2.2/go.mod h1:Rntq6jUAH0l9Gg17w5bFGhcC9a+vk4KNXs6s7IljKYE=
0
0
926
github.com/livepeer/go-tools v0.3.6-0.20240130205227-92479de8531b h1:VQcnrqtCA2UROp7q8ljkh2XA/u0KRgVv0S1xoUvOweE=
927
github.com/livepeer/go-tools v0.3.6-0.20240130205227-92479de8531b/go.mod h1:hwJ5DKhl+pTanFWl+EUpw1H7ukPO/H+MFpgA7jjshzw=
928
github.com/livepeer/joy4 v0.1.2-0.20191121080656-b2fea45cbded h1:ZQlvR5RB4nfT+cOQee+WqmaDOgGtP2oDMhcVvR4L0yA=
···
1078
github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw=
1079
github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9 h1:1/WtZae0yGtPq+TI6+Tv1WTxkukpXeMlviSxvL7SRgk=
1080
github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9/go.mod h1:x3N5drFsm2uilKKuuYo6LdyD8vZAW55sH/9w+pbo1sw=
0
0
1081
github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 h1:oYW+YCJ1pachXTQmzR3rNLYGGz4g/UgFcjb28p/viDM=
1082
github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0=
1083
github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM=
···
1313
github.com/streamplace/atproto-oauth-golang v0.0.0-20250619231223-a9c04fb888ac/go.mod h1:9LlKkqciiO5lRfbX0n4Wn5KNY9nvFb4R3by8FdW2TWc=
1314
github.com/streamplace/go-dpop v0.0.0-20250510031900-c897158a8ad4 h1:L1fS4HJSaAyNnkwfuZubgfeZy8rkWmA0cMtH5Z0HqNc=
1315
github.com/streamplace/go-dpop v0.0.0-20250510031900-c897158a8ad4/go.mod h1:bGUXY9Wd4mnd+XUrOYZr358J2f6z9QO/dLhL1SsiD+0=
0
0
1316
github.com/streamplace/oatproxy v0.0.0-20260130124113-420429019d3b h1:BB/R1egvkEqZhGeKL3tqAlTn0mkoOaaMY6r6s18XJYA=
1317
github.com/streamplace/oatproxy v0.0.0-20260130124113-420429019d3b/go.mod h1:pXi24hA7xBHj8eEywX6wGqJOR9FaEYlGwQ/72rN6okw=
1318
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+2
-31
pkg/cmd/go_livepeer.go
···
3
import (
4
"context"
5
"flag"
6
-
"strings"
7
8
-
"github.com/golang/glog"
9
"github.com/livepeer/go-livepeer/cmd/livepeer/starter"
10
"stream.place/streamplace/pkg/config"
11
)
12
13
func GoLivepeer(ctx context.Context, fs *flag.FlagSet) error {
14
-
lpfs := flag.NewFlagSet("livepeer", flag.ExitOnError)
15
-
cfg := starter.NewLivepeerConfig(lpfs)
16
-
fs.VisitAll(func(f *flag.Flag) {
17
-
if !strings.HasPrefix(f.Name, "livepeer.") {
18
-
return
19
-
}
20
-
name := strings.TrimPrefix(f.Name, "livepeer.")
21
-
adapted := config.LivepeerFlags.SnakeToCamel[name]
22
-
23
-
if adapted == "" {
24
-
panic("unknown livepeer flag: " + name)
25
-
}
26
-
err := lpfs.Set(adapted, f.Value.String())
27
-
if err != nil {
28
-
panic(err)
29
-
}
30
-
})
31
-
32
err := flag.Set("logtostderr", "true")
33
if err != nil {
34
return err
···
39
return err
40
}
41
42
-
// Config file
43
-
// err = ff.Parse(fs, args,
44
-
// ff.WithConfigFileFlag("config"),
45
-
// ff.WithEnvVarPrefix("SP_LIVEPEER"),
46
-
// )
47
-
if err != nil {
48
-
glog.Exit("Error parsing config: ", err)
49
-
}
50
-
51
-
cfg = starter.UpdateNilsForUnsetFlags(cfg)
52
53
-
starter.StartLivepeer(ctx, cfg)
54
55
return nil
56
}
···
3
import (
4
"context"
5
"flag"
0
6
0
7
"github.com/livepeer/go-livepeer/cmd/livepeer/starter"
8
"stream.place/streamplace/pkg/config"
9
)
10
11
func GoLivepeer(ctx context.Context, fs *flag.FlagSet) error {
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
12
err := flag.Set("logtostderr", "true")
13
if err != nil {
14
return err
···
19
return err
20
}
21
22
+
config.LivepeerConfig = starter.UpdateNilsForUnsetFlags(config.LivepeerConfig)
0
0
0
0
0
0
0
0
0
23
24
+
starter.StartLivepeer(ctx, config.LivepeerConfig)
25
26
return nil
27
}
+9
-24
pkg/cmd/streamplace.go
···
72
makeMigrateCommand(build),
73
}
74
// Add the verbosity flag
75
-
app.Flags = append(app.Flags, &urfavecli.StringFlag{
76
-
Name: "v",
77
-
Usage: "log verbosity level",
78
-
Value: "3",
79
-
})
80
app.Before = func(ctx context.Context, cmd *urfavecli.Command) (context.Context, error) {
81
// Run self-test before starting
82
selfTest := cmd.Name == "self-test"
···
406
return err
407
}
408
group.Go(func() error {
409
-
lpfs := flag.NewFlagSet("livepeer", flag.ExitOnError)
410
-
_ = starter.NewLivepeerConfig(lpfs)
411
-
// Parse livepeer flags from mainCmd
412
-
err := lpfs.Parse([]string{})
413
-
if err != nil {
414
-
return err
415
-
}
416
-
err = GoLivepeer(ctx, lpfs)
417
if err != nil {
418
return err
419
}
···
647
648
func makeLivepeerCommand(build *config.BuildFlags) *urfavecli.Command {
649
return &urfavecli.Command{
650
-
Name: "livepeer",
651
-
Usage: "run livepeer gateway",
652
-
SkipFlagParsing: true,
653
Action: func(ctx context.Context, cmd *urfavecli.Command) error {
654
-
args := cmd.Args().Slice()
655
-
lpfs := flag.NewFlagSet("livepeer", flag.ExitOnError)
656
-
_ = starter.NewLivepeerConfig(lpfs)
657
-
err := lpfs.Parse(args)
658
-
if err != nil {
659
-
return err
660
-
}
661
-
return GoLivepeer(ctx, lpfs)
662
},
663
}
664
}
···
72
makeMigrateCommand(build),
73
}
74
// Add the verbosity flag
75
+
// app.Flags = append(app.Flags, &urfavecli.StringFlag{
76
+
// Name: "v",
77
+
// Usage: "log verbosity level",
78
+
// Value: "3",
79
+
// })
80
app.Before = func(ctx context.Context, cmd *urfavecli.Command) (context.Context, error) {
81
// Run self-test before starting
82
selfTest := cmd.Name == "self-test"
···
406
return err
407
}
408
group.Go(func() error {
409
+
err = GoLivepeer(ctx, config.LivepeerFlagSet)
0
0
0
0
0
0
0
410
if err != nil {
411
return err
412
}
···
640
641
func makeLivepeerCommand(build *config.BuildFlags) *urfavecli.Command {
642
return &urfavecli.Command{
643
+
Name: "livepeer",
644
+
Usage: "run livepeer gateway",
0
645
Action: func(ctx context.Context, cmd *urfavecli.Command) error {
646
+
return GoLivepeer(ctx, config.LivepeerFlagSet)
0
0
0
0
0
0
0
647
},
648
}
649
}
+19
pkg/config/config.go
···
7
"encoding/json"
8
"encoding/pem"
9
"errors"
0
10
"fmt"
11
"io"
12
"net"
···
21
"math/rand/v2"
22
23
"github.com/lestrrat-go/jwx/v2/jwk"
0
24
"github.com/lmittmann/tint"
25
slogGorm "github.com/orandin/slog-gorm"
26
urfavecli "github.com/urfave/cli/v3"
···
158
ReplicatorWebsocket string = "websocket"
159
ReplicatorIroh string = "iroh"
160
)
0
0
0
161
162
func (cli *CLI) NewCommand(name string) *urfavecli.Command {
163
cmd := &urfavecli.Command{
···
845
Sources: urfavecli.EnvVars("SP_MIST_HTTP_PORT"),
846
})
847
}
0
0
0
0
0
0
0
0
0
0
0
0
0
0
848
849
return cmd
850
}
···
7
"encoding/json"
8
"encoding/pem"
9
"errors"
10
+
"flag"
11
"fmt"
12
"io"
13
"net"
···
22
"math/rand/v2"
23
24
"github.com/lestrrat-go/jwx/v2/jwk"
25
+
"github.com/livepeer/go-livepeer/cmd/livepeer/starter"
26
"github.com/lmittmann/tint"
27
slogGorm "github.com/orandin/slog-gorm"
28
urfavecli "github.com/urfave/cli/v3"
···
160
ReplicatorWebsocket string = "websocket"
161
ReplicatorIroh string = "iroh"
162
)
163
+
164
+
var LivepeerFlagSet *flag.FlagSet
165
+
var LivepeerConfig starter.LivepeerConfig
166
167
func (cli *CLI) NewCommand(name string) *urfavecli.Command {
168
cmd := &urfavecli.Command{
···
850
Sources: urfavecli.EnvVars("SP_MIST_HTTP_PORT"),
851
})
852
}
853
+
854
+
LivepeerFlagSet = flag.NewFlagSet("livepeer", flag.ContinueOnError)
855
+
LivepeerConfig = starter.NewLivepeerConfig(LivepeerFlagSet)
856
+
LivepeerFlagSet.VisitAll(func(f *flag.Flag) {
857
+
adapted := LivepeerFlags.CamelToSnake[f.Name]
858
+
cmd.Flags = append(cmd.Flags, &urfavecli.StringFlag{
859
+
Name: fmt.Sprintf("livepeer.%s", adapted),
860
+
Usage: f.Usage,
861
+
Sources: urfavecli.EnvVars(fmt.Sprintf("SP_LIVEPEER_%s", adapted)),
862
+
Action: func(ctx context.Context, cmd *urfavecli.Command, s string) error {
863
+
return LivepeerFlagSet.Set(f.Name, s)
864
+
},
865
+
})
866
+
})
867
868
return cmd
869
}