From 0d23eaba09a4878520bf346af4cead90d76829fc Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Sun, 25 Sep 2022 18:24:21 +1000 Subject: Refactor to mono-repo + upgrade packages --- scripts/benchmark/connections.js | 64 +++ scripts/benchmark/index.js | 4 + scripts/benchmark/users.js | 25 + scripts/build.js | 72 +++ scripts/droptables.sql | 31 ++ scripts/generate_openapi.js | 137 +++++ scripts/generate_schema.js | 96 ++++ scripts/install.js | 23 + scripts/migrate_db_engine.js | 109 ++++ scripts/rights.js | 20 + scripts/stresstest/.gitignore | 3 + scripts/stresstest/accounts.json.example | 1 + scripts/stresstest/config.json.example | 5 + scripts/stresstest/index.js | 38 ++ scripts/stresstest/package-lock.json | 856 +++++++++++++++++++++++++++++++ scripts/stresstest/package.json | 17 + scripts/stresstest/src/login/index.js | 20 + scripts/stresstest/src/message/send.js | 23 + scripts/stresstest/src/register/index.js | 34 ++ 19 files changed, 1578 insertions(+) create mode 100644 scripts/benchmark/connections.js create mode 100644 scripts/benchmark/index.js create mode 100644 scripts/benchmark/users.js create mode 100644 scripts/build.js create mode 100644 scripts/droptables.sql create mode 100644 scripts/generate_openapi.js create mode 100644 scripts/generate_schema.js create mode 100644 scripts/install.js create mode 100644 scripts/migrate_db_engine.js create mode 100644 scripts/rights.js create mode 100644 scripts/stresstest/.gitignore create mode 100644 scripts/stresstest/accounts.json.example create mode 100644 scripts/stresstest/config.json.example create mode 100644 scripts/stresstest/index.js create mode 100644 scripts/stresstest/package-lock.json create mode 100644 scripts/stresstest/package.json create mode 100644 scripts/stresstest/src/login/index.js create mode 100644 scripts/stresstest/src/message/send.js create mode 100644 scripts/stresstest/src/register/index.js (limited to 'scripts') diff --git a/scripts/benchmark/connections.js b/scripts/benchmark/connections.js new file mode 100644 index 00000000..ffca2628 --- /dev/null +++ b/scripts/benchmark/connections.js @@ -0,0 +1,64 @@ +require("dotenv").config(); +const cluster = require("cluster"); +const WebSocket = require("ws"); +const endpoint = process.env.GATEWAY || "ws://localhost:3001"; +const connections = Number(process.env.CONNECTIONS) || 50; +const token = process.env.TOKEN; +var cores = 1; +try { + cores = Number(process.env.THREADS) || os.cpus().length; +} catch { + console.log("[Bundle] Failed to get thread count! Using 1...") +} + +if (!token) { + console.error("TOKEN env var missing"); + process.exit(); +} + +if (cluster.isMaster) { + for (let i = 0; i < threads; i++) { + cluster.fork(); + } + + cluster.on("exit", (worker, code, signal) => { + console.log(`worker ${worker.process.pid} died`); + }); +} else { + for (let i = 0; i < connections; i++) { + connect(); + } +} + +function connect() { + const client = new WebSocket(endpoint); + client.on("message", (data) => { + data = JSON.parse(data); + + switch (data.op) { + case 10: + client.interval = setInterval(() => { + client.send(JSON.stringify({ op: 1 })); + }, data.d.heartbeat_interval); + + client.send( + JSON.stringify({ + op: 2, + d: { + token, + properties: {}, + }, + }) + ); + + break; + } + }); + client.once("close", (code, reason) => { + clearInterval(client.interval); + connect(); + }); + client.on("error", (err) => { + // console.log(err); + }); +} diff --git a/scripts/benchmark/index.js b/scripts/benchmark/index.js new file mode 100644 index 00000000..37ac5633 --- /dev/null +++ b/scripts/benchmark/index.js @@ -0,0 +1,4 @@ +require("dotenv").config(); + +require("./connections"); +require("./messages"); diff --git a/scripts/benchmark/users.js b/scripts/benchmark/users.js new file mode 100644 index 00000000..bce67bf4 --- /dev/null +++ b/scripts/benchmark/users.js @@ -0,0 +1,25 @@ +require("dotenv").config(); +const fetch = require("node-fetch"); +const count = Number(process.env.COUNT) || 50; +const endpoint = process.env.API || "http://localhost:3001"; + +async function main() { + for (let i = 0; i < count; i++) { + fetch(`${endpoint}/api/auth/register`, { + method: "POST", + body: JSON.stringify({ + fingerprint: `${i}.wR8vi8lGlFBJerErO9LG5NViJFw`, + username: `test${i}`, + invite: null, + consent: true, + date_of_birth: "2000-01-01", + gift_code_sku_id: null, + captcha_key: null, + }), + headers: { "content-type": "application/json" }, + }); + console.log(i); + } +} + +main(); diff --git a/scripts/build.js b/scripts/build.js new file mode 100644 index 00000000..dfe7dfa1 --- /dev/null +++ b/scripts/build.js @@ -0,0 +1,72 @@ +const { execSync } = require("child_process"); +const path = require("path"); +const fs = require("fs"); +const { getSystemErrorMap } = require("util"); +const { argv } = require("process"); + +var steps = 2, i = 0; +if (argv.includes("clean")) steps++; +if (argv.includes("copyonly")) steps--; +const dirs = ["api", "util", "cdn", "gateway", "bundle"]; +const verbose = argv.includes("verbose") || argv.includes("v"); + +var copyRecursiveSync = function(src, dest) { + if(verbose) console.log(`cpsync: ${src} -> ${dest}`); + var exists = fs.existsSync(src); + if(!exists){ + console.log(src + " doesn't exist, not copying!"); + return; + } + var stats = exists && fs.statSync(src); + var isDirectory = exists && stats.isDirectory(); + if (isDirectory) { + fs.mkdirSync(dest, {recursive: true}); + fs.readdirSync(src).forEach(function(childItemName) { + copyRecursiveSync(path.join(src, childItemName), + path.join(dest, childItemName)); + }); + } else { + fs.copyFileSync(src, dest); + } + }; + +if (argv.includes("clean")) { + console.log(`[${++i}/${steps}] Cleaning...`); + dirs.forEach((a) => { + var d = "../" + a + "/dist"; + if (fs.existsSync(d)) { + fs.rmSync(d, { recursive: true }); + if (verbose) console.log(`Deleted ${d}!`); + } + }); +} + +console.log(`[${++i}/${steps}] Copying src files...`); +copyRecursiveSync(path.join(__dirname, "..", "..", "api", "assets"), path.join(__dirname, "..", "dist", "api", "assets")); +copyRecursiveSync(path.join(__dirname, "..", "..", "api", "client_test"), path.join(__dirname, "..", "dist", "api", "client_test")); +copyRecursiveSync(path.join(__dirname, "..", "..", "api", "locales"), path.join(__dirname, "..", "dist", "api", "locales")); +dirs.forEach((a) => { + copyRecursiveSync("../" + a + "/src", "dist/" + a + "/src"); + if (verbose) console.log(`Copied ${"../" + a + "/dist"} -> ${"dist/" + a + "/src"}!`); +}); + +if (!argv.includes("copyonly")) { + console.log(`[${++i}/${steps}] Compiling src files ...`); + + console.log( + execSync( + 'node "' + + path.join(__dirname, "..", "node_modules", "typescript", "lib", "tsc.js") + + '" -p "' + + path.join(__dirname, "..") + + '"', + { + cwd: path.join(__dirname, ".."), + shell: true, + env: process.env, + encoding: "utf8" + } + ) + ); +} + diff --git a/scripts/droptables.sql b/scripts/droptables.sql new file mode 100644 index 00000000..8a852048 --- /dev/null +++ b/scripts/droptables.sql @@ -0,0 +1,31 @@ +DROP TABLE applications; +DROP TABLE attachments; +DROP TABLE audit_logs; +DROP TABLE bans; +DROP TABLE connected_accounts; +DROP TABLE emojis; +DROP TABLE invites; +DROP TABLE member_roles; +DROP TABLE message_channel_mentions; +DROP TABLE message_role_mentions; +DROP TABLE message_stickers; +DROP TABLE message_user_mentions; +DROP TABLE messages; +DROP TABLE rate_limits; +DROP TABLE read_states; +DROP TABLE recipients; +DROP TABLE relationships; +DROP TABLE roles; +DROP TABLE sessions; +DROP TABLE stickers; +DROP TABLE team_members; +DROP TABLE teams; +DROP TABLE templates; +DROP TABLE voice_states; +DROP TABLE webhooks; +DROP TABLE channels; +DROP TABLE members; +DROP TABLE guilds; +DROP TABLE client_release; +-- DROP TABLE users; +-- DROP TABLE config; \ No newline at end of file diff --git a/scripts/generate_openapi.js b/scripts/generate_openapi.js new file mode 100644 index 00000000..c9de9fa6 --- /dev/null +++ b/scripts/generate_openapi.js @@ -0,0 +1,137 @@ +// https://mermade.github.io/openapi-gui/# +// https://editor.swagger.io/ +const getRouteDescriptions = require("../jest/getRouteDescriptions"); +const path = require("path"); +const fs = require("fs"); +require("missing-native-js-functions"); + +const openapiPath = path.join(__dirname, "..", "assets", "openapi.json"); +const SchemaPath = path.join(__dirname, "..", "assets", "schemas.json"); +const schemas = JSON.parse(fs.readFileSync(SchemaPath, { encoding: "utf8" })); +const specification = JSON.parse(fs.readFileSync(openapiPath, { encoding: "utf8" })); + +function combineSchemas(schemas) { + var definitions = {}; + + for (const name in schemas) { + definitions = { + ...definitions, + ...schemas[name].definitions, + [name]: { ...schemas[name], definitions: undefined, $schema: undefined } + }; + } + + for (const key in definitions) { + specification.components.schemas[key] = definitions[key]; + delete definitions[key].additionalProperties; + delete definitions[key].$schema; + const definition = definitions[key]; + + if (typeof definition.properties === "object") { + for (const property of Object.values(definition.properties)) { + if (Array.isArray(property.type)) { + if (property.type.includes("null")) { + property.type = property.type.find((x) => x !== "null"); + property.nullable = true; + } + } + } + } + } + + return definitions; +} + +function getTag(key) { + return key.match(/\/([\w-]+)/)[1]; +} + +function apiRoutes() { + const routes = getRouteDescriptions(); + + const tags = Array.from(routes.keys()).map((x) => getTag(x)); + specification.tags = [...specification.tags.map((x) => x.name), ...tags].unique().map((x) => ({ name: x })); + + routes.forEach((route, pathAndMethod) => { + const [p, method] = pathAndMethod.split("|"); + const path = p.replace(/:(\w+)/g, "{$1}"); + + let obj = specification.paths[path]?.[method] || {}; + if (!obj.description) { + const permission = route.permission ? `##### Requires the \`\`${route.permission}\`\` permission\n` : ""; + const event = route.test?.event ? `##### Fires a \`\`${route.test?.event}\`\` event\n` : ""; + obj.description = permission + event; + } + if (route.body) { + obj.requestBody = { + required: true, + content: { + "application/json": { + schema: { $ref: `#/components/schemas/${route.body}` } + } + } + }.merge(obj.requestBody); + } + if (!obj.responses) { + obj.responses = { + default: { + description: "not documented" + } + }; + } + if (route.test?.response) { + const status = route.test.response.status || 200; + let schema = { + allOf: [ + { + $ref: `#/components/schemas/${route.test.response.body}` + }, + { + example: route.test.body + } + ] + }; + if (!route.test.body) schema = schema.allOf[0]; + + obj.responses = { + [status]: { + ...(route.test.response.body + ? { + description: obj.responses[status].description || "", + content: { + "application/json": { + schema: schema + } + } + } + : {}) + } + }.merge(obj.responses); + delete obj.responses.default; + } + if (p.includes(":")) { + obj.parameters = p.match(/:\w+/g)?.map((x) => ({ + name: x.replace(":", ""), + in: "path", + required: true, + schema: { type: "string" }, + description: x.replace(":", "") + })); + } + obj.tags = [...(obj.tags || []), getTag(p)].unique(); + + specification.paths[path] = { ...specification.paths[path], [method]: obj }; + }); +} + +function main() { + combineSchemas(schemas); + apiRoutes(); + + fs.writeFileSync( + openapiPath, + JSON.stringify(specification, null, 4).replaceAll("#/definitions", "#/components/schemas").replaceAll("bigint", "number") + ); +} + +main(); diff --git a/scripts/generate_schema.js b/scripts/generate_schema.js new file mode 100644 index 00000000..b56c3fbc --- /dev/null +++ b/scripts/generate_schema.js @@ -0,0 +1,96 @@ +// https://mermade.github.io/openapi-gui/# +// https://editor.swagger.io/ +const path = require("path"); +const fs = require("fs"); +const TJS = require("typescript-json-schema"); +require("missing-native-js-functions"); +const schemaPath = path.join(__dirname, "..", "assets", "schemas.json"); + +const settings = { + required: true, + ignoreErrors: true, + excludePrivate: true, + defaultNumberType: "integer", + noExtraProps: true, + defaultProps: false +}; +const compilerOptions = { + strictNullChecks: true +}; +const Excluded = [ + "DefaultSchema", + "Schema", + "EntitySchema", + "ServerResponse", + "Http2ServerResponse", + "global.Express.Response", + "Response", + "e.Response", + "request.Response", + "supertest.Response", + + // TODO: Figure out how to exclude schemas from node_modules? + "SomeJSONSchema", + "UncheckedPartialSchema", + "PartialSchema", + "UncheckedPropertiesSchema", + "PropertiesSchema", + "AsyncSchema", + "AnySchema", +]; + +function modify(obj) { + for (var k in obj) { + if (typeof obj[k] === "object" && obj[k] !== null) { + modify(obj[k]); + } + } +} + +function main() { + const files = [ + ...walk(path.join(__dirname, "..", "src", "routes")), + ...walk(path.join(__dirname, "..", "..", "util", "src")), + ]; + const program = TJS.getProgramFromFiles( + files, + compilerOptions + ); + const generator = TJS.buildGenerator(program, settings); + if (!generator || !program) return; + + let schemas = generator.getUserSymbols().filter((x) => (x.endsWith("Schema") || x.endsWith("Response")) && !Excluded.includes(x)); + console.log(schemas); + + var definitions = {}; + + for (const name of schemas) { + const part = TJS.generateSchema(program, name, settings, [], generator); + if (!part) continue; + + definitions = { ...definitions, [name]: { ...part } }; + } + + modify(definitions); + + fs.writeFileSync(schemaPath, JSON.stringify(definitions, null, 4)); +} + +main(); + +function walk(dir) { + var results = []; + var list = fs.readdirSync(dir); + list.forEach(function (file) { + file = dir + "/" + file; + var stat = fs.statSync(file); + if (stat && stat.isDirectory()) { + /* Recurse into a subdirectory */ + results = results.concat(walk(file)); + } else { + if (!file.endsWith(".ts")) return; + results.push(file); + } + }); + return results; +} diff --git a/scripts/install.js b/scripts/install.js new file mode 100644 index 00000000..db9dadbc --- /dev/null +++ b/scripts/install.js @@ -0,0 +1,23 @@ +const path = require("path"); +const fs = require("fs"); +const parts = ["api", "util", "cdn", "gateway"]; + +const bundle = require("../package.json"); + +for (const part of parts) { + const { devDependencies, dependencies } = require(path.join( + "..", + "..", + part, + "package.json" + )); + bundle.devDependencies = { ...bundle.devDependencies, ...devDependencies }; + bundle.dependencies = { ...bundle.dependencies, ...dependencies }; + delete bundle.dependencies["@fosscord/util"]; +} + +fs.writeFileSync( + path.join(__dirname, "..", "package.json"), + JSON.stringify(bundle, null, "\t"), + { encoding: "utf8" } +); diff --git a/scripts/migrate_db_engine.js b/scripts/migrate_db_engine.js new file mode 100644 index 00000000..79e9d86f --- /dev/null +++ b/scripts/migrate_db_engine.js @@ -0,0 +1,109 @@ +const { config } = require("dotenv"); +config(); +const { createConnection } = require("typeorm"); +const { initDatabase } = require("../../dist/util/Database"); +require("missing-native-js-functions"); +const { + Application, + Attachment, + Ban, + Channel, + ConfigEntity, + ConnectedAccount, + Emoji, + Guild, + Invite, + Member, + Message, + ReadState, + Recipient, + Relationship, + Role, + Sticker, + Team, + TeamMember, + Template, + User, + VoiceState, + Webhook, +} = require("../../dist/entities/index"); + +async function main() { + if (!process.env.TO) throw new Error("TO database env connection string not set"); + + // manually arrange them because of foreign keys + const entities = [ + ConfigEntity, + User, + Guild, + Channel, + Invite, + Role, + Ban, + Application, + Emoji, + ConnectedAccount, + Member, + ReadState, + Recipient, + Relationship, + Sticker, + Team, + TeamMember, + Template, + VoiceState, + Webhook, + Message, + Attachment, + ]; + + const oldDB = await initDatabase(); + + const type = process.env.TO.includes("://") ? process.env.TO.split(":")[0]?.replace("+srv", "") : "sqlite"; + const isSqlite = type.includes("sqlite"); + + // @ts-ignore + const newDB = await createConnection({ + type, + url: isSqlite ? undefined : process.env.TO, + database: isSqlite ? process.env.TO : undefined, + entities, + name: "new", + synchronize: true, + }); + let i = 0; + + try { + for (const entity of entities) { + const entries = await oldDB.manager.find(entity); + + // @ts-ignore + console.log("migrating " + entries.length + " " + entity.name + " ..."); + + for (const entry of entries) { + console.log(i++); + + try { + await newDB.manager.insert(entity, entry); + } catch (error) { + try { + if (!entry.id) throw new Error("object doesn't have a unique id: " + entry); + await newDB.manager.update(entity, { id: entry.id }, entry); + } catch (error) { + console.error("couldn't migrate " + i + " " + entity.name, error); + } + } + } + + // @ts-ignore + console.log("migrated " + entries.length + " " + entity.name); + } + } catch (error) { + console.error(error.message); + } + + console.log("SUCCESS migrated all data"); + await newDB.close(); +} + +main().caught(); diff --git a/scripts/rights.js b/scripts/rights.js new file mode 100644 index 00000000..289071f6 --- /dev/null +++ b/scripts/rights.js @@ -0,0 +1,20 @@ +const { Rights } = require(".."); + +const allRights = new Rights(1).bitfield; +console.log(`All rights:`, allRights); + +var discordLike = allRights; +discordLike -= Rights.FLAGS.OPERATOR; +discordLike -= Rights.FLAGS.MANAGE_APPLICATIONS; +discordLike -= Rights.FLAGS.MANAGE_GUILDS; +discordLike -= Rights.FLAGS.MANAGE_MESSAGES; +discordLike -= Rights.FLAGS.MANAGE_RATE_LIMITS; +discordLike -= Rights.FLAGS.MANAGE_ROUTING; +discordLike -= Rights.FLAGS.MANAGE_TICKETS; +discordLike -= Rights.FLAGS.MANAGE_USERS; +discordLike -= Rights.FLAGS.ADD_MEMBERS; +discordLike -= Rights.FLAGS.BYPASS_RATE_LIMITS; +discordLike -= Rights.FLAGS.CREDITABLE; +discordLike -= Rights.FLAGS.MANAGE_GUILD_DIRECTORY; +discordLike -= Rights.FLAGS.SEND_BACKDATED_EVENTS; +console.log(`Discord.com-like rights:`, discordLike); \ No newline at end of file diff --git a/scripts/stresstest/.gitignore b/scripts/stresstest/.gitignore new file mode 100644 index 00000000..bde26fd4 --- /dev/null +++ b/scripts/stresstest/.gitignore @@ -0,0 +1,3 @@ +/node_modules +config.json +accounts.json diff --git a/scripts/stresstest/accounts.json.example b/scripts/stresstest/accounts.json.example new file mode 100644 index 00000000..61904c5e --- /dev/null +++ b/scripts/stresstest/accounts.json.example @@ -0,0 +1 @@ +[{"email":"org11ncxa8.wi732t9b4o@fosscord.com","password":"x.ibahfyqwle.ne4hajbzp11.gpc4lcup4"},{"email":"rek6kyprik.i5hldol255@fosscord.com","password":"1.o3w16haor2y.0e1ey2yk1x.1r0gn5o5h"},{"email":"07o37povsi.uk5q9dtxbp@fosscord.com","password":"8.6z64gcjavp1n.uar3qqymwfi.g0sfmmbd9m"},{"email":"94di5zaie4.n1vhzdfsj@fosscord.com","password":"1e.k3ijylxme1u.e9xr9yqbrk.3tir7qnvh"},{"email":"zbrqft4chj.yl73e5puq3@fosscord.com","password":"5.nkc3g8cvwl15.dmp8ywmkka.m79e9t4wij"},{"email":"br1wknv7k.6hw6yl69e@fosscord.com","password":"3.gimzx06u7mh.6rjrdflo9j1t.h3d8k2f5t"},{"email":"cdehs12h6h.iexxvg16xf@fosscord.com","password":"1i.5ab7e9rtwl1n.31qtfv7cz9.e1k313py9"},{"email":"pazx37jpra.mgsb8k50ip@fosscord.com","password":"d.eg5dwqvd981e.5qobehiyffe.6k5pb4fqm"},{"email":"vs6k62ak2o.xo1v4w0rj@fosscord.com","password":"c.hrkcrnlxlg1d.w18ztd39d1p.eycgehb49"},{"email":"u5d27rbewm.3p0wa7s899@fosscord.com","password":"s.1r7o1ur8o9k.puzbm1uuta9.an5m8bhh0a"},{"email":"vyp6x66fr.yv74eftomo@fosscord.com","password":"m.w0c7h21asf.pq2lj3uot6a.xnhv9ftqii"},{"email":"da0k6sra2n.qts4gs9ufg@fosscord.com","password":"h.8e42ud5f6r5.896sp1t8y6e.shwe0d8no9"},{"email":"l093koc05n.81vt1v8tsx@fosscord.com","password":"11.zhkv1jbhdf.0ub2po3mnu.no4lq8l4"},{"email":"115tfo7ct.muvy04u0tf@fosscord.com","password":"1c.4bpk2a17z1p.gw2h6qmvhez.57drs0quz"},{"email":"dq6bk1hjch.huw092gkhr@fosscord.com","password":"1l.kp28mclrtee.5i4dmacbpc1j.hcqgemsni"},{"email":"8g8q9v3wmk.l2frwpuds8@fosscord.com","password":"1n.i0wwg0njmv.teaiqjqalt1g.ib6551nh4"},{"email":"5b3y3neqxa.mmi0ex2hxd@fosscord.com","password":"8.tvz7q9uw0hm.6ufz6fu65c1a.88vp9di6e"},{"email":"mg28g3krsp.35h1akxrqj@fosscord.com","password":"s.y8j2n19iffr.qyecyrgo6ig.6hgrc5vy9"},{"email":"ehtumcok2j.2oozlhiq97@fosscord.com","password":"11.uq0up8g8h1q.ofvjsx29yd.pfwen3kr38"},{"email":"le98rah1uc.au4ug9tpnt@fosscord.com","password":"t.q15zsc0q2mt.2nj3jsdxhfc.leb9ba1xku"},{"email":"hrroex9f5n.6cl98h3jsi@fosscord.com","password":"17.qnqqhg2us4.kh92v74atg19.49ufgil7g"},{"email":"w95wrrn48.6gfnue7dcq@fosscord.com","password":"b.jnqgbi89oj1k.8rn0llovbll.kcblui80th"},{"email":"rqo4n0il5w.4gl1u8hlyc@fosscord.com","password":"17.41d1lpjmi0.d8ijhslby11w.sjn7sqhi9"},{"email":"6dv3yp4kon.pk7ye6q1r6@fosscord.com","password":"0.j70py6yysjz.sf56ebpp2gp.z68yo9hiim"},{"email":"knmi9qkige.5v1bg6h09w@fosscord.com","password":"1d.7n58xntwg1s.umnglex7h13.c5xrsfkosm"},{"email":"cefymgc7te.dd81jabws4@fosscord.com","password":"1u.73ea7dde1o.0i1fhyaird.sjk30nky1e"},{"email":"33xcwiqf73.r6khs46a7j@fosscord.com","password":"b.5p5gdmh1891f.11g4590n5a.vfoek6qjb9"},{"email":"9zcgmr84s6.utnlygoubi@fosscord.com","password":"8.g4v53t7kcl16.wgaiufzgg1u.pusdfdneb"},{"email":"26vpzekrdw.3bwq27wla@fosscord.com","password":"11.yxey8293lj1d.nxhkju2eke.hl86mcvswd"},{"email":"vvq6w36r84.lr1auhpfc@fosscord.com","password":"y.7vlqbpftom.6xfrtozd11k.ycf9ifi7o"},{"email":"6ejeiq64yo.zorve5saw4@fosscord.com","password":"o.eue50qp1frq.qi0rwphg3dv.psph7va2fb"},{"email":"6s0hu88ro8.hsckrmud1i@fosscord.com","password":"16.fc836nhb91a.ul37503ppg.l62wgser4i"},{"email":"h8qwchz2x9.5br1kcw1iv@fosscord.com","password":"l.iw1041wgy.6azyc9h6vb.br9cr0dmn8"},{"email":"yx13rst2hu.ybisfdwgv@fosscord.com","password":"8.5yasf5ba619.ir0toxu251p.tbgwjd18f"},{"email":"1j7vrr1trh.wqj0ozl357@fosscord.com","password":"1m.iucscoe7b0.6ca1jfaag361.c2trc36mnvk"},{"email":"9w2w572pzr.fv1rk360pp@fosscord.com","password":"t.labzw6qw8t3.33k42uvhgd1s.e1gj71h14"},{"email":"yf5e43ol4.6509owbcxa@fosscord.com","password":"12.jewy0uvx1m1m.ce28kht6dk.v2p0bzlvz"},{"email":"gzny2o1re.1xrl0ua7yd@fosscord.com","password":"h.3valf7r8jh.6bzfr4ions.r4b2mt0l0g"},{"email":"bc77a5kw9v.hu5barps6q@fosscord.com","password":"1a.jt11azsa81j.4v70jvm9d1o.hflrb1tigk"},{"email":"ltoezpefev.hrvnxmq9ee@fosscord.com","password":"b.v4f5lqrlc912.dx4dd4xq91v.zj345to03"},{"email":"svcpsuoenk.b8mfqxpbzg@fosscord.com","password":"1a.7aobev8b4r.xqqfybkcs1t.cjuswku0a"},{"email":"n0mroewqq.svq5iq57pe@fosscord.com","password":"1l.zxm1xhlavp.65rp7bz57x.01vjajdsc"},{"email":"trly6yupd.dt37kh07dn@fosscord.com","password":"1i.o2ieg72fz1j.er031tzerx.2ngg4dcvlh"},{"email":"ickkf14cqv.9pu2pnmx7n@fosscord.com","password":"18.pyhd9ruatl1k.erfchcjc95.wfd67r5e8x"},{"email":"5o4ornfwy9.yabymb8e2k@fosscord.com","password":"1g.117kmei8df10.cedozr4vee.08te5d44nb"},{"email":"p0ulegfi3.dgmar6qc2v@fosscord.com","password":"1h.tle7s3ed82.un20o5nv3dk.wnz4w802h8"},{"email":"58gejpvr6v.jolxrsl83p@fosscord.com","password":"e.ksw14117hbo.f0pgufr3na.ssrjys23al"},{"email":"vf349zeoja.r8bjel59kd@fosscord.com","password":"1o.79kh6e6glm9.d76d86g1jp16.u37p4jhf7"},{"email":"uc786nn0go.n9ygun6owj@fosscord.com","password":"m.xo4bwhct5be.lpokbj59w8p.z4l52dzv1r"},{"email":"5jgx24s87u.odlx0bfo0r@fosscord.com","password":"1k.ni9jyfol7h1g.vczzsa8dbg.r4bhoh5op"},{"email":"2v44408x8l.unfspunnnm@fosscord.com","password":"16.63njhji5b4.r4xkcf672f1a.x389dr603g"},{"email":"ityj8kcvrm.9djzannsll@fosscord.com","password":"1p.6jdbhaxiqc.nfnpw7e09g8.967dtt2dy3"},{"email":"8csbvl9qot.28etdf4pf@fosscord.com","password":"1b.52rdo5qmj3.ta9jw1wm3k9.m96fe27tp"},{"email":"dqndi38hsq.yv77wk3mov@fosscord.com","password":"k.zpjwpwxmlr1f.tbj03rxayn17.9x451qclu"},{"email":"ohwmvag9j.w6t8ngs4t@fosscord.com","password":"b.h1ta0mly991q.wzu1ssffyk1h.kc10wt8i2"},{"email":"2mmors2h0w.jwukibc7oi@fosscord.com","password":"y.xo4kgepqa1t.b77zwt1in5.3um79fx22r"},{"email":"ux0q6gvwnr.gnywxxrsn@fosscord.com","password":"g.52userbsonu.ny8omqaduf.rvhtwq4jer"},{"email":"0q12b4zet.y87zc04r8r@fosscord.com","password":"1t.79mg1a9q85.k66wagu67j14.ad0gw3caw"},{"email":"gatbconrvq.dsopxa8fkk@fosscord.com","password":"1n.fycl7y9roh1p.4yg37pst4k16.votnvabrf"},{"email":"mmp9g1b1v.xz1w4qzxee@fosscord.com","password":"1k.cjmz3huosl.jh502yz5jf1e.hyce7qc67"},{"email":"5s90s1hbns.b027pfiv3s@fosscord.com","password":"1l.86ipkmi6fg.scabtvproj4.yw4nb9qui9"},{"email":"l4zrvtrbpb.1r627sllk@fosscord.com","password":"1l.zzm1dunzzek.10sr7mp01ly.yyrjj1hsli"},{"email":"xih9rwk90i.rmdifv40g@fosscord.com","password":"15.db9k0pxci1v.hs6l033urm.5a1zv42fhl"},{"email":"55mq93jdq.2dhr1ps4f5@fosscord.com","password":"i.v5hpg2qez1u.xhs32cwes1h.n10pexmfff"},{"email":"5c0vb38rul.5su27w4pn8@fosscord.com","password":"12.y87q6jxq41m.qgiji2j0hm.gmy2wuavc"},{"email":"qjk2eoqeqq.ljq4dig10o@fosscord.com","password":"0.lpu8eio3hra12.mq8qcehpe1e.77p7zilh4"},{"email":"b45ltbf5d.o4oouuik1e@fosscord.com","password":"1u.wb7hn2b1x1k.jys5p3ri4j.9ew9jab3ll"},{"email":"1mw205tjri.gpi2h76eps@fosscord.com","password":"1g.kyh53pnamd13.5yufexmyv1h.r56pmhm7i"},{"email":"8y0psdjq2s.ifqyimhnkj@fosscord.com","password":"1d.fi03hlwk41u.b89w0vrd712.ljudzvdo6"},{"email":"ls73glp0q9.3rtqyb262@fosscord.com","password":"1.z70c4ef5hfi.fes9zmue2it.5cobkz3ah"},{"email":"ipe2um46bi.in93oau1l@fosscord.com","password":"5.a5he7keuru1n.l05ivx4n24.piohqdy51w"},{"email":"mt16ta8diq.krypy2t9cv@fosscord.com","password":"n.zk4goctn5p3.r1fhllqy1m1p.ni2q3y68w"},{"email":"qehwflm0ja.x5uvmxgfle@fosscord.com","password":"1e.r2sj0uimq1f.nmtozr8qd1s.xgvz4d62b"},{"email":"0ppn1iwd6.ivrqbvn17i@fosscord.com","password":"1n.fr6x1pbzjl.c8xwipgo6c.m1me2h2g58"},{"email":"xiiq47ofev.u9z0gndxs6@fosscord.com","password":"1t.7tfe0181ij.jbznx5eebs.ytm50kp5qf"},{"email":"kqhk3lt2mo.o4y7u23zbu@fosscord.com","password":"1b.bkoqmxjcf1l.c5q9oneuz1u.00x93z7l4"},{"email":"ri64c5o5zn.o429slph64@fosscord.com","password":"1r.mre2hu1gpu.401xyxa6eu.j98cetaplg"},{"email":"j5jpukoktw.q5bseyjfu@fosscord.com","password":"h.k1ar11fpx1m.n50t8tz4k4.9oj17rtdjw"},{"email":"cg8gyuhu16.jezv2bo8n@fosscord.com","password":"1c.vyfo117pd1b.hxlc7e9zve.j6ej7ho2rk"},{"email":"7ngysyss7w.yjy0whd5fh@fosscord.com","password":"12.pl4jjp66wi1r.xx7s13gsgy.v2slv2vyx"},{"email":"7uhylwdaiq.w557htx0x@fosscord.com","password":"1j.icm6w8m4mh.4qyoql77m8.ar8kliax0s"},{"email":"y6yn1ckm1e.7xxizerecm@fosscord.com","password":"1e.om7n18zisn1w.usblhxf4p1m.r9ke41xox"},{"email":"uwdsktqhuw.4vmh5gmg7d@fosscord.com","password":"6.cdte4bk24b16.cf1sbtxlx1o.n62w4weh9"},{"email":"8v1nt755y.w0y1jgfcgm@fosscord.com","password":"f.ozxpvznxj41o.bs5s5dhua1l.ffayy0gsy"},{"email":"rmy9b61cij.qir0bjorcm@fosscord.com","password":"1h.bxjxpx0u6f13.e97yh8g761c.j8zog74iql"},{"email":"93ir0yiyi9.1f7bfzt3fb@fosscord.com","password":"18.vky28kwlw14.w1wsoyu6c15.yhxbr725xe"},{"email":"g0kqw9plr.v2zcovhyg6@fosscord.com","password":"1r.3txq1jt4zl1d.ha0ejtekjh.xhjl9e6vqg"},{"email":"xmk2q5zxa.v1ka9gm3a8@fosscord.com","password":"1l.ryvykh3ihm16.rxea04ifq0.h14sz83yisv"},{"email":"mqt2bmltj9.53o16bc6xn@fosscord.com","password":"i.vt66ajtme1f.lllyzaprk16.yb0yh0o1z"},{"email":"4kvjyddsv.7u7lmex2df@fosscord.com","password":"1i.axaegtd0qz.2yvfr5n261g.8s8fprsd8"},{"email":"yigntcopcc.8bchnlmclm@fosscord.com","password":"n.b5yn5xried1d.siep9e4fb1t.h6s6erw5t"},{"email":"meubr1b03t.t97015wih6@fosscord.com","password":"5.wu3izi2gyqi.iurx5qpp7l.znq1htzuel"},{"email":"xz3gta0hi.1x5o83xyee@fosscord.com","password":"14.uafjiryde3.oin9k24w3510.vkjmjleb4i"},{"email":"9jkrkk9r6o.6ossrgj919@fosscord.com","password":"v.u9531wtw2o11.151eg145bf.bk57nd0s6u"},{"email":"kf9fdmnacv.67shfcubvn@fosscord.com","password":"1i.7f1olv2hkt.v2cso7zxlfw.8ylhl33g1"},{"email":"k8zuiett0r.0w299k0t9j@fosscord.com","password":"t.1mrpwsil15.999lbrfvz1h.7od0kjlxo"},{"email":"8m9rt3vgg.vkpf6apx9@fosscord.com","password":"1n.2ohz11tk412.5ezp8ujcwn8.rvqqrozh9s"},{"email":"rfavhpnhc.6xwy7o3ulm@fosscord.com","password":"11.ikd54271zj.vq3brjark7.h1ryvz7ap8"},{"email":"6zmju5azrd.4bes4a3cq@fosscord.com","password":"5.litb6taajto.ownyp3uhjkh.f543o47uc9"},{"email":"ml5pst7t3g.kbvn8b1vg@fosscord.com","password":"1q.co2aumj6fw.fa18frro5e.vnpotfg209"},{"email":"kaa1r6srjs.wjriguic5e@fosscord.com","password":"y.y635jqxai9.s4hcd1weni5.51i7z3c26r"},{"email":"n09uhfkuc5.9aqau9qyk@fosscord.com","password":"1f.wtjqoqzdwg6.mfvvtcwtx91t.8ujt3pwx4"},{"email":"6y5y3px9oa.4183pg5aq6@fosscord.com","password":"11.8a00uh75g1i.d462wzpqv1t.dnd8sdvr"},{"email":"aqdzadem03.f8uv1m4zv4@fosscord.com","password":"4.4ndx89thn53.afcjfzjqe51o.ivaemdp5hf"},{"email":"oqv3944yav.31ccatif3r@fosscord.com","password":"1w.9cstqu9o21f.p40uqca3vl19.iqnn79lqde"},{"email":"akzyzmigv.9c6w5aj4o@fosscord.com","password":"m.m382wa8nznr.szvso4c03ke.ttw2jhnwh8"},{"email":"13dqfm57jo.e05e711ggt@fosscord.com","password":"1b.t1b51jt7lf.rhi4j32rw91u.0foqthilf"},{"email":"3derfs5v66.s2kbedbm3o@fosscord.com","password":"t.e153si8xso1m.9rv9il857fd.e3i0di3ope"},{"email":"92k9vmws7.dt9mvv6ijh@fosscord.com","password":"1r.r8oy0su9c1e.irtwz9gdna.3fddwt8k4n"},{"email":"w1huzvblr.q9qp44japt@fosscord.com","password":"1v.dfdr92srfs.3x2wd25frh15.z73xb3vol"},{"email":"vne3an2fif.32eq9woyl@fosscord.com","password":"7.lurd6n689ek.sf3gedrf711.5xclyfsn3"},{"email":"298zj4dvxf.5sfh7f2e2m@fosscord.com","password":"n.1rbv0z54wr1n.nt2041ujks.0gwbe80zyl"},{"email":"ywp1ssr2zh.gl97epixxu@fosscord.com","password":"1w.gfpvze8vq1p.is7b2795819.4hilzah3"},{"email":"kqzujy4m5j.ocydwl4yyh@fosscord.com","password":"1c.sqxzxuareez.fgczf2qh3en.yi5vo23phn"},{"email":"ck8n5p7d6d.2vu4cdm6iw@fosscord.com","password":"1o.g3lq6grnm1t.otf44zgiw1c.jfdgqubfjl"},{"email":"s3vqe9bzj.muec34461t@fosscord.com","password":"1u.i4u3eidof19.tl8hf5fpdv.mvbij0fdgc"},{"email":"7hedrsktw.oqe4hym4us@fosscord.com","password":"1j.orlptqc2h.hs6661zehh1r.ngepsoldvf"},{"email":"44tm2rsu6j.oxrw5ib1np@fosscord.com","password":"1o.n71dxtllrf9.htwjv6fsi81l.5w9pyr8eee"},{"email":"o28saa2e4t.m49530ir45@fosscord.com","password":"16.z31xrcp6li12.uaklzxvskl.nqyq23zqb"},{"email":"aaz3kkwx2q.u42rdyacy6@fosscord.com","password":"1k.aohk44bxqkq.6lec7k6yfa14.geiq4ok3b"},{"email":"ntw1oc87mh.js3q1iqxrh@fosscord.com","password":"15.li45vduoy15.h90fv4ytl1t.3v78qdvcq"},{"email":"cpkgoh313.lkdhhl039a@fosscord.com","password":"3.fdw00uv0dn1v.qz6frlgeh0.3g0c7xnn9le"},{"email":"wznnajnyww.3f5s5cf0lt@fosscord.com","password":"4.3d2ro1uvag2.9yum8m4gd5t.yd1zriwovn"},{"email":"odwdxlk49g.m113aywba@fosscord.com","password":"y.24hnap1ckh.n0q1dtobf717.0tzaopasse"},{"email":"0xt66uuwbs.24qfa4w82q@fosscord.com","password":"e.3cfcd0usw57.oydvjpl5wm1b.sxnf38ihh"},{"email":"4pxgasro0t.xifcrlp26f@fosscord.com","password":"1d.oxpqgh8jbgb.6epjawtwga1u.o5d33jm"},{"email":"l202g9q8xo.t4ck4xu44v@fosscord.com","password":"d.gyul2yhu7h1g.163rzn4kqik.e5qlstdwp"},{"email":"8mwzma33ko.b9on13ypjl@fosscord.com","password":"b.0sdy90whqr1o.rruwt57r8l14.hjejwclmr"},{"email":"h8dm19fu77.hzpnw8famh@fosscord.com","password":"s.q49kg1uq8gc.046rudurb1o.2lqegjfds"},{"email":"exkp3ve6z7.mdydbk9jy@fosscord.com","password":"16.bq8o0d13sd8.tri7wtdjpro.2ebtbyqgtt"},{"email":"n8fe02yphv.huwi91ywha@fosscord.com","password":"1d.8qp5wkq541k.ulwk4bzjsm19.q3qbxorto"},{"email":"lsslgvrdyb.u86qng3p7o@fosscord.com","password":"11.9q1m8gwavd.9z3kflcg5k1e.lrux8aqm8"},{"email":"0jur86ya2p.gb26btuz7@fosscord.com","password":"n.fflp1f1yksg.10rh6etc61.yld8y7u9hi"},{"email":"raseda2c45.vl9resp89r@fosscord.com","password":"b.6gd8az3ljg.es1yjenqskk.i4i8m466p"},{"email":"jmam7ha069.b96jzg1bkl@fosscord.com","password":"1f.2z41vc92bo.84f3d3j3gra.5yev9enzv"},{"email":"pp2rki7hjd.a037bg6u6@fosscord.com","password":"3.nktq53a97c19.khsapwl0wd.ej16kksime"},{"email":"c35l8m3ikr.e7vx8nmbil@fosscord.com","password":"2.oryjofui8mu.7jes36sirs1u.oclq1geaf"},{"email":"ufhsl7tn5u.j4ey0abswv@fosscord.com","password":"14.uctn73o6h1n.t75arwloxgf.nvgdr4l41o"},{"email":"8ru4fr2ed.kf8ffg9ko8@fosscord.com","password":"n.hqxwr2ypwd1l.vu23byfp3c.nzgszptoqk"},{"email":"6gmjeij67o.ep5256bmf@fosscord.com","password":"1i.237gs5pk5j1w.yvuhvp9ho15.l4qibsw5i"},{"email":"4wrhgqel0w.e0sz7l0zki@fosscord.com","password":"w.g09qtor0p1g.a5uzjl6u3g17.v3z6rhb9h"},{"email":"3860ixs8g.6pha1slnur@fosscord.com","password":"m.o7o62cqw3g.wkkaak7zz8.h82m4nenbf"},{"email":"wnnpg8stto.zwsxqfp38i@fosscord.com","password":"c.k2b6jn1b3r14.ojpvlbxil1r.rpkncuyqp"},{"email":"t04ss33dlw.98dpq7j8rg@fosscord.com","password":"5.7zgfmumai7.iphztcsjfw1h.sq2kp3j9j"},{"email":"hy53et7kw6.vsku4tebj9@fosscord.com","password":"3.ayjddj0roe1m.ngz1qajzlgu.xue35w1d1d"},{"email":"252ueajele.j4euv8la1d@fosscord.com","password":"h.tw1utyw7mh9.ydii1rkvp4.8xafwfxrqd"},{"email":"ye2mi1d86.uqa7ig7qxb@fosscord.com","password":"j.pn3eoar1ft1e.k8febwch91o.fzau5lnbx"},{"email":"4cq5y22mm8.q33hk612wu@fosscord.com","password":"1l.7tx03ihc9e1a.3i2l76ur5.28yffumat8"},{"email":"d9op87vvj7.vbu23p4mnq@fosscord.com","password":"10.z7pgyokesip.0i0axexmwpa.0p5xrlag9k"},{"email":"tnhgsqizxh.14ulf4jinl@fosscord.com","password":"j.8p0jucy5xk10.creosnkf2o.vzznt05x"},{"email":"8h2h3w3ex5.8ogl7f027n@fosscord.com","password":"1b.08wkhdm03g3.8hdklh1zj41t.fq57w9raf"},{"email":"ommn4ocwtn.1fkdjbz2v8@fosscord.com","password":"1e.i8k15b9uk1p.70n34lxbzf.4inv63cwt8"},{"email":"fnxg92zeqn.ljg5uumt3e@fosscord.com","password":"w.ltho2dsgveu.d1ome2w0x8j.7wr2hq1wk8"},{"email":"lzi8aurosp.mck9i974of@fosscord.com","password":"u.zezf4qdz2p0.l2g634tak98.ql0n1tg6sq"},{"email":"fdhv4fccm5.o9x209i94g@fosscord.com","password":"5.2o84u6v43619.4c0c71a9gk7.n9cmjegefv"},{"email":"tuedrm1ajt.bxjgzsyj4s@fosscord.com","password":"1m.ng2h807gvu.rhd056e6bbb.lkvewwp2tg"},{"email":"488bryb32a.x928qzsf8g@fosscord.com","password":"y.n2c3x3irffa.fz9xwiimno8.nnpvm280oc"},{"email":"n928oorjaa.kj35rf9p35@fosscord.com","password":"1l.flvmvopcj16.pmx6n9hi7hi.v9odjzq3at"},{"email":"emzd8qz0f8.b972dvhf0m@fosscord.com","password":"3.7umgbd5apm18.0n6yi8ol9g.m4607npuc"},{"email":"g7jzdulwv5.0a2wzws2ua@fosscord.com","password":"10.1u1sac19wkf.lvi2qwfhtq16.8wbdddpms"},{"email":"giuivahumo.7iqapfnbfr@fosscord.com","password":"q.pzck5qtbype.llhl9ypv6b1e.3dz8gsv0pg"},{"email":"0t84mm2pj9.kycgvqkuag@fosscord.com","password":"1t.kpvjmvipo14.kwv0np3ordv.ustw31ifu"},{"email":"vx5t6yurg7.pocn2c069m@fosscord.com","password":"f.gdwgrk0wia1u.7m1ozam0b0.d5y62kwyih5"},{"email":"p7arvq1hha.7wryrvhvl@fosscord.com","password":"1v.eb62r3rx71h.d3fhbfdxa1l.4gzcu184s"},{"email":"adp64dkhdd.q2nc2qvy3@fosscord.com","password":"q.96rt5rc517h.3f0foodom4.h1wee4z428"},{"email":"pfhrq2kv8.92dq9bxy8a@fosscord.com","password":"1g.nfaha2xx7hi.vtng22emxs1l.fpbra2wo6h"},{"email":"jjnysdssoc.eqr6v2pqeo@fosscord.com","password":"1.112arb9m3cb.w3yfq6ekz1d.keb15ptd5"},{"email":"m5rab6dhrc.p1tnxv9feg@fosscord.com","password":"1.3guc8m7j0uj4.xphgg3121714.7ii7ah6g7f"},{"email":"zgq1iount.blsiqtyvc6@fosscord.com","password":"16.dzt6188au1w.ilwc3p3ds17.7j7lcsqur"},{"email":"ix7nx1ce4a.3wj4gs8b7p@fosscord.com","password":"13.p2v1p2nwa1t.2yarcqsmzk.ay7w9u0p1r"},{"email":"5jh7wm63ug.feyytgy11g@fosscord.com","password":"10.otpp2mz0smb.uv94hcp26c8.a3nlz16n14"},{"email":"9cd7yy1ps4.jet2fn1fdb@fosscord.com","password":"9.bjtfocm7zk12.sushyeb1yg.lhtmj6a70t"},{"email":"20u20f6dlk.l8n5tvh2re@fosscord.com","password":"19.qfrr25rarj.4tzf063a9n4.3i5s3vm30b"},{"email":"b1hnmmwcb.q21mrflg1h@fosscord.com","password":"3.ysh10ultyjz.nz8azt84216.lxn1kgvly"},{"email":"j7nhj8s2d.aqaeidbi8m@fosscord.com","password":"g.nlnw7ejuqbz.41exhwj2wiv.1yr0njmd"}] \ No newline at end of file diff --git a/scripts/stresstest/config.json.example b/scripts/stresstest/config.json.example new file mode 100644 index 00000000..73f52f05 --- /dev/null +++ b/scripts/stresstest/config.json.example @@ -0,0 +1,5 @@ +{ + "url": "", + "text-channel": "", + "invite": "" +} diff --git a/scripts/stresstest/index.js b/scripts/stresstest/index.js new file mode 100644 index 00000000..a9a65097 --- /dev/null +++ b/scripts/stresstest/index.js @@ -0,0 +1,38 @@ +const register = require("./src/register"); +const login = require("./src/login/index"); +const config = require("./config.json"); +const figlet = require("figlet"); +const sendMessage = require("./src/message/send"); +const fs = require("fs"); +figlet("Fosscord Stress Test :)", function (err, data) { + if (err) { + console.log("Something went wrong..."); + console.dir(err); + return; + } + console.log("\x1b[32m", data); +}); +setInterval(() => { + generate(); +}, 1000 * 5); +setInterval(() => { + getUsers(); +}, 60 * 1000); +async function generate() { + var accounts = await JSON.parse(fs.readFileSync("accounts.json")); + console.log(accounts); + var account = await register(); + accounts.push(account); + fs.writeFileSync("accounts.json", JSON.stringify(accounts)); + console.log(accounts.length); + var y = await login(account); + sendMessage(y); +} +async function getUsers() { + var accounts = await JSON.parse(fs.readFileSync("accounts.json")); + accounts.forEach(async (x) => { + var y = await login(x); + console.log(y); + sendMessage(y); + }); +} diff --git a/scripts/stresstest/package-lock.json b/scripts/stresstest/package-lock.json new file mode 100644 index 00000000..81c9b817 --- /dev/null +++ b/scripts/stresstest/package-lock.json @@ -0,0 +1,856 @@ +{ + "name": "stresstest", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "stresstest", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "figlet": "^1.5.2", + "node-fetch": "^2.6.6", + "request": "^2.88.2" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/asn1": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "dependencies": { + "safer-buffer": "~2.1.0" + } + }, + "node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "node_modules/aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "engines": { + "node": "*" + } + }, + "node_modules/aws4": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" + }, + "node_modules/bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dependencies": { + "tweetnacl": "^0.14.3" + } + }, + "node_modules/caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "node_modules/dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dependencies": { + "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dependencies": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "node_modules/extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "engines": [ + "node >=0.6.0" + ] + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + }, + "node_modules/figlet": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/figlet/-/figlet-1.5.2.tgz", + "integrity": "sha512-WOn21V8AhyE1QqVfPIVxe3tupJacq1xGkPTB4iagT6o+P2cAgEOOwIxMftr4+ZCTI6d551ij9j61DFr0nsP2uQ==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "engines": { + "node": "*" + } + }, + "node_modules/form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dependencies": { + "assert-plus": "^1.0.0" + } + }, + "node_modules/har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "engines": { + "node": ">=4" + } + }, + "node_modules/har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "deprecated": "this library is no longer supported", + "dependencies": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dependencies": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + }, + "engines": { + "node": ">=0.8", + "npm": ">=1.3.7" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "node_modules/isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "node_modules/jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + }, + "node_modules/json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "node_modules/jsprim": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "dependencies": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.4.0", + "verror": "1.10.0" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/mime-db": { + "version": "1.51.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", + "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.34", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", + "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "dependencies": { + "mime-db": "1.51.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "engines": { + "node": "*" + } + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "node_modules/psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", + "dependencies": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dependencies": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dependencies": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "engines": [ + "node >=0.6.0" + ], + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + } + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "asn1": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + }, + "figlet": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/figlet/-/figlet-1.5.2.tgz", + "integrity": "sha512-WOn21V8AhyE1QqVfPIVxe3tupJacq1xGkPTB4iagT6o+P2cAgEOOwIxMftr4+ZCTI6d551ij9j61DFr0nsP2uQ==" + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "requires": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + }, + "json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "jsprim": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.4.0", + "verror": "1.10.0" + } + }, + "mime-db": { + "version": "1.51.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", + "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==" + }, + "mime-types": { + "version": "2.1.34", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", + "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "requires": { + "mime-db": "1.51.0" + } + }, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "requires": { + "punycode": "^2.1.0" + } + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + } + } +} diff --git a/scripts/stresstest/package.json b/scripts/stresstest/package.json new file mode 100644 index 00000000..8d94d05b --- /dev/null +++ b/scripts/stresstest/package.json @@ -0,0 +1,17 @@ +{ + "name": "stresstest", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "start": "node ." + }, + "author": "", + "license": "ISC", + "dependencies": { + "figlet": "^1.5.2", + "node-fetch": "^2.6.6", + "request": "^2.88.2" + } +} diff --git a/scripts/stresstest/src/login/index.js b/scripts/stresstest/src/login/index.js new file mode 100644 index 00000000..96603652 --- /dev/null +++ b/scripts/stresstest/src/login/index.js @@ -0,0 +1,20 @@ +const fetch = require("node-fetch"); +const fs = require("fs"); +var config = require("../../config.json"); +module.exports = login; +async function login(account) { + var body = { + fingerprint: "805826570869932034.wR8vi8lGlFBJerErO9LG5NViJFw", + login: account.email, + password: account.password + }; + var x = await fetch(config.url + "/auth/login", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(body) + }); + console.log(x); + x = await x.json(); + console.log(x); + return x; +} diff --git a/scripts/stresstest/src/message/send.js b/scripts/stresstest/src/message/send.js new file mode 100644 index 00000000..d21560d7 --- /dev/null +++ b/scripts/stresstest/src/message/send.js @@ -0,0 +1,23 @@ +const fetch = require("node-fetch"); +const fs = require("fs"); +var config = require("../../config.json"); +module.exports = sendMessage; +async function sendMessage(account) { + var body = { + fingerprint: "805826570869932034.wR8vi8lGlFBJerErO9LG5NViJFw", + content: "Test", + tts: false + }; + var x = await fetch(config.url + "/channels/" + config["text-channel"] + "/messages", { + method: "POST", + headers: { + "Content-Type": "application/json", + Authorization: account.token + }, + body: JSON.stringify(body) + }); + console.log(x); + x = await x.json(); + console.log(x); + return x; +} diff --git a/scripts/stresstest/src/register/index.js b/scripts/stresstest/src/register/index.js new file mode 100644 index 00000000..86f908cd --- /dev/null +++ b/scripts/stresstest/src/register/index.js @@ -0,0 +1,34 @@ +const fetch = require("node-fetch"); +const fs = require("fs"); +var config = require("../../config.json"); +module.exports = generate; +async function generate() { + var mail = (Math.random() + 10).toString(36).substring(2); + mail = mail + "." + (Math.random() + 10).toString(36).substring(2) + "@stresstest.com"; + var password = + (Math.random() * 69).toString(36).substring(-7) + + (Math.random() * 69).toString(36).substring(-7) + + (Math.random() * 69).toString(36).substring(-8); + console.log(mail); + console.log(password); + var body = { + fingerprint: "805826570869932034.wR8vi8lGlFBJerErO9LG5NViJFw", + email: mail, + username: "Fosscord Stress Test", + password: password, + invite: config.invite, + consent: true, + date_of_birth: "2000-04-04", + gift_code_sku_id: null, + captcha_key: null + }; + var x = await fetch(config.url + "/auth/register", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(body) + }); + console.log(x); + x = await x.json(); + console.log(x); + return { email: mail, password: password }; +} -- cgit 1.4.1