Skip to content

Refactor: Migrate to Bun, implement stacks and real-time stats #43

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

Open
wants to merge 346 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
346 commits
Select commit Hold shift + click to select a range
a6838b0
Feat: Better locking
Its4Nik Jan 1, 2025
3c348d3
Fix: fixing the logger
Its4Nik Jan 1, 2025
5984464
Chore: Change routes to classes instead of huge functions
Its4Nik Jan 1, 2025
c5e4e6c
Chore: Moving some typings around
Its4Nik Jan 1, 2025
604a6cf
Chore: Move files around
Its4Nik Jan 1, 2025
dcf62b7
Chore: Update ReadMe
Its4Nik Jan 1, 2025
45b0cfd
Fix: Remove escape characters from log file
Its4Nik Jan 1, 2025
ffb4552
Chore: Cleaning up Dockerfile(s)
Its4Nik Jan 2, 2025
5df6829
Fix: Run uglifyjs only on .js files
Its4Nik Jan 2, 2025
7fa7eeb
Err: Workflow wont run
Its4Nik Jan 2, 2025
9175d9a
Fix: Update validation.yaml
Its4Nik Jan 3, 2025
f39f1bc
Fix: Update validation.yaml
Its4Nik Jan 3, 2025
9bc2f65
Chore: Cleanup frontendConfiguration.json
Its4Nik Jan 3, 2025
bb8a627
Fix: missing return in api.ts
Its4Nik Jan 3, 2025
987b550
Chore: Change to dev Dockerfile for workflow
Its4Nik Jan 3, 2025
621d142
Feat: Added docker scout
Its4Nik Jan 3, 2025
d932c98
Feat: Update workflow logic
Its4Nik Jan 3, 2025
c87ba87
Fix: Permissions
Its4Nik Jan 3, 2025
9cb3490
Fix: Workflow adjustment => drop docker scout :/
Its4Nik Jan 3, 2025
7b09298
Fix: Remove unnecessary matrix
Its4Nik Jan 3, 2025
204d4bf
Chore: Pre release workflow
Its4Nik Jan 3, 2025
b27369f
Fix: removed negation from if in workflow
Its4Nik Jan 3, 2025
fe37f2d
Feat: Added new image => See next commit
Its4Nik Jan 5, 2025
a82d021
Fix: Add checkout
Its4Nik Jan 29, 2025
0f3ed69
Feat: Add WebSockets, graph generation service and HA (#31)
Its4Nik Feb 9, 2025
ad79836
Automatically added GitHub issue links to TODOs
github-actions[bot] Feb 9, 2025
1aa44c6
Fix: Websocket logic adjustments
Feb 9, 2025
915cc33
Fix: Make Linter happy
Feb 9, 2025
63c396e
Change: Graph generation logic changed!
Its4Nik Feb 11, 2025
3f67923
Fix: Code styling
Its4Nik Feb 12, 2025
d7c8016
Fix: Remove unusable routes
Its4Nik Feb 15, 2025
62b0574
Fix: Add docker executable
Its4Nik Feb 15, 2025
01d7307
Fix: Fixing user creation and docker user
Its4Nik Feb 15, 2025
955d413
Fix: Use Node-20-slim in build stage
Its4Nik Feb 15, 2025
fdac573
Fix: Update to composeAction
Its4Nik Feb 15, 2025
caa4b6c
Fix: Make errors more verbose for debugging purpose
Its4Nik Feb 15, 2025
fbc63f4
Fix: Add correct docker packages to Container
Its4Nik Feb 15, 2025
0dc912e
Fix: Adjust dockerfile (gosh i hope it works now)
Its4Nik Feb 15, 2025
c49da92
Fix: Adjust entrypoints and dockerfiles
Its4Nik Feb 16, 2025
9576cdc
Feat: Test new workflow
Its4Nik Feb 16, 2025
749c286
Feat: Test new workflow
Its4Nik Feb 16, 2025
dec86d3
Fix: test new workflow
Its4Nik Feb 16, 2025
b0b5b16
Feat: Switch to bun / ElysiaJS
Its4Nik Feb 23, 2025
d01c12b
Feat: Log deletion, first docker statistics, typechecker, and more!
Its4Nik Feb 23, 2025
32ffec8
ToFix: Sockets are not closing after disconnecting
Its4Nik Feb 25, 2025
fef8744
Fix: Webocket cleanup works? Let's go?
Its4Nik Feb 25, 2025
b1aaefb
Fix: CLosing now works
Its4Nik Feb 26, 2025
90b829e
Feat: Logger adjustments, WebSocket closing and more
Its4Nik Feb 26, 2025
36e1dc2
Fix: Log level adjustment
Its4Nik Feb 26, 2025
b1559c8
Feat: Scheduling, Plugins (wip), databse saving of container stats
Its4Nik Feb 27, 2025
e0352f9
Feat: README update, Storing host stats in db, plugin functions and more
Its4Nik Feb 28, 2025
ea8da8f
Feat: Better logging usability, TASK level logs, database time needed…
Mar 4, 2025
68ec168
Feat: Adjustable log level and minor changes
Its4Nik Mar 4, 2025
4f2be55
Feat: Package info, contributers, License and README update
Its4Nik Mar 8, 2025
d1566b1
Update README.md
Its4Nik Mar 11, 2025
0ed8ebd
Update README.md
Its4Nik Mar 11, 2025
7d6fafe
Feat: Stacks, RealyController (WIP)
Its4Nik Mar 11, 2025
d2cc501
Fix: ignore adjustments
Its4Nik Mar 11, 2025
1b6b04a
Update README.md
Its4Nik Mar 11, 2025
a07499d
Inline variable that is immediately returned (inline-immediately-retu…
Its4Nik Mar 11, 2025
26ebd1e
Avoid unneeded ternary statements (simplify-ternary)
Its4Nik Mar 11, 2025
35f70f8
Avoid unneeded ternary statements (simplify-ternary)
Its4Nik Mar 11, 2025
a827c0a
Inline variable that is immediately returned (inline-immediately-retu…
Its4Nik Mar 11, 2025
4155566
Fix: Code Quality
Its4Nik Mar 11, 2025
e5f967e
Merge branch 'rewrite-elysia' of github.com:Its4Nik/DockStatAPI into …
Its4Nik Mar 11, 2025
1ba080d
Fix: Adjust Readme
Its4Nik Mar 11, 2025
3b4696a
Fix: Adjust Rreadme (forgot how markdown works)
Its4Nik Mar 11, 2025
03c872d
Fix: Adjust Readme (this is getting sill)
Its4Nik Mar 11, 2025
745856e
Fix: Fixes #38
Its4Nik Mar 11, 2025
ba507e2
Fix: Fixes #37
Its4Nik Mar 11, 2025
cf33ba6
Fix: Fixes #34
Its4Nik Mar 12, 2025
2e1d948
Fix: Fixes #39
Its4Nik Mar 12, 2025
91393d7
Fix: Robust parsing of Docker host URL.
Its4Nik Mar 12, 2025
583f5a9
Fix: Fixes #36
Its4Nik Mar 12, 2025
92f10b2
Merge branch 'dev' into rewrite-elysia
Its4Nik Mar 12, 2025
bb9e1c1
Merge pull request #33 from Its4Nik/rewrite-elysia
Its4Nik Mar 12, 2025
bacd092
Feat: Server timing - won't do OpenTelementry - Closes: #41
Its4Nik Mar 13, 2025
d3219e5
Feat: tRPC, ReadMe and Docs Update
Its4Nik Mar 13, 2025
4f195b4
Update README.md
Its4Nik Mar 13, 2025
a374650
Feat: Dependency graph
Its4Nik Mar 13, 2025
8739491
Merge branch 'dev' of github.com:Its4Nik/DockStatAPI into dev
Its4Nik Mar 13, 2025
31b5e30
Fix: Typo
Its4Nik Mar 13, 2025
29af2cf
Fix: Permission
Its4Nik Mar 13, 2025
7b8c2c1
CI/CD: Update dependency graph
Its4Nik Mar 13, 2025
9139b03
Fix: Switch to dependency-cruiser
Its4Nik Mar 13, 2025
8066901
Fix: Adjust pathing
Its4Nik Mar 13, 2025
45579b0
Fix: Adjust to no config
Its4Nik Mar 13, 2025
afc46f2
Update dependency graphs
Its4Nik Mar 13, 2025
5e4a12f
Fix: Chhhhange to bun run
Its4Nik Mar 13, 2025
17feb2e
Fix: Change to bun run
Its4Nik Mar 13, 2025
bede276
Fix: Change to Bun run
Its4Nik Mar 13, 2025
af85b57
Update dependency graphs
Its4Nik Mar 13, 2025
b1ff316
Fix: Adjust Workflow to only render svg
Its4Nik Mar 13, 2025
14c4240
Update dependency graphs
Its4Nik Mar 13, 2025
5996947
Fix: Adjust CI/CD
Its4Nik Mar 13, 2025
95e1844
Update dependency graphs
Its4Nik Mar 13, 2025
47a277e
Fix: Switch to DOTT
Its4Nik Mar 13, 2025
89a6d95
Fix: I meant archi
Its4Nik Mar 13, 2025
886098c
Update dependency graphs
Its4Nik Mar 13, 2025
93ef0c9
Fix: Ortho
Its4Nik Mar 13, 2025
538d54b
Update dependency graphs
Its4Nik Mar 13, 2025
3e851c9
Fix: Add dependency-graphs to Readme
Its4Nik Mar 18, 2025
83e52e4
Feat: Authentication, closes #40 and some more adjustments
Its4Nik Mar 18, 2025
c1113fc
Update dependency graphs
Its4Nik Mar 18, 2025
df63924
Feat: Plugins with their respectful hooks implemented. Fixes #42
Its4Nik Mar 18, 2025
9885404
Update dependency graphs
Its4Nik Mar 18, 2025
16c94da
Fix: Add routes to get all correctly imported plugins
Its4Nik Mar 18, 2025
06efcc2
Update dependency graphs
Its4Nik Mar 18, 2025
a23282c
Fix: Sourcery suggesions, knip adjustments, stack controller refactor,
Its4Nik Mar 19, 2025
68a6461
Feat: Docker image workflow
Its4Nik Mar 19, 2025
c341826
Fix: Adjust Dockerfile location
Its4Nik Mar 19, 2025
1d96562
Fix: Adjust Login Code
Its4Nik Mar 19, 2025
58b0bd5
Fix: Repository name must be lowercase :sob:
Its4Nik Mar 19, 2025
d861dc6
Fix: Bun alpine image does not support arm/v7
Its4Nik Mar 19, 2025
2149866
Fix: Add permissions
Its4Nik Mar 19, 2025
5015d83
Fix: Adjustment to Dockerfile
Its4Nik Mar 19, 2025
d54b56b
Feat: Info Route
Its4Nik Mar 19, 2025
ede35ba
Feat: Add utils route(s)
Its4Nik Mar 19, 2025
b48d616
Feat: Live Log endpoint and adjustments
Its4Nik Mar 21, 2025
7445931
Update dependency graphs
Its4Nik Mar 21, 2025
81add74
Feat: Unit testing
Its4Nik Mar 21, 2025
20c29c4
Feat: Unit tests and general adjustments
Its4Nik Mar 21, 2025
2aae57c
Update dependency graphs
Its4Nik Mar 21, 2025
6131d8a
Fix: Add dependant docker socket prroxy
Its4Nik Mar 21, 2025
3f47cd7
Merge branch 'dev' of github.com:Its4Nik/DockStatAPI into dev
Its4Nik Mar 21, 2025
c63e0eb
Fix: Name have to be written lowercase?
Its4Nik Mar 21, 2025
d3178ae
Fixx: That name?
Its4Nik Mar 21, 2025
b79ca8e
Fix: Adjustments to checking for container start
Its4Nik Mar 21, 2025
8579a13
Fix: Docs update
Its4Nik Mar 21, 2025
4828551
Fixxx: Mismatch in error message for deleteDockerHost parameter.
Its4Nik Mar 21, 2025
9920952
Fix: Falsy check for a boolean flag may lead to false positives.
Its4Nik Mar 21, 2025
69faa81
Fix: Unreachable code in logger format function.
Its4Nik Mar 21, 2025
aaa8c73
Fix: Typo
Its4Nik Mar 21, 2025
8c9f59a
Fix: See https://github.com/Its4Nik/DockStatAPI/pull/43#pullrequestre…
Its4Nik Mar 21, 2025
9df33d1
Merge branch 'dev' of github.com:Its4Nik/DockStatAPI into dev
Its4Nik Mar 21, 2025
df7b2b6
Update dependency graphs
Its4Nik Mar 21, 2025
690ab3c
Fix: Knip adjustment
Its4Nik Mar 21, 2025
48964e5
Merge branch 'dev' of github.com:Its4Nik/DockStatAPI into dev
Its4Nik Mar 21, 2025
6118ad9
Fix: Minor code adjustments
Its4Nik Mar 26, 2025
9b9945c
Update dependency graphs
Its4Nik Mar 26, 2025
26fac15
Fix: WebSocket connection show all containers
Its4Nik Mar 27, 2025
c1f577d
Feat: More IDs and smaller changes
Its4Nik Mar 29, 2025
ac0b430
Fix: Refactor and Stacks now have IDs !
Its4Nik Mar 29, 2025
b01ef42
Feat: Better Swagger documentation and minor fix in stack logic
Its4Nik Mar 29, 2025
8ac97e7
Update dependency graphs
Its4Nik Mar 29, 2025
84125a9
Fix: Delete unused files
Its4Nik Mar 29, 2025
15d7d06
Fix: Remove unused file and update dependencies
Its4Nik Mar 29, 2025
b339fd3
Merge branch 'dev' of github.com:Its4Nik/DockStatAPI into dev
Its4Nik Mar 29, 2025
b2e7ebc
Fix: Remove unused files, update dependencies
Its4Nik Mar 29, 2025
1ec78f6
Fix: Removing tRPC since it is not used in DockStat
Its4Nik Mar 30, 2025
2876048
Update dependency graphs
Its4Nik Mar 30, 2025
a8506c5
Fix: Minor code adjustments
Its4Nik Mar 30, 2025
ad3509e
Update dependency graphs
Its4Nik Mar 30, 2025
b3192ec
Feat: More info in the non websocket request
Its4Nik Apr 5, 2025
5a72c1c
Feat: Stacks progress websocket route
Its4Nik Apr 15, 2025
d62c682
Update dependency graphs
Its4Nik Apr 15, 2025
cbb42fa
Fix: Formatting
Its4Nik Apr 16, 2025
a3b0699
Feat: Linter, formatting and a bunch more
Its4Nik Apr 16, 2025
2462ed9
Merge branch 'dev' of github.com:Its4Nik/DockStatAPI into dev
Its4Nik Apr 16, 2025
a8e3055
Update dependency graphs
Its4Nik Apr 16, 2025
82b28c8
CI/CD: Fix Lint
Its4Nik Apr 16, 2025
d9515cf
Merge branch 'dev' of github.com:Its4Nik/DockStatAPI into dev
Its4Nik Apr 16, 2025
10c7d5b
CI/CD: Fix permissions
Its4Nik Apr 16, 2025
2c636b0
Linting
Its4Nik Apr 16, 2025
2cd11e4
CI/CD: Fix command
Its4Nik Apr 16, 2025
bdfb200
Merge branch 'dev' of github.com:Its4Nik/DockStatAPI into dev
Its4Nik Apr 16, 2025
855959f
CI/CD: Fix junit reports
Its4Nik Apr 16, 2025
488e27f
CI/CD: Fix linter
Its4Nik Apr 16, 2025
2570cb8
CI/CD: Logging to debug
Its4Nik Apr 16, 2025
fe46d26
CI/CD: This seems stupid
Its4Nik Apr 16, 2025
7846fed
CI/CD: Maybe this?
Its4Nik Apr 16, 2025
e17d6b8
CI/CD: Yes? No?
Its4Nik Apr 16, 2025
69cc950
CI/CD: This might be it
Its4Nik Apr 16, 2025
18e41a2
CI/CD: Remove detailed summarrry
Its4Nik Apr 16, 2025
e9e37a1
CI/CD: Fix path
Its4Nik Apr 16, 2025
8fe2e71
CI/CD: Fix reports
Its4Nik Apr 16, 2025
7936bb2
CI/CD: Fix readd package permission
Its4Nik Apr 16, 2025
39777b5
CI//CD: Add knip report
Its4Nik Apr 16, 2025
0877286
CI/CD: Fix add include_passed
Its4Nik Apr 16, 2025
cc0bf5e
CI/CD: Change to GH output
Its4Nik Apr 16, 2025
00f2d80
CI/CD: FIx Reporting
Its4Nik Apr 17, 2025
deb505f
CI/CD: Fix pathing
Its4Nik Apr 17, 2025
5cbe174
CI/CD: Update pipeline.yaml
Its4Nik Apr 25, 2025
718ddd4
CI/CD: Update pipeline.yaml
Its4Nik Apr 25, 2025
252eaae
CI/CD: pipeline.yaml
Its4Nik Apr 25, 2025
5ab15c7
CI/CD: Update pipeline.yaml
Its4Nik Apr 25, 2025
0228832
Update pipeline.yaml
Its4Nik Apr 25, 2025
8f4b05c
CI/CD: Update pipeline.yaml
Its4Nik Apr 25, 2025
b343c3c
CI/CD: Update pipeline.yaml
Its4Nik Apr 25, 2025
6c2b5b0
Update pipeline.yaml
Its4Nik Apr 25, 2025
2ab6005
CI/CD: Update pipeline.yaml
Its4Nik Apr 25, 2025
3755750
CI/CD: Update pipeline.yaml
Its4Nik Apr 25, 2025
5ae009e
Create ci.yml
Its4Nik Apr 29, 2025
f90dc15
Create cd.yml
Its4Nik Apr 29, 2025
d95032f
Delete .github/workflows/pipeline.yaml
Its4Nik Apr 29, 2025
024363e
Merge pull request #46 from Its4Nik/ci/cd-rework
Its4Nik Apr 29, 2025
8a9e4f2
Update ci.yml
Its4Nik Apr 29, 2025
5934b6c
Update ci.yml
Its4Nik Apr 29, 2025
fdd6ba8
CI/CD: Fix test pipeline
Its4Nik Apr 29, 2025
dc7e7a5
CI/CD: Fix Linter
Its4Nik Apr 29, 2025
df40a84
CI/CD: Disable padding in github logs
Its4Nik Apr 29, 2025
76ad637
CI/CD: Disable padding in github logs
Its4Nik Apr 29, 2025
f2b58f2
CI/CD: Forgot to activate the socket proxy in ci
Its4Nik Apr 29, 2025
5668377
Update ci.yml
Its4Nik Apr 29, 2025
30618fb
Update ci.yml
Its4Nik Apr 29, 2025
205c1e4
chore: apply lint fixes [skip ci]
actions-user Apr 29, 2025
de68073
Feat: Update swagger api with better examples and added submodule for…
Its4Nik Apr 30, 2025
59e9ee1
Update dependency graphs
Its4Nik Apr 30, 2025
a24c66e
Chroe: Update CodeQL
Its4Nik Apr 30, 2025
5f6fcec
Merge branch 'dev' of github.com:Its4Nik/DockStatAPI into dev
Its4Nik Apr 30, 2025
911cb85
CQL: Apply lint fixes [skip ci]
actions-user Apr 30, 2025
00e8253
Feat: Eden treaty
Its4Nik Apr 30, 2025
d048958
Fix: Export for ci
Its4Nik Apr 30, 2025
6418d56
CQL: Apply lint fixes [skip ci]
actions-user Apr 30, 2025
10a1921
Fix: Formatting
Its4Nik May 3, 2025
595002b
Fix: Remove index.js
Its4Nik May 3, 2025
b561168
Update dependency graphs
Its4Nik May 3, 2025
db3b6d7
Merge branch 'dev' of github.com:Its4Nik/DockStatAPI into dev
Its4Nik May 5, 2025
2bfdcce
Feat: Elysia server.d.ts route
Its4Nik May 6, 2025
675c3a1
Update dependency graphs
Its4Nik May 6, 2025
ab49684
CI/CD: Always publish test report
Its4Nik May 6, 2025
64a9b9c
Feat: Bunch of changes, see future note
Its4Nik May 8, 2025
4012718
CI/CD: Unit test update *WIP*
Its4Nik May 8, 2025
110152e
CI/CD: Fix?
Its4Nik May 8, 2025
af1f3e5
CI/CD: Remove different server port in CI
Its4Nik May 8, 2025
3434980
CI/CD: This?
Its4Nik May 8, 2025
b29081b
CI/CD: istg ts works on my machine
Its4Nik May 8, 2025
805fe4e
Feat: More resillient debugging for Database initialisation
Its4Nik May 11, 2025
d022f72
Update dependency graphs
Its4Nik May 11, 2025
e8c7c2a
Feat: Better request logging (not saved in db), adjusted error respon…
Its4Nik May 14, 2025
4b52cb2
Update dependency graphs
Its4Nik May 14, 2025
b826987
CI/CD: Move lint into seperate workflow
Its4Nik May 14, 2025
7a3253d
CQL: Apply lint fixes [skip ci]
actions-user May 14, 2025
567dc2e
CI/CD: Fix readability
Its4Nik May 14, 2025
86fb895
CI/CD: Fix readability and non existent dependant test
Its4Nik May 14, 2025
0593532
Merge branch 'dev' of github.com:Its4Nik/DockStatAPI into dev
Its4Nik May 14, 2025
f722a60
CI/CD: Fix gitignore
Its4Nik May 14, 2025
1854513
Fix: Just commit the data folder or smth to fix this weird error...
Its4Nik May 14, 2025
5198159
CI/CD: Debug junit reporter
Its4Nik May 14, 2025
b0edecd
CI/CD: Maybe do not delete the files before using them...
Its4Nik May 14, 2025
935304b
CI/CD: Always publish test results
Its4Nik May 14, 2025
64c0dc8
CI/CD: New test results
Its4Nik May 14, 2025
9d73c7d
CI/CD: Fix my wrong string flavour :sob:
Its4Nik May 14, 2025
dae4d07
CI/CD: Fix wrong path in for loop
Its4Nik May 14, 2025
c8dbcbd
CI/CD: fix type
Its4Nik May 14, 2025
17b1f98
CI/CD: Add CONTRIBUTORS.md workflow
Its4Nik May 14, 2025
9a455d9
Feat: Adjust error responses
Its4Nik May 16, 2025
7bb328b
CQL: Apply lint fixes [skip ci]
actions-user May 16, 2025
2e8528a
UT: Fix wrong body selection
Its4Nik May 16, 2025
4afe4ca
UT: Fix wrong body selection
Its4Nik May 16, 2025
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
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
*.db*
/stacks
/node_modules
*.md
/docker
*.dot
*.svg
*.mmd
*.lock
src/tests
.github
.local-tests
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.ts [email protected]
Binary file added .github/DockStat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions .github/scripts/dep-graph.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

mermaidContent="$(cat dependency-graph.mmd)"

echo "---
config:
flowchart:
defaultRenderer: elk
---

$mermaidContent
" > dependency-graph.mmd

48 changes: 0 additions & 48 deletions .github/workflows/anchore.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/build-dev.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/build-image.yml

This file was deleted.

63 changes: 63 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: "Continuous Delivery"

on:
release:
types: [published, prereleased]

permissions:
contents: read
packages: write

jobs:
publish:
name: Publish Container Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Determine tags
id: tags
uses: docker/metadata-action@v5
with:
images: ghcr.io/its4nik/dockstatapi
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.tags.outputs.tags }}

sbom:
name: Generate SBOM
runs-on: ubuntu-latest
needs: publish
steps:
- name: Generate SBOM
uses: aquasecurity/[email protected]
with:
image-ref: ghcr.io/its4nik/dockstatapi:${{ github.event.release.tag_name }}
format: spdx-json
output: sbom.json

- name: Upload SBOM
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: sbom.json
89 changes: 89 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: "Continuous Integration"

on:
push:
pull_request:

jobs:
unit-test:
name: Unit Testing
runs-on: ubuntu-latest
permissions:
contents: write
checks: write
security-events: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun install

- name: Run unit tests
run: |
export PAD_NEW_LINES=false
docker compose -f docker/docker-compose.dev.yaml up -d
bun test

- name: Log unit test files
run: |
ls -lah reports/markdown

- name: Publish Test Report
if: always()
run: |
SUMMARY=""
for element in $(ls reports/markdown); do
SUMMARY="$(echo -e "${SUMMARY}\n$(cat "reports/markdown/${element}")")"
done
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY
build-scan:
name: Build and Security Scan
runs-on: ubuntu-latest
needs: unit-test
permissions:
contents: read
checks: write
security-events: write

steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
tags: dockstatapi:ci-${{ github.sha }}
load: true

- name: Start and test container
run: |
docker run --name test-container -d dockstatapi:ci-${{ github.sha }}
sleep 10
docker ps | grep test-container
docker logs test-container
docker stop test-container

- name: Trivy vulnerability scan
uses: aquasecurity/[email protected]
with:
image-ref: "dockstatapi:ci-${{ github.sha }}"
format: "sarif"
output: "trivy-results.sarif"
severity: "HIGH,CRITICAL"

- name: Upload security results
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-results.sarif"
21 changes: 21 additions & 0 deletions .github/workflows/contributors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Update CONTRIBUTORS file
on:
schedule:
- cron: "0 0 1 * *"
workflow_dispatch:
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: minicli/[email protected]
name: "Update a projects CONTRIBUTORS file"
env:
CONTRIB_REPOSITORY: "Its4Nik/DockStatAPI"
CONTRIB_OUTPUT_FILE: "CONTRIBUTORS.md"

- name: Commit changes
uses: test-room-7/action-update-file@v1
with:
file-path: "CONTRIBUTORS.md"
commit-msg: Update Contributors
github-token: ${{ secrets.GITHUB_TOKEN }}
44 changes: 44 additions & 0 deletions .github/workflows/dependency-graph.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Generate Dependency Graph"

on:
push:

permissions: write-all

jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: oven-sh/setup-bun@v2

- name: Install dependency-cruiser and graphviz
run: |
bun add dependency-cruiser
sudo apt-get install -y graphviz

- name: Generate Mermaid Dependency Graph
run: |
bun run dependency-cruiser --output-type mermaid src/index.ts --output-to dependency-graph.mmd --no-config -x node_modules --ts-pre-compilation-deps --ts-config tsconfig.json
echo "Mermaid graph generated at dependency-graph.mmd"

- name: Convert to ELK Layout
run: |
bash ./.github/scripts/dep-graph.sh

- name: Generate Dependency Graph (SVG)
run: |
bun run dependency-cruiser --output-type dot src/index.ts --output-to dependency-graph.dot --no-config -x node_modules --ts-pre-compilation-deps --ts-config tsconfig.json
dot -T svg -Gsplines=ortho dependency-graph.dot -o dependency-graph.svg
echo "SVG graph generated at dependency-graph.svg"

- name: Commit and Push Changes
uses: EndBug/add-and-commit@v9
with:
add: '["dependency-graph.svg", "dependency-graph.mmd"]'
message: "Update dependency graphs"
committer_name: "GitHub Action"
committer_email: "[email protected]"
Loading