branch bow-v2-go updated (fc81b7a -> 092aa56)
This is an automated email from the git hooks/post-receive script. New change to branch bow-v2-go in repository bow. See https://gitlab.nuiton.org/chorem/bow.git from fc81b7a Diverses petites retouches graphiques new c8948f5 ajout du monitoring new 13fdcbd Ajout Caddy new 61ffa37 Ajout healthchecks new 092aa56 modification resource memoire pour bow The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 092aa56b313f88f08da7d43bc50730c1e7bc21ca Author: Benjamin <poussin@codelutin.com> Date: Tue Aug 18 17:55:53 2020 +0200 modification resource memoire pour bow commit 61ffa37911eb490a4b322a2bfacade3f92d93be7 Author: Andrés Maldonado <amaldona@etu.utc.fr> Date: Tue Aug 18 15:13:02 2020 +0200 Ajout healthchecks Signed-off-by: Benjamin <poussin@codelutin.com> commit 13fdcbdc86ebe1223e4eec7c6a5b7a9d076c9a32 Author: Andrés Maldonado <amaldona@etu.utc.fr> Date: Mon Aug 17 18:25:46 2020 +0200 Ajout Caddy https://gitlab.nuiton.org/codelutin/admsys/infra/issues/9 Signed-off-by: Benjamin <poussin@codelutin.com> commit c8948f5c54f68f5993db775595281f0a67b3d494 Author: Benjamin <poussin@codelutin.com> Date: Tue Aug 18 17:51:37 2020 +0200 ajout du monitoring Summary of changes: docker/docker-compose.yml | 20 ++++++++++++++++++-- go.mod | 1 + go.sum | 1 + pkg/http/router.go | 7 ++++++- 4 files changed, 26 insertions(+), 3 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch bow-v2-go in repository bow. See https://gitlab.nuiton.org/chorem/bow.git commit c8948f5c54f68f5993db775595281f0a67b3d494 Author: Benjamin <poussin@codelutin.com> Date: Tue Aug 18 17:51:37 2020 +0200 ajout du monitoring --- go.mod | 1 + go.sum | 1 + pkg/http/router.go | 7 ++++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index d6dd960..7ca9eaa 100644 --- a/go.mod +++ b/go.mod @@ -11,5 +11,6 @@ require ( github.com/mitchellh/go-server-timing v1.0.0 github.com/pkg/errors v0.9.1 // indirect golang.org/x/crypto v0.0.0-20200403201458-baeed622b8d8 + golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect ) diff --git a/go.sum b/go.sum index 8ef6f3d..ac0f52b 100644 --- a/go.sum +++ b/go.sum @@ -134,6 +134,7 @@ golang.org/x/crypto v0.0.0-20200403201458-baeed622b8d8/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 h1:fHDIZ2oxGnUZRN6WgWFCbYBjH9uqVPRCUVUDhs0wnbA= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/pkg/http/router.go b/pkg/http/router.go index bb792ea..daeb414 100644 --- a/pkg/http/router.go +++ b/pkg/http/router.go @@ -2,6 +2,9 @@ package http import ( "context" + // ajout du monitoring de go (memoire, allocation, ...) + // endpoint /debug/vars + "expvar" "fmt" "io" "log" @@ -36,11 +39,13 @@ func Start(bowPublicURL string, addr string) { // router.Use(mux.CORSMethodMiddleware(router)) router.Use(cors) router.Use(authentication) + // router.Handle("/debug/{*}", http.DefaultServeMux) // router.HandleFunc("/", handler404) s := router.PathPrefix("/api/v1").Subrouter() s.HandleFunc("/system/liveness", isAlive).Methods(http.MethodGet, http.MethodOptions) + s.Handle("/system/metrics", expvar.Handler()).Methods(http.MethodGet, http.MethodOptions) s.HandleFunc("/system/stats", getStats).Methods(http.MethodGet, http.MethodOptions) s.HandleFunc("/users", createUser).Methods(http.MethodPost, http.MethodOptions) s.HandleFunc("/users/auth", createAuth).Methods(http.MethodPost, http.MethodOptions) @@ -143,7 +148,7 @@ func withoutAuthenticationEndpoint(r *http.Request) bool { } func needAdminEndpoint(r *http.Request) bool { - result := strings.HasSuffix(r.URL.Path, "/system/stats") + result := strings.HasSuffix(r.URL.Path, "/system/") return result } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch bow-v2-go in repository bow. See https://gitlab.nuiton.org/chorem/bow.git commit 13fdcbdc86ebe1223e4eec7c6a5b7a9d076c9a32 Author: Andrés Maldonado <amaldona@etu.utc.fr> Date: Mon Aug 17 18:25:46 2020 +0200 Ajout Caddy https://gitlab.nuiton.org/codelutin/admsys/infra/issues/9 Signed-off-by: Benjamin <poussin@codelutin.com> --- docker/docker-compose.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index f03e596..bf85337 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -3,6 +3,8 @@ version: '3.7' networks: traefik-net: external: true + caddy: + external: true volumes: postgresql_data: @@ -43,6 +45,7 @@ services: image: registry.nuiton.org/chorem/bow:$CI_COMMIT_REF_SLUG networks: - traefik-net + - caddy - default environment: DATABASE_URL: 'postgres://dbuser:xxxxxxxx@database:5432/bow' @@ -71,3 +74,5 @@ services: - traefik.http.routers.bow.entrypoints=https - traefik.http.routers.bow.tls=true - traefik.http.routers.bow.tls.certresolver=codelutin + - caddy=bookmarks.cl + - caddy.reverse_proxy="{{upstreams 8000}}" -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch bow-v2-go in repository bow. See https://gitlab.nuiton.org/chorem/bow.git commit 61ffa37911eb490a4b322a2bfacade3f92d93be7 Author: Andrés Maldonado <amaldona@etu.utc.fr> Date: Tue Aug 18 15:13:02 2020 +0200 Ajout healthchecks Signed-off-by: Benjamin <poussin@codelutin.com> --- docker/docker-compose.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index bf85337..6b0c10f 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -40,6 +40,12 @@ services: reservations: cpus: '0.02' memory: 50M + healthcheck: + test: pg_isready -q -d ${POSTGRES_DB} -U ${POSTGRES_USER} || exit 1 + interval: 1m30s + timeout: 10s + retries: 3 + start_period: 3m bow: image: registry.nuiton.org/chorem/bow:$CI_COMMIT_REF_SLUG @@ -76,3 +82,9 @@ services: - traefik.http.routers.bow.tls.certresolver=codelutin - caddy=bookmarks.cl - caddy.reverse_proxy="{{upstreams 8000}}" + # healthcheck: + # test: bow --healthcheck # À implémenter + # interval: 1m30s + # timeout: 10s + # retries: 3 + # start_period: 3m -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch bow-v2-go in repository bow. See https://gitlab.nuiton.org/chorem/bow.git commit 092aa56b313f88f08da7d43bc50730c1e7bc21ca Author: Benjamin <poussin@codelutin.com> Date: Tue Aug 18 17:55:53 2020 +0200 modification resource memoire pour bow --- docker/docker-compose.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 6b0c10f..c949cdd 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -32,7 +32,6 @@ services: placement: constraints: - node.labels.function==saas - - node.labels.hosttype==s1-8 resources: # limits: # cpus: '0.60' @@ -72,7 +71,7 @@ services: # memory: 200M reservations: cpus: '0.02' - memory: 60M + memory: 13M labels: - traefik.enable=true - traefik.http.routers.bow.rule=Host(`bookmarks.cl`) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm