diff --git a/Caddyfile b/Caddyfile index de8481e..70f5a51 100644 --- a/Caddyfile +++ b/Caddyfile @@ -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} } diff --git a/docker-compose.yml b/docker-compose.yml index dd09df3..3e6f8f8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: