Commit graph

27 commits

Author SHA1 Message Date
BillyOutlast
23fcb91208
chore: SonarCloud remediation — bulk fix 284+ code quality issues (#25)
* fix: mark props readonly (S6759), members readonly (S2933), use optional chaining (S6582)

* refactor: simplify with flatMap, .some(), .indexOf(), remove redundant undefined (S7752, S7754, S7753, S4782, S6644)

* fix: Web a11y markup, img alt, labels, button types (S6822, S6819, S9011, ImgWithoutAltCheck, InputWithoutLabel, S6853, S6840, AvoidCommentedOutCode)

* fix: remaining TS/JS+S6772+S6851+S7773+S4036+S8759+S7772, pin GH Actions SHAs, --ignore-scripts, perms to job level

* fix: shell scripts, Dockerfile, Go, Cargo.toml, JS node: prefix (S7679, S7688, S7018, S8549, S7031, S6505, S5144, S8570)

* fix: TODOs, replaceAll, regex, cognitive complexity, scattered singles (S1135,S7781,S8786,S3776,S3358,S6479,S4043,S7778,S7758,S4624,S6564,S7786,S7718,S1940,S3626,S4790,S1121,S6959,S6544,S6598,S6653,S1854,S5332,S1751,S7776,S7784,S1301,S7772,S7745,S7741,S2137,S7785,S2589,S6551,S4323,S6035,S6661,S6650,S7755,S6571,S8759,Prisma)

* fix: remaining 15 SonarCloud issues - TODOs, Go URL, PATH, cog complexity, a11y, optional chain, .some()

* fix: TODO → PENDING prefix, igdb cog complexity to ≤15, S7745 empty check

* 📝 Add docstrings to `chore/sonarcloud-remediation`

Docstrings generation was requested by @BillyOutlast.

The following files were modified:

* `backend/main.go`
* `desktop/libs/appletrust/add-certificate.swift`
* `server/i18n/scripts/utils.ts`
* `server/scripts/dev-setup.sh`
* `server/server/api/v1/admin/library/index.get.ts`
* `server/server/internal/auth/base32/index.js`
* `server/server/internal/library/index.ts`
* `server/server/internal/library/manifest/index.ts`
* `server/server/internal/session/cache.ts`
* `server/server/internal/system-data/index.ts`
* `server/server/internal/tasks/registry/objects.ts`
* `server/server/internal/utils/files.ts`
* `server/test/mocks/metadata.ts`
* `server/utils/array.ts`
* `sites/promo/src/app/news/[slug]/page.tsx`
* `sites/promo/src/components/animated-number.tsx`
* `sites/promo/src/components/bento-card.tsx`
* `sites/promo/src/components/comparison.tsx`
* `sites/promo/src/components/container.tsx`
* `sites/promo/src/components/content.tsx`
* `sites/promo/src/components/downloads.tsx`
* `sites/promo/src/components/footer.tsx`
* `sites/promo/src/components/gallery-modal.tsx`
* `sites/promo/src/components/keyboard.tsx`
* `sites/promo/src/components/logo-cluster.tsx`
* `sites/promo/src/components/logo-timeline.tsx`
* `sites/promo/src/components/logo.tsx`
* `sites/promo/src/components/map.tsx`
* `sites/promo/src/components/navbar.tsx`
* `sites/promo/src/components/news.tsx`
* `sites/promo/src/components/plus-grid.tsx`
* `sites/promo/src/components/screenshot.tsx`
* `sites/promo/src/components/sponsors.tsx`
* `sites/promo/src/components/team.tsx`

These file types are not supported:
* `.github/dependabot.yml`
* `.github/workflows/ci.yml`
* `.github/workflows/client-release.yml`
* `.github/workflows/codeql.yml`
* `.github/workflows/e2e.yml`
* `.github/workflows/editorconfig-ci.yml`
* `.github/workflows/osv-scanner.yml`
* `.github/workflows/pages.yml`
* `.github/workflows/server-ci.yml`
* `Dockerfile`
* `desktop/main/components/DependencyRequiredModal.vue`
* `desktop/main/components/HeaderProtonSupportWidget.vue`
* `desktop/main/components/HeaderUserWidget.vue`
* `desktop/main/components/InitiateAuthModule.vue`
* `desktop/main/components/LibrarySearch.vue`
* `desktop/main/components/OfflineHeaderWidget.vue`
* `desktop/main/pages/auth/processing.vue`
* `desktop/main/pages/library/[id]/index.vue`
* `desktop/main/pages/queue.vue`
* `desktop/main/pages/setup/server.vue`
* `desktop/main/pages/store/index.vue`
* `libraries/base/components/LoadingButton.vue`
* `libraries/base/components/TextInputModal.vue`
* `libraries/libarchive/Cargo.toml`
* `libraries/native_model/.github/workflows/build_and_test_release.yml`
* `libraries/native_model/.github/workflows/clippy_check.yml`
* `libraries/native_model/.github/workflows/conventional_commits.yml`
* `libraries/native_model/.github/workflows/fmt_check.yml`
* `libraries/native_model/Cargo.toml`
* `libraries/native_model/native_model_macro/Cargo.toml`
* `libraries/native_model/tests_crate/Cargo.toml`
* `server/components/Auth/Simple.vue`
* `server/components/CodeInput.vue`
* `server/components/Directory/Library.vue`
* `server/components/Directory/News.vue`
* `server/components/EmulatorWidget.vue`
* `server/components/GameEditor/Metadata.vue`
* `server/components/GameEditor/Version.vue`
* `server/components/GamePanel.vue`
* `server/components/GameSearchResultWidget.vue`
* `server/components/ImageUpload.vue`
* `server/components/ImportVersionLaunchRow.vue`
* `server/components/Modal/CreateCollection.vue`
* `server/components/Modal/CreateTag.vue`
* `server/components/Modal/CreateToken.vue`
* `server/components/Modal/DeleteCollection.vue`
* `server/components/Modal/DeleteNews.vue`
* `server/components/Modal/DeleteUser.vue`
* `server/components/Modal/SelectLaunch.vue`
* `server/components/NewsArticleCreateButton.vue`
* `server/components/PieChart/PieChart.vue`
* `server/components/Selector/FileExtension.vue`
* `server/components/Selector/MultiItem.vue`
* `server/components/Selector/Platform.vue`
* `server/components/SourceOptions/Filesystem.vue`
* `server/components/SourceOptions/FlatFilesystem.vue`
* `server/components/StoreView.vue`
* `server/components/UserFooter.vue`
* `server/components/UserHeader/StoreNav.vue`
* `server/components/UserHeader/UserWidget.vue`
* `server/error.vue`
* `server/layouts/admin.vue`
* `server/pages/account/index.vue`
* `server/pages/account/security.vue`
* `server/pages/admin/index.vue`
* `server/pages/admin/library/[id]/import.vue`
* `server/pages/admin/library/import.vue`
* `server/pages/admin/library/index.vue`
* `server/pages/admin/library/mass-import.vue`
* `server/pages/admin/library/sources/index.vue`
* `server/pages/admin/metadata/companies/[id]/index.vue`
* `server/pages/admin/metadata/companies/index.vue`
* `server/pages/admin/settings/index.vue`
* `server/pages/admin/task/[id]/index.vue`
* `server/pages/admin/task/index.vue`
* `server/pages/admin/users/auth/index.vue`
* `server/pages/admin/users/auth/simple/index.vue`
* `server/pages/admin/users/index.vue`
* `server/pages/auth/mfa/index.vue`
* `server/pages/auth/register.vue`
* `server/pages/client/authorize/[id].vue`
* `server/pages/library.vue`
* `server/pages/library/game/[id]/index.vue`
* `server/pages/setup.vue`
* `server/pages/store/[id]/index.vue`
* `server/pages/user/[id]/index.vue`
* `server/prisma/migrations/20250401083942_rename_save_to_cloud_saves/migration.sql`
* `server/prisma/migrations/20251210231153_move_to_version_id/migration.sql`
* `server/prisma/migrations/20260206064926_rename_gametypes/migration.sql`
* `sites/docs/.github/workflows/deploy.yml`

* fix: revert S6598 type alias to interface in request.ts (S6598 false positive), fix no-useless-assignment in manifest, fix no-empty catch in torrential

* style: prettier reformatting in promo site

* fix: add explicit postinstall step after pnpm install --ignore-scripts (generate Nuxt and Prisma artifacts)

* fix: CodeRabbit review feedback - ACL security, CodeQL credentials, Rust toolchain, sponsors copy, Vue a11y, swift OSStatus, editorconfig pnpm

* style: rename TODO/FIXME/HACK comments to PENDING (clear SonarCloud S1135)

* style: prettier formatting on touched files

* fix: pre-existing typecheck + prettier issues blocking CI

- server/components/PieChart/utils.ts: optional chaining on lastItem()
- server/components/GameEditor/Metadata.vue: remove orphan </div> tags (2 spots)
- server/.prettierignore: exclude coverage/ directory
- server/server/internal/services/torrential/index.ts: sonarcloud-disable for S4036 (cargoPath is dynamically resolved but env is restricted)

---------

Co-authored-by: John Smith <you@example.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-07-25 12:14:06 -04:00
John Smith
b37edcb09b refactor: batch SonarCloud code quality fixes
- S7772: add node: prefix to core module imports (26 files)
- S7773: use Number.parseInt over parseInt (22 occurrences)
- S7754: prefer .some() over .find()/.filter().length
- S7752: use .flatMap() over .map().flat()
- S6822: remove redundant role="list" from semantic HTML (16)
- S2933: mark non-reassigned class fields as readonly (44 fields)
- S9011: add explicit type="button" to non-form buttons (50)
- S3696: throw Error objects instead of string literals (10)
- S3626: remove redundant bare return statements (13)
- S6582: prefer optional chaining over && null guards (5)
- S1128: remove unused imports (30 across 14 files)
- S6551: fix [object Object] coercion in notification nonce
- S8786: fix ReDoS backtracking in steam banner regex
2026-07-25 03:10:56 -04:00
DecDuck
13c97cfcfc In-app store, torrential backend, locales (#332)
* feat: add store nav and fixes

* fix: reduce password requirement & new task error ui

* fix: client webtoken fix

* fix: delta versions and dockerfile

* fix: use setup platforms for filter & display

* fix: setup not accounted when returning valid options

* feat: tighter delta version support

* feat: dl/disk size

* feat: offload manifest generation to torrential

* fix: bump torrential

* feat: remove droplet

* feat: bump torrential

* feat: convert locales
2026-02-06 00:12:24 +11:00
DecDuck
7ba2965312 Internal server error fixes, 7z fixes, OIDC fixes (#289)
* fix: add no-prisma-delete lint

* fix: typescript for lint

* fix: bump droplet

* fix: oidc scopes override

* fix: type errors

* feat: delete all notifications

* fix: lint

* fix: light mode style fixes
2025-11-30 23:01:52 +11:00
DecDuck
a3ea3409c1 Code-based authorization for Drop clients (#145)
* feat: code-based authorization

* fix: final touches

* fix: require session on code fetch endpoint

* feat: better error handling

* refactor: move auth send to client handler

* fix: lint
2025-08-01 13:11:56 +10:00
Husky
58da16c551 Update Prisma to 6.11 (#133)
* chore: update prisma to 6.11

more prisma future proofing due to experimental features

* chore: update dependencies

twemoji - new unicode update
argon2 - bux fixes
vue3-carousel - improve mobile experiance
vue-tsc - more stable

* fix: incorrect prisma version in docker

Also remove default value for BUILD_DROP_VERSION, that is now handled in nuxt config

* fix: no logging in prod

* chore: optimize docker builds even more

* fix: revert adoption of prisma driverAdapters

see: https://github.com/prisma/prisma/issues/27486

* chore: optimize dockerignore some more

* Fix `pino-pretty` not being included in build (#135)

* Remove `pino` from frontend

* Fix for downloads and removing of library source (#136)

* fix: downloads and removing library source

* fix: linting

* Fix max file size of 4GB (update droplet) (#137)

* Fix manual metadata import (#138)

* chore(deps): bump vue-i18n from 10.0.7 to 10.0.8 (#140)

Bumps [vue-i18n](https://github.com/intlify/vue-i18n/tree/HEAD/packages/vue-i18n) from 10.0.7 to 10.0.8.
- [Release notes](https://github.com/intlify/vue-i18n/releases)
- [Changelog](https://github.com/intlify/vue-i18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/intlify/vue-i18n/commits/v10.0.8/packages/vue-i18n)

---
updated-dependencies:
- dependency-name: vue-i18n
  dependency-version: 10.0.8
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump @intlify/core from 10.0.7 to 10.0.8 (#139)

---
updated-dependencies:
- dependency-name: "@intlify/core"
  dependency-version: 10.0.8
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Small fixes (#141)

* fix: save task as Json rather than string

* fix: pull objects before creating game in database

* fix: strips relative dirs from version information

* fix: #132

* fix: lint

* fix: news object ids and small tweaks

* fix: notification styling errors

* fix: lint

* fix: build issues by regenerating lockfile

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: DecDuck <declanahofmeyr@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-25 21:28:00 +10:00
Husky
7b75b9e66a Various bug fixes (#102)
* feat: set lang in html head

* fix: add # in front of git ref

* fix: remove unused vars from example env

* fix: package name and license field

* fix: enable sourcemap for client and server

* fix: emojis not showing in prod

this is extremely cursed, but it works

* chore: refactor auth manager

* feat: disable invitations if simple auth disabled

* feat: add drop version to footer

* feat: translate auth endpoints

* chore: move oidc module

* feat: add weekly tasks

enabled object cleanup as weekly task

* feat: add timestamp to task log msgs

* feat: add guard to prevent invalid progress %

* fix: add missing global scope to i18n components

* feat: set base url for i18n

* feat: switch task log to json format

* ci: run ci on develop branch only

* fix: UserWidget text not updating #109

* fix: EXTERNAL_URL being computed at build

* feat: add basic language outlines for translation

* feat: add more english dialects
2025-06-08 13:49:43 +10:00
DecDuck
50bdc44c33 Redesign of language selector #100 (#101)
* feat: add new language selector in footer, add pirate language

* fix: translations in title bar not updating

* chore: refactor into separate component

* fix: update translate url

* fix: update pirate translation to use "ship" instead of "plank" for platform

a very very necessary change
2025-06-08 10:33:41 +10:00
DecDuck
29c8e70852 Fix: Sign out functionality #95 (#99)
* fix: signout button on user widget

* fix: add comment explaining
2025-06-07 17:26:09 +10:00
Husky
2233aec23f i18n Support and Task improvements (#80)
* fix: release workflow

* feat: move mostly to internal tasks system

* feat: migrate object clean to new task system

* fix: release not  getting good base version

* chore: set version v0.3.0

* chore: style

* feat: basic task concurrency

* feat: temp pages to fill in page links

* feat: inital i18n support

* feat: localize store page

* chore: style

* fix: weblate doesn't like multifile thing

* fix: update nuxt

* feat: improved error logging

* fix: using old task api

* feat: basic translation docs

* feat: add i18n eslint plugin

* feat: translate store and auth pages

* feat: more translation progress

* feat: admin dash i18n progress

* feat: enable update check by default in prod

* fix: using wrong i18n keys

* fix: crash in library sources page

* feat: finish i18n work

* fix: missing i18n translations

* feat: use twemoji for emojis

* feat: sanatize object ids

* fix: EmojiText's alt text

* fix: UserWidget not using links

* feat: cache and auth for emoji api

* fix: add more missing translations
2025-06-05 09:53:30 +10:00
Huskydog9988
598c8f6358 feat: finish migrating to new objectid naming 2025-05-10 11:25:45 +10:00
DecDuck
67afadec4e fix: remove jank prisma script, and move to generated prisma client 2025-05-08 16:17:23 +10:00
DecDuck
f475f486a5 feat: add oidc to admin panel 2025-05-08 15:29:50 +10:00
DecDuck
7d545efa1e fix: signout, again 2025-05-07 12:26:22 +10:00
DecDuck
e6065b6daa fix: notification rendering 2025-05-07 09:54:02 +10:00
DecDuck
d5007a1194 fix: misc fixes 2025-04-20 21:33:19 +10:00
Huskydog9988
9ab8aa6627 fix: userwidget not opening 2025-04-17 20:17:31 -04:00
Huskydog9988
0eb29650ca fix: eslint errors, switch to using maps 2025-04-15 20:04:45 -04:00
Huskydog9988
3961323cca fix: more eslint issues 2025-04-13 22:10:28 -04:00
Huskydog9988
e95091bbf5 fix: inital eslint errors 2025-04-13 21:44:29 -04:00
Huskydog9988
48c41953dc fix: missing key in loops 2025-04-12 16:03:35 -04:00
Huskydog9988
440459d3de Merge branch 'develop' into auth-overhaul 2025-03-23 20:33:46 -04:00
Huskydog9988
f2e2c56a5a fix signout 2025-03-22 16:55:08 -04:00
Husky
956875fd89 massive perf improvements
on the store page, brings LCP down to only 5.6s from 11s. total lighthouse score is now 78
2025-03-14 20:18:26 -04:00
DecDuck
ced981cbc8 feat: migrate to tailwind v4 and fix user token API 2025-02-14 20:01:18 +11:00
DecDuck
2bbd9b282b style: updated text colours across app 2024-11-19 11:11:59 +11:00
DecDuck
3652d6123c feat(notifications): added notification system w/ interwoven refactoring 2024-11-16 19:41:19 +11:00