Skip to content

feat: migrate from JSON files to PocketBase public API#510

Merged
MickLesk merged 10 commits intomainfrom
feature/pocketbase-migration
Mar 17, 2026
Merged

feat: migrate from JSON files to PocketBase public API#510
MickLesk merged 10 commits intomainfrom
feature/pocketbase-migration

Conversation

@MickLesk
Copy link
Copy Markdown
Member

✍️ Description

  • Remove all community JSON files from json/ folder (folder kept for user scripts)
  • Add pocketbase npm package
  • Add pbService.ts: PocketBase singleton client (unauthenticated)
  • Add pbScripts.ts: PocketBase queries mirroring the website's API
  • Update localScripts.ts: use PocketBase as primary source, local JSON as fallback
  • Rewrite scripts.ts router: all data fetching via PocketBase
  • Update scriptDownloader.js: derive script paths by convention (type+slug) instead of relying on explicit JSON paths
  • Update autoSyncService.js: fetch scripts from PocketBase instead of JSON files
  • Update env.js: add PB_URL, remove JSON_FOLDER requirement
  • Update .env.example: document new PB_URL variable

🔗 Related PR / Issue

Fixes: #

✅ Prerequisites (X in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes work as expected.
  • No security risks – No hardcoded secrets, unnecessary privilege escalations, or permission issues.

Screenshot for frontend Change


🛠️ Type of Change (X in brackets)

  • 🐞 Bug fix – Resolves an issue without breaking functionality.
  • New feature – Adds new, non-breaking functionality.
  • 💥 Breaking change – Alters existing functionality in a way that may require updates.

- Remove all community JSON files from json/ folder (folder kept for user scripts)
- Add pocketbase npm package
- Add pbService.ts: PocketBase singleton client (unauthenticated)
- Add pbScripts.ts: PocketBase queries mirroring the website's API
- Update localScripts.ts: use PocketBase as primary source, local JSON as fallback
- Rewrite scripts.ts router: all data fetching via PocketBase
- Update scriptDownloader.js: derive script paths by convention (type+slug)
  instead of relying on explicit JSON paths
- Update autoSyncService.js: fetch scripts from PocketBase instead of JSON files
- Update env.js: add PB_URL, remove JSON_FOLDER requirement
- Update .env.example: document new PB_URL variable
@MickLesk MickLesk requested a review from a team as a code owner March 17, 2026 12:52
- @hono/node-server: >=1.19.10 (authorization bypass fix)
- lodash: ^4.17.23 (prototype pollution fix)
All vulns were transitive deps of prisma CLI internals (@prisma/dev)
- resyncScripts: add error field to return type
- ScriptsGrid.tsx: remove 'source' from ScriptCard literal
- autoSyncService.js: add JSDoc types for implicit any params
- githubJsonService.ts: use process.env.JSON_FOLDER directly
- localScripts.ts: fix PB->Script mapping (interface_port, default_credentials,
  date_created, logo as null); add website field to getScriptCards()
…with prisma.config.ts

- db.ts / db.js: use dbUrl variable (with fallback to pve-scripts.db) instead
  of process.env.DATABASE_URL! directly, prevents crash when DATABASE_URL is
  not set in environment
- autoSyncService.js: suppress ENOENT error log in loadSettings when .env file
  does not exist (return defaults silently instead of printing error)
@MickLesk MickLesk merged commit d8e92e0 into main Mar 17, 2026
4 checks passed
@MickLesk MickLesk deleted the feature/pocketbase-migration branch April 1, 2026 11:14
sm-moshi pushed a commit to sm-moshi/ProxmoxVE-Local that referenced this pull request Apr 14, 2026
…ipts#510)

* feat: migrate from JSON files to PocketBase public API

- Remove all community JSON files from json/ folder (folder kept for user scripts)
- Add pocketbase npm package
- Add pbService.ts: PocketBase singleton client (unauthenticated)
- Add pbScripts.ts: PocketBase queries mirroring the website's API
- Update localScripts.ts: use PocketBase as primary source, local JSON as fallback
- Rewrite scripts.ts router: all data fetching via PocketBase
- Update scriptDownloader.js: derive script paths by convention (type+slug)
  instead of relying on explicit JSON paths
- Update autoSyncService.js: fetch scripts from PocketBase instead of JSON files
- Update env.js: add PB_URL, remove JSON_FOLDER requirement
- Update .env.example: document new PB_URL variable

* fix: correct PocketBase URL to db.community-scripts.org

* fix: downgrade @vitejs/plugin-react to ^5 (compatible with vitest@4/vite@6), add .npmrc

* fix: resolve all npm audit vulnerabilities via overrides

- @hono/node-server: >=1.19.10 (authorization bypass fix)
- lodash: ^4.17.23 (prototype pollution fix)
All vulns were transitive deps of prisma CLI internals (@prisma/dev)

* fix: remove .js extensions from TS imports for webpack compatibility

* fix: remove 'source' from ScriptCard literal, fix pbScripts import extension

* fix: restore repository_url as optional in ScriptCard, remove dead repo filters

* fix: resolve all remaining build errors

- resyncScripts: add error field to return type
- ScriptsGrid.tsx: remove 'source' from ScriptCard literal
- autoSyncService.js: add JSDoc types for implicit any params
- githubJsonService.ts: use process.env.JSON_FOLDER directly
- localScripts.ts: fix PB->Script mapping (interface_port, default_credentials,
  date_created, logo as null); add website field to getScriptCards()

* fix: use dbUrl fallback for Prisma adapter and align default DB path with prisma.config.ts

- db.ts / db.js: use dbUrl variable (with fallback to pve-scripts.db) instead
  of process.env.DATABASE_URL! directly, prevents crash when DATABASE_URL is
  not set in environment
- autoSyncService.js: suppress ENOENT error log in loadSettings when .env file
  does not exist (return defaults silently instead of printing error)

* fix: align .env.example DATABASE_URL db filename with prisma.config.ts default
sm-moshi pushed a commit to sm-moshi/ProxmoxVE-Local that referenced this pull request Apr 14, 2026
…ipts#510)

* feat: migrate from JSON files to PocketBase public API

- Remove all community JSON files from json/ folder (folder kept for user scripts)
- Add pocketbase npm package
- Add pbService.ts: PocketBase singleton client (unauthenticated)
- Add pbScripts.ts: PocketBase queries mirroring the website's API
- Update localScripts.ts: use PocketBase as primary source, local JSON as fallback
- Rewrite scripts.ts router: all data fetching via PocketBase
- Update scriptDownloader.js: derive script paths by convention (type+slug)
  instead of relying on explicit JSON paths
- Update autoSyncService.js: fetch scripts from PocketBase instead of JSON files
- Update env.js: add PB_URL, remove JSON_FOLDER requirement
- Update .env.example: document new PB_URL variable

* fix: correct PocketBase URL to db.community-scripts.org

* fix: downgrade @vitejs/plugin-react to ^5 (compatible with vitest@4/vite@6), add .npmrc

* fix: resolve all npm audit vulnerabilities via overrides

- @hono/node-server: >=1.19.10 (authorization bypass fix)
- lodash: ^4.17.23 (prototype pollution fix)
All vulns were transitive deps of prisma CLI internals (@prisma/dev)

* fix: remove .js extensions from TS imports for webpack compatibility

* fix: remove 'source' from ScriptCard literal, fix pbScripts import extension

* fix: restore repository_url as optional in ScriptCard, remove dead repo filters

* fix: resolve all remaining build errors

- resyncScripts: add error field to return type
- ScriptsGrid.tsx: remove 'source' from ScriptCard literal
- autoSyncService.js: add JSDoc types for implicit any params
- githubJsonService.ts: use process.env.JSON_FOLDER directly
- localScripts.ts: fix PB->Script mapping (interface_port, default_credentials,
  date_created, logo as null); add website field to getScriptCards()

* fix: use dbUrl fallback for Prisma adapter and align default DB path with prisma.config.ts

- db.ts / db.js: use dbUrl variable (with fallback to pve-scripts.db) instead
  of process.env.DATABASE_URL! directly, prevents crash when DATABASE_URL is
  not set in environment
- autoSyncService.js: suppress ENOENT error log in loadSettings when .env file
  does not exist (return defaults silently instead of printing error)

* fix: align .env.example DATABASE_URL db filename with prisma.config.ts default
sm-moshi pushed a commit to sm-moshi/ProxmoxVE-Local that referenced this pull request Apr 14, 2026
…ipts#510)

* feat: migrate from JSON files to PocketBase public API

- Remove all community JSON files from json/ folder (folder kept for user scripts)
- Add pocketbase npm package
- Add pbService.ts: PocketBase singleton client (unauthenticated)
- Add pbScripts.ts: PocketBase queries mirroring the website's API
- Update localScripts.ts: use PocketBase as primary source, local JSON as fallback
- Rewrite scripts.ts router: all data fetching via PocketBase
- Update scriptDownloader.js: derive script paths by convention (type+slug)
  instead of relying on explicit JSON paths
- Update autoSyncService.js: fetch scripts from PocketBase instead of JSON files
- Update env.js: add PB_URL, remove JSON_FOLDER requirement
- Update .env.example: document new PB_URL variable

* fix: correct PocketBase URL to db.community-scripts.org

* fix: downgrade @vitejs/plugin-react to ^5 (compatible with vitest@4/vite@6), add .npmrc

* fix: resolve all npm audit vulnerabilities via overrides

- @hono/node-server: >=1.19.10 (authorization bypass fix)
- lodash: ^4.17.23 (prototype pollution fix)
All vulns were transitive deps of prisma CLI internals (@prisma/dev)

* fix: remove .js extensions from TS imports for webpack compatibility

* fix: remove 'source' from ScriptCard literal, fix pbScripts import extension

* fix: restore repository_url as optional in ScriptCard, remove dead repo filters

* fix: resolve all remaining build errors

- resyncScripts: add error field to return type
- ScriptsGrid.tsx: remove 'source' from ScriptCard literal
- autoSyncService.js: add JSDoc types for implicit any params
- githubJsonService.ts: use process.env.JSON_FOLDER directly
- localScripts.ts: fix PB->Script mapping (interface_port, default_credentials,
  date_created, logo as null); add website field to getScriptCards()

* fix: use dbUrl fallback for Prisma adapter and align default DB path with prisma.config.ts

- db.ts / db.js: use dbUrl variable (with fallback to pve-scripts.db) instead
  of process.env.DATABASE_URL! directly, prevents crash when DATABASE_URL is
  not set in environment
- autoSyncService.js: suppress ENOENT error log in loadSettings when .env file
  does not exist (return defaults silently instead of printing error)

* fix: align .env.example DATABASE_URL db filename with prisma.config.ts default
feat: cache logos locally, show config_path, rename Sync button (community-scripts#511)

- logoCacheService.ts: download script logos to public/logos/ for local serving
- cache-logos.ts: build-time script caching 500+ logos from PocketBase
- scripts.ts router: resolve local logo paths, resyncScripts now caches logos
- autoSyncService.js: cache logos during background auto-sync
- ScriptDetailModal: show config_path per install method
- ResyncButton: renamed 'Sync Json Files' to 'Sync Scripts'
- GeneralSettingsModal: updated auto-sync description text
- .gitignore: ignore public/logos/ and data/*.db
sm-moshi pushed a commit to sm-moshi/ProxmoxVE-Local that referenced this pull request Apr 14, 2026
…ipts#510)

* feat: migrate from JSON files to PocketBase public API

- Remove all community JSON files from json/ folder (folder kept for user scripts)
- Add pocketbase npm package
- Add pbService.ts: PocketBase singleton client (unauthenticated)
- Add pbScripts.ts: PocketBase queries mirroring the website's API
- Update localScripts.ts: use PocketBase as primary source, local JSON as fallback
- Rewrite scripts.ts router: all data fetching via PocketBase
- Update scriptDownloader.js: derive script paths by convention (type+slug)
  instead of relying on explicit JSON paths
- Update autoSyncService.js: fetch scripts from PocketBase instead of JSON files
- Update env.js: add PB_URL, remove JSON_FOLDER requirement
- Update .env.example: document new PB_URL variable

* fix: correct PocketBase URL to db.community-scripts.org

* fix: downgrade @vitejs/plugin-react to ^5 (compatible with vitest@4/vite@6), add .npmrc

* fix: resolve all npm audit vulnerabilities via overrides

- @hono/node-server: >=1.19.10 (authorization bypass fix)
- lodash: ^4.17.23 (prototype pollution fix)
All vulns were transitive deps of prisma CLI internals (@prisma/dev)

* fix: remove .js extensions from TS imports for webpack compatibility

* fix: remove 'source' from ScriptCard literal, fix pbScripts import extension

* fix: restore repository_url as optional in ScriptCard, remove dead repo filters

* fix: resolve all remaining build errors

- resyncScripts: add error field to return type
- ScriptsGrid.tsx: remove 'source' from ScriptCard literal
- autoSyncService.js: add JSDoc types for implicit any params
- githubJsonService.ts: use process.env.JSON_FOLDER directly
- localScripts.ts: fix PB->Script mapping (interface_port, default_credentials,
  date_created, logo as null); add website field to getScriptCards()

* fix: use dbUrl fallback for Prisma adapter and align default DB path with prisma.config.ts

- db.ts / db.js: use dbUrl variable (with fallback to pve-scripts.db) instead
  of process.env.DATABASE_URL! directly, prevents crash when DATABASE_URL is
  not set in environment
- autoSyncService.js: suppress ENOENT error log in loadSettings when .env file
  does not exist (return defaults silently instead of printing error)

* fix: align .env.example DATABASE_URL db filename with prisma.config.ts default
feat: cache logos locally, show config_path, rename Sync button (community-scripts#511)

- logoCacheService.ts: download script logos to public/logos/ for local serving
- cache-logos.ts: build-time script caching 500+ logos from PocketBase
- scripts.ts router: resolve local logo paths, resyncScripts now caches logos
- autoSyncService.js: cache logos during background auto-sync
- ScriptDetailModal: show config_path per install method
- ResyncButton: renamed 'Sync Json Files' to 'Sync Scripts'
- GeneralSettingsModal: updated auto-sync description text
- .gitignore: ignore public/logos/ and data/*.db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant