Skip to content

Commit b2a490e

Browse files
authored
Merge pull request #1 from projectdiscovery/docs-github-actions
Docs GitHub actions
2 parents a4f7241 + f0f5b1b commit b2a490e

File tree

13 files changed

+411
-17
lines changed

13 files changed

+411
-17
lines changed

.github/feature_request.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: "[feature]"
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.

.github/issue-report.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Issue report
3+
about: Create a report to help us improve
4+
title: "[issue]"
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**Nuclei version**
14+
Please share the version of the nuclei you are running with `simplehttpserver -version`
15+
16+
17+
**Screenshot of the error or bug**
18+
please add the screenshot showing bug or issue you are facing.

.github/workflows/build.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
8+
jobs:
9+
lint:
10+
name: golangci-lint
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
- name: Run golangci-lint
16+
uses: golangci/golangci-lint-action@v2.2.0
17+
with:
18+
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
19+
version: v1.31
20+
args: --timeout 5m
21+
22+
# Optional: working directory, useful for monorepos
23+
# working-directory: somedir
24+
25+
# Optional: golangci-lint command line arguments.
26+
# args: --issues-exit-code=0
27+
28+
# Optional: show only new issues if it's a pull request. The default value is `false`.
29+
# only-new-issues: true
30+
build:
31+
name: Build
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Set up Go
35+
uses: actions/setup-go@v2
36+
with:
37+
go-version: 1.14
38+
39+
- name: Check out code
40+
uses: actions/checkout@v2
41+
42+
- name: Test
43+
run: go test .
44+
working-directory: .
45+
46+
- name: Build
47+
run: go build .
48+
working-directory: .
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# dockerhub-push pushes docker build to dockerhub automatically
2+
# on the creation of a new release
3+
name: Publish to Dockerhub on creation of a new release
4+
on:
5+
release:
6+
types: [published]
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@master
12+
- name: Publish to Dockerhub Registry
13+
uses: elgohr/Publish-Docker-Github-Action@master
14+
with:
15+
name: projectdiscovery/simplehttpserver
16+
username: ${{ secrets.DOCKER_USERNAME }}
17+
password: ${{ secrets.DOCKER_PASSWORD }}

.github/workflows/release.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Release
2+
on:
3+
create:
4+
tags:
5+
- v*
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
-
12+
name: "Check out code"
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
-
17+
name: "Set up Go"
18+
uses: actions/setup-go@v2
19+
with:
20+
go-version: 1.14
21+
-
22+
env:
23+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
24+
name: "Create release on GitHub"
25+
uses: goreleaser/goreleaser-action@v2
26+
with:
27+
args: "release --rm-dist"
28+
version: latest

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.exe
2+
simplehttpserver

.golangci.yml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
linters-settings:
2+
dupl:
3+
threshold: 100
4+
exhaustive:
5+
default-signifies-exhaustive: false
6+
# funlen:
7+
# lines: 100
8+
# statements: 50
9+
goconst:
10+
min-len: 2
11+
min-occurrences: 2
12+
gocritic:
13+
enabled-tags:
14+
- diagnostic
15+
- experimental
16+
- opinionated
17+
- performance
18+
- style
19+
disabled-checks:
20+
- dupImport # https://github.com/go-critic/go-critic/issues/845
21+
- ifElseChain
22+
# gocyclo:
23+
# min-complexity: 15
24+
goimports:
25+
local-prefixes: github.com/golangci/golangci-lint
26+
golint:
27+
min-confidence: 0
28+
gomnd:
29+
settings:
30+
mnd:
31+
# don't include the "operation" and "assign"
32+
checks: argument,case,condition,return
33+
govet:
34+
check-shadowing: true
35+
settings:
36+
printf:
37+
funcs:
38+
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
39+
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
40+
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
41+
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
42+
# lll:
43+
# line-length: 140
44+
maligned:
45+
suggest-new: true
46+
misspell:
47+
locale: US
48+
nolintlint:
49+
allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space)
50+
allow-unused: false # report any unused nolint directives
51+
require-explanation: false # don't require an explanation for nolint directives
52+
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
53+
54+
linters:
55+
# please, do not use `enable-all`: it's deprecated and will be removed soon.
56+
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
57+
disable-all: true
58+
enable:
59+
- bodyclose
60+
- deadcode
61+
- dogsled
62+
- dupl
63+
- errcheck
64+
- exhaustive
65+
- gochecknoinits
66+
- goconst
67+
- gocritic
68+
- gofmt
69+
- goimports
70+
- golint
71+
- gomnd
72+
- goprintffuncname
73+
- gosimple
74+
- govet
75+
- ineffassign
76+
- interfacer
77+
- maligned
78+
- misspell
79+
- nakedret
80+
- noctx
81+
- nolintlint
82+
- rowserrcheck
83+
- scopelint
84+
- staticcheck
85+
- structcheck
86+
- stylecheck
87+
- typecheck
88+
- unconvert
89+
- unparam
90+
- unused
91+
- varcheck
92+
- whitespace
93+
94+
# don't enable:
95+
# - depguard
96+
# - asciicheck
97+
# - funlen
98+
# - gochecknoglobals
99+
# - gocognit
100+
# - gocyclo
101+
# - godot
102+
# - godox
103+
# - goerr113
104+
# - gosec
105+
# - lll
106+
# - nestif
107+
# - prealloc
108+
# - testpackage
109+
# - wsl
110+
111+
issues:
112+
exclude-use-default: false
113+
exclude:
114+
# should have a package comment, unless it's in another file for this package (golint)
115+
- 'in another file for this package'
116+
117+
# golangci.com configuration
118+
# https://github.com/golangci/golangci/wiki/Configuration
119+
service:
120+
golangci-lint-version: 1.31.x # use the fixed version to not introduce new linters unexpectedly
121+
prepare:
122+
- echo "here I can run custom commands, but no preparation needed for this repo"

.goreleaser.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
builds:
2+
- binary: simplehttpserver
3+
main: simplehttpserver.go
4+
goos:
5+
- linux
6+
- windows
7+
- darwin
8+
goarch:
9+
- amd64
10+
- 386
11+
- arm
12+
- arm64
13+
14+
archives:
15+
- id: tgz
16+
format: tar.gz
17+
replacements:
18+
darwin: macOS
19+
format_overrides:
20+
- goos: windows
21+
format: zip

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM golang:1.14-alpine AS builder
2+
RUN apk add --no-cache git
3+
RUN GO111MODULE=auto go get -u -v github.com/projectdiscovery/simplehttpserver
4+
5+
FROM alpine:latest
6+
COPY --from=builder /go/bin/simplehttpserver /usr/local/bin/
7+
8+
ENTRYPOINT ["simplehttpserver"]

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Exposed Atoms Pvt Ltd
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)