ps3netsrv-go

module
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2023 License: MIT

README

ps3netsrv-go

It's a minimal alternative implementation of original ps3netsrv which needed to install games using WebMAN/IrisMAN over network (without copying files to console).

I made it because original code is way hard to read and hard to build for some platforms. And for fun and education (understanding and implementation custom network protocols, generating/serving iso image on-the-fly) of course.

This project written in Go because it's (cross-)compilation is much easier than C/C++ and resulting binaries will run without any external library on target system.

Currently multipart files are not supported. But I've added tcp data exchange timeouts to reduce amount of "hang" connections.

Receiving files from console is supported now! Use flag --allow-write to enable this.

Decryption of 3k3y/redump images on-the-fly is supported now! Keys search behaviour completely matches with original ps3netsrv: at first we try to find .dkey file for .iso in PS3ISO directory. Then we try to find .dkey in REDKEY directory. You can also use

$ ps3netsrv-go decrypt

tool to decrypt images.

Running

Just run

$ ps3netsrv-go server

from your working directory to serve it.

Or specify custom root directory in --root flag of server subcommand:

$ ps3netsrv-go server --root=/home/user/games

To get help run:

$ ps3netsrv-go --help

To run "debug" server (for pprof, etc.) specify --debug-server-listen-addr flag.

Configuration

Server supports configuration via environment variables and command line flags. Environment variables names can be found in output of ps3netsrv-go server --help command. I.e. in line:

--root="."                             Root directory with games ($PS3NETSRV_ROOT).

PS3NETSRV_ROOT is environment variable name.

Also server supports configuration via config file. Example:

[server]
root = /home/user/games
client-whitelist = 192.168.1.0/24
max-clients = 10
allow-write = true

Configuration keys names are the same as command line flags names without -- prefix.

Config file discovered in following order:

  • --config flag or PS3NETSRV_CONFIG_FILE environment variable
  • config.ini file in current directory
  • <user config directory>/ps3netsrv-go/config.ini, where <user config directory> is OS-specific directory for user configuration files:
    • %APPDATA% on Windows
    • $XDG_CONFIG_HOME or ~/.config on Linux
    • ~/Library/Application Support on macOS

Exposing tips

  • Use limits:
    • by IP address(es) using --client-whitelist flag: $ ps3netsrv-go server --root=/home/games --client-whitelist=192.168.0.123
    • by number of clients using --max-clients flag
    • idle connection time: --read-timeout flag
  • To expose over NAT (non-public or "grey" IP) you can use:
  • To secure connection using TLS you may use two TLS-terminators (like HAProxy) configured with mutual TLS authentication. Note that desired terminator must support "wrapping" plain TCP connection to TLS with client certificate.

Requirements to build

Go 1.21+

Building

$ go mod download
$ go build -o ps3netsrv-go ./cmd/ps3netsrv-go/...

Directories

Path Synopsis
cmd
internal
pkg
fs
proto
Package proto describes ps3netsrv protocol used by WebMAN MOD to interact with remote filesystem using network.
Package proto describes ps3netsrv protocol used by WebMAN MOD to interact with remote filesystem using network.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL