Files
hipctf/types.ts
m0rph3us1987 27566a7813 - Added "HW" (Hardware) category to the platform with a dedicated icon and color
- Updated challenge grid to 6 columns on desktop to accommodate the new category
- Alphabetized challenge categories in the main view and Admin panel selection
- Alphabetized operators list in the Admin panel with case-insensitive sorting
- Restricted visibility of Challenges, Scoreboard, and Score Matrix to authenticated users only
- Secured the /state API endpoint to prevent leaking challenges, solves, teams, or internal IP (dockerIp) to guests
- Implemented server-side verification of user profile in the state response to prevent client-side admin spoofing
- Refactored the /state backend endpoint using async/await for better reliability and error handling
- Rebranded the project from "cypherstrike-ctf" to "hipctf" across package.json, index.html, and server defaults
- Synchronized browser page title with the competition name configured in the Admin panel
- Fixed a "black page" issue by resolving a missing React import and adding frontend sanity checks
2026-03-10 13:29:50 +01:00

58 lines
1.1 KiB
TypeScript

export type Difficulty = 'Low' | 'Medium' | 'High';
export interface ChallengeFile {
name: string;
url: string;
}
export interface Challenge {
id: string;
title: string;
category: string;
difficulty: Difficulty;
description: string;
initialPoints: number;
minimumPoints: number; // Lowest possible points
decaySolves: number; // Solves to reach minimum
flag: string;
files: ChallengeFile[];
solves: string[]; // Team IDs
port?: number;
connectionType?: 'nc' | 'http';
overrideIp?: string;
}
export interface Team {
id: string;
name: string;
password?: string;
isAdmin?: boolean | number;
isDisabled?: boolean | number;
}
export interface Solve {
teamId: string;
challengeId: string;
timestamp: number;
pointsEarned: number; // Not used for dynamic calc but stored for history
}
export interface BlogPost {
id: string;
title: string;
content: string;
timestamp: number;
}
export interface CTFState {
isStarted: boolean;
startTime: number | null;
teams: Team[];
challenges: Challenge[];
solves: Solve[];
blogs: BlogPost[];
config: Record<string, string>;
user?: Team | null;
}