Skip to content

Commit

Permalink
fix access verification on transcoded content
Browse files Browse the repository at this point in the history
update deps
update gh actions
  • Loading branch information
nikooo777 committed Jul 10, 2024
1 parent 7722ecd commit 7d8932a
Show file tree
Hide file tree
Showing 9 changed files with 228 additions and 209 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -24,10 +24,10 @@ jobs:
- name: Check running containers
run: docker ps -a

- name: Set up Go 1.20
uses: actions/setup-go@v3
- name: Set up Go 1.22
uses: actions/setup-go@v5
with:
go-version: '1.20.x'
go-version: '1.22.x'
id: go

- name: Test
Expand All @@ -37,16 +37,16 @@ jobs:
# run: goveralls -coverprofile=coverage.out -service=circle-ci -repotoken ${{ secrets.COVERALLS_TOKEN }}

- name: Submit coverage report
uses: coverallsapp/github-action@1.1.3
uses: coverallsapp/github-action@2.3.0
with:
path-to-lcov: coverage.lcov
file: coverage.lcov
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Make binary
run: make linux

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
version := $(shell git describe --tags)



.PHONY: prepare_test
prepare_test:
curl https://raw.githubusercontent.com/OdyseeTeam/gody-cdn/master/db-init.sql -o init.sql
Expand Down
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import (
"github.com/OdyseeTeam/player-server/player"
"github.com/lbryio/reflector.go/server/http3"

tclient "github.com/OdyseeTeam/transcoder/client"
"github.com/lbryio/lbry.go/v2/stream"
"github.com/lbryio/reflector.go/server/peer"
"github.com/lbryio/reflector.go/store"
tclient "github.com/lbryio/transcoder/client"

"github.com/c2h5oh/datasize"
"github.com/sirupsen/logrus"
Expand Down
16 changes: 16 additions & 0 deletions firewall/firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"sync"
"time"

"github.com/OdyseeTeam/player-server/internal/iapi"

"github.com/bluele/gcache"
)

Expand Down Expand Up @@ -52,3 +54,17 @@ func CheckAndRateLimitIp(ip string, endpoint string) (bool, int) {
})
return flagged, resourcesCount
}

func IsStreamBlocked(claimId string, channelClaimId *string) bool {
blocked, err := iapi.GetBlockedContent()
if err == nil {
if blocked[claimId] {
return true
}
}

if channelClaimId != nil && blocked[*channelClaimId] {
return true
}
return false
}
91 changes: 45 additions & 46 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
module github.com/OdyseeTeam/player-server

go 1.20
go 1.22

require (
github.com/Depado/ginprom v1.7.11
github.com/OdyseeTeam/gody-cdn v1.0.7
github.com/Depado/ginprom v1.8.1
github.com/OdyseeTeam/gody-cdn v1.0.8
github.com/OdyseeTeam/transcoder v0.19.2
github.com/Pallinder/go-randomdata v1.2.0
github.com/aybabtme/iocontrol v0.0.0-20230712224448-9cbcdff08777
github.com/aybabtme/iocontrol v0.0.0-20240617100617-d92f77f10b49
github.com/bluele/gcache v0.0.2
github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b
github.com/c2h5oh/datasize v0.0.0-20231215233829-aa82cc1e6500
github.com/ekyoung/gin-nice-recovery v0.0.0-20160510022553-1654dca486db
github.com/getsentry/sentry-go v0.24.1
github.com/gin-contrib/pprof v1.4.0
github.com/gin-gonic/gin v1.9.1
github.com/getsentry/sentry-go v0.28.1
github.com/gin-contrib/pprof v1.5.0
github.com/gin-gonic/gin v1.10.0
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/lbryio/lbry.go/v2 v2.7.2-0.20230307181431-a01aa6dc0629
github.com/lbryio/reflector.go v1.1.3-0.20231011190137-4d81a43a8fab
github.com/lbryio/transcoder v0.18.2
github.com/lbryio/reflector.go v1.1.3-0.20240409180046-de736b068d75
github.com/lbryio/types v0.0.0-20220224142228-73610f6654a6
github.com/prometheus/client_golang v1.17.0
github.com/prometheus/client_golang v1.19.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.7.0
github.com/stretchr/testify v1.8.4
github.com/spf13/cobra v1.8.0
github.com/stretchr/testify v1.9.0
github.com/ybbus/jsonrpc v2.1.2+incompatible
golang.org/x/sync v0.4.0
golang.org/x/sync v0.7.0
)

