Skip to content

Commit

Permalink
v0.9 (#15)
Browse files Browse the repository at this point in the history
* Enhance HTTP request logging to skip specific paths
* Bump version to 0.9 in update scripts and Docker image build files
  • Loading branch information
leodip authored Nov 17, 2024
1 parent d443e21 commit f0b5d48
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 19 deletions.
14 changes: 13 additions & 1 deletion src/adminconsole/internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,19 @@ func (s *Server) initMiddleware(settings *models.Settings) {
// HTTP request logging
if config.Get().LogHttpRequests {
slog.Info("http request logging enabled")
s.router.Use(middleware.Logger)
s.router.Use(func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// Skip logging for health check, static files, and favicon
if r.URL.Path == "/health" ||
strings.HasPrefix(r.URL.Path, "/static/") ||
r.URL.Path == "/favicon.ico" {
next.ServeHTTP(w, r)
return
}
// Use the standard Chi logger for all other routes
middleware.Logger(next).ServeHTTP(w, r)
})
})
} else {
slog.Info("http request logging disabled")
}
Expand Down
14 changes: 13 additions & 1 deletion src/authserver/internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,19 @@ func (s *Server) initMiddleware(settings *models.Settings) {
// HTTP request logging
if config.Get().LogHttpRequests {
slog.Info("http request logging enabled")
s.router.Use(middleware.Logger)
s.router.Use(func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// Skip logging for health check, static files, and favicon
if r.URL.Path == "/health" ||
strings.HasPrefix(r.URL.Path, "/static/") ||
r.URL.Path == "/favicon.ico" {
next.ServeHTTP(w, r)
return
}
// Use the standard Chi logger for all other routes
middleware.Logger(next).ServeHTTP(w, r)
})
})
} else {
slog.Info("http request logging disabled")
}
Expand Down
28 changes: 14 additions & 14 deletions src/authserver/update-versions.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

GOIABADA_VERSION="0.8"
GOIABADA_VERSION="0.9"
NEW_GO_VERSION="1.23.3" # https://go.dev/dl/
NEW_TAILWIND_VERSION="3.4.14" # https://github.com/tailwindlabs/tailwindcss
NEW_GOLANGCI_LINT_VERSION="1.61.0" # https://github.com/golangci/golangci-lint
Expand Down Expand Up @@ -85,22 +85,22 @@ fi

echo "Version update complete."

cd ../core
go get -u ./...
go mod tidy
# cd ../core
# go get -u ./...
# go mod tidy

echo "Updated core dependencies"
# echo "Updated core dependencies"

cd ../authserver
go get -u ./...
go mod tidy
# cd ../authserver
# go get -u ./...
# go mod tidy

echo "Updated authserver dependencies"
# echo "Updated authserver dependencies"

cd ../adminconsole
go get -u ./...
go mod tidy
# cd ../adminconsole
# go get -u ./...
# go mod tidy

echo "Updated adminconsole dependencies"
# echo "Updated adminconsole dependencies"

cd ../authserver
# cd ../authserver
2 changes: 1 addition & 1 deletion src/build/build-binaries.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
VERSION="0.8"
VERSION="0.9"
BUILD_DATE=$(date +%Y-%m-%d)
GIT_COMMIT=$(git rev-parse --short HEAD)

Expand Down
2 changes: 1 addition & 1 deletion src/build/build-docker-images.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
VERSION="0.8"
VERSION="0.9"
BUILD_DATE=$(date +%Y-%m-%d)
GIT_COMMIT=$(git rev-parse --short HEAD)

Expand Down
2 changes: 1 addition & 1 deletion src/build/push-docker-images.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
VERSION="0.8"
VERSION="0.9"

echo "Version: $VERSION"

Expand Down

0 comments on commit f0b5d48

Please sign in to comment.