mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-02 21:24:20 -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: |
|
run: |
|
||||||
docker compose ps -a
|
docker compose ps -a
|
||||||
docker compose logs
|
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
|
- name: Run robot tests
|
||||||
run: |
|
run: |
|
||||||
@ -43,7 +43,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Show logs
|
- name: Show logs
|
||||||
if: failure()
|
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
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
@ -22,4 +22,5 @@ USER nonroot:nonroot
|
|||||||
|
|
||||||
COPY --from=build /keibi /app/keibi
|
COPY --from=build /keibi /app/keibi
|
||||||
COPY sql ./sql
|
COPY sql ./sql
|
||||||
|
|
||||||
CMD ["/app/keibi"]
|
CMD ["/app/keibi"]
|
||||||
|
@ -53,6 +53,10 @@ func (v *Validator) Validate(i interface{}) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (h *Handler) CheckHealth(c echo.Context) error {
|
||||||
|
return c.JSON(200, struct{ Status string }{Status: "healthy"})
|
||||||
|
}
|
||||||
|
|
||||||
func OpenDatabase() (*pgxpool.Pool, error) {
|
func OpenDatabase() (*pgxpool.Pool, error) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
@ -160,9 +164,11 @@ func main() {
|
|||||||
r := e.Group("")
|
r := e.Group("")
|
||||||
r.Use(echojwt.WithConfig(echojwt.Config{
|
r.Use(echojwt.WithConfig(echojwt.Config{
|
||||||
SigningMethod: "RS256",
|
SigningMethod: "RS256",
|
||||||
SigningKey: h.config.JwtPublicKey,
|
SigningKey: h.config.JwtPublicKey,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
e.GET("/health", h.CheckHealth)
|
||||||
|
|
||||||
r.GET("/users", h.ListUsers)
|
r.GET("/users", h.ListUsers)
|
||||||
r.GET("/users/:id", h.GetUser)
|
r.GET("/users/:id", h.GetUser)
|
||||||
r.GET("/users/me", h.GetMe)
|
r.GET("/users/me", h.GetMe)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user