Skip to content

Commit

Permalink
Add Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
rosahaj committed Jan 6, 2024
1 parent a485d37 commit ba641d2
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 5 deletions.
26 changes: 26 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Go workspace file
go.work

# Keys and certificates
*.pem

.github
credentials
.dockerignore
.gitignore
Dockerfile
compose.yaml
README.md
25 changes: 20 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ on:
release:
types: [created]
permissions:
contents: write
packages: write
contents: write
packages: write
jobs:
releases-matrix:
name: Release ja3proxy binary
Expand All @@ -13,13 +13,28 @@ jobs:
matrix:
# build and publish in parallel: linux/amd64, linux/arm64,
# windows/amd64, windows/arm64, darwin/amd64, darwin/arm64
goos: [ linux, windows, darwin ]
goarch: [ amd64, arm64 ]
goos: [linux, windows, darwin]
goarch: [amd64, arm64]
steps:
- uses: actions/checkout@v3
- uses: wangyoucao577/go-release-action@v1.29
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
binary_name: "ja3proxy"
docker-image:
name: Build and push Docker image to GHCR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and Push Container to ghcr.io
uses: mr-smithers-excellent/docker-build-push@v6
with:
image: ja3proxy
registry: ghcr.io
multiplatform: true
platform: linux/amd64,linux/arm64,linux/arm/v7
addLatest: true
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
go.work

*.pem
credentials
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM golang:1.20 as builder

WORKDIR /app
COPY . .

RUN go mod download
RUN go build -o /app/ja3proxy

FROM gcr.io/distroless/cc-debian12

COPY --from=builder /app/ja3proxy /app/ja3proxy
ENTRYPOINT ["/app/ja3proxy"]
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,37 @@ Customizing TLS (JA3) Fingerprints through HTTP Proxy

## Usage

### Building from source

```bash
git clone https://github.com/lylemi/ja3proxy
cd ja3proxy
make
./ja3proxy -port 8080 -client 360Browser -version 7.5

curl -v -k --proxy http://localhost:8080 https://www.example.com
```

### Using docker

```bash
# With docker CLI
docker run \
-v ./credentials:/app/credentials \
-p 8080:8080 \
ghcr.io/LyleMi/ja3proxy:latest \
-cert /app/credentials/cert.pem \
-key /app/credentials/key.pem \
-client 360Browser \
-version 7.5
# With docker compose (see compose.yaml)
docker compose up -d

curl -v -k --proxy http://localhost:8080 https://www.example.com
```

### CLI usage

```bash
Usage of ja3proxy:
-addr string
Expand Down
20 changes: 20 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
services:
ja3proxy:
image: ghcr.io/LyleMi/ja3proxy:latest
build: .
entrypoint:
[
"/app/ja3proxy",
"-cert",
"/credentials/cert.pem",
"-key",
"/credentials/key.pem",
"-client",
"360Browser",
"-version",
"7.5"
]
ports:
- 8080:8080
volumes:
- ./credentials:/app/credentials

0 comments on commit ba641d2

Please sign in to comment.