Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions auth/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ info:
description: |
Authentication service API for registration, login, logout, token refresh, and internal JWT verification.
servers:
- url: http://localhost
- url: https://localhost
description: Public entrypoint through Nginx
- url: http://auth:3001
description: Internal Docker network endpoint

tags:
- name: Auth
Expand Down Expand Up @@ -236,11 +234,6 @@ paths:
tags: [Internal]
summary: Prometheus metrics
security: []
servers:
- url: http://auth:3001
description: Internal Docker network endpoint
- url: http://localhost:3001
description: Local direct service endpoint
responses:
'200':
description: Metrics payload
Expand Down
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,22 @@ services:
networks:
- monitor-net

swagger-ui:
image: swaggerapi/swagger-ui
container_name: swagger-ui
expose:
- "8080"
environment:
BASE_URL: /openapis
URLS: '[{"url":"/openapis/specs/users.yaml","name":"Users Service"},{"url":"/openapis/specs/auth.yaml","name":"Auth Service"},{"url":"/openapis/specs/gameservice.yaml","name":"Game Service"},{"url":"/openapis/specs/gamey.yaml","name":"Gamey Bot Server"}]'
URLS_PRIMARY_NAME: "Users Service"
volumes:
- ./users/openapi.yaml:/usr/share/nginx/html/specs/users.yaml:ro
- ./auth/openapi.yaml:/usr/share/nginx/html/specs/auth.yaml:ro
- ./gameservice/openapi.yaml:/usr/share/nginx/html/specs/gameservice.yaml:ro
- ./gamey/openapi.yaml:/usr/share/nginx/html/specs/gamey.yaml:ro
networks:
- monitor-net
nginx:
image: nginx:alpine
container_name: nginx_proxy
Expand All @@ -196,6 +212,7 @@ services:
- gameservice
- auth
- redis
- swagger-ui
networks:
- monitor-net
restart: unless-stopped
Expand Down
6 changes: 2 additions & 4 deletions gamey/openapi.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
openapi: 3.1.0
openapi: 3.0.3
info:
title: Gamey Bot Server API
description: REST API exposed by the Rust Game Y engine and bot server.
version: 1.0.0

servers:
- url: http://localhost:4000
description: Local Docker/default server port
- url: /api/gamey
description: Public gateway path through Nginx

Expand Down Expand Up @@ -128,7 +126,7 @@ paths:
- name: bot_id
in: query
required: false
description: Bot id or alias. Defaults to `random`.
description: Bot id or alias. Defaults to `impossible`.
schema:
type: string
responses:
Expand Down
2 changes: 1 addition & 1 deletion gamey/src/bot_server/play.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub async fn play(
))
})?;

let bot_id = req.bot_id.unwrap_or_else(|| "random".to_string());
let bot_id = req.bot_id.unwrap_or_else(|| "impossible".to_string());
let resolved_id = state.resolve_bot_id(&bot_id);

let bot = state.bots().find(resolved_id).ok_or_else(|| {
Expand Down
8 changes: 7 additions & 1 deletion nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,13 @@ http {
proxy_redirect off;
}


location ^~ /openapis/ {
proxy_pass http://swagger-ui:8080/openapis/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}

location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
proxy_pass http://webapp_backend;
Expand Down
12 changes: 0 additions & 12 deletions users/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ info:
servers:
- url: /api/users
description: Public gateway path through Nginx
- url: http://users:3000/api/users
description: Internal Docker network endpoint

tags:
- name: Profiles
Expand All @@ -27,11 +25,6 @@ paths:
get:
tags: [Operations]
summary: Service health/info endpoint
servers:
- url: /
description: Service root path
- url: http://users:3000
description: Internal Docker network endpoint
responses:
'200':
description: Service is running
Expand Down Expand Up @@ -630,11 +623,6 @@ paths:
get:
tags: [Operations]
summary: Prometheus metrics
servers:
- url: /
description: Service root path
- url: http://users:3000
description: Internal Docker network endpoint
responses:
'200':
description: Metrics payload
Expand Down
Loading