diff --git a/.vscode/settings.json b/.vscode/settings.json index 7d459a8b..4b90826e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,11 +10,11 @@ }, "mesonbuild.configureOnOpen": false, "cSpell.words": ["Devplace", "streamplace", "webrtc"], - "go.lintTool": "golangci-lint", - "go.lintFlags": ["--path-mode=abs"], + "go.lintTool": "golangci-lint-v2", + "go.lintFlags": ["--path-mode=abs", "--fast-only"], "go.formatTool": "custom", "go.alternateTools": { - "customFormatter": "golangci-lint" + "customFormatter": "golangci-lint-v2" }, "go.formatFlags": ["fmt", "--stdin"], "editor.codeActionsOnSave": { diff --git a/go.mod b/go.mod index 96eeb1a1..a4d590bb 100644 --- a/go.mod +++ b/go.mod @@ -10,10 +10,6 @@ replace github.com/AxisCommunications/go-dpop => github.com/streamplace/go-dpop replace github.com/bluesky-social/indigo => github.com/streamplace/indigo v0.0.0-20250813192504-b19ccd82854b -replace github.com/streamplace/oatproxy => ../oatproxy - -replace github.com/streamplace/atproto-oauth-golang => ../atproto-oauth-golang - require ( firebase.google.com/go/v4 v4.14.1 github.com/99designs/gqlgen v0.17.64 @@ -59,7 +55,7 @@ require ( github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e github.com/slok/go-http-metrics v0.13.0 github.com/streamplace/atproto-oauth-golang v0.0.0-20250619231223-a9c04fb888ac - github.com/streamplace/oatproxy v0.0.0-20250903220936-3131b72481a6 + github.com/streamplace/oatproxy v0.0.0-20251006070721-fdc391588c37 github.com/stretchr/testify v1.10.0 github.com/tdewolff/canvas v0.0.0-20250728095813-50d4cb1eee71 github.com/whyrusleeping/cbor-gen v0.3.1 diff --git a/go.sum b/go.sum index adf679b5..cfa366d0 100644 --- a/go.sum +++ b/go.sum @@ -1271,10 +1271,16 @@ github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YE github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= github.com/stbenjam/no-sprintf-host-port v0.2.0 h1:i8pxvGrt1+4G0czLr/WnmyH7zbZ8Bg8etvARQ1rpyl4= github.com/stbenjam/no-sprintf-host-port v0.2.0/go.mod h1:eL0bQ9PasS0hsyTyfTjjG+E80QIyPnBVQbYZyv20Jfk= +github.com/streamplace/atproto-oauth-golang v0.0.0-20250619231223-a9c04fb888ac h1:heVM4CGox3kfJclSmagsI3hvKk7W52EegnFqqs9CSYk= +github.com/streamplace/atproto-oauth-golang v0.0.0-20250619231223-a9c04fb888ac/go.mod h1:9LlKkqciiO5lRfbX0n4Wn5KNY9nvFb4R3by8FdW2TWc= github.com/streamplace/go-dpop v0.0.0-20250510031900-c897158a8ad4 h1:L1fS4HJSaAyNnkwfuZubgfeZy8rkWmA0cMtH5Z0HqNc= github.com/streamplace/go-dpop v0.0.0-20250510031900-c897158a8ad4/go.mod h1:bGUXY9Wd4mnd+XUrOYZr358J2f6z9QO/dLhL1SsiD+0= github.com/streamplace/indigo v0.0.0-20250813192504-b19ccd82854b h1:vh0Z1bDgcVXQjgmcXOBkC3B4uWi+HaxeyTvETzcA/Vg= github.com/streamplace/indigo v0.0.0-20250813192504-b19ccd82854b/go.mod h1:n6QE1NDPFoi7PRbMUZmc2y7FibCqiVU4ePpsvhHUBR8= +github.com/streamplace/oatproxy v0.0.0-20250903220936-3131b72481a6 h1:s83q+spLKCE/UXZEDnU7FEt6PJxyH+utQCyvQILATZk= +github.com/streamplace/oatproxy v0.0.0-20250903220936-3131b72481a6/go.mod h1:pXi24hA7xBHj8eEywX6wGqJOR9FaEYlGwQ/72rN6okw= +github.com/streamplace/oatproxy v0.0.0-20251006070721-fdc391588c37 h1:mCAT+PWrV1E/rbmA73/xYLnFw2DmOd6/HRR1AxZ1jRY= +github.com/streamplace/oatproxy v0.0.0-20251006070721-fdc391588c37/go.mod h1:pXi24hA7xBHj8eEywX6wGqJOR9FaEYlGwQ/72rN6okw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= diff --git a/pkg/cmd/streamplace.go b/pkg/cmd/streamplace.go index 6aa6fc97..3399f721 100644 --- a/pkg/cmd/streamplace.go +++ b/pkg/cmd/streamplace.go @@ -386,22 +386,25 @@ func start(build *config.BuildFlags, platformJobs []jobFunc) error { return err } - // clientMetadata := &oatproxy.OAuthClientMetadata{ - // Scope: "atproto transition:generic", - // ClientName: "Streamplace", - // RedirectURIs: []string{ - // fmt.Sprintf("https://%s/login", cli.PublicHost), - // fmt.Sprintf("https://%s/api/app-return", cli.PublicHost), - // }, - // } - - clientMetadata := &oatproxy.OAuthClientMetadata{ - Scope: "atproto transition:generic", - ClientName: "Streamplace", - RedirectURIs: []string{ - fmt.Sprintf("%s/login", cli.OwnPublicURL()), - fmt.Sprintf("%s/api/app-return", cli.OwnPublicURL()), - }, + var clientMetadata *oatproxy.OAuthClientMetadata + if cli.PublicOAuth { + clientMetadata = &oatproxy.OAuthClientMetadata{ + Scope: "atproto transition:generic", + ClientName: "Streamplace", + RedirectURIs: []string{ + fmt.Sprintf("%s/login", cli.OwnPublicURL()), + fmt.Sprintf("%s/api/app-return", cli.OwnPublicURL()), + }, + } + } else { + clientMetadata = &oatproxy.OAuthClientMetadata{ + Scope: "atproto transition:generic", + ClientName: "Streamplace", + RedirectURIs: []string{ + fmt.Sprintf("https://%s/login", cli.PublicHost), + fmt.Sprintf("https://%s/api/app-return", cli.PublicHost), + }, + } } op := oatproxy.New(&oatproxy.Config{ diff --git a/pkg/config/config.go b/pkg/config/config.go index 21c4745d..242f09c0 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -88,6 +88,7 @@ type CLI struct { Redirects []string TestStream bool FrontendProxy string + PublicOAuth bool AppBundleID string NoFirehose bool PrintChat bool @@ -149,6 +150,7 @@ func (cli *CLI) NewFlagSet(name string) *flag.FlagSet { fs.StringVar(&cli.AppBundleID, "app-bundle-id", "", "bundle id of an app that we facilitate oauth login for") fs.StringVar(&cli.StreamerName, "streamer-name", "", "name of the person streaming from this streamplace node") fs.StringVar(&cli.FrontendProxy, "dev-frontend-proxy", "", "(FOR DEVELOPMENT ONLY) proxy frontend requests to this address instead of using the bundled frontend") + fs.BoolVar(&cli.PublicOAuth, "dev-public-oauth", false, "(FOR DEVELOPMENT ONLY) enable public oauth login for http://127.0.0.1 development") fs.StringVar(&cli.LivepeerGatewayURL, "livepeer-gateway-url", "", "URL of the Livepeer Gateway to use for transcoding") fs.BoolVar(&cli.LivepeerGateway, "livepeer-gateway", false, "enable embedded Livepeer Gateway") fs.BoolVar(&cli.WideOpen, "wide-open", false, "allow ALL streams to be uploaded to this node (not recommended for production)") diff --git a/util/streamplace-dev.sh b/util/streamplace-dev.sh index 37718730..c283337d 100755 --- a/util/streamplace-dev.sh +++ b/util/streamplace-dev.sh @@ -9,4 +9,5 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) STREAMPLACE_DEV_VERSION=$(go run ./pkg/config/git/git.go -v) \ LD_LIBRARY_PATH="$SCRIPT_DIR/lib" \ SP_DEV_FRONTEND_PROXY="http://127.0.0.1:38081" \ +SP_DEV_PUBLIC_OAUTH=true \ exec "$SCRIPT_DIR/libstreamplace" "$@"