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
1 change: 1 addition & 0 deletions doc/specs/examples/server-getServerVersion.json.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
value: { "server": { "date": "2026-10-28T07:25:58Z", "commit": "b551752d2a0e7a63459d9812825d95a633a98737" } }
6 changes: 6 additions & 0 deletions doc/specs/lichess-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ tags:
- Each user blog exposes an atom (RSS) feed, like <https://lichess.org/@/thibault/blog.atom>
- User blogs mashup feed: https://lichess.org/blog/community.atom
- User blogs mashup feed for a language: https://lichess.org/blog/community/fr.atom
- name: Server
description: |
Information about Lichess
- name: OAuth
description: |
Obtaining and revoking OAuth tokens.
Expand Down Expand Up @@ -388,6 +391,9 @@ paths:
/bookmark/{gameId}:
$ref: "./tags/games/bookmark-gameId.yaml"

/api/version:
$ref: "./tags/server/api-version.yaml"

/api/tv/channels:
$ref: "./tags/tv/api-tv-channels.yaml"

Expand Down
40 changes: 40 additions & 0 deletions doc/specs/tags/server/api-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
get:
operationId: apiVersion
summary: Get server version
description: |
Get the date and git commit of the server code currently deployed.
Source code: [github.com/lichess-org/lila](https://github.com/lichess-org/lila).
tags:
- Server
security: []
responses:
"200":
description: The server version.
headers:
Access-Control-Allow-Origin:
schema:
type: string
default: "'*'"
content:
application/json:
schema:
type: object
required:
- server
properties:
server:
type: object
required:
- date
- commit
properties:
date:
type: string
format: date-time
description: When the deployed server was built
commit:
type: string
description: Git commit hash of the deployed lila version
examples:
default:
$ref: "../../examples/server-getServerVersion.json.yaml"
2 changes: 1 addition & 1 deletion scripts/update-examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Or only some of them, by name:
bun index.ts account tv
```

Each script is a file in this directory: `account`, `analysis`, `arenas`, `board`, `bot`, `broadcasts`, `bulk-pairings`, `challenges`, `external-engine`, `fide`, `games`, `messaging`, `oauth`, `opening-explorer`, `puzzles`, `relations`, `simuls`, `studies`, `swiss`, `tablebase`, `teams`, `tv`, `users`.
Each script is a file in this directory: `account`, `analysis`, `arenas`, `board`, `bot`, `broadcasts`, `bulk-pairings`, `challenges`, `external-engine`, `fide`, `games`, `messaging`, `oauth`, `opening-explorer`, `puzzles`, `relations`, `server`, `simuls`, `studies`, `swiss`, `tablebase`, `teams`, `tv`, `users`.

`board` and `bot` take about a minute: a victory or a draw can only be claimed once the opponent has been gone for that long.

Expand Down
2 changes: 2 additions & 0 deletions scripts/update-examples/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import oauth from "./oauth";
import openingExplorer from "./opening-explorer";
import puzzles from "./puzzles";
import relations from "./relations";
import server from "./server";
import simuls from "./simuls";
import studies from "./studies";
import swiss from "./swiss";
Expand All @@ -39,6 +40,7 @@ const scripts: Record<string, () => Promise<void>> = {
"opening-explorer": openingExplorer,
puzzles,
relations,
server,
simuls,
studies,
swiss,
Expand Down
9 changes: 9 additions & 0 deletions scripts/update-examples/server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { example, prodClient } from "./config";

export default async function server() {
await example(
"server",
"getServerVersion",
prodClient().GET("/api/version"),
);
}
Loading