Commit Graph
61 Commits
Author SHA1 Message Date
najdek 626c463be6 Restore official self-updates with legacy launcher compatibility 2026-10-13 15:34:31 +02:00
najdek 9e6c5918a7 feat: cache repository icon catalogs separately 2026-10-13 13:20:02 +02:00
najdek a5a1760070 docs: align project contracts and retire unused stats 2026-10-13 11:28:47 +02:00
najdek 345a78ec63 fix: preserve ordered SSE logs and wake streams on shutdown 2026-10-13 01:13:42 +02:00
najdek 197c9d765b fix: validate process snapshots before listing or startup lookup 2026-10-13 00:58:08 +02:00
najdek c47b725344 fix: synchronize autoload lifecycle and bound loader transfers 2026-10-13 00:08:13 +02:00
najdek ab82dbf05e fix: validate partial settings and synchronize persistent edits and history 2026-10-12 23:23:19 +02:00
najdek dfc3ce20a6 fix: verify downloads and constrain payload execution paths 2026-10-12 21:51:20 +02:00
najdek 59adaa0fa3 fix: publish storage slots safely and recover interrupted commits 2026-10-12 21:11:49 +02:00
najdek 5c04204f97 fix: bound collection growth and propagate allocation failures 2026-10-12 19:49:45 +02:00
najdek 45be5c6cd7 fix: reject incomplete JSON and bound serializer output 2026-10-12 19:37:53 +02:00
najdek 3c42e3cf0e fix: bound JSON extraction and decode Unicode escapes 2026-10-12 18:48:23 +02:00
najdek 0d39bd5cf4 fix: preserve Unicode and complete escapes in JSON encoding 2026-10-12 18:02:02 +02:00
najdek 608d7fa5f2 fix: clean up terminated HTTP requests and bound autoload lists 2026-10-12 17:54:16 +02:00
najdek ba529e8917 refactor: remove kill disc player on startup functionality
- Remove disc player termination call from daemon startup in main.c
- Remove ps5_kill_disc_player, get_pid_by_name, and unused LncUtil externs
- Remove KILL_DISC_PLAYER_ON_STARTUP from config storage and HTTP endpoints
- Remove Kill Disc Player toggle row from SettingsView
2026-10-12 01:40:09 +02:00
najdek a1c152a203 feat: persist dashboard favorites in backend across all browsers
- Store favorites in /data/pldmgr/favorites.txt on backend
- Return FAVORITES and FAVORITES_INITIALIZED in /get_config
- Parse and save FAVORITES in /set_config POST handler
- Automatically update/remove favorites entries on slot delete, replace, and legacy migration
- Sync favorites state from backend in frontend on startup and persist updates
- Include one-time migration from localStorage for existing clients
2026-10-12 00:06:09 +02:00
najdek aedf1bf31a Merge pull request #109 from kianborg/fix/repository-timeout-autoload 2026-10-11 23:07:05 +02:00
najdek 098f1c3a47 refactor: remove self-update mechanism and exclude pldmgr from repo listings
- Remove startup self-update check and chainloading in main.c
- Remove self-update logic and ELF version inspection from repository.c and repository.h
- Neuter /update_check route to return status none
- Remove update banners, notifications, and settings toggle from frontend
- Exclude pldmgr from repository payload listings and block installing pldmgr as a payload
- Add launch guards in HTTP server and autoload worker preventing pldmgr self-execution
2026-10-11 23:04:18 +02:00
najdek 13a034175f feat: redesign payload storage with managed slots and stable identifiers
- Implement managed slot layout: repo/<id>@<srchash8> and local/<key> with meta.json sidecars
- Decouple user uploads and USB imports from repository matching and updates
- Use stable slot keys for autoload.txt, favorites, launching, and deletion
- Add strict token-based version comparison in C and JS, hiding install button when repo is older
- Support cross-source duplicate handling (keep both vs replace) with conflict modals
- Auto-refresh stale repository caches on install and retry seamlessly
- Implement one-time legacy storage migration on startup (layout version 2)
- Update CUSTOM_REPOSITORIES.md with id field specifications and comparison rules
- Remove deprecated /repository_push and /repository_install_push routes
- Add full test suite for versions, payloadStatus, helpers, and markdown
2026-10-11 11:33:31 +02:00
najdek e4e72dc9d8 Bump version to 0.5.2 2026-09-29 12:30:50 +02:00
najdek b1f4fa0044 fix(core): resolve critical json parsing and self-update issues
This addresses the top two critical issues identified in ISSUES.md.

Backend C Fixes:

- Added `skip_top_level_wrapper()` and `find_next_object_start()` to `repository.c` to correctly parse payloads even when wrapped in a top-level JSON object or containing stringified braces.

- Updated `repository_check_self_update` and `repository_check_repo_update` to return full version, filename, and source metadata required by the frontend.

Frontend React Fixes:

- Updated the `App.jsx` update banner to properly consume the API contract.

- Added a functional `handleApplyUpdate` to load the downloaded self-update elf.

- Added a functional `handleInstallUpdate` to trigger repository installation when a new version is available.
2026-08-10 17:42:32 +02:00
najdek cb3fbf4716 feat(repository): overhaul payload repository to app store experience
This commit completely redesigns how users browse, view, and install payloads.

Backend C Changes:
- Updated C structures to support multiple concurrent payload sources (config.h, repository.h).
- Modified repository.c and config.c to parse and retain multi-source JSON payloads.
- Allowed the HTTP server to serve the dynamically merged JSON sources.

Frontend React Changes:
- Converted StorageHub.jsx into a grid-based "App Shop" catalog layout.
- Replaced the modal payload view with a seamless full-page PayloadDetailPanel.jsx component for extended markdown reading and details.
- Added RepositoryContext.jsx to unify repository fetching across views.
- Styled payload cards with a dynamic marquee animation for overflowing text names (PayloadName.jsx).
- Allowed external icons, with a fallback placeholder for payloads without one.
- Polished padding, margins, and transition effects for spatial controller navigation.
- Removed duplicate versioning strings in payload titles and tweaked dashboard header text.
2026-08-10 15:56:38 +02:00
najdek eaa2d0a884 bump version to v0.5.1 and update changelog 2026-08-02 15:06:54 +02:00
najdek bb6a425bf0 bump version to v0.5.0 and update changelog 2026-07-21 22:50:31 +02:00
najdek 3b15b5ca26 feat: Add payload launch indicator
Introduces a visual indicator to help track payloads launched during the current session.

Backend:
- Create history_mgr.c to track the last 20 launched payload paths
- Log payloads in ps5_launcher.c upon successful launch
- Add /history_list API endpoint to expose the launch history
- Update Makefile

Frontend:
- Fetch and poll /history_list in App.jsx to maintain launch history state
- Add isLaunched prop to PayloadButton.jsx to render a checkmark indicator

Closes #44
2026-07-21 22:19:50 +02:00
najdek 19cbde2912 bump version to 0.4.2 and update changelog 2026-07-20 21:56:07 +02:00
najdek 7b454e6164 bump version to 0.4.1 and update changelog 2026-07-20 01:09:11 +02:00
najdek 1a73d1e8bc bump version to 0.4.0 and update changelog 2026-07-19 17:16:20 +02:00
najdek a44346b8e0 feat: add custom payload categories & increase source limits
- Increased MAX_SOURCES to 50 and refactored SourceEntry allocations to the heap
- Added `category` field to payload schema (defaults to "Uncategorized")
- Updated repository UI to group payloads into collapsible category sections
- Auto-expand categories if 10 or fewer payloads are available
- Updated CUSTOM_REPOSITORIES.md

Resolves #30
2026-06-25 19:22:40 +02:00
najdek bacab16df7 fix: Add fallback to insecure download on SSL verification failure
Fixes #42

