Skip to content

Commit f9e7811

Browse files
committed
added releaser
updated readme removed first time use field from configuration struct
1 parent 1e778d5 commit f9e7811

File tree

5 files changed

+123
-2
lines changed

5 files changed

+123
-2
lines changed

.github/workflows/gobuild.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# gfwKnock Golang Builder
2+
name: GoBuild
3+
4+
on:
5+
push:
6+
tags:
7+
- 'v*'
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v2
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v2
21+
with:
22+
go-version: 1.20.2
23+
- name: Install goreleaser
24+
run: go install github.com/goreleaser/goreleaser@latest
25+
26+
- name: Build and release
27+
run: |
28+
goreleaser release
29+
env:
30+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

.goreleaser.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## gfwKnock Go Releaser Builder
2+
project_name: gfwKnock
3+
4+
before:
5+
hooks:
6+
- go mod tidy
7+
8+
builds:
9+
- env:
10+
- CGO_ENABLED=0
11+
goos:
12+
- linux
13+
- darwin
14+
- freebsd
15+
- openbsd
16+
goarch:
17+
- amd64
18+
- arm64
19+
20+
archives:
21+
- format: tar.gz
22+
# this name template makes the OS and Arch compatible with the results of uname.
23+
name_template: >-
24+
{{ .ProjectName }}_
25+
{{- title .Os }}_
26+
{{- if eq .Arch "amd64" }}x86_64
27+
{{- else if eq .Arch "386" }}i386
28+
{{- else }}{{ .Arch }}{{ end }}
29+
{{- if .Arm }}v{{ .Arm }}{{ end }}
30+
checksum:
31+
name_template: "checksums.txt"
32+
snapshot:
33+
name_template: "{{ incpatch .Version }}-next"

README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,62 @@
11
# gfwKnock
2+
![go]
3+
24
knock up GFW detection with packet fragmentation method PoC
5+
6+
## Installation
7+
8+
### Getting the Latest Release
9+
You can get the release of gfwKnock from [Releases](https://github.com/SonyaCore/gfwKnock/releases) section
10+
11+
Make sure to properly set configuration file.
12+
13+
14+
### Building from Source
15+
Clone the Repository this by running this command :
16+
17+
```bash
18+
git clone https://github.com/SonyaCore/gfwKnock.git
19+
```
20+
21+
Now Cd into project directory and use the following command to compile the program and then run the compiled binary :
22+
23+
```bash
24+
cd gfwKnock
25+
go build -o gfwKnock -ldflags "-s -w -buildid=" .
26+
./gfwKnock
27+
```
28+
29+
## Configuration
30+
gfwKnock Uses default a configuration file with the following specifications :
31+
32+
* `listen_port` : port for running gfwKnock client.
33+
* `cloud_flare_ip` : cloudflare ip.
34+
* `cloud_flare_port` : cloudflare port.
35+
* `socket_timeout`: time in seconds for closing the server socket if the socket doesn't respond.
36+
* `fragment_sleep` : sleep in milliseconds between each fragment.
37+
* `l_fragment` : length of fragments of Client hello packets.
38+
39+
example of config.json :
40+
41+
```json
42+
{
43+
// key : value : type
44+
"listen_port": 8080, // Integer
45+
"cloud_flare_ip": "45.85.118.88", // String
46+
"cloud_flare_port": 443, // Integer
47+
"socket_timeout": "60", // int Seconds
48+
"fragment_sleep": "100" // int Miliseconds,
49+
"l_fragment": 77 // int Byte
50+
51+
}
52+
```
53+
54+
## License
55+
56+
Licensed under the [GPL-3][license] license.
57+
58+
59+
[license]: LICENCE
60+
[go]: https://img.shields.io/badge/Go-cyan?logo=go
61+
62+

pkg/connection/init.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ func (C Server) InitialConfiguration() Server {
1212
C.CloudFlareIP = viper.GetString("cloud_flare_ip")
1313
C.CloudFlarePort = viper.GetInt("cloud_flare_port")
1414
C.SocketTimeout = viper.GetDuration("socket_timeout") * time.Second
15-
C.AcceptTimeSleep = viper.GetDuration("accept_time_sleep") * time.Millisecond
1615
C.FragmentSleep = viper.GetDuration("fragment_sleep") * time.Millisecond
1716
C.LFragment = viper.GetInt("l_fragment")
1817

pkg/connection/types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ type Configuration struct {
88
SocketTimeout time.Duration `json:"socket_timeout"`
99
AcceptTimeSleep time.Duration `json:"accept_time_sleep"`
1010
FragmentSleep time.Duration `json:"fragment_sleep"`
11-
FirstTimeSleep time.Duration `json:"first_time_sleep"`
1211
LFragment int `json:"l_fragment"`
1312
}
1413

0 commit comments

Comments
 (0)