tdjsnelling / sqtracker

A modern private BitTorrent tracker platform
GNU General Public License v3.0
216 stars 41 forks source link

test deploy problem #59

Open pureGavin opened 1 year ago

pureGavin commented 1 year ago

i just wanna do some test without domain, it's seem not able to be deploy without domain, i try to access to my test sqtracker server with IP address only, but it doesn't work :(

Klaiment commented 1 year ago

Hello, You test it on server or desktop ? OS ? Docker or npm ?

pureGavin commented 1 year ago

Hello, You test it on server or desktop ? OS ? Docker or npm ?

test on ubuntu VPS server with docker, i just git clone all project and do docker compose up -d

Klaiment commented 1 year ago

you have configure the config.js ? I test it on ubuntu 22.04 server and i'll back tu u

pureGavin commented 1 year ago

you have configure the config.js ? I test it on ubuntu 22.04 server and i'll back tu u

yes, i have configure the config.js, and there is a SQ_BASE_URL: "https://pt.example.com"

pureGavin commented 1 year ago

i don't have domain yet, should i type my IP address in it ?

Klaiment commented 1 year ago

put this :

    // The URL of your tracker site.
    SQ_BASE_URL: "http://IP:3000",

    // The URL of your API. Under the recommended setup, it should be `${SQ_BASE_URL}/api`.
    SQ_API_URL: "http://IP:3001",
pureGavin commented 1 year ago

put this :

    // The URL of your tracker site.
    SQ_BASE_URL: "http://IP:3000",

    // The URL of your API. Under the recommended setup, it should be `${SQ_BASE_URL}/api`.
    SQ_API_URL: "http://IP:3001",

just those two?

pureGavin commented 1 year ago

is traefik necessary?

Klaiment commented 1 year ago

is traefik necessary?

no

Klaiment commented 1 year ago

put this :

    // The URL of your tracker site.
    SQ_BASE_URL: "http://IP:3000",

    // The URL of your API. Under the recommended setup, it should be `${SQ_BASE_URL}/api`.
    SQ_API_URL: "http://IP:3001",

just those two?

mongo & secret too

pureGavin commented 1 year ago

put this :

    // The URL of your tracker site.
    SQ_BASE_URL: "http://IP:3000",

    // The URL of your API. Under the recommended setup, it should be `${SQ_BASE_URL}/api`.
    SQ_API_URL: "http://IP:3001",

just those two?

mongo & secret too

still doesn't work :( this is my config

// This is an example configuration file.
// Copy it to config.js and change each value according to your desired setup.

module.exports = {
  envs: {
    // The name of your tracker site. Maximum 20 characters.
    SQ_SITE_NAME: "sqtracker demo",

    // A short description of your tracker site. Maximum 80 characters.
    SQ_SITE_DESCRIPTION: "A short description for your tracker site",

    // A map of custom hex colours to use as the theme of your site.
    // If not specified, the default light and dark themes will be used.
    // If only "primary" is specified, the default light and dark themes will be used but with your main brand colour.
    // If the other values are specified, the fully custom theme will be used and not the default light/dark.
    SQ_CUSTOM_THEME: {
      primary: "#f45d48",
      // background: "#1f2023", // Page background colour
      // sidebar: "#27282b",    // A secondary background colour, used for sidebar, infoboxes etc.
      // border: "#303236",     // Border colour
      // text: "#f8f8f8",       // Text colour. Should be readable against background and sidebar
      // grey: "#aaa",          // Secondary text colour, used for less important text
    },

    // Registration mode. Either "open", "invite" or "closed".
    // Open: anyone can register.
    // Invite: must be invited by existing user.
    // Closed: no one can register.
    SQ_ALLOW_REGISTER: "invite",

    // A boolean value determining whether users can choose to upload anonymously.
    // Admins can still see who uploaded anonymously, but other users cannot.
    SQ_ALLOW_ANONYMOUS_UPLOADS: false,

    // Minimum allowed ratio. Below this users will not be able to download. Set to -1 to disable.
    SQ_MINIMUM_RATIO: 0.75,

    // Maximum allowed hit'n'runs. Above this users will not be allowed to download. Set to -1 to disable.
    // A user has committed a hit'n'run when a torrent is fully downloaded and not seeded to a 1:1 ratio.
    SQ_MAXIMUM_HIT_N_RUNS: 1,

    // A map of torrent categories that can be selected when uploading.
    // Each has an array of zero or more sources available within that category.
    SQ_TORRENT_CATEGORIES: {
      Movies: ["BluRay", "WebDL", "HDRip", "WebRip", "DVD", "Cam"],
      TV: [],
      Music: [],
      Books: [],
    },

    // Number of bonus points awarded to a user for each GB they upload. Minimum 0.
    SQ_BP_EARNED_PER_GB: 1,

    // Number of bonus points awarded to a user if they suggest a torrent to fill a request and it gets accepted
    // They get double if they also the uploader of the accepted torrent
    SQ_BP_EARNED_PER_FILLED_REQUEST: 1,

    // Number of bonus points it costs a user to buy 1 invite (set to 0 to disable buying invites).
    SQ_BP_COST_PER_INVITE: 3,

    // Number of bonus points it costs a user to buy 1 GB of upload (set to 0 to disable buying upload).
    SQ_BP_COST_PER_GB: 3,

    // Whether to enable freeleech on all torrents.
    SQ_SITE_WIDE_FREELEECH: false,

    // Whether torrent pages can be viewed by unregistered users.
    // If true, only logged-in users will be able to download/interact, but anyone (search engines included) will be able to view/read torrent info.
    // Non-logged-in users will also be able to browse category/tag pages and wiki pages that have been set to public.
    // Enable if you want torrents to be indexed to help search traffic.
    SQ_ALLOW_UNREGISTERED_VIEW: false,

    // An array of blacklisted file extensions. Torrents containing files with these extensions will fail to upload.
    SQ_EXTENSION_BLACKLIST: ["exe"],

    // The URL of your tracker site.
    SQ_BASE_URL: "http://139.180.214.53:3000",

    // The URL of your API. Under the recommended setup, it should be `${SQ_BASE_URL}/api`.
    SQ_API_URL: "http://139.180.214.53:3001",

    // The URL of your MongoDB server. Under the recommended setup, it should be `mongodb://sq_mongodb/sqtracker`.
    SQ_MONGO_URL: "mongodb://139.180.214.53",

    // The email address that mail will be sent from.
    SQ_MAIL_FROM_ADDRESS: "mail@sqtracker.dev",

    // The hostname of your SMTP server.
    SQ_SMTP_HOST: "139.180.214.53",

    // The port of your SMTP server.
    SQ_SMTP_PORT: 587,

    // Whether to force SMTP TLS: if true the connection will use TLS when connecting to server.
    // If false (the default) then TLS is used if server supports the STARTTLS extension.
    // In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false.
    SQ_SMTP_SECURE: false,
  },
  secrets: {
    // A secret value to sign tokens with. Should be long and random.
    SQ_JWT_SECRET: "hoGfhMMp6Fv47N70bYEsysmHrRqR8Q2gfTWm3BIv+IcAIIpETrkckQ4qaUAQ",

    // A secret value to verify server requests with. Should be long and random, and different to the JWT secret.
    SQ_SERVER_SECRET: "HtNHCstXwtBM1Tk53Q8Nz9dwNfBJW4Y2zhn7a4wb8y6TwQAApVnhvV0YWign",

    // The email address to use for the initial admin user.
    // Must be valid, you will need to verify.
    SQ_ADMIN_EMAIL: "admin@example.com",

    // The username to authenticate with your SMTP server with.
    SQ_SMTP_USER: "smtp_username",

    // The password to authenticate with your SMTP server with.
    SQ_SMTP_PASS: "smtp_password",
  },
};

and trust me, i already change the config file name to config.js

Klaiment commented 1 year ago

Do you have an error? Open ports?

pureGavin commented 1 year ago

Do you have an error? Open ports?

here is my output msg

root@vultr:/home/ubuntu/sqtracker# docker logs sq_client
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
root@vultr:/home/ubuntu/sqtracker# docker logs sq_api
yarn run v1.22.19
$ babel-node src/index.js
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
[sq] configuration is valid
[sq] initiating db connection...
[sq] ■ sqtracker running http://localhost:3001
[sq] error on initial db connection: connect ECONNREFUSED 139.180.214.53:27017
[sq] initiating db connection...
[sq] error on initial db connection: connect ECONNREFUSED 139.180.214.53:27017
[sq] initiating db connection...
[sq] error on initial db connection: connect ECONNREFUSED 139.180.214.53:27017
[sq] initiating db connection...
yarn run v1.22.19
$ babel-node src/index.js
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
[sq] ERROR: invalid configuration: envs.SQ_MONGO_URL must match the following: "/mongodb:\/\/.*/"
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
yarn run v1.22.19
$ babel-node src/index.js
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
[sq] configuration is valid
[sq] initiating db connection...
[sq] ■ sqtracker running http://localhost:3001
[sq] error on initial db connection: connect ECONNREFUSED 139.180.214.53:27017
[sq] initiating db connection...
[sq] error on initial db connection: connect ECONNREFUSED 139.180.214.53:27017
[sq] initiating db connection...
[sq] error on initial db connection: connect ECONNREFUSED 139.180.214.53:27017
[sq] initiating db connection...
[sq] error on initial db connection: connect ECONNREFUSED 139.180.214.53:27017
[sq] initiating db connection...
[sq] error on initial db connection: connect ECONNREFUSED 139.180.214.53:27017
[sq] initiating db connection...
[sq] error on initial db connection: connect ECONNREFUSED 139.180.214.53:27017
[sq] initiating db connection...
[sq] error on initial db connection: connect ECONNREFUSED 139.180.214.53:27017
[sq] initiating db connection...
[sq] error on initial db connection: connect ECONNREFUSED 139.180.214.53:27017
[sq] initiating db connection...
yarn run v1.22.19
$ babel-node src/index.js
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
[sq] configuration is valid
[sq] initiating db connection...
[sq] ■ sqtracker running http://localhost:3001
[sq] error on initial db connection: connect ECONNREFUSED 139.180.214.53:27017
[sq] initiating db connection...
[sq] error on initial db connection: connect ECONNREFUSED 139.180.214.53:27017
[sq] initiating db connection...
[sq] error on initial db connection: connect ECONNREFUSED 139.180.214.53:27017
[sq] initiating db connection...
[sq] error on initial db connection: connect ECONNREFUSED 139.180.214.53:27017
[sq] initiating db connection...
[sq] error on initial db connection: connect ECONNREFUSED 139.180.214.53:27017
[sq] initiating db connection...
[sq] error on initial db connection: connect ECONNREFUSED 139.180.214.53:27017
[sq] initiating db connection...

all port is open

root@vultr:/home/ubuntu/sqtracker# ufw status verbose 
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), deny (routed)
New profiles: skip