If github.com (Sectigo ECC) or its redirects cause mbedTLS to fail
verification due to cross-signed certificate chains or unsupported
ECC curves in the PS5 SDK, curl will now catch CURLE_PEER_FAILED_VERIFICATION
and automatically retry the download without SSL verification.

This is completely safe because repository.c securely verifies the
SHA256 checksum of the downloaded ELF against the trusted payloads.json
metadata before installing it.
2026-06-17 19:56:02 +02:00
najdek 9049eec7ba fix: Resolve intermittent SSL verification failures with mbedTLS
Older versions of curl using the mbedTLS backend require the PEM buffer
passed via CURLOPT_CAINFO_BLOB to be explicitly NUL-terminated, with the
length field including the NUL byte. Since the auto-generated
assets_cacert_pem array lacked this terminator, mbedTLS would read past
the buffer bounds, causing sporadic 'SSL peer certificate or SSH remote
key was not OK' errors depending on the memory layout.

This commit dynamically allocates a slightly larger buffer to append the
missing NUL terminator before passing it to curl, ensuring deterministic
certificate parsing across all environments.

Also bumped version to 0.3.2.
2026-06-15 21:31:24 +02:00
najdek cfbc70f30f bump version to v0.3.1 2026-06-07 01:23:25 +02:00
najdek 5c88211d49 feat: allow users to copy instead of move when importing from USB
Updates the USB import flow to provide explicit buttons for 'Copy to Internal' and 'Move to Internal'. The backend route now accepts a keep_original flag to optionally skip removing the source file.
2026-06-07 01:16:13 +02:00
najdek a292541f32 bump version to v0.3.0 2026-06-03 18:41:43 +02:00
najdek 2189ee962d refactor: decompose main.c and payload_mgr.c into focused modules
Split two monolithic files (main.c 1538→233 lines, payload_mgr.c
2355→467 lines) into 8 single-responsibility modules:

- http_server.c: MHD request router and all route handlers
- repository.c: repo cache, download, install/commit, self-update
- sources.c: multi-source repository management
- config.c: PldmgrConfig struct, read/write, JSON config handler
- log_server.c: ring buffer, SSE streaming, pldmgr_log()
- json_helpers.c: JsonListBuilder, JSON parser, file I/O utilities
- sha256.c: SHA256 hash implementation
- process_mgr.c: process listing and kill

Introduces PldmgrConfig struct to replace the 8-out-param
read_next_config_values() pattern. Renames extracted functions to
match their new modules (e.g. repository_install_download,
sources_add, process_kill). No HTTP route changes — frontend
is unaffected.
2026-06-03 18:22:26 +02:00
najdek 631e7de0c6 feat: add active processes management tab
Introduces a new "Active Processes" feature that enables users to view and
manage background processes running on the PS5.

Backend:
- Add `payload_mgr_process_list_json` using `sysctl` with `KERN_PROC_PROC`
  to fetch the kernel process list and memory footprints.
- Retrieve `appinfo` via `sceKernelGetAppInfo` to filter for user-spawned
  daemons (requires appid == `0000`).
- Implement `payload_mgr_process_kill` utilizing `SIGKILL`.
- Expose `/processes_list` and `/process_kill` endpoints.

Frontend:
- Add `ActiveProcessesView.jsx` with a real-time table of running processes.
- Implement background auto-refresh every 15s to maintain the UI state.
- Add safety nets to completely disable killing critical processes
  (`pldmgr.elf` and `elfldr.elf`).
- Implement kill confirmation modal to avoid accidental terminations.
- Integrate "Active Processes" tab with the sidebar and mobile bottom navigation.
2026-06-03 17:58:04 +02:00
najdek f4c76fbfb4 feat: add multi-source payload repository support
- Add MULTI_SOURCES_ENABLED config flag with toggle in Settings
- New "Manage Sources" view: add/remove/reorder third-party payload sources
  via URL; default source is locked and non-removable
- Source JSON format: top-level `name` field sets display name; falls back
  to hostname extraction if absent; checksums are optional
