forked from ehang-io/nps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
332 changed files
with
3,396 additions
and
63,338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Opening '...' | ||
2. Click on '....' | ||
3. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots or logs** | ||
Add screenshots or logs to help explain your problem. | ||
|
||
**Server (please complete the following information):** | ||
- OS: [e.g. Centos, Windows] | ||
- ARCH: [e.g. Amd64, Arm] | ||
- Tunnel [e.g. TCP, HTTP] | ||
- Version [e.g. 0.24.0] | ||
|
||
**Client (please complete the following information):** | ||
- OS: [e.g. Centos, Windows] | ||
- ARCH: [e.g. Amd64, Arm] | ||
- Tunnel [e.g. TCP, HTTP] | ||
- Version [e.g. 0.24.0] | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: enhancement | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
.idea | ||
.idea | ||
nps | ||
npc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM golang as builder | ||
WORKDIR /go/src/github.com/cnlh/nps | ||
COPY . . | ||
RUN go get -d -v ./... | ||
RUN CGO_ENABLED=0 go build -ldflags="-w -s -extldflags -static" ./cmd/npc/npc.go | ||
|
||
FROM scratch | ||
COPY --from=builder /go/src/github.com/cnlh/nps/npc / | ||
VOLUME /conf | ||
ENTRYPOINT ["/npc"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM golang as builder | ||
WORKDIR /go/src/github.com/cnlh/nps | ||
COPY . . | ||
RUN go get -d -v ./... | ||
RUN CGO_ENABLED=0 go build -ldflags="-w -s -extldflags -static" ./cmd/nps/nps.go | ||
|
||
FROM scratch | ||
COPY --from=builder /go/src/github.com/cnlh/nps/nps / | ||
COPY --from=builder /go/src/github.com/cnlh/nps/web /web | ||
VOLUME /conf | ||
CMD ["/nps"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
SOURCE_FILES?=./... | ||
TEST_PATTERN?=. | ||
TEST_OPTIONS?= | ||
|
||
export PATH := ./bin:$(PATH) | ||
export GO111MODULE := on | ||
export GOPROXY := https://gocenter.io | ||
|
||
# Build a beta version of goreleaser | ||
build: | ||
go build cmd/nps/nps.go | ||
go build cmd/npc/npc.go | ||
.PHONY: build | ||
|
||
# Install all the build and lint dependencies | ||
setup: | ||
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh | ||
curl -L https://git.io/misspell | sh | ||
go mod download | ||
.PHONY: setup | ||
|
||
# Run all the tests | ||
test: | ||
go test $(TEST_OPTIONS) -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt $(SOURCE_FILES) -run $(TEST_PATTERN) -timeout=2m | ||
.PHONY: test | ||
|
||
# Run all the tests and opens the coverage report | ||
cover: test | ||
go tool cover -html=coverage.txt | ||
.PHONY: cover | ||
|
||
# gofmt and goimports all go files | ||
fmt: | ||
find . -name '*.go' -not -wholename './vendor/*' | while read -r file; do gofmt -w -s "$$file"; goimports -w "$$file"; done | ||
.PHONY: fmt | ||
|
||
# Run all the linters | ||
lint: | ||
# TODO: fix tests and lll issues | ||
./bin/golangci-lint run --tests=false --enable-all --disable=lll ./... | ||
./bin/misspell -error **/* | ||
.PHONY: lint | ||
|
||
# Clean go.mod | ||
go-mod-tidy: | ||
@go mod tidy -v | ||
@git diff HEAD | ||
@git diff-index --quiet HEAD | ||
.PHONY: go-mod-tidy | ||
|
||
# Run all the tests and code checks | ||
ci: build test lint go-mod-tidy | ||
.PHONY: ci | ||
|
||
# Generate the static documentation | ||
static: | ||
@hugo --enableGitInfo --source www | ||
.PHONY: static | ||
|
||
# Show to-do items per file. | ||
todo: | ||
@grep \ | ||
--exclude-dir=vendor \ | ||
--exclude-dir=node_modules \ | ||
--exclude=Makefile \ | ||
--text \ | ||
--color \ | ||
-nRo -E ' TODO:.*|SkipNow' . | ||
.PHONY: todo | ||
|
||
clean: | ||
rm npc nps | ||
.PHONY: clean | ||
|
||
.DEFAULT_GOAL := build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.