Skip to content

Commit

Permalink
Add flag to enable/disable metrics endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
vuongxuongminh committed Apr 18, 2022
1 parent 9a426ce commit 55b6f57
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@
}

@admin_auth {
method POST
path /admin/graphql
method POST
expression `{$GBOX_ENABLED_CACHING:true} == true && {$GBOX_ENABLED_ADMIN_AUTH:false} == true`
}

@metrics {
path {$GBOX_METRICS_PATH:/metrics}
method GET
expression `{$GBOX_ENABLED_METRICS:false} == true`
}

route {
encode gzip
metrics {$GBOX_METRICS_PATH:/metrics}
metrics @metrics
basicauth @admin_auth bcrypt {
{$GBOX_ADMIN_USERNAME:gbox} {$GBOX_ADMIN_PASSWORD:JDJhJDE0JHBXUk5YMjVRYlRtTjN3SERiU0Rrei4uMW4ub0FhaHZlY0hnbWtBMUNSLnhmeEUuUDVOOW5l}
}
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ services:
GBOX_STORE_DSN: redis://redis:6379
GBOX_SERVER_HOST: :80
GBOX_UPSTREAM: https://countries.trevorblades.com/
GBOX_ENABLED_METRICS: 'true'
GBOX_GLOBAL_DIRECTIVES: |
debug
redis:
Expand Down

0 comments on commit 55b6f57

Please sign in to comment.