Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devel #28

Merged
merged 16 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/build-docker-container.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: ci
name: docker-build

on:
push:
branches: ["binary-release", "master", "devel"]
release:
types: [published]

jobs:
docker:
Expand All @@ -20,3 +20,5 @@ jobs:
with:
push: true
tags: hilkopterbob/packagelock:latest
build-args: |
APP_VERSION=${{ github.event.release.tag_name }}
21 changes: 21 additions & 0 deletions .github/workflows/unstable-build-docker-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: unstable-docker-build

on:
push:

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: hilkopterbob/packagelock:unstable-${{ github.head_ref || github.ref_name }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
certs/**
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ RUN go mod download


# Build

RUN CGO_ENABLED=0 GOOS=linux go build -o /packagelock
ARG APP_VERSION="v0.1.0+hotfixes"
RUN \
CGO_ENABLED=0 GOOS=linux go build -ldflags "-X 'main.AppVersion=$APP_VERSION'" -o /packagelock

# Optional:
# To bind to a TCP port, runtime parameters must be supplied to the docker command.
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ TODO: explain usage
- [ ] installable agent as background daemon
- [ ] config management
- [ ] TLS Encryption
- [ ] Secured API
- [ ] Best Practice based Package Layout
- [ ] Check Vars and Func-Names for naming convention
- [ ] persistent storage
Expand Down
7 changes: 4 additions & 3 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ network:
forcehttp: true
fqdn: 0.0.0.0
port: 8080
ssl:
ssl: true
ssl-config:
allowselfsigned: true
certificatepath: /etc/packagelock/ssl/cert.pem
privatekeypath: /etc/packagelock/ssl/privkey.pem
certificatepath: ./certs/testing.crt
privatekeypath: ./certs/testing.key
4 changes: 4 additions & 0 deletions config/conf-init.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"github.com/spf13/viper"
)

var Config ConfigProvider

type ConfigProvider interface {
SetConfigName(name string)
SetConfigType(fileext string)
Expand All @@ -20,6 +22,8 @@ type ConfigProvider interface {
ReadConfig(in io.Reader) error
AllSettings() map[string]any
GetString(string string) string
SetDefault(key string, value any)
Get(key string) any
}

// TODO: How to test?
Expand Down
45 changes: 18 additions & 27 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,45 @@ go 1.22.6

require (
github.com/fsnotify/fsnotify v1.7.0
github.com/gin-gonic/gin v1.10.0
github.com/gofiber/fiber/v2 v2.52.5
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.9.0
)

require (
github.com/bytedance/sonic v1.12.1 // indirect
github.com/bytedance/sonic/loader v0.2.0 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fvbock/endless v0.0.0-20170109170031-447134032cb6 // indirect
github.com/gabriel-vasile/mimetype v1.4.5 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.22.0 // indirect
github.com/goccy/go-json v0.10.3 // indirect
github.com/MicahParks/keyfunc/v2 v2.1.0 // indirect
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/gofiber/contrib/jwt v1.0.10 // indirect
github.com/gofiber/jwt/v3 v3.3.10 // indirect
github.com/gofiber/template v1.8.3 // indirect
github.com/gofiber/template/html/v2 v2.1.2 // indirect
github.com/gofiber/utils v1.1.0 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasthttp v1.55.0 // indirect
github.com/valyala/tcplisten v1.0.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/arch v0.9.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/text v0.17.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading
Loading