Skip to content

Commit

Permalink
Merge pull request #68 from DanGould/cli
Browse files Browse the repository at this point in the history
Move payjoin-client payjoin-cli
  • Loading branch information
DanGould authored May 11, 2023
2 parents c118fb7 + dc1932c commit 45f6c2b
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
with:
RUSTTARGET: ${{ matrix.target }}
ARCHIVE_TYPES: ${{ matrix.archive }}
SRC_DIR: payjoin-client
SRC_DIR: payjoin-cli
6 changes: 3 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
command: test
args: --verbose --all-features --lib --manifest-path payjoin/Cargo.toml

build-payjoin-client:
build-payjoin-cli:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -38,12 +38,12 @@ jobs:
with:
toolchain: ${{ matrix.rust }}
override: true
- run: cd payjoin-client
- run: cd payjoin-cli
- name: build payjoin example
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path payjoin-client/Cargo.toml
args: --manifest-path payjoin-cli/Cargo.toml

fmt:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[workspace]
members = ["payjoin", "payjoin-client"]
members = ["payjoin", "payjoin-cli"]
12 changes: 6 additions & 6 deletions payjoin-client.Dockerfile → payjoin-cli.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
## Initial build Stage
FROM rustlang/rust:nightly

WORKDIR /usr/src/payjoin-client
WORKDIR /usr/src/payjoin-cli
COPY Cargo.toml Cargo.lock ./
COPY payjoin/Cargo.toml ./payjoin/
COPY payjoin/src ./payjoin/src/
COPY payjoin-client/Cargo.toml ./payjoin-client/
COPY payjoin-client/src ./payjoin-client/src/
COPY payjoin-cli/Cargo.toml ./payjoin-cli/
COPY payjoin-cli/src ./payjoin-cli/src/

# Install the required dependencies to build for `musl` static linking
RUN apt-get update && apt-get install -y musl-tools musl-dev libssl-dev
# Add our x86 target to rust, then compile and install
RUN rustup target add x86_64-unknown-linux-musl
RUN cargo build --release --bin=payjoin-client --target x86_64-unknown-linux-musl --features=native-tls-vendored
RUN cargo build --release --bin=payjoin-cli --target x86_64-unknown-linux-musl --features=native-tls-vendored

FROM alpine:latest
RUN apk --no-cache add ca-certificates
COPY --from=0 /usr/src/payjoin-client/target/x86_64-unknown-linux-musl/release/payjoin-client ./
COPY --from=0 /usr/src/payjoin-cli/target/x86_64-unknown-linux-musl/release/payjoin-cli ./
# Run
ENTRYPOINT ["./payjoin-client"]
ENTRYPOINT ["./payjoin-cli"]
8 changes: 6 additions & 2 deletions payjoin-client/Cargo.toml → payjoin-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
[package]
name = "payjoin-client"
version = "0.1.15"
name = "payjoin-cli"
version = "0.0.1"
authors = ["Dan Gould <[email protected]>", "Martin Habovstiak <[email protected]>"]
edition = "2018"

[[bin]]
name = "payjoin"
path = "src/main.rs"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
native-tls-vendored = ["reqwest/native-tls-vendored"]
Expand Down
File renamed without changes.
4 changes: 3 additions & 1 deletion payjoin-client/src/main.rs → payjoin-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ fn cli() -> ArgMatches {
Command::new("send")
.arg_required_else_help(true)
.arg(arg!(<BIP21> "The `bitcoin:...` payjoin uri to send to"))
.arg(Arg::new("DANGER_ACCEPT_INVALID_CERTS").hide(true).help("Wicked dangerous! Vulnerable to MITM attacks! Accept invalid certs for the payjoin endpoint"))
.arg(Arg::new("DANGER_ACCEPT_INVALID_CERTS")
.hide(true)
.help("Wicked dangerous! Vulnerable to MITM attacks! Accept invalid certs for the payjoin endpoint"))
)
.subcommand(
Command::new("receive")
Expand Down

0 comments on commit 45f6c2b

Please sign in to comment.