- README: what Control4Free is and why it reaches menus and sign-in, features, a quick start, screenshots, requirements, limitations, credits. - docs/: installation, playing, troubleshooting (every message the page and the app can show), how it works, and the WebSocket protocol. - CONTRIBUTING.md: building, testing, code style, releasing. - Screenshots of the page on phones and a PC and of the app, made against the real service built for the host, at the example address 192.168.1.20. - Issue forms, a contact list pointing at the guides and private security reporting, and FUNDING.yml. - CHANGELOG.md dated. CI now publishes this version's section of it as the release notes rather than the whole file. - THIRD_PARTY.md: the DualShock 4 diagram the buttons are drawn after (CC BY 3.0), and Apollo Save Tool for the package settings. - Page: the Vibration setting no longer promises to buzz when a game rumbles, which 1.0.0 cannot do yet.
4.3 KiB
Contributing to Control4Free
Thanks for helping! Bug reports, compatibility reports, fixes and reviews are all welcome.
Reporting a bug
Use the bug report form. The most useful details:
- the Control4Free version, shown at the bottom of the page and of the app;
- the firmware and GoldHEN versions;
- the phone or computer and browser you used;
- what you did and what happened;
- the service's log, if you can get it:
/data/control4free/control4free.logon the PS4, over GoldHEN's FTP server (port 2121). The previous run is kept incontrol4free.log.previous.
The log contains your console's network address. Remove it before posting if you prefer.
Security problems: please follow SECURITY.md instead of opening a public issue.
Building
Everything builds in Docker, so Docker is all you need:
git clone https://github.com/MoHadiShibli/Control4Free
cd Control4Free
docker build -t control4free-build docker/
docker build -t control4free-launcher-build -f docker/Dockerfile.launcher docker/
docker run --rm -v "$PWD:/src" -w /src control4free-launcher-build bash -lc 'make && make -C launcher'
build/control4free.elfis the service, with the page and its icon built in.build/Control4Free-<version>.pkgis the app, with its own copy of the service.
The first image pins the ps4-payload-sdk release that builds the
service; the second adds the OpenOrbis toolchain,
pinned by digest, for the app and the package. On Windows, tools/build-launcher.ps1 runs all three steps.
The version comes from the VERSION file and nowhere else: the Makefiles and the packager read it, and
the page and the app show the version the service reports.
Testing
docker run --rm --network none -v "$PWD:/src" -w /src control4free-launcher-build python3 -B tests/run.py
The suites build the real sources for the host with only the PS4 calls stubbed, so they need no console:
test_webandtest_recoveryrun the actual service against a fake kernel log (tests/web_stub.c) that writes the same lines firmware 10.01 does, over real HTTP and WebSocket connections;test_frontendruns the page's own functions under Node;test_launcherdrives the app's logic, renders every state of its screen tobuild/launcher-preview-*.png, and checks the package'sparam.sfo;test_loggingcovers the log, the kernel-log opener and DeviceId matching.
Add a test with your fix: one that fails without it. Then test on a real console if you can, and say in your pull request which firmware, GoldHEN version and games you tried.
To try changes to the page without rebuilding, open client/index.html from disk and enter the console's
address, or add ?host=<ps4-ip>:4264 to the page's URL.
Code style
Match the code around your change:
- C with GNU extensions (gnu11), 4-space indent,
camelCasefunctions with ac4fprefix,C4ftypes andC4F_macros; - log with
c4fLog.c4fNotifyshows a notification on the TV: keep those rare; - comments explain why, not what;
- only button bits confirmed on hardware go in
include/c4f_sce.h; - the page is one file with no build step and no libraries: keep it that way;
- OpenOrbis's headers give
MSG_NOSIGNAL,SIGSYSandCLOCK_MONOTONICtheir Linux values, which the PS4 reads as something else. Don't use them directly inlauncher/; a test checks.
Build without new warnings; the app is built with -Werror.
Releasing
- Update
VERSION, and add a section toCHANGELOG.md. - Commit, tag
vX.Y.Z, and push the tag. - CI builds both images, runs the tests, and publishes the release with the ELF, the package and
SHA256SUMS. It refuses a tag that doesn't matchVERSION.
Reviewing AI-written code
Much of Control4Free was written with the help of AI models (Claude by Anthropic and Codex by OpenAI). It has been tested, on the console as well, but AI-written code can look right and still be wrong. Please read it critically: if you find dead code, wrong assumptions or needless complexity, open an issue or send a pull request.
License
Contributions are accepted under the GNU General Public License v3, the project's license.