Skip to content

Commit

Permalink
add is protected index (#126)
Browse files Browse the repository at this point in the history
* add is protected index


Update 019_comments_protected_idx.sql

* fix sqlboiler

* update import path

update go
update ubuntu
update binddata

Co-authored-by: Niko Storni <[email protected]>
  • Loading branch information
tzarebczan and nikooo777 authored Sep 21, 2022
1 parent b4b755c commit 1bf2462
Show file tree
Hide file tree
Showing 69 changed files with 227 additions and 320 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
os: linux
dist: bionic
dist: focal
language: go
go_import_path: github.com/lbryio/commentron
go_import_path: github.com/OdyseeTeam/commentron

go: 1.17.x
go: 1.18.x

install: true

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ The only integration we really support right now, is via the [Go Client API](com
```golang
package main

import "github.com/lbryio/commentron/commentapi"
import "github.com/lbryio/OdyseeTeam/commentapi"

func main() {
commentID := "0fa2eacf0b91fa3187e87733f103418e51f0c40d0b06b67c5d6d3ff2c13b2925"
Expand Down
10 changes: 5 additions & 5 deletions cmd/serve.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package cmd

import (
"github.com/lbryio/commentron/config"
"github.com/lbryio/commentron/env"
"github.com/lbryio/commentron/jobs"
"github.com/lbryio/commentron/server"
"github.com/lbryio/commentron/server/lbry"
"github.com/OdyseeTeam/commentron/config"
"github.com/OdyseeTeam/commentron/env"
"github.com/OdyseeTeam/commentron/jobs"
"github.com/OdyseeTeam/commentron/server"
"github.com/OdyseeTeam/commentron/server/lbry"

"github.com/pkg/profile"
"github.com/sirupsen/logrus"
Expand Down
8 changes: 4 additions & 4 deletions cmd/test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package cmd

import (
"github.com/lbryio/commentron/config"
"github.com/lbryio/commentron/env"
"github.com/lbryio/commentron/server/lbry"
"github.com/lbryio/commentron/tests"
"github.com/OdyseeTeam/commentron/config"
"github.com/OdyseeTeam/commentron/env"
"github.com/OdyseeTeam/commentron/server/lbry"
"github.com/OdyseeTeam/commentron/tests"

"github.com/pkg/profile"
"github.com/sirupsen/logrus"
Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/lbryio/commentron/meta"
"github.com/OdyseeTeam/commentron/meta"

"github.com/spf13/cobra"
)
Expand Down
4 changes: 2 additions & 2 deletions commentapi/blocked_lists.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"net/http"
"time"

"github.com/lbryio/commentron/validator"
"github.com/OdyseeTeam/commentron/validator"

"github.com/lbryio/lbry.go/v2/extras/api"
"github.com/lbryio/lbry.go/v2/extras/errors"
v "github.com/lbryio/ozzo-validation"
Expand Down
4 changes: 2 additions & 2 deletions commentapi/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"strings"
"time"

"github.com/lbryio/commentron/server/lbry"
"github.com/OdyseeTeam/commentron/server/lbry"

"github.com/lbryio/lbry.go/v2/extras/errors"

"github.com/fatih/structs"
"github.com/mitchellh/mapstructure"
log "github.com/sirupsen/logrus"
Expand Down
2 changes: 1 addition & 1 deletion commentapi/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/http"
"regexp"

"github.com/lbryio/commentron/validator"
"github.com/OdyseeTeam/commentron/validator"

"github.com/lbryio/lbry.go/v2/extras/api"
"github.com/lbryio/lbry.go/v2/extras/errors"
Expand Down
2 changes: 1 addition & 1 deletion commentapi/moderation.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"net/http"
"time"

"github.com/lbryio/commentron/validator"
"github.com/OdyseeTeam/commentron/validator"

"github.com/lbryio/lbry.go/v2/extras/api"
"github.com/lbryio/lbry.go/v2/extras/errors"
Expand Down
2 changes: 1 addition & 1 deletion commentapi/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package commentapi
import (
"net/http"

"github.com/lbryio/commentron/validator"
"github.com/OdyseeTeam/commentron/validator"

"github.com/lbryio/lbry.go/v2/extras/api"
"github.com/lbryio/lbry.go/v2/extras/errors"
Expand Down
4 changes: 2 additions & 2 deletions commentapi/test/comment.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package main

import (
"github.com/lbryio/commentron/commentapi"
"github.com/lbryio/commentron/env"
"github.com/OdyseeTeam/commentron/commentapi"
"github.com/OdyseeTeam/commentron/env"

"github.com/sirupsen/logrus"
)
Expand Down
6 changes: 3 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package config

import (
"github.com/lbryio/commentron/db"
"github.com/lbryio/commentron/env"
"github.com/lbryio/commentron/helper"
"github.com/OdyseeTeam/commentron/db"
"github.com/OdyseeTeam/commentron/env"
"github.com/OdyseeTeam/commentron/helper"

"github.com/johntdyer/slackrus"
"github.com/sirupsen/logrus"
Expand Down
2 changes: 1 addition & 1 deletion config/stripe.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package config

import "github.com/lbryio/commentron/env"
import "github.com/OdyseeTeam/commentron/env"

var connectAPIKey string
var connectAPIKeyTest string
Expand Down
2 changes: 1 addition & 1 deletion db/init.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package db

import (
"github.com/lbryio/commentron/migration"
"github.com/OdyseeTeam/commentron/migration"

"github.com/lbryio/lbry.go/v2/extras/errors"

Expand Down
2 changes: 1 addition & 1 deletion flags/flagged.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package flags

import (
"github.com/lbryio/commentron/model"
"github.com/OdyseeTeam/commentron/model"
)

// CheckComment checks and flags comments for deletion due to spam or key phrases
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/lbryio/commentron
module github.com/OdyseeTeam/commentron

go 1.17
go 1.18

require (
github.com/Avalanche-io/counter v0.0.0-20180124180526-1336089e985a
Expand Down
121 changes: 0 additions & 121 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions helper/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"database/sql"
"time"

"github.com/lbryio/commentron/db"
"github.com/lbryio/commentron/model"
"github.com/OdyseeTeam/commentron/db"
"github.com/OdyseeTeam/commentron/model"

"github.com/lbryio/lbry.go/v2/extras/errors"

Expand Down
6 changes: 3 additions & 3 deletions helper/moderation.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"database/sql"
"net/http"

"github.com/lbryio/commentron/db"
"github.com/lbryio/commentron/model"
m "github.com/lbryio/commentron/model"
"github.com/OdyseeTeam/commentron/db"
"github.com/OdyseeTeam/commentron/model"
m "github.com/OdyseeTeam/commentron/model"

"github.com/lbryio/lbry.go/v2/extras/api"
"github.com/lbryio/lbry.go/v2/extras/errors"
Expand Down
6 changes: 3 additions & 3 deletions jobs/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package jobs
import (
"time"

"github.com/lbryio/commentron/db"
"github.com/lbryio/commentron/metrics"
"github.com/lbryio/commentron/model"
"github.com/OdyseeTeam/commentron/db"
"github.com/OdyseeTeam/commentron/metrics"
"github.com/OdyseeTeam/commentron/model"

"github.com/go-co-op/gocron"
"github.com/sirupsen/logrus"
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import "github.com/lbryio/commentron/cmd"
import "github.com/OdyseeTeam/commentron/cmd"

//go:generate go-bindata -o migration/bindata.go -nometadata -pkg migration -ignore bindata.go migration/
//go:generate go fmt ./migration/bindata.go
Expand Down
5 changes: 5 additions & 0 deletions migration/019_comments_protected_idx.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- +migrate Up

-- +migrate StatementBegin
ALTER TABLE comment ADD INDEX idx_is_protected (is_protected), ALGORITHM=INPLACE, LOCK=NONE;
-- +migrate StatementEnd
23 changes: 23 additions & 0 deletions migration/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set -e


echo "== Compiling =="
export IMPORTPATH="github.com/lbryio/commentron"
export IMPORTPATH="github.com/OdyseeTeam/commentron"
mkdir -p "$DIR/bin"
go generate -v
export VERSIONSHORT="${TRAVIS_COMMIT:-"$(git describe --tags --always --dirty)"}"
Expand Down
10 changes: 5 additions & 5 deletions server/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
"net/http"
"strings"

"github.com/lbryio/commentron/commentapi"
"github.com/lbryio/commentron/db"
"github.com/lbryio/commentron/helper"
"github.com/lbryio/commentron/model"
"github.com/lbryio/commentron/server/lbry"
"github.com/OdyseeTeam/commentron/commentapi"
"github.com/OdyseeTeam/commentron/db"
"github.com/OdyseeTeam/commentron/helper"
"github.com/OdyseeTeam/commentron/model"
"github.com/OdyseeTeam/commentron/server/lbry"

"github.com/lbryio/lbry.go/v2/extras/errors"

Expand Down
2 changes: 1 addition & 1 deletion server/lbry/apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/url"
"strconv"

"github.com/lbryio/commentron/helper"
"github.com/OdyseeTeam/commentron/helper"

"github.com/lbryio/lbry.go/v2/extras/errors"

Expand Down
2 changes: 1 addition & 1 deletion server/lbry/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strconv"
"time"

"github.com/lbryio/commentron/helper"
"github.com/OdyseeTeam/commentron/helper"

"github.com/lbryio/lbry.go/v2/extras/errors"
"github.com/lbryio/lbry.go/v2/extras/jsonrpc"
Expand Down
2 changes: 1 addition & 1 deletion server/lbry/client.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package lbry

import (
"github.com/lbryio/commentron/env"
"github.com/OdyseeTeam/commentron/env"

"github.com/lbryio/lbry.go/v2/extras/jsonrpc"

Expand Down
2 changes: 1 addition & 1 deletion server/lbry/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package lbry
import (
"time"

"github.com/lbryio/commentron/metrics"
"github.com/OdyseeTeam/commentron/metrics"

"github.com/lbryio/lbry.go/v2/extras/errors"
"github.com/lbryio/lbry.go/v2/extras/jsonrpc"
Expand Down
4 changes: 2 additions & 2 deletions server/lbry/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"strconv"
"time"

"github.com/lbryio/commentron/config"
"github.com/lbryio/commentron/helper"
"github.com/OdyseeTeam/commentron/config"
"github.com/OdyseeTeam/commentron/helper"

"github.com/lbryio/lbry.go/v2/extras/errors"
"github.com/lbryio/lbry.go/v2/extras/jsonrpc"
Expand Down
2 changes: 1 addition & 1 deletion server/lbry/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"testing"
"time"

"github.com/lbryio/commentron/helper"
"github.com/OdyseeTeam/commentron/helper"

"github.com/lbryio/lbry.go/v2/schema/keys"

Expand Down
Loading

0 comments on commit 1bf2462

Please sign in to comment.