Compare commits

...

11 Commits

Author SHA1 Message Date
58265a642d fix(deps): update module github.com/gofiber/template/html/v2 to v2.1.3 2025-01-28 06:00:44 +00:00
ngn
a1853c0c79 Merge pull request 'chore(deps): update golang docker tag to v1.23.5' (#2) from renovate/golang-1.x into main
All checks were successful
Build docker image / build (push) Successful in 2m24s
Reviewed-on: #2
2025-01-28 08:16:12 +03:00
ngn
3ae593500f Merge branch 'main' into renovate/golang-1.x 2025-01-28 08:16:02 +03:00
ngn
a9f1729748 Merge pull request 'fix(deps): update module github.com/gofiber/fiber/v2 to v2.52.6' (#3) from renovate/github.com-gofiber-fiber-v2-2.x into main
All checks were successful
Build docker image / build (push) Successful in 1m33s
Reviewed-on: #3
2025-01-28 08:07:04 +03:00
ngn
368789bf78 Merge branch 'main' into renovate/github.com-gofiber-fiber-v2-2.x 2025-01-28 08:06:58 +03:00
ngn
a593dff15b
fix: action container name
Some checks failed
Build docker image / build (push) Failing after 58s
Signed-off-by: ngn <ngn@ngn.tf>
2025-01-28 08:02:38 +03:00
ngn
7555bb3f67
update: readme deployment instructions
Some checks failed
Build docker image / build (push) Failing after 2m29s
Signed-off-by: ngn <ngn@ngn.tf>
2025-01-28 07:59:04 +03:00
ngn
094aa2a96d
fix: copy makefile in dockerfile
Signed-off-by: ngn <ngn@ngn.tf>
2025-01-28 07:56:11 +03:00
ngn
ce78bf803b
new: docker workflow action
Some checks failed
Build docker image / build (push) Failing after 2m45s
Signed-off-by: ngn <ngn@ngn.tf>
2025-01-28 07:38:24 +03:00
84622efe82 fix(deps): update module github.com/gofiber/fiber/v2 to v2.52.6 2025-01-28 04:12:42 +00:00
ba21427c06 chore(deps): update golang docker tag to v1.23.5 2025-01-28 04:12:39 +00:00
5 changed files with 59 additions and 19 deletions

View File

@ -0,0 +1,28 @@
name: Build docker image
on:
push:
branches: ["main"]
env:
REGISTRY: git.matterlinux.xyz
IMAGE: ${{gitea.repository}}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: "https://github.com/actions/checkout@v4"
- name: Login to container repo
uses: "https://github.com/docker/login-action@v1"
with:
registry: ${{env.REGISTRY}}
username: ${{gitea.actor}}
password: ${{secrets.PACKAGES_TOKEN}}
- name: Build image
run: |
docker build --tag ${{env.REGISTRY}}/${{env.IMAGE}}:latest .
docker push ${{env.REGISTRY}}/${{env.IMAGE}}:latest

View File

@ -1,17 +1,24 @@
FROM golang:1.23.2 FROM golang:1.23.5
WORKDIR /app WORKDIR /app
COPY *.go ./ RUN useradd runner -r -u 1001 -d /app
RUN chown -R runner:runner /app
USER runner
COPY *.mod ./ COPY *.mod ./
COPY *.sum ./ COPY *.sum ./
RUN go mod download
COPY *.go ./
COPY Makefile ./
COPY lib ./lib COPY lib ./lib
COPY log ./log COPY log ./log
COPY public ./public COPY public ./public
COPY routes ./routes COPY routes ./routes
COPY templates ./templates COPY templates ./templates
RUN go build . RUN make
ENTRYPOINT ["/app/tracker"] ENTRYPOINT ["/app/tracker"]

View File

@ -1,4 +1,7 @@
# tracker | MatterLinux package tracker # tracker | MatterLinux package tracker
![](https://git.matterlinux.xyz/matter/tracker/actions/workflows/docker.yml/badge.svg)
Soruce code of MatterLinux's package tracker, located at Soruce code of MatterLinux's package tracker, located at
[tracker.matterlinux.xyz](https://tracker.matterlinux.xyz) [tracker.matterlinux.xyz](https://tracker.matterlinux.xyz)
@ -39,23 +42,19 @@ official MatterLinux 24 repos:
``` ```
### Deployment ### Deployment
Web server can be built and deployed with docker compose using the following Web server can be deployed with docker compose using the following configuration file:
configuration file:
```yaml ```yaml
version: "3"
services: services:
tracker: tracker:
image: mattertracker container_name: mattertracker
restart: unless-stopped image: git.matterlinux.xyz/matter/tracker
build:
context: ./
ports: ports:
- "127.0.0.1:9877:9877" - "127.0.0.1:9877:9877"
volumes: volumes:
- "./config.json:/app/config.json:ro" - "./config.json:/app/config.json:ro"
restart: unless-stopped
``` ```
After saving the configuration file, you can build and run the docker container: After saving the configuration file, you can run the docker container:
```bash ```bash
docker-compose up -d docker-compose up -d
``` ```

6
go.mod
View File

@ -4,8 +4,8 @@ go 1.22.5
require ( require (
github.com/bigkevmcd/go-configparser v0.0.0-20240808124832-fc81059ea0bd github.com/bigkevmcd/go-configparser v0.0.0-20240808124832-fc81059ea0bd
github.com/gofiber/fiber/v2 v2.52.5 github.com/gofiber/fiber/v2 v2.52.6
github.com/gofiber/template/html/v2 v2.1.2 github.com/gofiber/template/html/v2 v2.1.3
) )
require ( require (
@ -21,5 +21,5 @@ require (
github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasthttp v1.57.0 // indirect github.com/valyala/fasthttp v1.57.0 // indirect
github.com/valyala/tcplisten v1.0.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect
golang.org/x/sys v0.27.0 // indirect golang.org/x/sys v0.28.0 // indirect
) )

6
go.sum
View File

@ -6,10 +6,14 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/gofiber/fiber/v2 v2.52.5 h1:tWoP1MJQjGEe4GB5TUGOi7P2E0ZMMRx5ZTG4rT+yGMo= 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/fiber/v2 v2.52.5/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ=
github.com/gofiber/fiber/v2 v2.52.6 h1:Rfp+ILPiYSvvVuIPvxrBns+HJp8qGLDnLJawAu27XVI=
github.com/gofiber/fiber/v2 v2.52.6/go.mod h1:YEcBbO/FB+5M1IZNBP9FO3J9281zgPAreiI1oqg8nDw=
github.com/gofiber/template v1.8.3 h1:hzHdvMwMo/T2kouz2pPCA0zGiLCeMnoGsQZBTSYgZxc= github.com/gofiber/template v1.8.3 h1:hzHdvMwMo/T2kouz2pPCA0zGiLCeMnoGsQZBTSYgZxc=
github.com/gofiber/template v1.8.3/go.mod h1:bs/2n0pSNPOkRa5VJ8zTIvedcI/lEYxzV3+YPXdBvq8= github.com/gofiber/template v1.8.3/go.mod h1:bs/2n0pSNPOkRa5VJ8zTIvedcI/lEYxzV3+YPXdBvq8=
github.com/gofiber/template/html/v2 v2.1.2 h1:wkK/mYJ3nIhongTkG3t0QgV4ADdgOYJYVSAF2AHnh8Y= github.com/gofiber/template/html/v2 v2.1.2 h1:wkK/mYJ3nIhongTkG3t0QgV4ADdgOYJYVSAF2AHnh8Y=
github.com/gofiber/template/html/v2 v2.1.2/go.mod h1:E98Z/FzvpaSib06aWEgYk6GXNf3ctoyaJH8yW5ay5ak= github.com/gofiber/template/html/v2 v2.1.2/go.mod h1:E98Z/FzvpaSib06aWEgYk6GXNf3ctoyaJH8yW5ay5ak=
github.com/gofiber/template/html/v2 v2.1.3 h1:n1LYBtmr9C0V/k/3qBblXyMxV5B0o/gpb6dFLp8ea+o=
github.com/gofiber/template/html/v2 v2.1.3/go.mod h1:U5Fxgc5KpyujU9OqKzy6Kn6Qup6Tm7zdsISR+VpnHRE=
github.com/gofiber/utils v1.1.0 h1:vdEBpn7AzIUJRhe+CiTOJdUcTg4Q9RK+pEa0KPbLdrM= github.com/gofiber/utils v1.1.0 h1:vdEBpn7AzIUJRhe+CiTOJdUcTg4Q9RK+pEa0KPbLdrM=
github.com/gofiber/utils v1.1.0/go.mod h1:poZpsnhBykfnY1Mc0KeEa6mSHrS3dV0+oBWyeQmb2e0= github.com/gofiber/utils v1.1.0/go.mod h1:poZpsnhBykfnY1Mc0KeEa6mSHrS3dV0+oBWyeQmb2e0=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
@ -46,6 +50,8 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=