151 Commits
Author SHA1 Message Date
Seregon 1a0b8a46c1 Merge pull request #16 from NotSoTypicalGamer/main
fix: preserve native install/uninstall error codes
2026-10-17 19:07:19 +02:00
NotSoTypicalGamer 1aa1ab1c2d games/ps5: fix install error-code parsing 2026-10-17 09:30:45 -04:00
NotSoTypicalGamer 91452c150a games/ps5: fix uninstall error-code parsing
Skip the space after ERROR in sscanf and preserve the signed native
error code instead of negating it. Previously a native failure parsed
as 0 and was negated into a positive value that api_games_uninstall
treated as success.
2026-10-17 09:27:37 -04:00
Seregon 83d78ef958 Merge pull request #15 from NotSoTypicalGamer/main
Add native PKG uninstall through the installer helper (zhttp)
2026-10-17 15:21:57 +02:00
NotSoTypicalGamer baaee914ac games/ps5: native uninstall through the installer helper
zhttp can now uninstall a title natively, reusing the same embedded
helper that drives installs. Three changes make it work on 13.60:

- install_helper.c escalates to the SYSTEM_PROCESS auth id
  (0x4800000000000006) by writing cr_sceAuthID at ucred+0x58 via
  kernel_copyin; the SDKs
2026-10-16 21:09:07 -04:00
seregonwar 8c3302284b Harden console startup and sendfile fallback
Treat `instance.pid` as a control identity instead of a hard lock by authenticating shutdown requests with the saved token, ignoring stale/reused/malformed identities, and only blocking when a verified payload (or authenticated prior instance) is still alive. Add PS4/PS5 `sendfile` safety gating that uses buffered `pread`+`send` on incompatible or unknown mount types (exFAT/FAT/nullfs/PFS, or mount lookup failure) while keeping zero-copy on safe filesystems, and wire in README/Makefile updates plus new host-side tests and stubs for both paths.
2026-10-05 17:45:10 +02:00
seregonwar e19c68c3a2 fix(build): keep the web-less builds clean under newer clang
The macOS/Linux ftp jobs rejected pal_dns_filter.c with
-Wunused-but-set-global: g_dns_stop is only read by the console resolver
loops, so on hosts it was written for nothing.  The control port carried the
same kind of dead state (g_control_thread_started, and a thread id only ever
passed to pthread_create) because the thread is detached and never joined.
Guard the DNS stop flag with the console builds and drop the unused control
port variables; an audit of every release configuration on preprocessed
sources now reports no set-but-unread file-scope statics.
v1.6.0
2026-09-30 20:52:32 +02:00
seregonwar 037aaa9974 fix(build): compile the non-web variants again
The PS5 ftp build (ENABLE_ZHTTPD=0) did not compile: main.c evaluated
ENABLE_ZHTTPD before defaulting it (-Wundef) and the PS5 shutdown helpers sat
inside the web-only block even though the main loop and the control port rely
on them.  Default the switch at the top of the file, keep the shutdown helpers
in every PS5 build, and let the Makefile define ENABLE_ZHTTPD=0 explicitly so
no translation unit ever sees the macro undefined.
2026-09-30 20:42:12 +02:00
seregonwar 7099a9d214 fix(games): read PS5 title names from the appmeta param.json
Console-format PS5 packages (magic 0x7F "FIH") hold no readable param.sfo, so
native PS5 titles kept showing their title id twice while PS4 ones resolved.
Fall back to the system metadata when the package cannot be parsed:
/user/appmeta/<TITLE>/param.json and then /system_data/priv/appmeta, whose
localizedParameters carry the display name as plain UTF-8 (first entry = the
default language).  The format is pinned by a fixture in test_http_games.
2026-09-30 19:23:46 +02:00
seregonwar da573e05a8 build(ps5): do not build or embed the install helper when the installer is off
With ENABLE_PKG_INSTALL=0 the helper was still compiled and its 115 KB blob
linked into the payload even though no code referenced it.  Gate the helper
build and blob on the flag so release artifacts carry the installer neither in
code nor in data.
2026-09-30 19:18:44 +02:00
seregonwar cb7ce7c715 perf(copy): deeper parallel-read copy pipeline and server-side move
- copy.c: replace the 2x4 MB ping-pong with a 4-slot ring of 8 MB chunks
  (PS4: 1 MB), filled by concurrent pread() readers (2 on PS5, 1 on PS4)
  and drained by a single in-order writer. The progress callback now runs
  without holding the pipeline mutex, and mmap pressure degrades to fewer
  slots/smaller chunks before falling back to the serial copy.
