Skip to content

Commit

Permalink
init push
Browse files Browse the repository at this point in the history
Signed-off-by: jason yang <[email protected]>
  • Loading branch information
JasonYangShadow committed Oct 5, 2023
0 parents commit b2465e7
Show file tree
Hide file tree
Showing 35 changed files with 3,916 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.build/
.tarballs/

!.build/linux-amd64/
!.build/linux-armv7
!.build/linux-arm64
!.build/linux-ppc64le
!.build/linux-s390x
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Feature request
**Use case. Why is this important?**

*“Nice to have” is not a good use case. :)*

## Bug Report
**What did you do?**

**What did you expect to see?**

**What did you see instead? Under which circumstances?**

**Environment**

* System information:

Insert output of `uname -srm` here.

* Apptheus version:

Insert output of `apptheus--version` here.

* Apptheus command line:

Insert full command line.

* Logs:
```
Insert Apptheus logs relevant to the issue here.
```
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "monthly"
23 changes: 23 additions & 0 deletions .github/workflows/golang-build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: golang-build-test
on:
push:
branches:
- master
- main
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21.x'
- name: Install dependencies
run: go get .
- name: Build
run: go build -v ./...
- name: Test with the Go CLI
run: go test ./...
27 changes: 27 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: golangci-lint
on:
push:
branches:
- master
- main
pull_request:

permissions:
contents: read
pull-requests: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: "latest"
args: --timeout=30m
37 changes: 37 additions & 0 deletions .github/workflows/gotest-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: gotest-coverage
on:
push:
branches:
- master
- main
pull_request:

permissions:
contents: read
pull-requests: read

jobs:
go-test-coverage:
name: Go test coverage check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21.x'

- name: Install dependencies
run: go get .

- name: Build
run: go build -v ./...

- name: generate test coverage
run: go test ./... -coverprofile=./cover.out

- name: check test coverage
uses: vladopajic/go-test-coverage@v2
with:
config: ./.testcoverage.yml
27 changes: 27 additions & 0 deletions .github/workflows/license-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: license-check
on:
push:
branches:
- master
- main
pull_request:

permissions:
contents: read
pull-requests: read

jobs:
license-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21.x'
- name: Install dependencies
run: go get .
- name: Install go-license
run: go install github.com/google/go-licenses@latest
- name: Check license
run: go-licenses check --include_tests github.com/jasonyangshadow/apptheus...
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/apptheus
/.build
/.release
/.tarballs
*.test
*~
*.exe
*.tar.gz
/vendor
/testutil/main/main
62 changes: 62 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
linters:
enable-all: true
disable:
- maligned
- interfacer
- scopelint
- golint
- dupl
- funlen
- gomnd
- lll
- gochecknoglobals
- varnamelen
- ireturn
- gomoddirectives
- godox
- gocyclo
- exhaustivestruct
- exhaustruct
- tagliatelle
- wsl
- forbidigo
- makezero
- depguard
- wrapcheck
- gocritic
- gci
- godot
- cyclop
- gocognit
- maintidx
- goerr113
- errname
- nilnil
- prealloc
- ifshort
- nlreturn
- exhaustive
- nestif
- forcetypeassert
- containedctx
- contextcheck
- wastedassign
- promlinter
- nonamedreturns
- nosnakecase
- gochecknoinits
- goconst
- goheader
- paralleltest
- errcheck
- thelper
- usestdlibvars

linters-settings:
goheader:
values:
const:
COMPANY: CIQ, Inc
template: |-
SPDX-FileCopyrightText: Copyright (c) {{ YEAR-RANGE }}, {{ COMPANY }}. All rights reserved
SPDX-License-Identifier: Apache-2.0
28 changes: 28 additions & 0 deletions .testcoverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# (mandatory)
# Path to coverprofile file (output of `go test -coverprofile` command)
profile: cover.out

# Holds coverage thresholds percentages, values should be in range [0-100]
threshold:
# (optional; default 0)
# The minimum coverage that each file should have
file: 80

# (optional; default 0)
# The minimum coverage that each package should have
package: 80

# (optional; default 0)
# The minimum total coverage project should have
total: 80

#override:
# Increase coverage threshold to 100% for `foo` package (default is 80, as configured above)
#- threshold: 100
# path: ^pkg/lib/foo$

# Holds regexp rules which will exclude matched files or packages from coverage statistics
exclude:
# Exclude files or packages matching their paths
paths:
- ^storage/interface
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## 0.1.0 / 2023-10-01

### Feature
1. Add SO_PASSCRED verification

### Changes
1. Removed most unused code
2. Add new ci configuration for github actions
3. Refactor existing code base
1 change: 1 addition & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Apptheus Community Code of Conduct
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Contributing
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ARG ARCH="amd64"
ARG OS="linux"
FROM quay.io/prometheus/busybox-${OS}-${ARCH}:latest
LABEL maintainer="The Apptheus Contributors"

ARG ARCH="amd64"
ARG OS="linux"
COPY --chown=nobody:nobody apptheus /bin/apptheus

EXPOSE 9091
RUN mkdir -p /apptheus && chown nobody:nobody /apptheus
WORKDIR /apptheus

USER 65534

ENTRYPOINT [ "/bin/apptheus" ]
Loading

0 comments on commit b2465e7

Please sign in to comment.