Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitleaksignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
44e161fd06967f9c71b3f5c95e82729a54ae0d70:Readme.md:generic-api-key:26
44e161fd06967f9c71b3f5c95e82729a54ae0d70:assets/config/simple.toml:generic-api-key:2
44e161fd06967f9c71b3f5c95e82729a54ae0d70:p2proxyd/Readme.md:generic-api-key:55
44e161fd06967f9c71b3f5c95e82729a54ae0d70:p2proxyd/Readme.md:generic-api-key:73
44e161fd06967f9c71b3f5c95e82729a54ae0d70:p2proxyd/Readme.md:generic-api-key:73
2407b108ad7f2df62dba270df9c557e314172ff6:p2proxyd/Readme.md:generic-api-key:55
2407b108ad7f2df62dba270df9c557e314172ff6:p2proxyd/Readme.md:generic-api-key:72
31 changes: 31 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,37 @@ it can be used to connect to a remote `p2proxyd` service.

See its readme for more details [here](./p2proxy-desktop/Readme.md).

## Building

To build, you need a rust toolchain, you can get one [through rustup](https://rust-lang.org/tools/install/) for
example.

You need `libglib2.0-dev` and `libgtk-3-dev` to build the desktop app. The proxy and cli does not need these
extra dependencies (as far as I'm aware).

### Daemon

`cargo b -r -p p2proxyd`, binary ends up in `target/release/p2proxyd`

### CLI

`cargo b -r -p p2proxy-cli`, binary ends up in `target/release/p2proxy-cli`

### Desktop

`cargo b -r -p p2proxy-desktop`, binary ends up in `target/release/p2proxy-desktop`

### Android app

Can be built using flutter:

To build release, you need to set up signing-configs,
[see the flutter docs](https://docs.flutter.dev/deployment/android#configure-signing-in-gradle)

```shell
cd p2proxy_fl && flutter build appbundle --debug
```

## License

This project is licensed under [GPLv3](./LICENSE).
Expand Down
28 changes: 13 additions & 15 deletions p2proxyd/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,12 @@ Which nodes can access which routes.
The simplest example is this:

```toml
# Node id: 7003b83df94765d4862185187508055e11be90d761663061e4f368d076b7a9b8
secret_key_hex = "11701920da9f96a52625963997db5bc54e27ea86b00094646e2e860c4a8fa796"
allow_any_peer = true
# Node id: 7c32ab7cdd9a4e2651c9eff072958a43a9b411cc5b69603a1dca6d7d843f2406
secret_key_hex = "8c3981f6f98d0a09f69931549a883d8ce1c37fbf767c28ace12c81ede4713bfc"
default_route = "default"

[[server_ports]]
port = 8080
port = 4501
name = "default"
allow_any_peer = true
```
Expand All @@ -69,8 +68,8 @@ depending on what's running on port 8080.
### Full configuration example

```toml
# Node id: 7003b83df94765d4862185187508055e11be90d761663061e4f368d076b7a9b8
secret_key_hex = "11701920da9f96a52625963997db5bc54e27ea86b00094646e2e860c4a8fa796"
# Node id: f2b1ce018dda1d4e75d97fc9f86ecf30adbb0aba0977445ae85283502a8cc7be
secret_key_hex = "690927f498c370cff79be198b1e6b81e3ec12521d1a76753c8aff67a7bb6f549"
# Use an access log, writes down accepted and rejected connections, with cause
# If using, the log *should* be rotated with f.e. `logrotate`
access_log_path = "/home/<user>/logs/p2proxy-access.log"
Expand All @@ -80,32 +79,31 @@ default_route = "demo"
# A collection of exposed services through the proxy
[[server_ports]]
# Ip, if for example there's an entry-server that runs the proxy to some other server on a local network.
host_ip = "192.168.0.3"
host_ip = "127.0.0.1"
# Port to listen on
port = 4500
port = 4502
# Port name for routing
name = "demo"
# Allow any peer to connect to this service
allow_any_peer = true

[[server_ports]]
# Only a port specified, uses `0.0.0.0:8080`
port = 8080
# Only a port specified, uses `0.0.0.0:4502`
port = 4503
# Port name for routing
name = "private"

# A collection of approved peers
[[peers]]
# The peer node's node_id
node_id = "7003b83df94765d4862185187508055e11be90d761663061e4f368d076b7a9b7"
# The peer node's node_id (assets/testing-has-access-private-client.key)
node_id = "69a0507ed92bf714b99135024a15628ad508a90db9e142a8518e7a9d939de7ba"
# If the peer node can access anything (superuser)
allow_any_port = false
# The ports that this peer is allowed to reach ("demo" has no access control, so it can reach that one as well)
allow_named_ports = ["private"]

[[peers]]
node_id = "7003b83df94765d4862185187508055e11be90d761663061e4f368d076b7a9b6"
# Superuser, can access any service
# Superuser, can access any service (assets/testing/superuser-client.key)
node_id = "7d835f80eb895097e3b1a3648dee0e40e30733b76cdc30144b98c9b467a0f845"
allow_any_port = true

```