latest update

This commit is contained in:
Karl 2021-11-16 17:37:04 +00:00
parent a315c3e6b7
commit cf88b5f3e5
14 changed files with 93 additions and 20 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
node_modules node_modules
test2.js

9
.vscode/launch.json vendored
View File

@ -4,6 +4,15 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{
"name": "Launch Program",
"program": "${workspaceFolder}/lib/apache_functions.js",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node"
},
{ {
"type": "node", "type": "node",
"request": "launch", "request": "launch",

View File

@ -1,4 +1,4 @@
docker stop bblbtv_dns &&\ docker stop ktvmanager &\
docker rm --force bblbtv_dns &&\ docker rm --force ktvmanager &\
docker build -t bblbtv_dns . &&\ docker build -t ktvmanager . &&\
docker run -p 6969:6969 -v ${PWD}/logs:/usr/src/app/logs -d --name bblbtv_dns bblbtv_dns:latest docker run -p 6969:6969 -v ${PWD}/logs:/usr/src/app/logs -d --name kTvManager ktvmanager:latest

View File

@ -5,7 +5,7 @@ services:
build: build:
context: . context: .
dockerfile: .dockerfile dockerfile: .dockerfile
image: "karl0ss/bblbtv_dns-backend" image: "karl0ss/ktvmanager"
extra_hosts: extra_hosts:
- "host.docker.internal:host-gateway" - "host.docker.internal:host-gateway"
volumes: volumes:

View File

@ -6,7 +6,7 @@ const sql = require('./mysql')
function storeAccountToDB(accountDetails) { function storeAccountToDB(accountDetails) {
const encryptedPassword = cryptr.encrypt(accountDetails.password); const encryptedPassword = cryptr.encrypt(accountDetails.password);
const result = sql.query(`INSERT userAccounts (username, password, stream, userID, expiaryDate, streamURL) VALUES ("${accountDetails.username}", "${encryptedPassword}", "${accountDetails.streamName}", ${accountDetails.userId}, ${accountDetails.expiryDate}, "${accountDetails.streamURL}")`); const result = sql.query(`INSERT userAccounts (username, password, stream, userID, expiaryDate, streamURL, maxConnections) VALUES ("${accountDetails.username}", "${encryptedPassword}", "${accountDetails.streamName}", ${accountDetails.userId}, ${accountDetails.expiryDate}, "${accountDetails.streamURL}", ${accountDetails.maxConnections})`);
return result return result
} }

View File

@ -1,5 +1,5 @@
[ [
"http://webservgroup.xyz/smarters4567891/api/home.php?action=dns", "http://apppanel.co.uk/panel/capo/smarters/api//home.php?action=dns",
"http://panelhost.xyz/cli3nts/Funky/Smarters/api/home.php?action=dns", "http://panelhost.xyz/cli3nts/Funky/Smarters/api/home.php?action=dns"
"http://panelhost.xyz/cli3nts/smartersv3/funky/api/home.php?action=dns"
] ]

5
lib/DNSArray_old.json Normal file
View File

@ -0,0 +1,5 @@
[
"http://webservgroup.xyz/smarters4567891/api/home.php?action=dns",
"http://panelhost.xyz/cli3nts/Funky/Smarters/api/home.php?action=dns",
"http://panelhost.xyz/cli3nts/smartersv3/funky/api/home.php?action=dns"
]

View File

@ -9,7 +9,7 @@ const tor_axios = require('tor-axios');
const tor = tor_axios.torSetup({ const tor = tor_axios.torSetup({
ip: process.env.TORSSRV, ip: process.env.TORSSRV,
port: 9050, port: 9050,
controlPort: '9051', controlPort: 9051,
controlPassword: process.env.TORSPWD, controlPassword: process.env.TORSPWD,
}) })
@ -77,7 +77,8 @@ async function addNewAccount(userAccount, data, url) {
"userId": userAccount.userId, "userId": userAccount.userId,
"streamName": userAccount.stream, "streamName": userAccount.stream,
"streamURL": URL.extractedUrl, "streamURL": URL.extractedUrl,
"expiryDate": data.user_info.exp_date "expiryDate": data.user_info.exp_date,
"maxConnections": data.user_info.max_connections
}, URL.extractedUrl, data.user_info.exp_date) }, URL.extractedUrl, data.user_info.exp_date)
var date = new Date(data.user_info.exp_date * 1000).toLocaleDateString(undefined, { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }) var date = new Date(data.user_info.exp_date * 1000).toLocaleDateString(undefined, { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' })
console.log(`${userAccount.username} - - ${URL.extractedUrl} - Expires ${date}.`) console.log(`${userAccount.username} - - ${URL.extractedUrl} - Expires ${date}.`)

View File

@ -1,13 +1,14 @@
{ {
"using": [ "using": [
],
"notUsing": [
"https://blackpud475.xyz",
"https://trippy.pro:443", "https://trippy.pro:443",
"https://itty.in:443", "https://itty.in:443",
"http://sting.ltd:25461", "http://sting.ltd:25461",
"http://37723998.to:2052", "http://37723998.to:2052",
"https://tictacs.win" "https://tictacs.win"
],
"notUsing": [
"https://blackpud475.xyz"
] ]
} }

41
package-lock.json generated
View File

@ -123,6 +123,11 @@
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
}, },
"apache-api": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/apache-api/-/apache-api-1.2.5.tgz",
"integrity": "sha512-kZFt2DkWUzpNmZKJCHuchk3jMDfb+gbd3bN1Bf8UMmTb5Gr38SmAERQjDLxq83MC3VVQV9YjVb7yOwjS0Pvd7w=="
},
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
@ -440,6 +445,15 @@
} }
} }
}, },
"deepdash": {
"version": "5.3.9",
"resolved": "https://registry.npmjs.org/deepdash/-/deepdash-5.3.9.tgz",
"integrity": "sha512-GRzJ0q9PDj2T+J2fX+b+TlUa2NlZ11l6vJ8LHNKVGeZ8CfxCuJaCychTq07iDRTvlfO8435jlvVS1QXBrW9kMg==",
"requires": {
"lodash": "^4.17.21",
"lodash-es": "^4.17.21"
}
},
"defer-to-connect": { "defer-to-connect": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz",
@ -910,6 +924,21 @@
"json-buffer": "3.0.1" "json-buffer": "3.0.1"
} }
}, },
"lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"lodash-es": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz",
"integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw=="
},
"lodash.isequal": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
"integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
},
"lowercase-keys": { "lowercase-keys": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz",
@ -1056,6 +1085,14 @@
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
"integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
}, },
"obj-traverse": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/obj-traverse/-/obj-traverse-1.0.0.tgz",
"integrity": "sha1-WP7H4jWWHjtpIsWc/Fu4RkgHIUY=",
"requires": {
"lodash.isequal": "^4.5.0"
}
},
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
@ -1590,6 +1627,10 @@
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
},
"yourls": {
"version": "git+https://github.com/karl0ss/node-yourls.git#596e6810d34aaf82755ea46af28a61004e0ab0c0",
"from": "git+https://github.com/karl0ss/node-yourls.git"
} }
} }
} }