- PS5 mode shows QR code + URL for Manage Sources; desktop shows full list UI
- Source removal uses shared confirm modal; reorder auto-saves with toast
- Backend (payload_mgr.c):
  - CRUD for sources list persisted to /data/pldmgr/sources.json
  - Multi-source repository list/install routes; each source has its
    own independent payload catalog
  - Bounded name parsing: only searches before "payloads" key to avoid
    capturing payload item names; domain fallback when name absent
  - list_payloads response now includes `meta` map: walks
    PAYLOADS_STORAGE_DIR subdirectories for .elf/.bin/.lua sidecar
    files and emits source_name per payload
  - Fallback for pre-feature sidecars: extracts hostname from
    install_source_detail, skipping the official repository URL
- Frontend: source badge (Globe icon + name) shown in bottom-right corner
  of each payload card on Dashboard and Management tab when
  MULTI_SOURCES_ENABLED is on and payload has a non-default source
- StorageHub: accordion-style per-source catalogs when multi-source enabled
- showConfirm helper in App.jsx auto-closes modal before executing callback
2026-06-02 21:59:35 +02:00
najdek 9e5ea12bf1 bump version to v0.2.0 2026-06-02 00:36:47 +02:00
najdek bfc4d096c5 Fix loading payloads from USB root
- Allow /mnt/usb paths in is_allowed_payload_path
- Expose pldmgr_read_config_bool globally

Closes #18
2026-05-28 13:03:29 +02:00
najdek eb23f205fa bump version to v0.1.2 2026-05-27 00:31:28 +02:00
najdek 1baa48e4f3 release: v0.1.1 - stability and ui refinements 2026-05-02 14:02:27 +02:00
najdek 9180759fa2 bump version to v0.1.0 2026-04-30 21:35:40 +02:00
najdek bc54258f4a change version to 0.0.1 (pre-release) 2026-04-30 01:35:03 +02:00
najdek 0d1c0078ea refactor: implement precision millisecond tracking for autoload countdown and lock execution from abort calls 2026-04-30 01:31:01 +02:00
najdek 0bfb763eab add offline cache page 2026-04-29 19:38:26 +02:00
najdek 45738a7e43 feat: implement automatic self-update for payload manager
- Embeds version signature dynamically into ELF
- Scans 'pldmgr' or 'payload-manager' ELFs for version on startup
- Auto-launches updated ELF without infinite loops
- Hides payload manager from UI lists to prevent accidental deletion
2026-04-29 02:33:55 +02:00
najdek 4c29ed811e update payload repository url 2026-04-29 01:24:45 +02:00
najdek 3282e14305 Feat: Migrate payload downloads from frontend to backend using libcurl
- Shift payload downloading from browser-side fetching to the backend C daemon
- Add OpenSSL and libcurl dependencies to the Docker SDK build environment
- Embed CA certificate bundle for secure HTTPS downloads
- Introduce the /repository_install endpoint in the internal API
2026-04-28 23:32:38 +02:00
najdek 840ab2293c rename project to Payload Manager 2026-04-28 20:45:38 +02:00
najdek 4c9697800e security: harden HTTP server against path traversal and thread safety issues
Address code review findings:
- Validate USB paths (restrict to /mnt/usbN/, block .., require .elf/.bin)
- Sanitize /loadpayload route (resolve via known scan dirs only)
- Add filename validation to /manage:check endpoint
- Fix autoload config OOB write (swap fgets/line_count check order)
- Escape JSON strings in /log and /get_config responses
- Move json_escape to utils.c as nm_json_escape for reuse
- Replace global response_buffer with per-request malloc + MUST_FREE
- Add alloc_response_buffer helper to deduplicate OOM handling
- Fix overwrite flag being ignored in USB move
- Handle truncated repository JSON with proper error status
- Centralize CORS headers via add_cors_headers helper
- Fix dangling pointer in loadpayload resolved_path scope
2026-04-28 13:19:48 +02:00