add trailer to homepage
deploy / build-and-deploy (push) Successful in 20s

This commit is contained in:
bytedream committed 2026-10-31 15:39:49 +01:00
1 parent 6eb1bb6172
commit fa8d834f4a
7 files changed
+90 -26

No files matched your search

+1
View File
@@ -8,6 +8,7 @@ ADMIN_COOKIE=muelleel
UPLOAD_PATH=/tmp/uploads UPLOAD_PATH=/tmp/uploads
VIDEO_PATH=/tmp/videos VIDEO_PATH=/tmp/videos
HOMEPAGE_TRAILER_URL=http://localhost:4321/craftattack/video/trailer/embed
TEAMSPEAK_LINK=http://example.com TEAMSPEAK_LINK=http://example.com
DISCORD_LINK=http://example.com DISCORD_LINK=http://example.com
+25 -24
View File
@@ -306,27 +306,28 @@ Alle Webhooks:
## Environment Variables ## Environment Variables
| Name | Default | Beschreibung | | Name | Default | Beschreibung |
| --------------------- | -------------------------- | -------------------------------------------------------------------------------------------------- | | ---------------------- | -------------------------- | -------------------------------------------------------------------------------------------------- |
| `HOST` | `0.0.0.0` | Bind-Adresse des Webservers | | `HOST` | `0.0.0.0` | Bind-Adresse des Webservers |
| `PORT` | `8080` | Port des Webservers | | `PORT` | `8080` | Port des Webservers |
| `ROOT_URL` | `http://localhost:4321` | Vollständige öffentliche URL inklusive Subpath | | `ROOT_URL` | `http://localhost:4321` | Vollständige öffentliche URL inklusive Subpath |
| `DATABASE_URI` | - | MariaDB URI. Muss gesetzt sein. | | `DATABASE_URI` | - | MariaDB URI. Muss gesetzt sein. |
| `API_SECRET` | - | Basic-Auth-Passwort für externe API-Endpunkte. Ohne Wert ist die API-Authentifizierung deaktiviert | | `API_SECRET` | - | Basic-Auth-Passwort für externe API-Endpunkte. Ohne Wert ist die API-Authentifizierung deaktiviert |
| `ADMIN_USER` | - | Benutzername für den default Admin User. Ohne Wert ist der Admin User deaktiviert | | `ADMIN_USER` | - | Benutzername für den default Admin User. Ohne Wert ist der Admin User deaktiviert |
| `ADMIN_PASSWORD` | - | Passwort für den default Admin User. Ohne Wert ist der Admin User deaktiviert | | `ADMIN_PASSWORD` | - | Passwort für den default Admin User. Ohne Wert ist der Admin User deaktiviert |
| `ADMIN_COOKIE` | `muelleel` | Name des Admin-Session-Cookies | | `ADMIN_COOKIE` | `muelleel` | Name des Admin-Session-Cookies |
| `UPLOAD_PATH` | - | Verzeichnis für Report-Anhänge. Ohne Wert sind Uploads deaktiviert | | `UPLOAD_PATH` | - | Verzeichnis für Report-Anhänge. Ohne Wert sind Uploads deaktiviert |
| `VIDEO_PATH` | - | Verzeichnis für Videos. Ohne Wert sind die Video-Routen deaktiviert | | `VIDEO_PATH` | - | Verzeichnis für Videos. Ohne Wert sind die Video-Routen deaktiviert |
| `CACHE_PATH` | OS-Temp-Verzeichnis | Verzeichnis für generierte Caches, z.B. Video Thumbnails | | `HOMEPAGE_TRAILER_URL` | - | URL des Trailers, der auf der Startseite per Iframe eingebettet wird |
| `MAX_UPLOAD_BYTES` | `20971520` | Maximale Gesamtgröße aller Report-Anhänge eines Reports in Bytes | | `CACHE_PATH` | OS-Temp-Verzeichnis | Verzeichnis für generierte Caches, z.B. Video Thumbnails |
| `START_DATE` | `1970-01-01` | Startdatum/Startzeit für Countdown und Anmeldung | | `MAX_UPLOAD_BYTES` | `20971520` | Maximale Gesamtgröße aller Report-Anhänge eines Reports in Bytes |
| `WEBHOOK_ENDPOINT` | - | Kommaseparierte Liste von Webhook-URLs | | `START_DATE` | `1970-01-01` | Startdatum/Startzeit für Countdown und Anmeldung |
| `STATISTICS_ENDPOINT` | - | Endpoint für Live-Statistiken. Ohne Wert werden keine Statistiken geladen | | `WEBHOOK_ENDPOINT` | - | Kommaseparierte Liste von Webhook-URLs |
| `STATISTICS_INTERVAL` | `1800` | Abfrageintervall für Live-Statistiken in Sekunden | | `STATISTICS_ENDPOINT` | - | Endpoint für Live-Statistiken. Ohne Wert werden keine Statistiken geladen |
| `TEAMSPEAK_LINK` | `http://example.com` | Link zum TeamSpeak-Server | | `STATISTICS_INTERVAL` | `1800` | Abfrageintervall für Live-Statistiken in Sekunden |
| `DISCORD_LINK` | `http://example.com` | Link zum Discord-Server | | `TEAMSPEAK_LINK` | `http://example.com` | Link zum TeamSpeak-Server |
| `PAYPAL_LINK` | `http://example.com` | Link für PayPal Spenden | | `DISCORD_LINK` | `http://example.com` | Link zum Discord-Server |
| `SERVER_IP` | `http://example.com` | Öffentliche Minecraft-Server-Adresse | | `PAYPAL_LINK` | `http://example.com` | Link für PayPal Spenden |
| `OPENXBL_API_KEY` | - | API-Key für die Xbox-/Bedrock-UUID-Suche. Ohne Key schlägt die Bedrock-UUID-Ermittlung fehl | | `SERVER_IP` | `http://example.com` | Öffentliche Minecraft-Server-Adresse |
| `LOG_LEVEL` | Dev: `debug`, Prod: `warn` | Log-Level, als `trace`, `debug`, `info`, `warn` oder `error` | | `OPENXBL_API_KEY` | - | API-Key für die Xbox-/Bedrock-UUID-Suche. Ohne Key schlägt die Bedrock-UUID-Ermittlung fehl |
| `LOG_LEVEL` | Dev: `debug`, Prod: `warn` | Log-Level, als `trace`, `debug`, `info`, `warn` oder `error` |
+2
View File
@@ -55,6 +55,8 @@ export default defineConfig({
PAYPAL_LINK: envField.string({ context: 'server', access: 'secret', default: 'http://example.com' }), PAYPAL_LINK: envField.string({ context: 'server', access: 'secret', default: 'http://example.com' }),
SERVER_IP: envField.string({ context: 'server', access: 'secret', default: 'http://example.com' }), SERVER_IP: envField.string({ context: 'server', access: 'secret', default: 'http://example.com' }),
HOMEPAGE_TRAILER_URL: envField.string({ context: 'server', access: 'secret', optional: true }),
DATABASE_URI: envField.string({ context: 'server', access: 'secret' }), DATABASE_URI: envField.string({ context: 'server', access: 'secret' }),
ROOT_URL: envField.string({ context: 'server', access: 'secret', default: 'http://localhost:4321' }), ROOT_URL: envField.string({ context: 'server', access: 'secret', default: 'http://localhost:4321' }),
+1
View File
@@ -44,6 +44,7 @@
UPLOAD_PATH = "./.data/uploads"; UPLOAD_PATH = "./.data/uploads";
VIDEO_PATH = "./.data/videos"; VIDEO_PATH = "./.data/videos";
HOMEPAGE_TRAILER_URL = "http://localhost:4321/craftattack/video/out-final-final/embed";
TEAMSPEAK_LINK = "http://example.com"; TEAMSPEAK_LINK = "http://example.com";
DISCORD_LINK = "http://example.com"; DISCORD_LINK = "http://example.com";
+1 -1
View File
@@ -55,7 +55,7 @@ export const report = {
} }
let totalFilesSize = 0; let totalFilesSize = 0;
for (const file of (input.files ?? [])) { for (const file of input.files ?? []) {
const realType = mime.getType(file.name); const realType = mime.getType(file.name);
if (realType != file.type) { if (realType != file.type) {
throw new ActionError({ throw new ActionError({
+35 -1
View File
@@ -4,8 +4,9 @@ import Countdown from '@app/website/index/Countdown.svelte';
import LiveStats from '@app/website/index/LiveStats.svelte'; import LiveStats from '@app/website/index/LiveStats.svelte';
import Craftattack from '@assets/img/craftattack.webp'; import Craftattack from '@assets/img/craftattack.webp';
import Background from '@assets/img/background.webp'; import Background from '@assets/img/background.webp';
import { START_DATE } from 'astro:env/server'; import { HOMEPAGE_TRAILER_URL, START_DATE } from 'astro:env/server';
import { getSetting, SettingKey } from '@util/settings'; import { getSetting, SettingKey } from '@util/settings';
import { siteUrl } from '@util/url.ts';
import { db } from '@db/database.ts'; import { db } from '@db/database.ts';
const signupEnabled = await getSetting(db, SettingKey.SignupEnabled, false); const signupEnabled = await getSetting(db, SettingKey.SignupEnabled, false);
@@ -72,6 +73,39 @@ const information = [
</div> </div>
</div> </div>
{HOMEPAGE_TRAILER_URL && (
<section class="bg-base-300 w-full px-4 py-12" aria-labelledby="trailer-heading">
<div class="mx-auto flex items-center w-full max-w-7xl gap-30">
<iframe
class="aspect-video w-full border-0"
src={HOMEPAGE_TRAILER_URL}
title="CraftAttack 9 Trailer"
allow="autoplay; fullscreen; picture-in-picture; encrypted-media"
allowfullscreen
loading="lazy"
></iframe>
<div class="hidden items-center gap-2 lg:flex" aria-hidden="true">
<span class="h-60 w-1 rotate-12 rounded-full bg-base-content/30"></span>
<span class="h-60 w-1 rotate-12 rounded-full bg-base-content/30"></span>
</div>
<div class="space-y-4">
<h2 id="trailer-heading" class="text-2xl font-bold">
CraftAttack geht in die neunte Runde - und du kannst dabei sein!
</h2>
<p class="leading-relaxed text-base-content/80">
Die Teilnahme ist kostenlos. Am 27. Dezember 2026 startet CraftAttack 9 – die Anmeldung ist ab dem 1.
Dezember 2026 möglich.
</p>
<p class="leading-relaxed text-base-content/80">
Alle Informationen zum Projekt und zur Teilnahme findest du unter hier.
</p>
</div>
</div>
</section>
)}
<div class="flex justify-center py-20 bg-base-200"> <div class="flex justify-center py-20 bg-base-200">
<div class="card bg-base-100 shadow-lg w-11/12 xl:w-5/12 p-10"> <div class="card bg-base-100 shadow-lg w-11/12 xl:w-5/12 p-10">
<div> <div>
+25
View File
@@ -0,0 +1,25 @@
---
import '@styles/websiteLayout.css';
import BaseLayout from '@layouts/BaseLayout.astro';
import VideoPlayer from '@app/website/video/VideoPlayer.svelte';
import { getVideoMetadata, resolveVideo } from '@util/video.ts';
import { siteUrl } from '@util/url.ts';
const { name } = Astro.params;
const video = name ? await resolveVideo(name) : null;
if (!video) return new Response(null, { status: 404 });
const metadata = await getVideoMetadata(video);
const title = metadata?.title ?? video.name;
const streamUrl = siteUrl(`video/${encodeURIComponent(video.name)}/stream`);
const thumbnailUrl = siteUrl(`video/${encodeURIComponent(video.name)}/thumbnail.jpg`);
---
<BaseLayout title={title}>
<div class="flex min-h-dvh w-full items-center justify-center overflow-hidden bg-black">
<div class="w-full max-w-[calc(100dvh*16/9)]">
<VideoPlayer client:load src={streamUrl} type={video.contentType} title={title} poster={thumbnailUrl} />
</div>
</div>
</BaseLayout>