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
411 changes: 229 additions & 182 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ resolver = "3"
[workspace.package]
edition = "2024"
license = "GPL-3.0"
version = "1.0.1"

[workspace.dependencies]
p2proxy-client = { path = "./p2proxy-client" }
Expand Down
18 changes: 17 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ See its readme for more details [here](./p2proxy-desktop/Readme.md).
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
You need `libglib2.0-dev` and `libgtk-3-dev` to build the desktop app (on linux). The proxy and cli does not need these
extra dependencies (as far as I'm aware).

### Daemon
Expand All @@ -103,6 +103,22 @@ To build release, you need to set up signing-configs,
cd p2proxy_fl && flutter build appbundle --debug
```

## Downloading

For targets that are easy to build for and test with a VM (`generic linux`, `debian`, and `windows`) signed
binaries/packages
are supplied under releases.

`p2proxyd` and `p2proxy-cli` can (and are) compiled statically for Linux in both cases. `p2proxy-desktop` has a
dependency on `libgtk` and `libglib`, so that's compiled on debian `bullseye` for compatibility. It should work
on any reasonably up-to-date linux install.

I'm assuming that windows users won't run `p2proxyd`, but there's no technical reason that that can't be built
or run on windows either.

If you're lucky `f97b4c8a80c2aa84380f44e69f193b41360c0bb6ff81861f9ed154f186e9f137` may be serving something
interesting.

## License

This project is licensed under [GPLv3](./LICENSE).
Expand Down
50 changes: 50 additions & 0 deletions assets/deployment/build-debian.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/sh
set -ex

LTO="lto"
PACKAGE_DIR="target/packaged"
DEB_DIR="target/debian"
DEB_VER="1.0.1-1"
X86_MUSL="x86_64-unknown-linux-musl"
X86_GNU="x86_64-unknown-linux-gnu"
AARCH64_MUSL="aarch64-unknown-linux-musl"
AARCH64_GNU="aarch64-unknown-linux-gnu"
X86_WINDOWS="x86_64-pc-windows-gnu"
AARCH64_MAC="aarch64-apple-darwin"

function package() {
BIN_NAME="$1"
BUILD_TARGET="$2"
OUTPUT_DIR="target/$BUILD_TARGET/$LTO"
DEB_ARCH="$3"
DEST_NAME="$4"
EXT="$5"
cross b -p "$BIN_NAME" --target "$BUILD_TARGET" --profile "$LTO"
cp "$OUTPUT_DIR/$BIN_NAME""$EXT" "$PACKAGE_DIR/$DEST_NAME""$EXT"
gpg --yes --armor --output "$PACKAGE_DIR/$DEST_NAME""$EXT.sig" --detach-sig "$PACKAGE_DIR/$DEST_NAME""$EXT"
# Some shared artifacts end up here, getting reused and causing build failures
rm -r "target/$LTO"
}

function package_deb() {
package "$1" "$2" "$3" "$4" "$5"
DEB_ARCH="$3"
DEB_FILE="$DEB_DIR/$BIN_NAME"_"$DEB_VER"_"$DEB_ARCH.deb"
cargo deb -p "$BIN_NAME" --target "$BUILD_TARGET" --profile "$LTO" --no-build --no-strip
gpg --yes --armor --output "$DEB_FILE.sig" --detach-sig "$DEB_FILE"
mv "$DEB_FILE.sig" "$PACKAGE_DIR"
mv "$DEB_FILE" "$PACKAGE_DIR"
}

mkdir -p "$PACKAGE_DIR"
package_deb "p2proxyd" "$X86_MUSL" "amd64" "p2proxyd-x86_64-linux" ""
package_deb "p2proxyd" "$AARCH64_MUSL" "arm64" "p2proxyd-aarch64-linux" ""
package_deb "p2proxy-cli" "$X86_MUSL" "amd64" "p2proxy-cli-x86_64-linux" ""
package_deb "p2proxy-cli" "$AARCH64_MUSL" "arm64" "p2proxy-cli-aarch64-linux" ""

# Inject a prepared image to build with (has deps and an old debian version for compatibility)
export CROSS_CONFIG=./p2proxy-desktop/cross.toml
package_deb "p2proxy-desktop" "$X86_GNU" "amd64" "p2proxy-desktop-x86_64-linux-gnu" ""

package "p2proxy-cli" "$X86_WINDOWS" "amd64" "p2proxy-cli" ".exe"
package "p2proxy-desktop" "$X86_WINDOWS" "amd64" "p2proxy-desktop" ".exe"
5 changes: 5 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,21 @@ skip = [
{ name = "windows-implement", version = "=0.58.0" },
{ name = "windows-core", version = "=0.58.0" },
{ name = "windows-core", version = "=0.61.2" },
{ name = "windows-collections", version = "=0.2.0" },
{ name = "windows-future", version = "=0.2.1" },
{ name = "windows", version = "=0.58.0" },
{ name = "windows", version = "=0.61.3" },
{ name = "windows-sys", version = "=0.48.0" },
{ name = "windows-sys", version = "=0.52.0" },
{ name = "windows-sys", version = "=0.59.0" },
{ name = "windows-sys", version = "=0.60.2" },
{ name = "windows-strings", version = "=0.1.0" },
{ name = "windows-strings", version = "=0.4.2" },
{ name = "windows-link", version = "=0.1.3" },
{ name = "windows-numerics", version = "=0.2.0" },
{ name = "windows-result", version = "=0.2.0" },
{ name = "windows-result", version = "=0.3.4" },
{ name = "windows-threading", version = "=0.1.0" },
# Much smaller apple-swamp
{ name = "objc2", version = "=0.5.2" },
{ name = "objc2-foundation", version = "=0.2.2" },
Expand Down
13 changes: 12 additions & 1 deletion p2proxy-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
name = "p2proxy-cli"
version = "1.0.0"
version = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
description = "A cli to host a local server which connects to a p2proxyd proxy"

[dependencies]
p2proxy-lib = { workspace = true }
Expand All @@ -19,3 +20,13 @@ tracing-subscriber = { workspace = true }

[lints]
workspace = true

[package.metadata.deb]
maintainer = "Marcus Grass <marcus.grass@protonmail.com>"
copyright = "2025, Marcus Grass"
section = "utility"
priority = "optional"
assets = [
["target/release/p2proxy-cli", "usr/bin/", "755"],
["Readme.md", "usr/share/doc/p2proxy-cli/README", "644"]
]
1 change: 1 addition & 0 deletions p2proxy-cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(target_family = "windows", windows_subsystem = "windows")]
mod observability;

use crate::observability::setup_observability;
Expand Down
2 changes: 1 addition & 1 deletion p2proxy-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "p2proxy-client"
version = "1.0.0"
version = { workspace = true }
edition = { workspace = true }
license = { workspace = true }

Expand Down
18 changes: 17 additions & 1 deletion p2proxy-desktop/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
name = "p2proxy-desktop"
version = "1.0.0"
version = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
description = "A desktop client to host a local server which connects to a p2proxyd proxy"

[dependencies]
p2proxy-lib = { workspace = true }
Expand All @@ -22,3 +23,18 @@ tracing-subscriber = { workspace = true }

[lints]
workspace = true

[package.metadata.deb]
maintainer = "Marcus Grass <marcus.grass@protonmail.com>"
copyright = "2025, Marcus Grass"
section = "utility"
priority = "optional"
depends = [
# File picker, could do without
"libgtk-3-0",
"libglib2.0-0"
]
assets = [
["target/release/p2proxy-desktop", "usr/bin/", "755"],
["Readme.md", "usr/share/doc/p2proxy-desktop/README", "644"]
]
11 changes: 11 additions & 0 deletions p2proxy-desktop/cross.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[target.x86_64-unknown-linux-gnu]
image = "debian:bullseye-slim"
pre-build = [
"apt-get update && apt-get -y upgrade && apt-get -y install build-essential libgtk-3-dev libglib2.0-dev"
]

[target.aarch64-unknown-linux-gnu]
image = "arm64v8/debian:bullseye-slim"
pre-build = [
"apt-get update && apt-get -y upgrade && apt-get -y install build-essential libgtk-3-dev libglib2.0-dev"
]
1 change: 1 addition & 0 deletions p2proxy-desktop/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(target_family = "windows", windows_subsystem = "windows")]
mod observability;
mod peer_id;
mod peer_node_state;
Expand Down
2 changes: 1 addition & 1 deletion p2proxy-lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "p2proxy-lib"
version = "1.0.0"
version = { workspace = true }
edition = { workspace = true }
license = { workspace = true }

Expand Down
2 changes: 1 addition & 1 deletion p2proxy-test-runner/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "p2proxy-test-runner"
version = "1.0.0"
version = { workspace = true }
edition.workspace = true
license.workspace = true

Expand Down
2 changes: 1 addition & 1 deletion p2proxy-test-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "p2proxy-test-server"
version = "1.0.0"
version = { workspace = true }
edition.workspace = true
license.workspace = true

Expand Down
2 changes: 1 addition & 1 deletion p2proxy_fl/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rust_lib_p2proxy_fl"
version = "1.0.0"
version = { workspace = true }
edition = { workspace = true }
license = { workspace = true }

Expand Down
13 changes: 12 additions & 1 deletion p2proxyd/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
name = "p2proxyd"
version = "1.0.0"
version = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
description = "A peer-to-peer reverse proxy for local TCP connections"

[dependencies]
p2proxy-lib = { workspace = true }
Expand All @@ -22,3 +23,13 @@ tracing-subscriber = { workspace = true }

[lints]
workspace = true

[package.metadata.deb]
maintainer = "Marcus Grass <marcus.grass@protonmail.com>"
copyright = "2025, Marcus Grass"
section = "utility"
priority = "optional"
assets = [
["target/release/p2proxyd", "usr/bin/", "755"],
["Readme.md", "usr/share/doc/p2proxyd/README", "644"]
]
5 changes: 2 additions & 3 deletions p2proxyd/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,8 @@ fn construct_routes(
}
}
if explicit_allow_map.is_empty() {
anyhow::bail!(
"configuration error, server port {} has no explicit allow list, and does not allow any (cannot be connected to)",
server_port_name
bail!(
"configuration error, server port {server_port_name} has no explicit allow list, and does not allow any (cannot be connected to)",
);
}

Expand Down