patch for latest api

This commit is contained in:
Expand-sys 2022-12-23 15:39:19 +11:00
parent 481be2dc2a
commit 9e1e078ee8
5 changed files with 160 additions and 160 deletions

View file

@ -92,8 +92,8 @@ fastify.get("/", async function (req, res) {
if (process.env.SETUP == false || !process.env.SETUP) {
res.view("setup");
} else {
console.log(`${api}../properties`);
let checkalive = await got(`${api}../properties`, {
console.log(`${api}/api/properties`);
let checkalive = await got(`${api}/api/properties`, {
headers: {
Accept: "application/json",
},
@ -134,7 +134,7 @@ fastify.get(
const user = req.session.get("user");
const password = req.session.get("password");
const auth = req.session.get("b64");
balance = await got(`${api}user/balance`, {
balance = await got(`${api}/api/v1/user/balance`, {
headers: {
Authorization: auth,
Accept: "application/json",
@ -147,7 +147,7 @@ fastify.get(
console.log(balance);
console.log("start " + Date.now());
let logsent = await got(`${api}user/log`, {
let logsent = await got(`${api}/api/v2/user/log`, {
headers: {
Authorization: auth,
Accept: "application/json",
@ -277,7 +277,7 @@ fastify.post("/register", async function (req, res) {
//let checkuser = await client.addUser(name, password);
try {
let checkuser = await got.post(`${api}user/register`, {
let checkuser = await got.post(`${api}/api/v1/user/register`, {
headers: {
Accept: "application/json",
},
@ -305,11 +305,11 @@ fastify.post("/login", async function (req, res) {
}
const { name, password } = req.body;
let auth = btoa(`${name}:${password}`);
let auth = Buffer.from(`${name}:${password}`).toString('base64');
auth = `Basic ${auth}`;
let adminTest;
try {
adminTest = await got.post(`${api}admin/verify_account`, {
adminTest = await got.post(`${api}/api/v1/admin/verify_account`, {
headers: {
Authorization: auth,
Accept: "application/json",
@ -330,7 +330,7 @@ fastify.post("/login", async function (req, res) {
let verified;
//verified = await client.verifyPassword(name, password);
try {
verified = await got.post(`${api}user/verify_password`, {
verified = await got.post(`${api}/api/v1/user/verify_password`, {
headers: {
Authorization: auth,
Accept: "application/json",
@ -382,7 +382,7 @@ fastify.get("/login", async function (req, res) {
let errors = req.session.get("errors");
req.session.set("errors", "");
//let checkalive = await client.ping();
let checkalive = await got(`${api}../properties`, {
let checkalive = await got(`${api}/api/properties`, {
headers: {
Accept: "application/json",
},
@ -407,7 +407,7 @@ fastify.get("/register", async function (req, res) {
let errors = req.session.get("errors");
req.session.set("errors", "");
//let checkalive = await client.ping();
let checkalive = await got(`${api}../properties`, {
let checkalive = await got(`${api}/api/properties`, {
headers: {
Accept: "application/json",
},

273
package-lock.json generated
View file

@ -11,7 +11,7 @@
"dependencies": {
"@mgcrea/fastify-session": "^0.14.1",
"dotenv": "^8.2.0",
"express-validator": "5.3.1",
"express-validator": "^6.14.2",
"fastify": "^3.18.0",
"fastify-cookie": "^5.3.1",
"fastify-flash": "^2.0.2",
@ -72,6 +72,11 @@
"ajv": "^6.12.6"
}
},
"node_modules/@fastify/error": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@fastify/error/-/error-2.0.0.tgz",
"integrity": "sha512-wI3fpfDT0t7p8E6dA2eTECzzOd+bZsZCJ2Hcv+Onn2b7ZwK3RwD27uW2QDaMtQhAfWQQP+WNK7nKf0twLsBf9w=="
},
"node_modules/@hapi/bourne": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@hapi/bourne/-/bourne-2.0.0.tgz",
@ -514,6 +519,14 @@
"node": ">= 0.6"
}
},
"node_modules/content-type": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
"integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/cookie": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz",
@ -692,23 +705,15 @@
}
},
"node_modules/express-validator": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/express-validator/-/express-validator-5.3.1.tgz",
"integrity": "sha512-g8xkipBF6VxHbO1+ksC7nxUU7+pWif0+OZXjZTybKJ/V0aTVhuCoHbyhIPgSYVldwQLocGExPtB2pE0DqK4jsw==",
"version": "6.14.2",
"resolved": "https://registry.npmjs.org/express-validator/-/express-validator-6.14.2.tgz",
"integrity": "sha512-8XfAUrQ6Y7dIIuy9KcUPCfG/uCbvREctrxf5EeeME+ulanJ4iiW71lWmm9r4YcKKYOCBMan0WpVg7FtHu4Z4Wg==",
"dependencies": {
"lodash": "^4.17.10",
"validator": "^10.4.0"
"lodash": "^4.17.21",
"validator": "^13.7.0"
},
"engines": {
"node": ">= 6.0.0"
}
},
"node_modules/express-validator/node_modules/validator": {
"version": "10.11.0",
"resolved": "https://registry.npmjs.org/validator/-/validator-10.11.0.tgz",
"integrity": "sha512-X/p3UZerAIsbBfN/IwahhYaBbY68EN/UQBWHtsbXGT5bfrH/p4NQzUCG1kF/rtKaNpnJ7jAu6NGTdSNtyNIXMw==",
"engines": {
"node": ">= 0.10"
"node": ">= 8.0.0"
}
},
"node_modules/fast-decode-uri-component": {
@ -741,9 +746,9 @@
}
},
"node_modules/fast-redact": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.0.1.tgz",
"integrity": "sha512-kYpn4Y/valC9MdrISg47tZOpYBNoTXKgT9GYXFpHN/jYFs+lFkPoisY+LcBODdKVMY96ATzvzsWv+ES/4Kmufw==",
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.1.2.tgz",
"integrity": "sha512-+0em+Iya9fKGfEQGcd62Yv6onjBmmhV1uh86XVfOU8VwAe6kaFdQCWI9s0/Nnugx5Vd9tdbZ7e6gE2tR9dzXdw==",
"engines": {
"node": ">=6"
}
@ -754,26 +759,26 @@
"integrity": "sha512-lXatBjf3WPjmWD6DpIZxkeSsCOwqI0maYMpgDlx8g4U2qi4lbjA9oH/HD2a87G+KfsUmo5WbJFmqBZlPxtptag=="
},
"node_modules/fastify": {
"version": "3.19.0",
"resolved": "https://registry.npmjs.org/fastify/-/fastify-3.19.0.tgz",
"integrity": "sha512-BCRysn+IAcGk03khcUnqfawti93rK67VCD9xN42W1FESDR4pRWFNyuWMVowGTjy1rcKKM91pUfVr05lNu49RfQ==",
"version": "3.29.4",
"resolved": "https://registry.npmjs.org/fastify/-/fastify-3.29.4.tgz",
"integrity": "sha512-BEyKidZQvscNaiF1BLh+YLE7AzHH03NexhPzrwZP6KBQ+jG2czdgq72X+RFB5rK9hbqdaafVb5yiWN+hCvHfYg==",
"dependencies": {
"@fastify/ajv-compiler": "^1.0.0",
"@fastify/error": "^2.0.0",
"abstract-logging": "^2.0.0",
"avvio": "^7.1.2",
"content-type": "^1.0.4",
"fast-json-stringify": "^2.5.2",
"fastify-error": "^0.3.0",
"fastify-warning": "^0.2.0",
"find-my-way": "^4.0.0",
"find-my-way": "^4.5.0",
"flatstr": "^1.0.12",
"light-my-request": "^4.2.0",
"pino": "^6.2.1",
"pino": "^6.13.0",
"process-warning": "^1.0.0",
"proxy-addr": "^2.0.7",
"readable-stream": "^3.4.0",
"rfdc": "^1.1.4",
"secure-json-parse": "^2.0.0",
"semver": "^7.3.2",
"tiny-lru": "^7.0.0"
"tiny-lru": "^8.0.1"
}
},
"node_modules/fastify-cookie": {
@ -786,11 +791,6 @@
"fastify-plugin": "^3.0.0"
}
},
"node_modules/fastify-error": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/fastify-error/-/fastify-error-0.3.1.tgz",
"integrity": "sha512-oCfpcsDndgnDVgiI7bwFKAun2dO+4h84vBlkWsWnz/OUK9Reff5UFoFl241xTiLeHWX/vU9zkDVXqYUxjOwHcQ=="
},
"node_modules/fastify-flash": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/fastify-flash/-/fastify-flash-2.0.2.tgz",
@ -902,19 +902,6 @@
"resolved": "https://registry.npmjs.org/fastify-warning/-/fastify-warning-0.2.0.tgz",
"integrity": "sha512-s1EQguBw/9qtc1p/WTY4eq9WMRIACkj+HTcOIK1in4MV5aFaQC9ZCIt0dJ7pr5bIf4lPpHvAtP2ywpTNgs7hqw=="
},
"node_modules/fastify/node_modules/readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
"dependencies": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/fastq": {
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.1.tgz",
@ -924,9 +911,9 @@
}
},
"node_modules/find-my-way": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-4.3.2.tgz",
"integrity": "sha512-hjd9Oe7cJUknsm4cj91RLjz4TDsgFDkTTeKax44059GPI/nBYbGVG5RvCMDLcXLJhq1561QqknstRUwup0INzg==",
"version": "4.5.1",
"resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-4.5.1.tgz",
"integrity": "sha512-kE0u7sGoUFbMXcOG/xpkmz4sRLCklERnBcg7Ftuu1iAxsfEt2S46RLJ3Sq7vshsEy2wJT2hZxE58XZK27qa8kg==",
"dependencies": {
"fast-decode-uri-component": "^1.0.1",
"fast-deep-equal": "^3.1.3",
@ -1023,16 +1010,16 @@
}
},
"node_modules/got": {
"version": "11.8.2",
"resolved": "https://registry.npmjs.org/got/-/got-11.8.2.tgz",
"integrity": "sha512-D0QywKgIe30ODs+fm8wMZiAcZjypcCodPNuMz5H9Mny7RJ+IjJ10BdmGW7OM7fHXP+O7r6ZwapQ/YQmMSvB0UQ==",
"version": "11.8.6",
"resolved": "https://registry.npmjs.org/got/-/got-11.8.6.tgz",
"integrity": "sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==",
"dependencies": {
"@sindresorhus/is": "^4.0.0",
"@szmarczak/http-timer": "^4.0.5",
"@types/cacheable-request": "^6.0.1",
"@types/responselike": "^1.0.0",
"cacheable-lookup": "^5.0.3",
"cacheable-request": "^7.0.1",
"cacheable-request": "^7.0.2",
"decompress-response": "^6.0.0",
"http2-wrapper": "^1.0.0-beta.5.2",
"lowercase-keys": "^2.0.0",
@ -1344,9 +1331,9 @@
}
},
"node_modules/minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"dependencies": {
"brace-expansion": "^1.1.7"
},
@ -1355,9 +1342,12 @@
}
},
"node_modules/minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
"version": "1.2.7",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz",
"integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==",
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/mkdirp": {
"version": "0.5.5",
@ -1384,9 +1374,9 @@
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"node_modules/nanoid": {
"version": "3.1.23",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz",
"integrity": "sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==",
"version": "3.3.4",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz",
"integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==",
"bin": {
"nanoid": "bin/nanoid.cjs"
},
@ -1584,14 +1574,15 @@
}
},
"node_modules/pino": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/pino/-/pino-6.12.0.tgz",
"integrity": "sha512-5NGopOcUusGuklGHVVv9az0Hv/Dj3urHhD3G+zhl5pBGIRYAeGCi/Ej6YCl16Q2ko28cmYiJz+/qRoJiwy62Rw==",
"version": "6.14.0",
"resolved": "https://registry.npmjs.org/pino/-/pino-6.14.0.tgz",
"integrity": "sha512-iuhEDel3Z3hF9Jfe44DPXR8l07bhjuFY3GMHIXbjnY9XcafbyDDwl2sN2vw2GjMPf5Nkoe+OFao7ffn9SXaKDg==",
"dependencies": {
"fast-redact": "^3.0.0",
"fast-safe-stringify": "^2.0.8",
"flatstr": "^1.0.12",
"pino-std-serializers": "^3.1.0",
"process-warning": "^1.0.0",
"quick-format-unescaped": "^4.0.3",
"sonic-boom": "^1.0.2"
},
@ -1656,6 +1647,11 @@
"node": ">= 0.6.0"
}
},
"node_modules/process-warning": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/process-warning/-/process-warning-1.0.0.tgz",
"integrity": "sha512-du4wfLyj4yCZq1VupnVSZmRsPJsNuxoDQFdCFHLaYiEbFBD7QE0a+I4D7hOxrVnh78QE/YipFAj9lXHiXocV+Q=="
},
"node_modules/promise": {
"version": "7.3.1",
"resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz",
@ -1844,9 +1840,9 @@
]
},
"node_modules/quick-format-unescaped": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.3.tgz",
"integrity": "sha512-MaL/oqh02mhEo5m5J2rwsVL23Iw2PEaGVHgT2vFt8AAsr0lfvQA5dpXo9TPu0rz7tSBdUPgkbam0j/fj5ZM8yg=="
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz",
"integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg=="
},
"node_modules/quick-lru": {
"version": "5.1.1",
@ -2150,9 +2146,9 @@
}
},
"node_modules/tiny-lru": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/tiny-lru/-/tiny-lru-7.0.6.tgz",
"integrity": "sha512-zNYO0Kvgn5rXzWpL0y3RS09sMK67eGaQj9805jlK9G6pSadfriTczzLHFXa/xcW4mIRfmlB9HyQ/+SgL0V1uow==",
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/tiny-lru/-/tiny-lru-8.0.2.tgz",
"integrity": "sha512-ApGvZ6vVvTNdsmt676grvCkUCGwzG9IqXma5Z07xJgiC5L7akUMof5U8G2JTI9Rz/ovtVhJBlY6mNhEvtjzOIg==",
"engines": {
"node": ">=6"
}
@ -2341,6 +2337,14 @@
"uuid": "bin/uuid"
}
},
"node_modules/validator": {
"version": "13.7.0",
"resolved": "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz",
"integrity": "sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==",
"engines": {
"node": ">= 0.10"
}
},
"node_modules/void-elements": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz",
@ -2413,6 +2417,11 @@
"ajv": "^6.12.6"
}
},
"@fastify/error": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@fastify/error/-/error-2.0.0.tgz",
"integrity": "sha512-wI3fpfDT0t7p8E6dA2eTECzzOd+bZsZCJ2Hcv+Onn2b7ZwK3RwD27uW2QDaMtQhAfWQQP+WNK7nKf0twLsBf9w=="
},
"@hapi/bourne": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@hapi/bourne/-/bourne-2.0.0.tgz",
@ -2783,6 +2792,11 @@
"safe-buffer": "5.1.2"
}
},
"content-type": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
"integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA=="
},
"cookie": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz",
@ -2907,19 +2921,12 @@
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
},
"express-validator": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/express-validator/-/express-validator-5.3.1.tgz",
"integrity": "sha512-g8xkipBF6VxHbO1+ksC7nxUU7+pWif0+OZXjZTybKJ/V0aTVhuCoHbyhIPgSYVldwQLocGExPtB2pE0DqK4jsw==",
"version": "6.14.2",
"resolved": "https://registry.npmjs.org/express-validator/-/express-validator-6.14.2.tgz",
"integrity": "sha512-8XfAUrQ6Y7dIIuy9KcUPCfG/uCbvREctrxf5EeeME+ulanJ4iiW71lWmm9r4YcKKYOCBMan0WpVg7FtHu4Z4Wg==",
"requires": {
"lodash": "^4.17.10",
"validator": "^10.4.0"
},
"dependencies": {
"validator": {
"version": "10.11.0",
"resolved": "https://registry.npmjs.org/validator/-/validator-10.11.0.tgz",
"integrity": "sha512-X/p3UZerAIsbBfN/IwahhYaBbY68EN/UQBWHtsbXGT5bfrH/p4NQzUCG1kF/rtKaNpnJ7jAu6NGTdSNtyNIXMw=="
}
"lodash": "^4.17.21",
"validator": "^13.7.0"
}
},
"fast-decode-uri-component": {
@ -2949,9 +2956,9 @@
}
},
"fast-redact": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.0.1.tgz",
"integrity": "sha512-kYpn4Y/valC9MdrISg47tZOpYBNoTXKgT9GYXFpHN/jYFs+lFkPoisY+LcBODdKVMY96ATzvzsWv+ES/4Kmufw=="
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.1.2.tgz",
"integrity": "sha512-+0em+Iya9fKGfEQGcd62Yv6onjBmmhV1uh86XVfOU8VwAe6kaFdQCWI9s0/Nnugx5Vd9tdbZ7e6gE2tR9dzXdw=="
},
"fast-safe-stringify": {
"version": "2.0.8",
@ -2959,38 +2966,26 @@
"integrity": "sha512-lXatBjf3WPjmWD6DpIZxkeSsCOwqI0maYMpgDlx8g4U2qi4lbjA9oH/HD2a87G+KfsUmo5WbJFmqBZlPxtptag=="
},
"fastify": {
"version": "3.19.0",
"resolved": "https://registry.npmjs.org/fastify/-/fastify-3.19.0.tgz",
"integrity": "sha512-BCRysn+IAcGk03khcUnqfawti93rK67VCD9xN42W1FESDR4pRWFNyuWMVowGTjy1rcKKM91pUfVr05lNu49RfQ==",
"version": "3.29.4",
"resolved": "https://registry.npmjs.org/fastify/-/fastify-3.29.4.tgz",
"integrity": "sha512-BEyKidZQvscNaiF1BLh+YLE7AzHH03NexhPzrwZP6KBQ+jG2czdgq72X+RFB5rK9hbqdaafVb5yiWN+hCvHfYg==",
"requires": {
"@fastify/ajv-compiler": "^1.0.0",
"@fastify/error": "^2.0.0",
"abstract-logging": "^2.0.0",
"avvio": "^7.1.2",
"content-type": "^1.0.4",
"fast-json-stringify": "^2.5.2",
"fastify-error": "^0.3.0",
"fastify-warning": "^0.2.0",
"find-my-way": "^4.0.0",
"find-my-way": "^4.5.0",
"flatstr": "^1.0.12",
"light-my-request": "^4.2.0",
"pino": "^6.2.1",
"pino": "^6.13.0",
"process-warning": "^1.0.0",
"proxy-addr": "^2.0.7",
"readable-stream": "^3.4.0",
"rfdc": "^1.1.4",
"secure-json-parse": "^2.0.0",
"semver": "^7.3.2",
"tiny-lru": "^7.0.0"
},
"dependencies": {
"readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
"requires": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
}
}
"tiny-lru": "^8.0.1"
}
},
"fastify-cookie": {
@ -3003,11 +2998,6 @@
"fastify-plugin": "^3.0.0"
}
},
"fastify-error": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/fastify-error/-/fastify-error-0.3.1.tgz",
"integrity": "sha512-oCfpcsDndgnDVgiI7bwFKAun2dO+4h84vBlkWsWnz/OUK9Reff5UFoFl241xTiLeHWX/vU9zkDVXqYUxjOwHcQ=="
},
"fastify-flash": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/fastify-flash/-/fastify-flash-2.0.2.tgz",
@ -3124,9 +3114,9 @@
}
},
"find-my-way": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-4.3.2.tgz",
"integrity": "sha512-hjd9Oe7cJUknsm4cj91RLjz4TDsgFDkTTeKax44059GPI/nBYbGVG5RvCMDLcXLJhq1561QqknstRUwup0INzg==",
"version": "4.5.1",
"resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-4.5.1.tgz",
"integrity": "sha512-kE0u7sGoUFbMXcOG/xpkmz4sRLCklERnBcg7Ftuu1iAxsfEt2S46RLJ3Sq7vshsEy2wJT2hZxE58XZK27qa8kg==",
"requires": {
"fast-decode-uri-component": "^1.0.1",
"fast-deep-equal": "^3.1.3",
@ -3199,16 +3189,16 @@
}
},
"got": {
"version": "11.8.2",
"resolved": "https://registry.npmjs.org/got/-/got-11.8.2.tgz",
"integrity": "sha512-D0QywKgIe30ODs+fm8wMZiAcZjypcCodPNuMz5H9Mny7RJ+IjJ10BdmGW7OM7fHXP+O7r6ZwapQ/YQmMSvB0UQ==",
"version": "11.8.6",
"resolved": "https://registry.npmjs.org/got/-/got-11.8.6.tgz",
"integrity": "sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==",
"requires": {
"@sindresorhus/is": "^4.0.0",
"@szmarczak/http-timer": "^4.0.5",
"@types/cacheable-request": "^6.0.1",
"@types/responselike": "^1.0.0",
"cacheable-lookup": "^5.0.3",
"cacheable-request": "^7.0.1",
"cacheable-request": "^7.0.2",
"decompress-response": "^6.0.0",
"http2-wrapper": "^1.0.0-beta.5.2",
"lowercase-keys": "^2.0.0",
@ -3453,17 +3443,17 @@
"integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ=="
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
"version": "1.2.7",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz",
"integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g=="
},
"mkdirp": {
"version": "0.5.5",
@ -3484,9 +3474,9 @@
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"nanoid": {
"version": "3.1.23",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz",
"integrity": "sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw=="
"version": "3.3.4",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz",
"integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw=="
},
"node-gyp-build": {
"version": "4.2.3",
@ -3627,14 +3617,15 @@
"integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY="
},
"pino": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/pino/-/pino-6.12.0.tgz",
"integrity": "sha512-5NGopOcUusGuklGHVVv9az0Hv/Dj3urHhD3G+zhl5pBGIRYAeGCi/Ej6YCl16Q2ko28cmYiJz+/qRoJiwy62Rw==",
"version": "6.14.0",
"resolved": "https://registry.npmjs.org/pino/-/pino-6.14.0.tgz",
"integrity": "sha512-iuhEDel3Z3hF9Jfe44DPXR8l07bhjuFY3GMHIXbjnY9XcafbyDDwl2sN2vw2GjMPf5Nkoe+OFao7ffn9SXaKDg==",
"requires": {
"fast-redact": "^3.0.0",
"fast-safe-stringify": "^2.0.8",
"flatstr": "^1.0.12",
"pino-std-serializers": "^3.1.0",
"process-warning": "^1.0.0",
"quick-format-unescaped": "^4.0.3",
"sonic-boom": "^1.0.2"
}
@ -3689,6 +3680,11 @@
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
"integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI="
},
"process-warning": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/process-warning/-/process-warning-1.0.0.tgz",
"integrity": "sha512-du4wfLyj4yCZq1VupnVSZmRsPJsNuxoDQFdCFHLaYiEbFBD7QE0a+I4D7hOxrVnh78QE/YipFAj9lXHiXocV+Q=="
},
"promise": {
"version": "7.3.1",
"resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz",
@ -3853,9 +3849,9 @@
"integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="
},
"quick-format-unescaped": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.3.tgz",
"integrity": "sha512-MaL/oqh02mhEo5m5J2rwsVL23Iw2PEaGVHgT2vFt8AAsr0lfvQA5dpXo9TPu0rz7tSBdUPgkbam0j/fj5ZM8yg=="
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz",
"integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg=="
},
"quick-lru": {
"version": "5.1.1",
@ -4109,9 +4105,9 @@
}
},
"tiny-lru": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/tiny-lru/-/tiny-lru-7.0.6.tgz",
"integrity": "sha512-zNYO0Kvgn5rXzWpL0y3RS09sMK67eGaQj9805jlK9G6pSadfriTczzLHFXa/xcW4mIRfmlB9HyQ/+SgL0V1uow=="
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/tiny-lru/-/tiny-lru-8.0.2.tgz",
"integrity": "sha512-ApGvZ6vVvTNdsmt676grvCkUCGwzG9IqXma5Z07xJgiC5L7akUMof5U8G2JTI9Rz/ovtVhJBlY6mNhEvtjzOIg=="
},
"tls-keygen": {
"version": "3.7.0",
@ -4274,6 +4270,11 @@
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
},
"validator": {
"version": "13.7.0",
"resolved": "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz",
"integrity": "sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw=="
},
"void-elements": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz",

View file

@ -2,7 +2,7 @@
"dependencies": {
"@mgcrea/fastify-session": "^0.14.1",
"dotenv": "^8.2.0",
"express-validator": "5.3.1",
"express-validator": "^6.14.2",
"fastify": "^3.18.0",
"fastify-cookie": "^5.3.1",
"fastify-flash": "^2.0.2",
@ -36,6 +36,5 @@
"engines": {
"node": "16.x"
},
"devDependencies": {},
"build": {}
}

View file

@ -14,7 +14,7 @@ module.exports = function (fastify, opts, done) {
preValidation: [validateAdmin],
},
async function (req, res) {
let checkalive = await got(`${api}../properties`, {
let checkalive = await got(`${api}/api/properties`, {
headers: {
Accept: "application/json",
},
@ -53,7 +53,7 @@ module.exports = function (fastify, opts, done) {
}
let post;
try {
post = await got.post(`${api}admin/user/register`, {
post = await got.post(`${api}/api/v1/admin/user/register`, {
headers: {
Authorization: req.session.get("b64"),
Accept: "application/json",
@ -88,7 +88,7 @@ module.exports = function (fastify, opts, done) {
req.session.set("errors", "");
let responsecode;
try {
balance = await got(`${api}user/balance`, {
balance = await got(`${api}/api/v1/user/balance`, {
headers: {
Authorization: req.session.get("b64"),
Accept: "application/json",
@ -107,7 +107,7 @@ module.exports = function (fastify, opts, done) {
if (balance || balance == 0) {
req.session.set(
"successes",
"User: " + name + " has " + balance + " truckstop shitter simoleons"
"User: " + name + " has " + balance + " diarrhea dollars"
);
}
res.redirect("/admin");
@ -125,7 +125,7 @@ module.exports = function (fastify, opts, done) {
req.session.successes = [];
req.session.errors = [];
try {
patch = await got.patch(`${api}admin/set_balance`, {
patch = await got.patch(`${api}/api/v1/admin/set_balance`, {
headers: {
Authorization: req.session.get("b64"),
Accept: "application/json",
@ -160,7 +160,7 @@ module.exports = function (fastify, opts, done) {
req.session.errors = [];
try {
patch = await got.post(`${api}admin/impact_balance`, {
patch = await got.post(`${api}/api/v1/admin/impact_balance`, {
headers: {
Authorization: req.session.get("b64"),
Accept: "application/json",
@ -192,7 +192,7 @@ module.exports = function (fastify, opts, done) {
if (new_pass == password2) {
try {
patch = await got.patch(`${api}admin/user/change_password`, {
patch = await got.patch(`${api}/api/v1/admin/user/change_password`, {
headers: {
Authorization: req.session.get("b64"),
Accept: "application/json",
@ -227,7 +227,7 @@ module.exports = function (fastify, opts, done) {
if (attempt != req.session.get("adminp"))
try {
let deleteUser = await got.delete(`${api}admin/user/delete`, {
let deleteUser = await got.delete(`${api}/api/v1/admin/user/delete`, {
headers: {
Authorization: req.session.get("b64"),
Accept: "application/json",
@ -295,7 +295,7 @@ module.exports = function (fastify, opts, done) {
let auth = btoa(`${name}:${attempt}`);
auth = `Basic ${auth}`;
try {
close = got.post(`${api}/admin/shutdown`, {
close = got.post(`${api}/api/v1/admin/shutdown`, {
headers: {
Authorization: auth,
Accept: "application/json",

View file

@ -19,7 +19,7 @@ module.exports = function (fastify, opts, done) {
preValidation: [validate],
},
async function (req, res) {
let checkalive = await got(`${api}../properties`, {
let checkalive = await got(`${api}/api/properties`, {
headers: {
Accept: "application/json",
},
@ -70,7 +70,7 @@ module.exports = function (fastify, opts, done) {
let name = req.session.get("user");
let auth = btoa(`${name}:${attempt}`);
auth = `Basic ${auth}`;
patch = await got.patch(`${api}user/change_password`, {
patch = await got.patch(`${api}/api/v1/user/change_password`, {
headers: {
Authorization: auth,
Accept: "application/json",
@ -124,7 +124,7 @@ module.exports = function (fastify, opts, done) {
let auth = btoa(`${name}:${password}`);
auth = `Basic ${auth}`;
try {
del = await got.delete(`${api}user/delete`, {
del = await got.delete(`${api}/api/v1/user/delete`, {
headers: {
Authorization: auth,
Accept: "application/json",