use git commit hash verification when replaying archived games (#204)

This commit is contained in:
evanpelle
2025-03-10 12:40:36 -07:00
committed by GitHub
parent 6a24bce213
commit 5dc00bc3ab
10 changed files with 138 additions and 59 deletions
+1
View File
@@ -395,4 +395,5 @@ export const GameRecordSchema = z.object({
winner: ID.nullable(),
allPlayersStats: z.record(ID, PlayerStatsSchema),
version: z.enum(["v0.0.1"]),
gitCommit: z.string().nullable().optional(),
});
+2
View File
@@ -100,6 +100,8 @@ export interface ServerConfig {
env(): GameEnv;
adminToken(): string;
adminHeader(): string;
// Only available on the server
gitCommit(): string;
}
export interface Config {
+3
View File
@@ -22,6 +22,9 @@ import { pastelTheme } from "./PastelTheme";
import { pastelThemeDark } from "./PastelThemeDark";
export abstract class DefaultServerConfig implements ServerConfig {
gitCommit(): string {
return process.env.GIT_COMMIT;
}
adminHeader(): string {
return "x-admin-key";
}
+3
View File
@@ -23,6 +23,9 @@ export class DevServerConfig extends DefaultServerConfig {
numWorkers(): number {
return 2;
}
gitCommit(): string {
return "DEV";
}
}
export class DevConfig extends DefaultConfig {