require (
github.com/aws/aws-sdk-go v1.45.24 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
github.com/aws/aws-sdk-go v1.51.19 // indirect
github.com/benbjohnson/clock v1.3.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/brk0v/directio v0.0.0-20190225130936-69406e757cf7 // indirect
Expand All @@ -36,92 +37,90 @@ require (
github.com/btcsuite/btcutil v1.0.2 // indirect
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd // indirect
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 // indirect
github.com/bytedance/sonic v1.10.1 // indirect
github.com/bytedance/sonic v1.11.6 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
github.com/chenzhuoyu/iasm v0.9.0 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/floostack/transcoder v1.2.0 // indirect
github.com/friendsofgo/errors v0.9.2 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-errors/errors v1.5.1 // indirect
github.com/go-gorp/gorp/v3 v3.1.0 // indirect
github.com/go-ini/ini v1.67.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.15.4 // indirect
github.com/go-sql-driver/mysql v1.7.1 // indirect
github.com/go-playground/validator/v10 v10.20.0 // indirect
github.com/go-sql-driver/mysql v1.8.1 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gofrs/uuid v4.4.0+incompatible // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/pprof v0.0.0-20230926050212-f7f687d19a98 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/grafov/m3u8 v0.12.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/karlseguin/ccache/v2 v2.0.8 // indirect
github.com/karrick/godirwalk v1.17.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/lbryio/chainquery v1.9.1-0.20230515181855-2fcba3115cfe // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/lyoshenka/bencode v0.0.0-20180323155644-b7abd7672df5 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/nikooo777/lbry-blobs-downloader v1.2.0 // indirect
github.com/nikooo777/lbry-blobs-downloader v1.2.2 // indirect
github.com/onsi/ginkgo/v2 v2.12.1 // indirect
github.com/panjf2000/ants/v2 v2.8.2 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/quic-go/qpack v0.4.0 // indirect
github.com/quic-go/qtls-go1-20 v0.3.4 // indirect
github.com/quic-go/quic-go v0.39.0 // indirect
github.com/quic-go/quic-go v0.42.0 // indirect
github.com/rubenv/sql-migrate v1.5.2 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.16.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/tabbed/pqtype v0.1.1 // indirect
github.com/tkanos/gonfig v0.0.0-20210106201359-53e13348de2f // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/volatiletech/inflect v0.0.1 // indirect
github.com/volatiletech/null/v8 v8.1.2 // indirect
github.com/volatiletech/randomize v0.0.1 // indirect
github.com/volatiletech/strmangle v0.0.5 // indirect
github.com/ybbus/jsonrpc/v2 v2.1.7 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/mock v0.3.0 // indirect
go.uber.org/mock v0.4.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/arch v0.5.0 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/tools v0.13.0 // indirect
golang.org/x/arch v0.8.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/tools v0.18.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/protobuf v1.31.0 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/nullbio/null.v6 v6.0.0-20161116030900-40264a2e6b79 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand All @@ -135,4 +134,4 @@ replace github.com/floostack/transcoder => github.com/anbsky/transcoder v1.2.0

//replace github.com/OdyseeTeam/gody-cdn => /home/niko/work/repositories/gody-cdn/
//replace github.com/lbryio/reflector.go => /home/niko/go/src/github.com/lbryio/reflector.go
//replace github.com/lbryio/transcoder => /home/niko/work/repositories/transcoder
//replace github.com/lbryio/transcoder => github.com/OdyseeTeam/transcoder master
Loading

0 comments on commit 7d8932a

Please sign in to comment.