From ca20f599340f503e3a7da30ce4b1d6d88ee2eec9 Mon Sep 17 00:00:00 2001 From: Kartoffel096 Date: Thu, 10 Oct 2024 12:29:29 +0200 Subject: [PATCH 1/9] Change: Edited Readme to include release badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d6d4a91..f14413f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/HilkopterBob/PackageLock/.github%2Fworkflows%2Frun-tests.yml) -![GitHub Actions Workflow Status](https://github.com/hilkopterbob/packagelock/actions/workflows/test-build.yml/badge.svg) +![GitHub Actions Workflow Status](https://github.com/hilkopterbob/packagelock/actions/workflows/release_tag.yml/badge.svg) ![GitHub Actions Workflow Status](https://github.com/hilkopterbob/packagelock/actions/workflows/golangci-lint.yml/badge.svg) ![GitHub Actions Workflow Status](https://github.com/hilkopterbob/packagelock/actions/workflows/build-docker-container.yml/badge.svg) ![GitHub Actions Workflow Status](https://github.com/hilkopterbob/packagelock/actions/workflows/unstable-build-docker-container.yml/badge.svg) From 91083581be37a63b08d5fb70c5bb2fe4f7047bb9 Mon Sep 17 00:00:00 2001 From: Kartoffel096 Date: Thu, 17 Oct 2024 19:26:09 +0200 Subject: [PATCH 2/9] Add: Added Nightly-Release Workflow --- .github/workflows/nightly_release.yml | 71 +++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/nightly_release.yml diff --git a/.github/workflows/nightly_release.yml b/.github/workflows/nightly_release.yml new file mode 100644 index 0000000..90ba031 --- /dev/null +++ b/.github/workflows/nightly_release.yml @@ -0,0 +1,71 @@ +name: Nightly Release + +on: + schedule: + - cron: "0 0 * * *" + workflow_dispatch: + inputs: + version: + description: 'Version to release (e.g., 1.0.0)' + required: true + +jobs: + release: + name: Create Nightly Release + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + + - name: Set APP_VERSION + id: version + run: | + if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then + VERSION=${{ github.event.inputs.version }} + else + VERSION=${{ github.ref }} + VERSION=${VERSION#refs/tags/} + fi + echo "APP_VERSION=$VERSION" >> $GITHUB_ENV + + - name: Build Go Application + run: | + mkdir -p ${{ github.workspace }}/packagelock + APP_VERSION=${{ env.APP_VERSION }} + CGO_ENABLED=0 GOOS=linux go build -ldflags "-X 'main.AppVersion=$APP_VERSION'" -o ${{ github.workspace }}/packagelock + + - name: Create Release Archive + run: | + mkdir -p release + cp -r ${{ github.workspace }}/packagelock ./release/packagelock + tar -czvf release/packagelock-${{ env.APP_VERSION }}-linux-amd64-nightly.tar.gz -C release packagelock + + - name: Calculate Checksum + run: | + md5sum ./release/packagelock-${{ env.APP_VERSION }}-linux-amd64-nightly.tar.gz | cut -f 1 -d " " > ./release/packagelock-${{ env.APP_VERSION }}-linux-amd64.tar.gz.md5 + + - name: Upload Release Tarball + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: https://api.github.com/repos/HilkopterBob/PackageLock/releases/180504390/assets + asset_path: ./release/packagelock-${{ env.APP_VERSION }}-linux-amd64-nightly.tar.gz + asset_name: packagelock-${{ env.APP_VERSION }}-linux-amd64-nightly.tar.gz + asset_content_type: application/gzip + + - name: Upload Checksum + id: upload-checksum-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: https://api.github.com/repos/HilkopterBob/PackageLock/releases/180504390/assets + asset_path: ./release/packagelock-${{ env.APP_VERSION }}-linux-amd64-nightly.tar.gz.md5 + asset_name: packagelock-${{ env.APP_VERSION }}-linux-amd64-nightly.tar.gz.md5 + asset_content_type: text/plain \ No newline at end of file From 168d9123c4cd9fe1dbe0b5186fc055c59d1f7867 Mon Sep 17 00:00:00 2001 From: Kartoffel096 Date: Fri, 18 Oct 2024 22:38:18 +0200 Subject: [PATCH 3/9] Change: Wiki-Optimization regarding: #109 --- wiki/developer docs/Dev-Home.md | 30 +++++++++++++++++------------- wiki/developer docs/_Sidebar.md | 16 ++++------------ 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/wiki/developer docs/Dev-Home.md b/wiki/developer docs/Dev-Home.md index 4564d6a..397bbf0 100644 --- a/wiki/developer docs/Dev-Home.md +++ b/wiki/developer docs/Dev-Home.md @@ -1,35 +1,39 @@ # PackageLock Developer Documentation - Welcome to the official developer documentation for **PackageLock**! This wiki serves as a comprehensive resource for developers looking to understand, contribute to, and extend the project. ## Table of Contents -- [Getting Started](#getting-started) -- [Architecture Overview](#architecture-overview) -- [API Reference](#api-reference) -- [Contributing](#contributing) -- [FAQ](#faq) -- [Support](#support) +- [Getting Started][getting-started] +- [Architecture Overview][architecture-overview] +- [API Reference][api-reference] +- [Contributing][contributing] +- [FAQ][faq] +- [Support][support] ## Getting Started -Begin your journey by following the [Getting Started](./Getting-Started.md) guide. This section will help you set up the development environment, install dependencies, and run the project locally. +Begin your journey by following the [Getting Started][Getting-Started] guide. This section will help you set up the development environment, install dependencies, and run the project locally. ## Architecture Overview -Understand the core architecture of **PackageLock** in the [Architecture Overview](./Architecture-Overview.md) section. Learn about the main components, their interactions, and the design principles that guide the project. +Understand the core architecture of **PackageLock** in the [Architecture Overview][Architecture-Overview] section. Learn about the main components, their interactions, and the design principles that guide the project. ## Contributing -We welcome contributions from the community! Please read our [Contributing](./Contributing.md) guidelines to learn how you can help improve **PackageLock**. This includes information on coding standards, submitting issues, and making pull requests. +We welcome contributions from the community! Please read our [Contributing][Contributing] guidelines to learn how you can help improve **PackageLock**. This includes information on coding standards, submitting issues, and making pull requests. ## FAQ -Have questions? Check out our [FAQ](./FAQ.md) for answers to common questions. +Have questions? Check out our [FAQ][FAQ] for answers to common questions. --- -*Happy Coding! 🚀* - +_Happy Coding! 🚀_ +[Getting Started]: getting-started +[Architecture Overview]: architecture-overview +[API Reference]: api-reference +[Contributing]: contributing +[FAQ]: faq +[Support]: support diff --git a/wiki/developer docs/_Sidebar.md b/wiki/developer docs/_Sidebar.md index 53109eb..11b1335 100644 --- a/wiki/developer docs/_Sidebar.md +++ b/wiki/developer docs/_Sidebar.md @@ -1,21 +1,13 @@ # Navigation - [Home][home] +- [Dev-Home][dev-home] +- [Getting Started][getting-started] +- [Contributing][contributing] +- [FAQ][faq] [home]: Home - -- Dev-Home - [dev-home]: Dev-Home - -- Getting Started - [getting-started]: Getting-Started - -- Contributing - [contributing]: Contributing - -- FAQ - [faq]: FAQ From 500fae261787719acfce95499cb499cca6cb21a1 Mon Sep 17 00:00:00 2001 From: HilkopterBob Date: Fri, 18 Oct 2024 22:50:08 +0200 Subject: [PATCH 4/9] chore: bump version(s) --- go.mod | 28 ++++++++++++---------------- go.sum | 35 ++++++++++------------------------- 2 files changed, 22 insertions(+), 41 deletions(-) diff --git a/go.mod b/go.mod index abf6d9c..4dceb82 100644 --- a/go.mod +++ b/go.mod @@ -4,17 +4,26 @@ go 1.22.6 require ( github.com/fsnotify/fsnotify v1.7.0 + github.com/gofiber/contrib/fiberzap v1.0.2 github.com/gofiber/contrib/jwt v1.0.10 + github.com/gofiber/contrib/otelfiber v1.0.10 github.com/gofiber/fiber/v2 v2.52.5 github.com/gofiber/template/html/v2 v2.1.2 github.com/golang-jwt/jwt/v5 v5.2.1 github.com/google/uuid v1.6.0 github.com/k0kubun/pp v3.0.1+incompatible - github.com/k0kubun/pp/v3 v3.2.0 github.com/sethvargo/go-password v0.3.1 github.com/spf13/cobra v1.8.1 github.com/spf13/viper v1.19.0 github.com/surrealdb/surrealdb.go v0.2.1 + go.opentelemetry.io/otel v1.31.0 + go.opentelemetry.io/otel/exporters/jaeger v1.17.0 + go.opentelemetry.io/otel/sdk v1.31.0 + go.opentelemetry.io/otel/trace v1.31.0 + go.uber.org/fx v1.23.0 + go.uber.org/zap v1.27.0 + golang.org/x/crypto v0.28.0 + gopkg.in/natefinch/lumberjack.v2 v2.2.1 ) require ( @@ -22,13 +31,8 @@ require ( github.com/andybalholm/brotli v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/gofiber/contrib/otelfiber v1.0.10 // indirect - github.com/gofiber/contrib/otelfiber/v2 v2.1.1 // indirect - github.com/gofiber/contrib/fiberzap v1.0.2 // indirect - github.com/gofiber/contrib/fiberzap/v2 v2.1.4 // indirect github.com/gofiber/template v1.8.3 // indirect github.com/gofiber/utils v1.1.0 // indirect - github.com/google/go-cmp v0.6.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect @@ -52,23 +56,15 @@ require ( github.com/valyala/fasthttp v1.56.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect go.opentelemetry.io/contrib v1.31.0 // indirect - go.opentelemetry.io/otel v1.31.0 // indirect - go.opentelemetry.io/otel/exporters/jaeger v1.17.0 // indirect + go.opentelemetry.io/contrib/propagators/b3 v1.20.0 // indirect go.opentelemetry.io/otel/metric v1.31.0 // indirect - go.opentelemetry.io/otel/sdk v1.31.0 // indirect - go.opentelemetry.io/otel/trace v1.31.0 // indirect - go.uber.org/atomic v1.9.0 // indirect - go.uber.org/atomic v1.10.0 // indirect + go.opentelemetry.io/otel/sdk/metric v0.41.0 // indirect go.uber.org/dig v1.18.0 // indirect - go.uber.org/fx v1.23.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.28.0 // indirect golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.19.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 88cd8f0..be19335 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,5 @@ github.com/MicahParks/keyfunc/v2 v2.1.0 h1:6ZXKb9Rp6qp1bDbJefnG7cTH8yMN1IC/4nf+GVjO99k= github.com/MicahParks/keyfunc/v2 v2.1.0/go.mod h1:rW42fi+xgLJ2FRRXAfNx9ZA8WpD4OeE/yHVMteCkw9k= -github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= -github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA= github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -20,14 +18,10 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/gofiber/contrib/fiberzap v1.0.2 h1:EQwhggtszVfIdBeXxN9Xrmld71es34Ufs+ef8VMqZxc= github.com/gofiber/contrib/fiberzap v1.0.2/go.mod h1:jGO8BHU4gRI9U0JtM6zj2CIhYfgVmW5JxziN8NTgVwE= -github.com/gofiber/contrib/fiberzap/v2 v2.1.4 h1:GCtCQnT4Cr9az4qab2Ozmqsomkxm4Ei86MfKk/1p5+0= -github.com/gofiber/contrib/fiberzap/v2 v2.1.4/go.mod h1:PkdXgUzw+oj4m6ksfKJ0Hs3H7iPhwvhfI4b2LSA9hhA= github.com/gofiber/contrib/jwt v1.0.10 h1:/ilGepl6i0Bntl0Zcd+lAzagY8BiS1+fEiAj32HMApk= github.com/gofiber/contrib/jwt v1.0.10/go.mod h1:1qBENE6sZ6PPT4xIpBzx1VxeyROQO7sj48OlM1I9qdU= github.com/gofiber/contrib/otelfiber v1.0.10 h1:Bu28Pi4pfYmGfIc/9+sNaBbFwTHGY/zpSIK5jBxuRtM= github.com/gofiber/contrib/otelfiber v1.0.10/go.mod h1:jN6AvS1HolDHTQHFURsV+7jSX96FpXYeKH6nmkq8AIw= -github.com/gofiber/contrib/otelfiber/v2 v2.1.1 h1:viX4WuGyapgRIEINWZ6Gy8ZngmVkfhSJMJV2Zmhur0E= -github.com/gofiber/contrib/otelfiber/v2 v2.1.1/go.mod h1:52MEjuv8JSiESuedc4yUpi4HiHx2qOGyMrWL78hIHKs= github.com/gofiber/fiber/v2 v2.52.5 h1:tWoP1MJQjGEe4GB5TUGOi7P2E0ZMMRx5ZTG4rT+yGMo= github.com/gofiber/fiber/v2 v2.52.5/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ= github.com/gofiber/template v1.8.3 h1:hzHdvMwMo/T2kouz2pPCA0zGiLCeMnoGsQZBTSYgZxc= @@ -52,10 +46,6 @@ github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 h1:uC1QfSlInpQ github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/k0kubun/pp v3.0.1+incompatible h1:3tqvf7QgUnZ5tXO6pNAZlrvHgl6DvifjDrd9g2S9Z40= github.com/k0kubun/pp v3.0.1+incompatible/go.mod h1:GWse8YhT0p8pT4ir3ZgBbfZild3tgzSScAn6HmfYukg= -github.com/k0kubun/pp/v3 v3.2.0 h1:h33hNTZ9nVFNP3u2Fsgz8JXiF5JINoZfFq4SvKJwNcs= -github.com/k0kubun/pp/v3 v3.2.0/go.mod h1:ODtJQbQcIRfAD3N+theGCV1m/CBxweERz2dapdz1EwA= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -108,8 +98,8 @@ github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= @@ -121,37 +111,36 @@ github.com/surrealdb/surrealdb.go v0.2.1 h1:E4rCnD75Ftq8/wTgbQ9kJgMACi3xMziXtMlR github.com/surrealdb/surrealdb.go v0.2.1/go.mod h1:CloW70O49xyVO/rGO9cAZ62FEbl0/hreRHEJuamnndQ= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.55.0 h1:Zkefzgt6a7+bVKHnu/YaYSOPfNYNisSVBo/unVCf8k8= -github.com/valyala/fasthttp v1.55.0/go.mod h1:NkY9JtkrpPKmgwV3HTaS2HWaJss9RSIsRVfcxxoHiOM= github.com/valyala/fasthttp v1.56.0 h1:bEZdJev/6LCBlpdORfrLu/WOZXXxvrUQSiyniuaoW8U= github.com/valyala/fasthttp v1.56.0/go.mod h1:sReBt3XZVnudxuLOx4J/fMrJVorWRiWY2koQKgABiVI= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= +github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU= github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E= go.opentelemetry.io/contrib v1.31.0 h1:GkjBOSwjro1dRWw64sDgsx3MAUa0puW4NLwLO4QNRCc= go.opentelemetry.io/contrib v1.31.0/go.mod h1:10IRYpeyXrTiOz6iJGXlLWoFWrnIzYRE/1EdC3GSHjg= +go.opentelemetry.io/contrib/propagators/b3 v1.20.0 h1:Yty9Vs4F3D6/liF1o6FNt0PvN85h/BJJ6DQKJ3nrcM0= +go.opentelemetry.io/contrib/propagators/b3 v1.20.0/go.mod h1:On4VgbkqYL18kbJlWsa18+cMNe6rYpBnPi1ARI/BrsU= go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= go.opentelemetry.io/otel/exporters/jaeger v1.17.0 h1:D7UpUy2Xc2wsi1Ras6V40q806WM07rqoCWzXu7Sqy+4= go.opentelemetry.io/otel/exporters/jaeger v1.17.0/go.mod h1:nPCqOnEH9rNLKqH/+rrUjiMzHJdV1BlpKcTwRTyKkKI= go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= -go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= -go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= +go.opentelemetry.io/otel/oteltest v1.0.0-RC3 h1:MjaeegZTaX0Bv9uB9CrdVjOFM/8slRjReoWoV9xDCpY= +go.opentelemetry.io/otel/oteltest v1.0.0-RC3/go.mod h1:xpzajI9JBRr7gX63nO6kAmImmYIAtuQblZ36Z+LfCjE= go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v0.41.0 h1:c3sAt9/pQ5fSIUfl0gPtClV3HhE18DCVzByD33R/zsk= +go.opentelemetry.io/otel/sdk/metric v0.41.0/go.mod h1:PmOmSt+iOklKtIg5O4Vz9H/ttcRFSNTgii+E1KGyn1w= go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= -go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= -go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/dig v1.18.0 h1:imUL1UiY0Mg4bqbFfsRQO5G4CGRBec/ZujWTvSVp3pw= go.uber.org/dig v1.18.0/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= go.uber.org/fx v1.23.0 h1:lIr/gYWQGfTwGcSXWXu4vP5Ws6iqnNEIY+F/aFzCKTg= go.uber.org/fx v1.23.0/go.mod h1:o/D9n+2mLP6v1EG+qsdT1O8wKopYAsqZasju97SDFCU= -go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= -go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= @@ -162,12 +151,8 @@ golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjs golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 645c00d447ff2f64f89459bf08ac04cc9b729bfa Mon Sep 17 00:00:00 2001 From: Kartoffel096 Date: Fri, 18 Oct 2024 23:35:16 +0200 Subject: [PATCH 5/9] FIX: Fixed broken Links --- wiki/_Sidebar.md | 16 +++++++++------- wiki/developer docs/Dev-Home.md | 20 ++++++++++---------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/wiki/_Sidebar.md b/wiki/_Sidebar.md index 0549c12..c533b91 100644 --- a/wiki/_Sidebar.md +++ b/wiki/_Sidebar.md @@ -13,13 +13,15 @@ - Hosts - [Get Host][hosts] - [Register Host][hosts_reg] +- [Dev-Home][dev-home] [home]: Home [apidocs]: API-Docs -[auth_login]:login -[agents]:get_agent_by_id -[agents_reg]:register_agent -[general_agents]:get_agents -[general_hosts]:get_hosts -[hosts]:get_host_by_agentid -[hosts_reg]:register_host +[auth_login]: login +[agents]: get_agent_by_id +[agents_reg]: register_agent +[general_agents]: get_agents +[general_hosts]: get_hosts +[hosts]: get_host_by_agentid +[hosts_reg]: register_host +[dev-home]: dev-home diff --git a/wiki/developer docs/Dev-Home.md b/wiki/developer docs/Dev-Home.md index 397bbf0..0ee75b1 100644 --- a/wiki/developer docs/Dev-Home.md +++ b/wiki/developer docs/Dev-Home.md @@ -13,27 +13,27 @@ Welcome to the official developer documentation for **PackageLock**! This wiki s ## Getting Started -Begin your journey by following the [Getting Started][Getting-Started] guide. This section will help you set up the development environment, install dependencies, and run the project locally. +Begin your journey by following the [Getting Started][getting-started] guide. This section will help you set up the development environment, install dependencies, and run the project locally. ## Architecture Overview -Understand the core architecture of **PackageLock** in the [Architecture Overview][Architecture-Overview] section. Learn about the main components, their interactions, and the design principles that guide the project. +Understand the core architecture of **PackageLock** in the [Architecture Overview][architecture-overview] section. Learn about the main components, their interactions, and the design principles that guide the project. ## Contributing -We welcome contributions from the community! Please read our [Contributing][Contributing] guidelines to learn how you can help improve **PackageLock**. This includes information on coding standards, submitting issues, and making pull requests. +We welcome contributions from the community! Please read our [Contributing][contributing] guidelines to learn how you can help improve **PackageLock**. This includes information on coding standards, submitting issues, and making pull requests. ## FAQ -Have questions? Check out our [FAQ][FAQ] for answers to common questions. +Have questions? Check out our [FAQ][faq] for answers to common questions. --- _Happy Coding! 🚀_ -[Getting Started]: getting-started -[Architecture Overview]: architecture-overview -[API Reference]: api-reference -[Contributing]: contributing -[FAQ]: faq -[Support]: support +[getting-started]: getting-started +[architecture-overview]: architecture-overview +[api-reference]: api-reference +[contributing]: contributing +[faq]: faq +[support]: support From e67684aa88fe3bcf8017cbfe3aa0d2b842ba529e Mon Sep 17 00:00:00 2001 From: Kartoffel096 Date: Sat, 19 Oct 2024 23:27:18 +0200 Subject: [PATCH 6/9] Change: Added HealthCheck middleware --- go.mod | 28 ++++++++++++---------------- go.sum | 35 ++++++++++------------------------- server/router.go | 11 +++++++++++ 3 files changed, 33 insertions(+), 41 deletions(-) diff --git a/go.mod b/go.mod index abf6d9c..4dceb82 100644 --- a/go.mod +++ b/go.mod @@ -4,17 +4,26 @@ go 1.22.6 require ( github.com/fsnotify/fsnotify v1.7.0 + github.com/gofiber/contrib/fiberzap v1.0.2 github.com/gofiber/contrib/jwt v1.0.10 + github.com/gofiber/contrib/otelfiber v1.0.10 github.com/gofiber/fiber/v2 v2.52.5 github.com/gofiber/template/html/v2 v2.1.2 github.com/golang-jwt/jwt/v5 v5.2.1 github.com/google/uuid v1.6.0 github.com/k0kubun/pp v3.0.1+incompatible - github.com/k0kubun/pp/v3 v3.2.0 github.com/sethvargo/go-password v0.3.1 github.com/spf13/cobra v1.8.1 github.com/spf13/viper v1.19.0 github.com/surrealdb/surrealdb.go v0.2.1 + go.opentelemetry.io/otel v1.31.0 + go.opentelemetry.io/otel/exporters/jaeger v1.17.0 + go.opentelemetry.io/otel/sdk v1.31.0 + go.opentelemetry.io/otel/trace v1.31.0 + go.uber.org/fx v1.23.0 + go.uber.org/zap v1.27.0 + golang.org/x/crypto v0.28.0 + gopkg.in/natefinch/lumberjack.v2 v2.2.1 ) require ( @@ -22,13 +31,8 @@ require ( github.com/andybalholm/brotli v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/gofiber/contrib/otelfiber v1.0.10 // indirect - github.com/gofiber/contrib/otelfiber/v2 v2.1.1 // indirect - github.com/gofiber/contrib/fiberzap v1.0.2 // indirect - github.com/gofiber/contrib/fiberzap/v2 v2.1.4 // indirect github.com/gofiber/template v1.8.3 // indirect github.com/gofiber/utils v1.1.0 // indirect - github.com/google/go-cmp v0.6.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect @@ -52,23 +56,15 @@ require ( github.com/valyala/fasthttp v1.56.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect go.opentelemetry.io/contrib v1.31.0 // indirect - go.opentelemetry.io/otel v1.31.0 // indirect - go.opentelemetry.io/otel/exporters/jaeger v1.17.0 // indirect + go.opentelemetry.io/contrib/propagators/b3 v1.20.0 // indirect go.opentelemetry.io/otel/metric v1.31.0 // indirect - go.opentelemetry.io/otel/sdk v1.31.0 // indirect - go.opentelemetry.io/otel/trace v1.31.0 // indirect - go.uber.org/atomic v1.9.0 // indirect - go.uber.org/atomic v1.10.0 // indirect + go.opentelemetry.io/otel/sdk/metric v0.41.0 // indirect go.uber.org/dig v1.18.0 // indirect - go.uber.org/fx v1.23.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.28.0 // indirect golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.19.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 88cd8f0..be19335 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,5 @@ github.com/MicahParks/keyfunc/v2 v2.1.0 h1:6ZXKb9Rp6qp1bDbJefnG7cTH8yMN1IC/4nf+GVjO99k= github.com/MicahParks/keyfunc/v2 v2.1.0/go.mod h1:rW42fi+xgLJ2FRRXAfNx9ZA8WpD4OeE/yHVMteCkw9k= -github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= -github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA= github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -20,14 +18,10 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/gofiber/contrib/fiberzap v1.0.2 h1:EQwhggtszVfIdBeXxN9Xrmld71es34Ufs+ef8VMqZxc= github.com/gofiber/contrib/fiberzap v1.0.2/go.mod h1:jGO8BHU4gRI9U0JtM6zj2CIhYfgVmW5JxziN8NTgVwE= -github.com/gofiber/contrib/fiberzap/v2 v2.1.4 h1:GCtCQnT4Cr9az4qab2Ozmqsomkxm4Ei86MfKk/1p5+0= -github.com/gofiber/contrib/fiberzap/v2 v2.1.4/go.mod h1:PkdXgUzw+oj4m6ksfKJ0Hs3H7iPhwvhfI4b2LSA9hhA= github.com/gofiber/contrib/jwt v1.0.10 h1:/ilGepl6i0Bntl0Zcd+lAzagY8BiS1+fEiAj32HMApk= github.com/gofiber/contrib/jwt v1.0.10/go.mod h1:1qBENE6sZ6PPT4xIpBzx1VxeyROQO7sj48OlM1I9qdU= github.com/gofiber/contrib/otelfiber v1.0.10 h1:Bu28Pi4pfYmGfIc/9+sNaBbFwTHGY/zpSIK5jBxuRtM= github.com/gofiber/contrib/otelfiber v1.0.10/go.mod h1:jN6AvS1HolDHTQHFURsV+7jSX96FpXYeKH6nmkq8AIw= -github.com/gofiber/contrib/otelfiber/v2 v2.1.1 h1:viX4WuGyapgRIEINWZ6Gy8ZngmVkfhSJMJV2Zmhur0E= -github.com/gofiber/contrib/otelfiber/v2 v2.1.1/go.mod h1:52MEjuv8JSiESuedc4yUpi4HiHx2qOGyMrWL78hIHKs= github.com/gofiber/fiber/v2 v2.52.5 h1:tWoP1MJQjGEe4GB5TUGOi7P2E0ZMMRx5ZTG4rT+yGMo= github.com/gofiber/fiber/v2 v2.52.5/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ= github.com/gofiber/template v1.8.3 h1:hzHdvMwMo/T2kouz2pPCA0zGiLCeMnoGsQZBTSYgZxc= @@ -52,10 +46,6 @@ github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 h1:uC1QfSlInpQ github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/k0kubun/pp v3.0.1+incompatible h1:3tqvf7QgUnZ5tXO6pNAZlrvHgl6DvifjDrd9g2S9Z40= github.com/k0kubun/pp v3.0.1+incompatible/go.mod h1:GWse8YhT0p8pT4ir3ZgBbfZild3tgzSScAn6HmfYukg= -github.com/k0kubun/pp/v3 v3.2.0 h1:h33hNTZ9nVFNP3u2Fsgz8JXiF5JINoZfFq4SvKJwNcs= -github.com/k0kubun/pp/v3 v3.2.0/go.mod h1:ODtJQbQcIRfAD3N+theGCV1m/CBxweERz2dapdz1EwA= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -108,8 +98,8 @@ github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= @@ -121,37 +111,36 @@ github.com/surrealdb/surrealdb.go v0.2.1 h1:E4rCnD75Ftq8/wTgbQ9kJgMACi3xMziXtMlR github.com/surrealdb/surrealdb.go v0.2.1/go.mod h1:CloW70O49xyVO/rGO9cAZ62FEbl0/hreRHEJuamnndQ= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.55.0 h1:Zkefzgt6a7+bVKHnu/YaYSOPfNYNisSVBo/unVCf8k8= -github.com/valyala/fasthttp v1.55.0/go.mod h1:NkY9JtkrpPKmgwV3HTaS2HWaJss9RSIsRVfcxxoHiOM= github.com/valyala/fasthttp v1.56.0 h1:bEZdJev/6LCBlpdORfrLu/WOZXXxvrUQSiyniuaoW8U= github.com/valyala/fasthttp v1.56.0/go.mod h1:sReBt3XZVnudxuLOx4J/fMrJVorWRiWY2koQKgABiVI= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= +github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU= github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E= go.opentelemetry.io/contrib v1.31.0 h1:GkjBOSwjro1dRWw64sDgsx3MAUa0puW4NLwLO4QNRCc= go.opentelemetry.io/contrib v1.31.0/go.mod h1:10IRYpeyXrTiOz6iJGXlLWoFWrnIzYRE/1EdC3GSHjg= +go.opentelemetry.io/contrib/propagators/b3 v1.20.0 h1:Yty9Vs4F3D6/liF1o6FNt0PvN85h/BJJ6DQKJ3nrcM0= +go.opentelemetry.io/contrib/propagators/b3 v1.20.0/go.mod h1:On4VgbkqYL18kbJlWsa18+cMNe6rYpBnPi1ARI/BrsU= go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= go.opentelemetry.io/otel/exporters/jaeger v1.17.0 h1:D7UpUy2Xc2wsi1Ras6V40q806WM07rqoCWzXu7Sqy+4= go.opentelemetry.io/otel/exporters/jaeger v1.17.0/go.mod h1:nPCqOnEH9rNLKqH/+rrUjiMzHJdV1BlpKcTwRTyKkKI= go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= -go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= -go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= +go.opentelemetry.io/otel/oteltest v1.0.0-RC3 h1:MjaeegZTaX0Bv9uB9CrdVjOFM/8slRjReoWoV9xDCpY= +go.opentelemetry.io/otel/oteltest v1.0.0-RC3/go.mod h1:xpzajI9JBRr7gX63nO6kAmImmYIAtuQblZ36Z+LfCjE= go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v0.41.0 h1:c3sAt9/pQ5fSIUfl0gPtClV3HhE18DCVzByD33R/zsk= +go.opentelemetry.io/otel/sdk/metric v0.41.0/go.mod h1:PmOmSt+iOklKtIg5O4Vz9H/ttcRFSNTgii+E1KGyn1w= go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= -go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= -go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/dig v1.18.0 h1:imUL1UiY0Mg4bqbFfsRQO5G4CGRBec/ZujWTvSVp3pw= go.uber.org/dig v1.18.0/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= go.uber.org/fx v1.23.0 h1:lIr/gYWQGfTwGcSXWXu4vP5Ws6iqnNEIY+F/aFzCKTg= go.uber.org/fx v1.23.0/go.mod h1:o/D9n+2mLP6v1EG+qsdT1O8wKopYAsqZasju97SDFCU= -go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= -go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= @@ -162,12 +151,8 @@ golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjs golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/server/router.go b/server/router.go index d81f5c1..10c6618 100644 --- a/server/router.go +++ b/server/router.go @@ -11,6 +11,7 @@ import ( "github.com/gofiber/contrib/otelfiber" "github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2/middleware/recover" + "github.com/gofiber/fiber/v2/middleware/healthcheck" "github.com/gofiber/template/html/v2" "github.com/golang-jwt/jwt/v5" "github.com/spf13/viper" @@ -58,6 +59,16 @@ func NewServer(params ServerParams) *fiber.App { app.Use(recover.New()) params.Logger.Info("Added Recovery Middleware.") + + // Middleware for healthcheck + app.Use(healthcheck.New(healthcheck.Config{ + LivenessProbe: func(c *fiber.Ctx) bool { + return true + }, + LivenessEndpoint: "/health", + })) + params.Logger.Info("Added HealtCheck Middleware.") + // Add routes addRoutes(app, params) params.Logger.Info("Added routes.") From eae37e6c1f300419d3cedea83cfdd41f6ce0aed1 Mon Sep 17 00:00:00 2001 From: Kartoffel096 Date: Mon, 21 Oct 2024 13:38:04 +0200 Subject: [PATCH 7/9] Change: Changed /health to /livez and added /readyz endpoint -- We should add ready() methods that we can check in readieness and maybe add a little status page @HilkopterBob --- server/router.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/router.go b/server/router.go index 10c6618..be52d0c 100644 --- a/server/router.go +++ b/server/router.go @@ -10,8 +10,8 @@ import ( jwtware "github.com/gofiber/contrib/jwt" "github.com/gofiber/contrib/otelfiber" "github.com/gofiber/fiber/v2" - "github.com/gofiber/fiber/v2/middleware/recover" "github.com/gofiber/fiber/v2/middleware/healthcheck" + "github.com/gofiber/fiber/v2/middleware/recover" "github.com/gofiber/template/html/v2" "github.com/golang-jwt/jwt/v5" "github.com/spf13/viper" @@ -65,7 +65,12 @@ func NewServer(params ServerParams) *fiber.App { LivenessProbe: func(c *fiber.Ctx) bool { return true }, - LivenessEndpoint: "/health", + LivenessEndpoint: "/livez", + + ReadinessProbe: func(c *fiber.Ctx) bool { + return true + }, + ReadinessEndpoint: "/readyz", })) params.Logger.Info("Added HealtCheck Middleware.") From e2edf9ab7c9d5cb9ff169ff035b14f914e62ef91 Mon Sep 17 00:00:00 2001 From: HilkopterBob Date: Mon, 28 Oct 2024 11:45:37 +0100 Subject: [PATCH 8/9] add: simple developer monitoring, only availible if general.production is set to false --- server/router.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/router.go b/server/router.go index be52d0c..6b01d59 100644 --- a/server/router.go +++ b/server/router.go @@ -11,6 +11,7 @@ import ( "github.com/gofiber/contrib/otelfiber" "github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2/middleware/healthcheck" + "github.com/gofiber/fiber/v2/middleware/monitor" "github.com/gofiber/fiber/v2/middleware/recover" "github.com/gofiber/template/html/v2" "github.com/golang-jwt/jwt/v5" @@ -49,6 +50,12 @@ func NewServer(params ServerParams) *fiber.App { params.Logger.Info("Added OpenTelemetry Middleware.") } + // Middleware for simple resource Monitor + // only use in Non-Production mode + if !params.Config.GetBool("general.production") { + app.Get("/monitor", monitor.New(monitor.Config{Title: "PackageLock Dev Monitoring Page"})) + } + // Middleware for logging app.Use(fiberzap.New(fiberzap.Config{ Logger: params.Logger, @@ -59,7 +66,6 @@ func NewServer(params ServerParams) *fiber.App { app.Use(recover.New()) params.Logger.Info("Added Recovery Middleware.") - // Middleware for healthcheck app.Use(healthcheck.New(healthcheck.Config{ LivenessProbe: func(c *fiber.Ctx) bool { From 770554191fa6c9b3a651de709d9071c05918a452 Mon Sep 17 00:00:00 2001 From: Nick <117028104+HilkopterBob@users.noreply.github.com> Date: Tue, 29 Oct 2024 14:35:06 +0100 Subject: [PATCH 9/9] fix: sonar issue report (#128) --- templates/404.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/404.html b/templates/404.html index d67513a..5d3628b 100644 --- a/templates/404.html +++ b/templates/404.html @@ -62,7 +62,7 @@

404 - Page not found 😢

-

Read the PackageLock Docs! 🚀

+

Read the PackageLock Docs! 🚀

{{ .AppVersion }}