latest update
This commit is contained in:
parent
a315c3e6b7
commit
cf88b5f3e5
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
node_modules
|
||||
test2.js
|
||||
|
9
.vscode/launch.json
vendored
9
.vscode/launch.json
vendored
@ -4,6 +4,15 @@
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Launch Program",
|
||||
"program": "${workspaceFolder}/lib/apache_functions.js",
|
||||
"request": "launch",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"type": "pwa-node"
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
|
@ -1,4 +1,4 @@
|
||||
docker stop bblbtv_dns &&\
|
||||
docker rm --force bblbtv_dns &&\
|
||||
docker build -t bblbtv_dns . &&\
|
||||
docker run -p 6969:6969 -v ${PWD}/logs:/usr/src/app/logs -d --name bblbtv_dns bblbtv_dns:latest
|
||||
docker stop ktvmanager &\
|
||||
docker rm --force ktvmanager &\
|
||||
docker build -t ktvmanager . &&\
|
||||
docker run -p 6969:6969 -v ${PWD}/logs:/usr/src/app/logs -d --name kTvManager ktvmanager:latest
|
||||
|
@ -5,7 +5,7 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: .dockerfile
|
||||
image: "karl0ss/bblbtv_dns-backend"
|
||||
image: "karl0ss/ktvmanager"
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
volumes:
|
||||
|
@ -6,7 +6,7 @@ const sql = require('./mysql')
|
||||
|
||||
function storeAccountToDB(accountDetails) {
|
||||
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
|
||||
}
|
||||
|
||||
|
@ -1,5 +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"
|
||||
"http://apppanel.co.uk/panel/capo/smarters/api//home.php?action=dns",
|
||||
"http://panelhost.xyz/cli3nts/Funky/Smarters/api/home.php?action=dns"
|
||||
|
||||
]
|
5
lib/DNSArray_old.json
Normal file
5
lib/DNSArray_old.json
Normal 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"
|
||||
]
|
@ -9,7 +9,7 @@ const tor_axios = require('tor-axios');
|
||||
const tor = tor_axios.torSetup({
|
||||
ip: process.env.TORSSRV,
|
||||
port: 9050,
|
||||
controlPort: '9051',
|
||||
controlPort: 9051,
|
||||
controlPassword: process.env.TORSPWD,
|
||||
})
|
||||
|
||||
@ -77,7 +77,8 @@ async function addNewAccount(userAccount, data, url) {
|
||||
"userId": userAccount.userId,
|
||||
"streamName": userAccount.stream,
|
||||
"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)
|
||||
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}.`)
|
||||
|
@ -1,13 +1,14 @@
|
||||
{
|
||||
"using": [
|
||||
|
||||
|
||||
],
|
||||
"notUsing": [
|
||||
"https://blackpud475.xyz",
|
||||
"https://trippy.pro:443",
|
||||
"https://itty.in:443",
|
||||
"http://sting.ltd:25461",
|
||||
"http://37723998.to:2052",
|
||||
"https://tictacs.win"
|
||||
|
||||
],
|
||||
"notUsing": [
|
||||
"https://blackpud475.xyz"
|
||||
]
|
||||
}
|
41
package-lock.json
generated
41
package-lock.json
generated
@ -123,6 +123,11 @@
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
|
||||
"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": {
|
||||
"version": "1.2.0",
|
||||
"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": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz",
|
||||
@ -910,6 +924,21 @@
|
||||
"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": {
|
||||
"version": "2.0.0",
|
||||
"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",
|
||||
"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": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||
@ -1590,6 +1627,10 @@
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,17 +6,22 @@
|
||||
"start": "node ./bin/www"
|
||||
},
|
||||
"dependencies": {
|
||||
"apache-api": "^1.2.5",
|
||||
"axios": "^0.21.4",
|
||||
"axios-cookiejar-support": "^2.0.0",
|
||||
"bcrypt": "^5.0.0",
|
||||
"cryptr": "^6.0.2",
|
||||
"deepdash": "^5.3.9",
|
||||
"express": "~4.16.1",
|
||||
"express-basic-auth": "^1.2.0",
|
||||
"got": "^11.8.1",
|
||||
"http-errors": "~1.6.3",
|
||||
"lodash": "^4.17.21",
|
||||
"obj-traverse": "^1.0.0",
|
||||
"request": "^2.88.2",
|
||||
"sync-mysql": "^3.0.1",
|
||||
"tor-axios": "^1.0.9",
|
||||
"tough-cookie": "^4.0.0"
|
||||
"tough-cookie": "^4.0.0",
|
||||
"yourls": "git+https://github.com/karl0ss/node-yourls.git"
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
var express = require('express');
|
||||
var router = express.Router();
|
||||
|
||||
const { storeAccountToDB } = require('../lib/Accounts')
|
||||
const { getUserId } = require('../lib/getUser')
|
||||
const { singleAccountCheck } = require('../lib/checker')
|
||||
|
||||
|
@ -34,7 +34,7 @@ async function getStreamsNew() {
|
||||
jointArray.push(url)
|
||||
});
|
||||
}
|
||||
jointArray.unshift(...otherURLs)
|
||||
jointArray.unshift(...otherURLs.using)
|
||||
jointArray = [...new Set(jointArray)]
|
||||
return jointArray
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ var express = require('express');
|
||||
var router = express.Router();
|
||||
|
||||
const { getUserAccounts, getUserId } = require('../lib/getUser')
|
||||
const { getStreamsNew } = require('../routes/getStreams')
|
||||
const { decryptPassword } = require('../lib/password')
|
||||
|
||||
/* POST postUser page. */
|
||||
@ -19,10 +20,20 @@ router.get('/', async function (req, res, next) {
|
||||
router.get('/count', async function (req, res, next) {
|
||||
try {
|
||||
let data = await getUserAccounts(await getUserId(req.auth.user))
|
||||
res.json({"streamCount": data.length})
|
||||
res.json({ "streamCount": data.length })
|
||||
} catch (error) {
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user