mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Add healthcheck for auth
This commit is contained in:
parent
adf534b58e
commit
d8ee47a951
6
.github/workflows/robot.yml
vendored
6
.github/workflows/robot.yml
vendored
@ -35,7 +35,7 @@ jobs:
|
||||
run: |
|
||||
docker compose ps -a
|
||||
docker compose logs
|
||||
# wget --retry-connrefused --retry-on-http-error=502 http://localhost:8901/api/health || (docker compose logs && exit 1)
|
||||
wget --retry-connrefused --retry-on-http-error=502 http://localhost:8901/auth/health
|
||||
|
||||
- name: Run robot tests
|
||||
run: |
|
||||
@ -43,7 +43,9 @@ jobs:
|
||||
|
||||
- name: Show logs
|
||||
if: failure()
|
||||
run: docker compose logs
|
||||
run: |
|
||||
docker compose --profile v5 -f docker-compose.build.yml ps -a
|
||||
docker compose --profile v5 -f docker-compose.build.yml logs
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
|
@ -22,4 +22,5 @@ USER nonroot:nonroot
|
||||
|
||||
COPY --from=build /keibi /app/keibi
|
||||
COPY sql ./sql
|
||||
|
||||
CMD ["/app/keibi"]
|
||||
|
@ -53,6 +53,10 @@ func (v *Validator) Validate(i interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (h *Handler) CheckHealth(c echo.Context) error {
|
||||
return c.JSON(200, struct{ Status string }{Status: "healthy"})
|
||||
}
|
||||
|
||||
func OpenDatabase() (*pgxpool.Pool, error) {
|
||||
ctx := context.Background()
|
||||
|
||||
@ -160,9 +164,11 @@ func main() {
|
||||
r := e.Group("")
|
||||
r.Use(echojwt.WithConfig(echojwt.Config{
|
||||
SigningMethod: "RS256",
|
||||
SigningKey: h.config.JwtPublicKey,
|
||||
SigningKey: h.config.JwtPublicKey,
|
||||
}))
|
||||
|
||||
e.GET("/health", h.CheckHealth)
|
||||
|
||||
r.GET("/users", h.ListUsers)
|
||||
r.GET("/users/:id", h.GetUser)
|
||||
r.GET("/users/me", h.GetMe)
|
||||
|
Loading…
x
Reference in New Issue
Block a user