Files
MythEclipse c6fd9ec268 feat: challenge registry-driven platform + XVI/XVII imports + admin toggle + domain rename
- Rename repo/domain: attack-defense-platform / attackdefense.imrnes.team (all refs replaced)
- challenge_registry.json: single source of truth (28 challs across gemastik18/xvi/xvii)
- teams.py: registry-driven CHALLENGES, set_challenge_enabled, sync_challenge_runtime
  (apply enable/disable to live teams: build/up or stop/remove + receiver restart)
- compose_gen.py: render per-team compose from canonical per-challenge templates
  (image reuse, per-team ports 30xxx, flag mounts, passwords)
- gen_canonical_composes.py: canonical docker-compose.yml for all services
- import_new_challenges.py: import XVI/XVII services + EOL base image fixes
  (debian:buster→bookworm, node:14→20, python:3.7-slim→3.11)
- receiver: xvi package (10 checkers) + xvii package (12 generic checkers),
  Challenge base reads PASSWORD_<team_port> from env; gen_receiver_main.py
  generates per-team main.py from registry
- main.py: /api/challenges returns full registry; PATCH /api/challenges/<name>
  toggles enabled + applies to live teams
- index.html: 🏗️ Challenge Manager tab (toggle per challenge, grouped by set)
- SLA bonus now dynamic (all enabled challenges, not hardcoded 6)
2026-09-25 14:04:33 +08:00

52 lines
2.6 KiB
Handlebars

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>kode-viewer</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<div class="flex flex-col h-full w-full">
{{> navbar}}
<main class="flex flex-col items-center h-full w-full my-5 gap-4">
<form class="flex h-10 w-1/2" action="/kode/find" method="POST">
<div class="flex flex-row justify-center items-center h h-full w-full gap-4">
<input
class="flex w-5/6 bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 w-full rounded-lg px-4 py-2 border border-neutral-400 focus:border-primary focus:ring-primary"
placeholder="Search items..."
type="search"
id="pattern"
name="pattern"
required
/>
<button type="submit" class="h-10 rounded-md text-md w-1/6 bg-blue-500 hover:bg-blue-700 text-white font-bold border border-blue-700 rounded">
Search
</button>
</div>
</form>
<div class="w-full gap-4">
<a class="w-full flex justify-center items-center" href="/kode/create">
<button class="h-10 rounded-md text-md w-1/2 bg-blue-500 hover:bg-blue-700 text-white font-bold border border-blue-700 rounded">
Create
</button>
</a>
</div>
{{#if kodes}}
{{#each kodes}}
<a href="/kode/{{ this.id }}" class="block flex flex-col p-6 w-1/2 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 gap-2 justify-center items-center">
<h5 class="mb-2 text-2xl font-bold tracking-tight">{{ this.name }}</h5>
<div class="gap-1">
<span class="bg-blue-500 text-white text-md font-medium me-2 px-2.5 py-1 rounded-full">{{ this.kind }}</span>
<span class="bg-gray-900 text-white text-md font-medium me-2 px-2.5 py-1 rounded-full">{{ this.email }}</span>
<span class="bg-blue-500 text-white text-md font-medium me-2 px-2.5 py-1 rounded-full">{{ this.lang }}</span>
</div>
</a>
{{/each}}
{{else}}
<div class="flex flex-col items-center justify-center gap-4">
<h1 class="text-muted-foreground text-gray-500 md:text-xl">No kodes found</h1>
</div>
{{/if}}
</main>
</div>
</html>