- Fix a source fd leak on the pre-flight ENOSPC path.
- /api/copy?move=1: rename() when source and destination share a
  filesystem, otherwise copy and remove the source entries (keep_src=0).
  Moves merging into an existing folder rename file by file.
- web: moves use the server-side mode instead of copy + recursive delete.
2026-09-30 19:15:10 +02:00
seregonwar 181e3d509b feat(ui): hide the package installer behind the build flag
Builds without ENABLE_PKG_INSTALL now report it in /api/status
(features.pkg_install) and the web interface hides every installer entry point
— the Games action, the file explorer item and the progress pollers — instead
of offering actions that only answer 409.  The release workflow already builds
with the flag off, so this release ships without the remote PKG installer.
2026-09-30 18:00:07 +02:00
seregonwar 15114b8af1 test(http): cover archive extraction and the system endpoints
Extend the HTTP suite with the archive extraction fixtures (good, traversal
and symlink cases) and the system endpoints, so the split APIs keep their
behavior pinned.
2026-09-30 17:51:39 +02:00
seregonwar b8a230e348 web: browser interface updates and documentation
Bring the file manager, transfers, settings and games views in line with the
split HTTP APIs (dump jobs, copy/extract progress, DNS filter and system
status), refresh the styling and document the API, pkg install flow and
architecture, together with the repository issue and pull request templates.
2026-09-30 17:51:29 +02:00
seregonwar a9d4e1e666 build(ps4): PacBrew portlibs for the URL downloader, PIE payloads, CI wiring
tools/fetch_pacbrew_ps4.sh unpacks the pinned PacBrew portlibs (libcurl,
mbedTLS, zlib) with a Mozilla CA bundle; the Makefile detects that prefix and
enables ENABLE_LIBCURL for PS4, bridging the three libc symbols the OpenOrbis
build expects.  Console payloads now always link as PIE (GoldHEN's payloader
rejects ET_EXEC), which is what made the plain `make deploy` flow work, and
the release workflow installs the same portlibs for PS4 zhttp artifacts.
2026-09-30 17:51:29 +02:00
seregonwar dfb358dc9d fix(games): read the title name from single-package (app.pkg) installs
Titles delivered as one package keep no sce_sys/param.sfo on disk, so the
Games view fell back to the title id and showed the content id twice.  Read
the param.sfo entry from app.pkg when the loose file is missing (magic probe,
encrypted entries skipped), cover CONTENT_ID/CATEGORY lookups too, and let the
web UI hide the id line when it would repeat the name.  Regression test builds
a minimal package image and checks the catalog reports the SFO title.
2026-09-30 17:51:09 +02:00
seregonwar 09b7cbff2a fix(console): survive an aborted download instead of dying on SIGPIPE
The PS4 entry point never ignored SIGPIPE (the shared handler is compiled out
there), so a browser cancelling a download killed the payload with signal 13.
Ignore SIGPIPE on PS4 like PS5 and POSIX do, and set SO_NOSIGPIPE on the HTTP
listener and client sockets (FTP sockets follow through pal_socket_configure)
so a vanished peer only breaks its own connection.  test_http_server aborts a
streamed download mid-flight and checks the server keeps answering.
2026-09-30 17:50:57 +02:00
seregonwar 7589664a6d feat(platform): volumes, disc, DNS filter, PS5 offsets and instance control
Add removable-volume detection that ignores empty slots, disc eject/state
helpers, the userland DNS filter, PS5 firmware offset lookup with the optional
kernel net filter, and a control port a new payload uses to retire the
previous instance.
2026-09-30 17:50:57 +02:00
seregonwar 7121e13861 feat(games): catalog, launch, install and app.db repair
List installed titles with icons, start them through LncUtil (with the
no-logged-in-user guard), install and uninstall packages, and repair missing
home screen entries through the shell's app.db.  PS5 package installs are
driven by an embedded helper delivered to elfldr on loopback.
2026-09-30 17:50:57 +02:00
seregonwar fbfaa68021 feat(dump): decrypted game dumps with cancel support
Dump an installed title's running sandbox (already decrypted by the kernel)
to the browser as a streamed ZIP or to console storage as a file tree or ZIP.
The job launches the title when needed, reports entries/size/source through
the status endpoint, honours POST /api/dump/cancel and keeps the decrypt flag
configurable.  Documented in docs/game-dumping.md, covered by test_dump_job.
2026-09-30 17:50:57 +02:00
seregonwar 50bbecb776 feat(archive): streaming ZIP writer, archive paths and builtin unzip
Add a ZIP64 writer that streams entries straight into the HTTP response (and
decrypts SELF containers on consoles), archive path validation helpers and a
reworked builtin unzip, all covered by fixtures and unit tests.
2026-09-30 17:50:45 +02:00
seregonwar fb1646ce2b refactor(io): shared file I/O layer and FTP instance plumbing
Move copy, sendfile and directory helpers behind one platform layer, let the
FTP server run beside the HTTP stack with its own instance bookkeeping, and
keep the transfer command on the shared pipeline.
2026-09-30 17:50:45 +02:00
seregonwar b8f15aed5a feat(transfer): unified download manager with curl, NFS and torrent backends
One manager owns remote downloads: libcurl for HTTP/HTTPS/FTP (with ranged
parallel fetches), libnfs for nfs:// URLs and an optional libtorrent engine
for magnet links.  Jobs survive payload re-injections, support pause, cancel
and retry, and report per-job progress through the HTTP API.
2026-09-30 17:50:45 +02:00
seregonwar f19ac02d6f refactor(http): split the server into listener, stream, upload and json modules
The HTTP stack had grown into a single file that owned sockets, parsing,
uploads and every API domain.  Split it into focused modules (listener,
response stream, upload, json helpers) with the domain handlers next to the
APIs they serve, and cover framing, streaming and uploads with unit tests.
2026-09-30 17:50:36 +02:00
Seregon 2db0f1014f web: redesign the browser interface
Replace the embedded UI with a file manager: sidebar, details table, keyboard shortcuts, uploads, copy/move and extraction. Games, System, Transfers and Settings use the same components. The previous UI is archived in web/legacy/ and left out of the embedded resources.

