mirror of
https://github.com/datarhei/core.git
synced 2025-10-04 15:42:57 +08:00
Add experimental LE certificate retrieval for cluster
This commit is contained in:
@@ -104,6 +104,21 @@ func NewAPI(config APIConfig) (API, error) {
|
||||
return c.JSON(http.StatusOK, Version.String())
|
||||
})
|
||||
|
||||
a.router.GET("/v1/ready", func(c echo.Context) error {
|
||||
origin := c.Request().Header.Get("X-Cluster-Origin")
|
||||
|
||||
if origin == a.id {
|
||||
return Err(http.StatusLoopDetected, "", "breaking circuit")
|
||||
}
|
||||
|
||||
err := a.cluster.IsReady(origin)
|
||||
if err != nil {
|
||||
return Err(http.StatusLocked, "", "not ready yet")
|
||||
}
|
||||
|
||||
return c.JSON(http.StatusOK, "OK")
|
||||
})
|
||||
|
||||
a.router.POST("/v1/server", a.AddServer)
|
||||
a.router.DELETE("/v1/server/:id", a.RemoveServer)
|
||||
|
||||
|
Reference in New Issue
Block a user