To                         Action      From
--                         ------      ----
22/tcp                     ALLOW IN    Anywhere                  
3000                       ALLOW IN    Anywhere                  
3001                       ALLOW IN    Anywhere                  
27017                      ALLOW IN    Anywhere                  
22/tcp (v6)                ALLOW IN    Anywhere (v6)             
3000 (v6)                  ALLOW IN    Anywhere (v6)             
3001 (v6)                  ALLOW IN    Anywhere (v6)             
27017 (v6)                 ALLOW IN    Anywhere (v6)  
pureGavin commented 1 year ago

Do you have an error? Open ports?

it looks like mongodb's problem

Klaiment commented 1 year ago

grab the local mongo ip with this command : docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sq_mongodb and replace

pureGavin commented 1 year ago

grab the local mongo ip with this command : docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sq_mongodb and replace

well, mongodb is worked but there is a new error

root@vultr:/home/ubuntu/sqtracker# docker logs sq_api
yarn run v1.22.19
$ babel-node src/index.js
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
[sq] configuration is valid
[sq] initiating db connection...
[sq] ■ sqtracker running http://localhost:3001
[sq] error on initial db connection: connect ECONNREFUSED 139.180.214.53:27017
[sq] initiating db connection...
[sq] error on initial db connection: connect ECONNREFUSED 139.180.214.53:27017
[sq] initiating db connection...
yarn run v1.22.19
$ babel-node src/index.js
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
[sq] configuration is valid
[sq] initiating db connection...
[sq] ■ sqtracker running http://localhost:3001
[sq] connected to mongodb successfully
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: Connection timeout
    at SMTPConnection._formatError (/sqtracker/app/node_modules/nodemailer/lib/smtp-connection/index.js:790:19)
    at SMTPConnection._onError (/sqtracker/app/node_modules/nodemailer/lib/smtp-connection/index.js:776:20)
    at Timeout.<anonymous> (/sqtracker/app/node_modules/nodemailer/lib/smtp-connection/index.js:235:22)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)
pureGavin commented 1 year ago

@Klaiment it's a smtp server problem, but i don't have a smtp server yet, should i create one before i start sqtracker?

Klaiment commented 1 year ago

smtp is not problem, i run without

Klaiment commented 1 year ago

if u want to test with it, you can use gmail smtp