The restyle is flat: donation banner, credits with the maintainer photo, and no gradients or card shadows. JavaScript stays ES5.
2026-09-29 12:53:34 +02:00
seregonwar a042eae480 refactor: modularize and harden file I/O 2026-09-09 18:13:06 +02:00
seregonwar a62b2ad2b2 refactor: modularize remaining FTP commands 2026-09-09 16:57:12 +02:00
seregonwar 5c2b18776b refactor: isolate FTP transfer commands 2026-09-09 16:32:34 +02:00
seregonwar 95bfcfcb83 refactor: split FTP control and listing commands 2026-09-09 16:28:05 +02:00
seregonwar 7745a1ff66 refactor: modularize HTTP games and routing 2026-09-09 16:23:12 +02:00
seregonwar be789e857e refactor: isolate HTTP system API and unify route matching 2026-09-09 14:18:13 +02:00
seregonwar 13dc390800 refactor: isolate HTTP process API and harden pid parsing 2026-09-09 14:13:20 +02:00
seregonwar 439499a117 refactor: isolate HTTP filesystem API 2026-09-09 14:08:36 +02:00
seregonwar 3eb3d0f115 refactor: split transfer archive and static HTTP handlers 2026-09-09 13:58:40 +02:00
seregonwar efa7b01d20 refactor: extract shared HTTP API primitives 2026-09-09 13:50:38 +02:00
seregonwar 5c9ff1dcae refactor: organize source tree by subsystem 2026-09-09 13:27:56 +02:00
seregonwar d0f6dd707d feat: expose ftp and nfs transfers in web downloader 2026-09-09 13:27:56 +02:00
seregonwar 1ac381b85d feat: replace custom download stack with curl and libnfs 2026-09-09 12:30:02 +02:00
Seregon c680efc605 Add HTTP /api/notify endpoint for custom PS4/PS5 system toasts.
Expose pal_notification_send_ex over ZHTTP so local automation (e.g. Home Assistant) can push console notifications without a dedicated payload.
2026-08-04 20:41:57 +02:00
Seregon 36845fd82a Add rest-mode resilience and fix CHMOD/copy regressions.
Survive console Rest Mode by recreating FTP/HTTP listeners with backoff and exposing daemon instance_id; implement real SITE CHMOD (#9) and fix atomic-copy temp paths that broke dashboard moves (#7).
2026-07-28 16:27:43 +02:00
Seregon 7bcc5c5f75 Update zftpd performance metrics in README
Updated performance metrics for zftpd to reflect improved speeds.
2026-07-10 11:50:12 +02:00
Seregon 272b6cb7b4 Update README.md
typo fix
2026-06-30 11:47:01 +02:00
Seregon e59fc3facb Update pal_filesystem_psx.c
Added KERNEL_ADDRESS_DATA_BASE for fw up to 13.xx
2026-06-30 11:26:39 +02:00
Seregon bf0206ae35 Merge pull request #8 from aydencharles/fix/list-flag-curlftpfs
fix: strip LIST -a flag for curlftpfs compatibility
2026-06-25 14:56:28 +02:00
Hexwell 6a7a25cb3d fix: handle LIST -a flag for curlftpfs compatibility
curlftpfs sends 'LIST -a' by default.  zftpd treated '-a' as a
path argument, causing 550 errors and empty directory listings
on FUSE-based FTP mounts (e.g. fnOS remote mount).

Add ftp_path_has_list_flag() / ftp_path_skip_list_flag() to
ftp_path.c with stat()-based flag-vs-path disambiguation.
Only well-known flags (-a/-l/-la/-al) are recognised; unknown
flag patterns pass through as paths to preserve access to files
whose names start with '-'.
2026-06-25 19:43:09 +08:00
Seregon e36bd23258 Update README.md 2026-06-15 09:44:50 +02:00
seregonwar 1ec37c6ee7 docs: fix ftp_config.h comment — PS4/PS5 default port is 2120, not 2122 v1.5.0 2026-06-14 18:59:31 +02:00
seregonwar 8f15f5f3b0 ci: platform-aware release packaging — .elf/.bin for PS4/PS5, .app for macOS
- PS4/PS5: upload .elf and .bin files directly (no tar.gz) for payload injection
- macOS: create .app bundle with Info.plist (extracts VERSION from ftp_config.h)
- Linux: keep standard tar.gz with BUILD_INFO
- Upload step: use dist/* to handle all artifact types
- Release assets: collect .elf, .bin, and .tar.gz files
- Fix Info.plist heredoc: remove single quotes so VERSION expands correctly
- Fix sha256sum: remove || true (if ls guard already handles missing files)
2026-06-14 18:38:20 +02:00
seregonwar 829f25914e ci: remove Linux zhttp build from release matrix, keep only standard Linux 2026-06-14 18:26:58 +02:00
seregonwar caa8529736 fix: remove stray closing paren after rss cast in api_processes 2026-06-14 18:20:44 +02:00