Skip to content

Commit

Permalink
adjust users
Browse files Browse the repository at this point in the history
  • Loading branch information
nikooo777 committed Jan 19, 2024
1 parent 9451331 commit d8d1559
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MYSQL_DSN_RO="lbry-ro:lbry@tcp(localhost:3306)/commentron"
MYSQL_DSN_RW="lbry-rw:lbry@tcp(localhost:3306)/commentron"
MYSQL_DSN_RO="commentron-ro:commentron@tcp(localhost:3306)/commentron"
MYSQL_DSN_RW="commentron-rw:commentron@tcp(localhost:3306)/commentron"
SDK_URL="https://api.na-backend.odysee.com/api/v1/proxy"
SOCKETY_TOKEN="sockety_token" #If you want to integrate directly with sockety locally
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
run: |
sudo mysql -u root -proot -e 'CREATE DATABASE IF NOT EXISTS commentron;'
sudo mysql -u root -proot -e 'CREATE DATABASE IF NOT EXISTS social;'
sudo mysql -u root -proot -e "CREATE USER 'lbry-rw'@'localhost' IDENTIFIED BY 'lbry';"
sudo mysql -u root -proot -e "CREATE USER 'lbry-ro'@'localhost' IDENTIFIED BY 'lbry';"
sudo mysql -u root -proot -e "GRANT ALL ON commentron.* TO 'lbry-rw'@'localhost';"
sudo mysql -u root -proot -e "GRANT SELECT ON commentron.* TO 'lbry-ro'@'localhost';"
sudo mysql -u root -proot -e "GRANT ALL ON social.* TO 'lbry-rw'@'localhost';"
sudo mysql -u root -proot -e "CREATE USER 'commentron-rw'@'localhost' IDENTIFIED BY 'commentron';"
sudo mysql -u root -proot -e "CREATE USER 'commentron-ro'@'localhost' IDENTIFIED BY 'commentron';"
sudo mysql -u root -proot -e "GRANT ALL ON commentron.* TO 'commentron-rw'@'localhost';"
sudo mysql -u root -proot -e "GRANT SELECT ON commentron.* TO 'commentron-ro'@'localhost';"
sudo mysql -u root -proot -e "GRANT ALL ON social.* TO 'commentron-rw'@'localhost';"
- name: Cache
uses: actions/cache@v2
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
env:
GOPRIVATE: github.com/OdyseeTeam
IS_TEST: true
SDK_URL: https://api.lbry.tv/api/v1/proxy
SDK_URL: https://api.na-backend.odysee.com/api/v1/proxy
run: |
./scripts/build.sh
./scripts/lint.sh
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ This is the commenting system for odysee.com. The system uses a JSON RPC server.

Make sure you setup the configuration to use env files.

`MYSQL_DSN_RO="lbry-ro:lbry@tcp(localhost:3306)/commentron"`
`MYSQL_DSN_RO="commentron-ro:commentron@tcp(localhost:3306)/commentron"`

`MYSQL_DSN_RW="lbry-rw:lbry@tcp(localhost:3306)/commentron"`
`MYSQL_DSN_RW="commentron-rw:commentron@tcp(localhost:3306)/commentron"`

`SDK_URL="https://api.na-backend.odysee.com/api/v1/proxy"`

Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func init() {

var rootCmd = &cobra.Command{
Use: "commentron",
Short: "LBRY Comment Server",
Short: "Odysee Comment Server",
Long: `Accepts new and delivers existing comments`,
Args: cobra.MinimumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ services:
- "3306"
environment:
- MYSQL_DATABASE=commentron
- MYSQL_USER=lbry
- MYSQL_PASSWORD=lbry
- MYSQL_USER=commentron
- MYSQL_PASSWORD=commentron
- MYSQL_LOG_CONSOLE=true
volumes:
- data:/var/lib/mysql"
commentron:
image: lbry/commentron:master
image: odyseeteam/commentron:master
restart: "no"
ports:
- "5900:5900"
environment:
- MYSQL_DSN=lbry:lbry@tcp(mysql:3306)/commentron
- MYSQL_DSN=commentron:commentron@tcp(mysql:3306)/commentron
- AUTH_TOKEN=<token>
depends_on:
- mysql
Expand Down
4 changes: 2 additions & 2 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
export DEBUGGING=1
export MYSQL_DSN_RO="lbry-ro:lbry@tcp(localhost:3306)/commentron"
export MYSQL_DSN_RW="lbry-rw:lbry@tcp(localhost:3306)/commentron"
export MYSQL_DSN_RO="commentron-ro:commentron@tcp(localhost:3306)/commentron"
export MYSQL_DSN_RW="commentron-rw:commentron@tcp(localhost:3306)/commentron"
touch -a .env && set -o allexport; source ./.env; set +o allexport
12 changes: 6 additions & 6 deletions scripts/test_db_via_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ mkdir -p /tmp/commentron/init.d
tee /tmp/commentron/init.d/001_init.sql <<EOF
CREATE DATABASE IF NOT EXISTS commentron;
CREATE DATABASE IF NOT EXISTS social;
CREATE USER 'lbry-ro'@'%' IDENTIFIED BY 'lbry';
CREATE USER 'lbry-rw'@'%' IDENTIFIED BY 'lbry';
GRANT ALL ON commentron.* TO 'lbry-rw'@'%';
GRANT SELECT ON commentron.* TO 'lbry-ro'@'%';
GRANT ALL ON social.* TO 'lbry-rw'@'%';
CREATE USER 'commentron-ro'@'%' IDENTIFIED BY 'commentron';
CREATE USER 'commentron-rw'@'%' IDENTIFIED BY 'commentron';
GRANT ALL ON commentron.* TO 'commentron-rw'@'%';
GRANT SELECT ON commentron.* TO 'commentron-ro'@'%';
GRANT ALL ON social.* TO 'commentron-rw'@'%';
FLUSH PRIVILEGES;
EOF

Expand All @@ -21,4 +21,4 @@ docker run --rm -it -p 3306:3306 \


# Verify with:
# mysql -h localhost -u lbry-rw -p commentron --protocol tcp
# mysql -h localhost -u commentron-rw -p commentron --protocol tcp
4 changes: 2 additions & 2 deletions sqlboiler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ output="model"
dbname="commentron"
host="localhost"
port=3306
user="lbry-rw"
pass="lbry"
user="commentron"
pass="commentron"
sslmode="false"

0 comments on commit d8d1559

Please sign in to comment.