View File

@ -6,17 +6,22 @@
"start": "node ./bin/www" "start": "node ./bin/www"
}, },
"dependencies": { "dependencies": {
"apache-api": "^1.2.5",
"axios": "^0.21.4", "axios": "^0.21.4",
"axios-cookiejar-support": "^2.0.0", "axios-cookiejar-support": "^2.0.0",
"bcrypt": "^5.0.0", "bcrypt": "^5.0.0",
"cryptr": "^6.0.2", "cryptr": "^6.0.2",
"deepdash": "^5.3.9",
"express": "~4.16.1", "express": "~4.16.1",
"express-basic-auth": "^1.2.0", "express-basic-auth": "^1.2.0",
"got": "^11.8.1", "got": "^11.8.1",
"http-errors": "~1.6.3", "http-errors": "~1.6.3",
"lodash": "^4.17.21",
"obj-traverse": "^1.0.0",
"request": "^2.88.2", "request": "^2.88.2",
"sync-mysql": "^3.0.1", "sync-mysql": "^3.0.1",
"tor-axios": "^1.0.9", "tor-axios": "^1.0.9",
"tough-cookie": "^4.0.0" "tough-cookie": "^4.0.0",
"yourls": "git+https://github.com/karl0ss/node-yourls.git"
} }
} }

View File

@ -1,7 +1,6 @@
var express = require('express'); var express = require('express');
var router = express.Router(); var router = express.Router();
const { storeAccountToDB } = require('../lib/Accounts')
const { getUserId } = require('../lib/getUser') const { getUserId } = require('../lib/getUser')
const { singleAccountCheck } = require('../lib/checker') const { singleAccountCheck } = require('../lib/checker')

View File

@ -34,7 +34,7 @@ async function getStreamsNew() {
jointArray.push(url) jointArray.push(url)
}); });
} }
jointArray.unshift(...otherURLs) jointArray.unshift(...otherURLs.using)
jointArray = [...new Set(jointArray)] jointArray = [...new Set(jointArray)]
return jointArray return jointArray
} }

View File

@ -2,6 +2,7 @@ var express = require('express');
var router = express.Router(); var router = express.Router();
const { getUserAccounts, getUserId } = require('../lib/getUser') const { getUserAccounts, getUserId } = require('../lib/getUser')
const { getStreamsNew } = require('../routes/getStreams')
const { decryptPassword } = require('../lib/password') const { decryptPassword } = require('../lib/password')
/* POST postUser page. */ /* POST postUser page. */
@ -19,10 +20,20 @@ router.get('/', async function (req, res, next) {
router.get('/count', async function (req, res, next) { router.get('/count', async function (req, res, next) {
try { try {
let data = await getUserAccounts(await getUserId(req.auth.user)) let data = await getUserAccounts(await getUserId(req.auth.user))
res.json({"streamCount": data.length}) res.json({ "streamCount": data.length })
} catch (error) { } catch (error) {
res.sendStatus(500) res.sendStatus(500)
} }
}); });
router.get('/streams', async function (req, res, next) {
try {
let data = await getStreamsNew()
res.json(data)
} catch (error) {
res.sendStatus(500)
}
});
module.exports = router; module.exports = router;