Skip to content

Commit 10b6189

Browse files
committed
fix version number inside binary/docker
1 parent 362df4f commit 10b6189

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ build: clean build-proxy-client build-proxy-server ## Build the proxy client and
2626
.PHONY: build-proxy-client
2727
build-proxy-client: ## Build the proxy client
2828
@mkdir -p ./build
29-
go build -trimpath -ldflags "-X cvm-reverse-proxy/common.Version=${VERSION}" -v -o ./build/proxy-client cmd/proxy-client/main.go
29+
go build -trimpath -ldflags "-X github.com/flashbots/cvm-reverse-proxy/common.Version=${VERSION}" -v -o ./build/proxy-client cmd/proxy-client/main.go
3030

3131
.PHONY: build-proxy-server
3232
build-proxy-server: ## Build the proxy server
3333
@mkdir -p ./build
34-
go build -trimpath -ldflags "-X cvm-reverse-proxy/common.Version=${VERSION}" -v -o ./build/proxy-server cmd/proxy-server/main.go
34+
go build -trimpath -ldflags "-X github.com/flashbots/cvm-reverse-proxy/common.Version=${VERSION}" -v -o ./build/proxy-server cmd/proxy-server/main.go
3535

3636
##@ Test & Development
3737

README.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,32 @@ Client
5252
### Build the server
5353

5454
```bash
55+
# Build the binary
5556
make build-proxy-server
57+
58+
# Build the Docker image
59+
make docker-images
5660
```
5761

5862
### Run the server
5963

6064
```bash
65+
# Run the binary
6166
sudo ./build/proxy-server --listen-addr=<listen-addr> --target-addr=<target-addr> [--server-attestation-type=<server-attestation-type>] [--client-attestation-type=<client-attestation-type>] [--client-measurements=<client-measurements>]
67+
68+
# Run the Docker image
69+
docker run -p 8080:8080 -e LOG_JSON=1 cvm-proxy-server
6270
```
6371

64-
By default the server will present Azure TDX attestation, and you can modify that via the `--server-attestation-type` flag.
65-
The server can be made to present a regular TLS certificate through `--tls-certificate` and `--tls-private-key` flags instead of aTLS one.
72+
By default the server will present Azure TDX attestation, and you can modify that via the `--server-attestation-type` flag.
73+
The server can be made to present a regular TLS certificate through `--tls-certificate` and `--tls-private-key` flags instead of aTLS one.
6674

6775
By default the server will not verify client attestations, you can change that via `--client-attestation-type` and `--client-measurements` flags. Valid for both aTLS and regular TLS.
6876

6977

7078
This repository contains a [dummy http server](./cmd/dummy-server/main.go) that you can use for testing the server. Simply run `go run ./cmd/dummy-server/main.go` and point your `--target-addr=http://127.0.0.1:8085`. You can also use the sample [measurements.json](./measurements.json).
7179

80+
7281
## proxy-client
7382

7483
### Command line arguments
@@ -97,8 +106,8 @@ make build-proxy-client
97106
./build/proxy-client --listen-addr=<listen-addr> --target-addr=<target-addr> [--server-measurements=<server-measurements-file>] [--server-attestation-type=<server-attestation-type>] [--client-attestation-type=<client-attestation-type>]
98107
```
99108

100-
By default the client will expect the server to present an Azure TDX attestation, and you can modify that via the `--server-attestation-type` and `--server-measurements` flags.
101-
The server can also be a regular TLS server, which you can configure with the `--verify-tls` flag, which is only valid in combination with `--server-attestation-type=none`. Non-standard CA for the server can also be configured with `--tls-ca-certificate`.
109+
By default the client will expect the server to present an Azure TDX attestation, and you can modify that via the `--server-attestation-type` and `--server-measurements` flags.
110+
The server can also be a regular TLS server, which you can configure with the `--verify-tls` flag, which is only valid in combination with `--server-attestation-type=none`. Non-standard CA for the server can also be configured with `--tls-ca-certificate`.
102111

103112
By default the client will not present client attestations, you can change that via `--client-attestation-type` flag. Valid for both aTLS and TLS server proxies.
104113

@@ -107,11 +116,11 @@ This repository contains a sample [measurements.json](./measurements.json) file
107116

108117
## Measurements
109118

110-
Attestation verification requires the expected measurements which you pass through the `--{client, server}-measurements` flag.
111-
The measurements are expected to be a JSON map, and multiple valid measurements can be provided. The verifier will attempt to verify with each of the provided measurements, and if any succeeds, the attestation is assumed valid.
119+
Attestation verification requires the expected measurements which you pass through the `--{client, server}-measurements` flag.
120+
The measurements are expected to be a JSON map, and multiple valid measurements can be provided. The verifier will attempt to verify with each of the provided measurements, and if any succeeds, the attestation is assumed valid.
112121

113-
The (single) validated measurement is json-marshalled and forwarded (returned in the case of client) as "X-Flashbots-Measurement" header, and the type of attestation as "X-Flashbots-Attestation-Type" header. For mapping attestation types to OIDs and issuers, see [internal/attestation/variant/variant.go](./internal/attestation/variant/variant.go).
114-
To only validate and forward the measurement (as opposed to also authorizing the measurement against an expected one), simply provide an empty expected measurements object.
122+
The (single) validated measurement is json-marshalled and forwarded (returned in the case of client) as "X-Flashbots-Measurement" header, and the type of attestation as "X-Flashbots-Attestation-Type" header. For mapping attestation types to OIDs and issuers, see [internal/attestation/variant/variant.go](./internal/attestation/variant/variant.go).
123+
To only validate and forward the measurement (as opposed to also authorizing the measurement against an expected one), simply provide an empty expected measurements object.
115124

116125
---
117126

proxy-server.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ADD . /build/
99
RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 GOOS=linux \
1010
go build \
1111
-trimpath \
12-
-ldflags "-s -X main.version=${VERSION}" \
12+
-ldflags "-s -X github.com/flashbots/cvm-reverse-proxy/common.Version=${VERSION}" \
1313
-v \
1414
-o proxy-server \
1515
cmd/proxy-server/main.go

0 commit comments

Comments
 (0)