Skip to content

Conversation

@alex289
Copy link
Member

@alex289 alex289 commented Jan 2, 2026

Just the minimal starter

@alex289 alex289 added the enhancement New feature or request label Jan 3, 2026
@alex289 alex289 self-assigned this Jan 3, 2026
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.25"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
go-version: "1.25"
go-version: "1.25.x"

run: go build -v ./...

- name: Check format
run: go mod tidy && gofmt -s -w . && git diff --exit-code
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe easier to use https://github.com/golangci/golangci-lint? It does do even more checks. Example configuration: https://github.com/AikidoSec/firewall-go/blob/main/.golangci.yml

run: go vet ./...

- name: Run Tests
run: go test -v -race -coverprofile=coverage.txt ./...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps nice if it is a separate job? Can of course be changed later.

- name: Run Tests
run: go test -v -race -coverprofile=coverage.txt ./...

frontend:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add to frontend PR later so it does not fail here?

r.Static("/assets", "./frontend/dist/assets")
r.StaticFile("/", "./frontend/dist/index.html")
r.NoRoute(func(c *gin.Context) {
c.File("./frontend/dist/index.html")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The frontend will show a 404 page?

github.com/gin-gonic/gin v1.11.0
github.com/rs/zerolog v1.34.0
github.com/spf13/cobra v1.10.2
gorm.io/driver/postgres v1.6.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To discuss: only sqlite or both options?

if strings.HasPrefix(env, "GIN_MODE=") && strings.Contains(env, "release") {
return true
}
if strings.HasPrefix(env, "LOG_FORMAT=") && strings.Contains(env, "json") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check LOG_FORMAT before GIN_MODE? Also add support for setting LOG_FORMAT to another value, e.g. plain.

// ShoudLogJSON checks if JSON logging should be used based on environment variables and command line arguments
func ShoudLogJSON(environ []string, args []string) bool {
// Check for production environment
for _, env := range environ {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why a loop and not LookupEnv?


// Start server
addr := fmt.Sprintf(":%s", port)
fmt.Printf("Server starting on %s\n", addr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use logger?


func CORS() gin.HandlerFunc {
return cors.New(cors.Config{
AllowOrigins: []string{"*"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really secure? We should only allow the public API later? So that it can only be used with API Keys but never with user cookie.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants