Merge branch 'dev/0.15.0' into dev/0.15.0

x-dev-15
X 12 months ago committed by GitHub
commit a0571d7fe6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -10,14 +10,11 @@
"scripts": { "scripts": {
"dev": "npm run build && npm start", "dev": "npm run build && npm start",
"fresh": "rm -dr .ass-data/ & npm run dev", "fresh": "rm -dr .ass-data/ & npm run dev",
"build": "rm -dr dist-*/ & npm run build:backend && npm run build:frontend", "build": "rm -dr dist-*/ & npm run build:backend && npm run build:frontend && npm run build:fix-frontend",
"build:backend": "tsc -p backend/", "build:backend": "tsc -p backend/",
"build:frontend": "tsc -p frontend/", "build:frontend": "tsc -p frontend/",
"postbuild:frontend": "node common/fix-frontend-js.js", "build:fix-frontend": "node common/fix-frontend-js.js",
"start": "node dist-backend/app.js", "start": "node dist-backend/app.js"
"cli-setpassword": "node dist/tools/script.setpassword.js",
"cli-testpassword": "node dist/tools/script.testpassword.js",
"cli-adduser": "node dist/tools/script.adduser.js"
}, },
"repository": "github:tycrek/ass", "repository": "github:tycrek/ass",
"keywords": [ "keywords": [
@ -29,13 +26,13 @@
"bugs": "https://github.com/tycrek/ass/issues", "bugs": "https://github.com/tycrek/ass/issues",
"homepage": "https://github.com/tycrek/ass#readme", "homepage": "https://github.com/tycrek/ass#readme",
"dependencies": { "dependencies": {
"@aws-sdk/client-s3": "^3.437.0", "@aws-sdk/client-s3": "^3.456.0",
"@shoelace-style/shoelace": "^2.11.2", "@shoelace-style/shoelace": "^2.12.0",
"@tinycreek/postcss-font-magician": "^4.2.0", "@tinycreek/postcss-font-magician": "^4.2.0",
"@tsconfig/node20": "^20.1.2", "@tsconfig/node20": "^20.1.2",
"@tycrek/discord-hookr": "^0.1.0", "@tycrek/discord-hookr": "^0.1.0",
"@tycrek/express-postcss": "^0.4.1", "@tycrek/express-postcss": "^0.4.1",
"@tycrek/joint": "^1.0.0-1", "@tycrek/joint": "1.0.0-1",
"@tycrek/log": "^0.7.5", "@tycrek/log": "^0.7.5",
"@xoi/gps-metadata-remover": "^1.1.2", "@xoi/gps-metadata-remover": "^1.1.2",
"any-shell-escape": "^0.1.1", "any-shell-escape": "^0.1.1",
@ -45,14 +42,14 @@
"cssnano": "^6.0.1", "cssnano": "^6.0.1",
"express": "^4.18.2", "express": "^4.18.2",
"express-busboy": "^10.1.0", "express-busboy": "^10.1.0",
"express-rate-limit": "^7.1.3", "express-rate-limit": "^7.1.4",
"express-session": "^1.17.3", "express-session": "^1.17.3",
"ffmpeg-static": "^5.2.0", "ffmpeg-static": "^5.2.0",
"fs-extra": "^11.1.1", "fs-extra": "^11.1.1",
"luxon": "^3.4.3", "luxon": "^3.4.4",
"memorystore": "^1.6.7", "memorystore": "^1.6.7",
"mongoose": "^8.0.0", "mongoose": "^8.0.0",
"mysql2": "^3.6.2", "mysql2": "^3.6.5",
"node-vibrant": "^3.1.6", "node-vibrant": "^3.1.6",
"pg": "^8.11.3", "pg": "^8.11.3",
"pug": "^3.0.2", "pug": "^3.0.2",
@ -60,17 +57,17 @@
"shoelace-fontawesome-pug": "^6.4.3", "shoelace-fontawesome-pug": "^6.4.3",
"shoelace-pug-loader": "^2.11.0", "shoelace-pug-loader": "^2.11.0",
"tailwindcss": "^3.3.5", "tailwindcss": "^3.3.5",
"typescript": "^5.2.2" "typescript": "^5.3.2"
}, },
"devDependencies": { "devDependencies": {
"@types/bcrypt": "^5.0.1", "@types/bcrypt": "^5.0.2",
"@types/express": "^4.17.20", "@types/express": "^4.17.21",
"@types/express-busboy": "^8.0.2", "@types/express-busboy": "^8.0.3",
"@types/express-session": "^1.17.9", "@types/express-session": "^1.17.10",
"@types/ffmpeg-static": "^3.0.2", "@types/ffmpeg-static": "^3.0.3",
"@types/fs-extra": "^11.0.3", "@types/fs-extra": "^11.0.4",
"@types/luxon": "^3.3.3", "@types/luxon": "^3.3.5",
"@types/node": "^20.8.9", "@types/node": "^20.10.0",
"@types/pg": "^8.10.7" "@types/pg": "^8.10.9"
} }
} }

File diff suppressed because it is too large Load Diff

@ -41,7 +41,7 @@ const migrate = (authFileName = 'auth.json'): Promise<Users> => new Promise(asyn
const oldUsers = fs.readJsonSync(authPath).users as OldUsers; const oldUsers = fs.readJsonSync(authPath).users as OldUsers;
// Create a new users object // Create a new users object
const newUsers: Users = { users: [], meta: {} }; const newUsers: Users = { users: [], meta: {}, cliKey: nanoid(32) };
newUsers.migrated = true; newUsers.migrated = true;
// Loop through each user // Loop through each user
@ -69,8 +69,9 @@ const migrate = (authFileName = 'auth.json'): Promise<Users> => new Promise(asyn
.catch(reject) .catch(reject)
// Migrate the datafile (token => uploader) // Migrate the datafile (token => uploader)
.then(() => data().get()) .then(() => (!data())
.then((fileData: [string, FileData][]) => ? (log.warn('data.json not found. This may be a new install?'), Promise.resolve())
: data().get().then((fileData: [string, FileData][]) =>
// ! A note about this block. // ! A note about this block.
// I know it's gross. But using Promise.all crashes low-spec servers, so I had to do it this way. Sorry. // I know it's gross. But using Promise.all crashes low-spec servers, so I had to do it this way. Sorry.
@ -100,7 +101,8 @@ const migrate = (authFileName = 'auth.json'): Promise<Users> => new Promise(asyn
runQueue(0); runQueue(0);
})) }))
.catch((err: any) => log.warn(err.message))
)
// We did it hoofuckingray // We did it hoofuckingray
.then(() => log.success('Migrated all auth & file data to new auth system')) .then(() => log.success('Migrated all auth & file data to new auth system'))
.then(() => resolve(newUsers)) .then(() => resolve(newUsers))

Loading…
Cancel
Save