add env variable to disable direct invitation links
This commit is contained in:
1 parent
b40665c2d7
commit
14fa022dd3
7 files changed
+55
-37
No files matched your search
@@ -8,6 +8,7 @@ ADMIN_COOKIE=muelleel
|
|||||||
|
|
||||||
UPLOAD_PATH=/tmp/uploads
|
UPLOAD_PATH=/tmp/uploads
|
||||||
VIDEO_PATH=/tmp/videos
|
VIDEO_PATH=/tmp/videos
|
||||||
|
DIRECT_INVITATION_LINKS_ENABLED=true
|
||||||
HOMEPAGE_TRAILER_URL=http://localhost:4321/craftattack/video/trailer/embed
|
HOMEPAGE_TRAILER_URL=http://localhost:4321/craftattack/video/trailer/embed
|
||||||
|
|
||||||
TEAMSPEAK_LINK=http://example.com
|
TEAMSPEAK_LINK=http://example.com
|
||||||
|
|||||||
@@ -327,28 +327,29 @@ 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 |
|
||||||
| `HOMEPAGE_TRAILER_URL` | - | URL des Trailers, der auf der Startseite per Iframe eingebettet wird |
|
| `DIRECT_INVITATION_LINKS_ENABLED` | `true` | Ob direkte Einladungslinks unter `/signup/{code}` erreichbar sind |
|
||||||
| `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` |
|
||||||
@@ -41,6 +41,8 @@ export default defineConfig({
|
|||||||
UPLOAD_PATH: envField.string({ context: 'server', access: 'secret', optional: true }),
|
UPLOAD_PATH: envField.string({ context: 'server', access: 'secret', optional: true }),
|
||||||
VIDEO_PATH: envField.string({ context: 'server', access: 'secret', optional: true }),
|
VIDEO_PATH: envField.string({ context: 'server', access: 'secret', optional: true }),
|
||||||
|
|
||||||
|
DIRECT_INVITATION_LINKS_ENABLED: envField.boolean({ context: 'server', access: 'secret', default: true }),
|
||||||
|
|
||||||
MAX_UPLOAD_BYTES: envField.number({ context: 'server', access: 'secret', default: 20 * 1024 * 1024 }),
|
MAX_UPLOAD_BYTES: envField.number({ context: 'server', access: 'secret', default: 20 * 1024 * 1024 }),
|
||||||
|
|
||||||
START_DATE: envField.string({ context: 'server', access: 'secret', default: '1970-01-01' }),
|
START_DATE: envField.string({ context: 'server', access: 'secret', default: '1970-01-01' }),
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
|
|
||||||
UPLOAD_PATH = "./.data/uploads";
|
UPLOAD_PATH = "./.data/uploads";
|
||||||
VIDEO_PATH = "./.data/videos";
|
VIDEO_PATH = "./.data/videos";
|
||||||
|
DIRECT_INVITATION_LINKS_ENABLED = "true";
|
||||||
HOMEPAGE_TRAILER_URL = "http://localhost:4321/craftattack/video/out-final-final/embed";
|
HOMEPAGE_TRAILER_URL = "http://localhost:4321/craftattack/video/out-final-final/embed";
|
||||||
|
|
||||||
TEAMSPEAK_LINK = "http://example.com";
|
TEAMSPEAK_LINK = "http://example.com";
|
||||||
|
|||||||
@@ -9,6 +9,13 @@
|
|||||||
directInvitations
|
directInvitations
|
||||||
} from '@app/admin/directInvitations/directInvitations.ts';
|
} from '@app/admin/directInvitations/directInvitations.ts';
|
||||||
|
|
||||||
|
// props
|
||||||
|
interface Props {
|
||||||
|
linksEnabled: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
let { linksEnabled }: Props = $props();
|
||||||
|
|
||||||
// state
|
// state
|
||||||
let directInvitationEditPopupDirectInvitation = $state(null);
|
let directInvitationEditPopupDirectInvitation = $state(null);
|
||||||
let directInvitationEditPopupOpen = $derived(!!directInvitationEditPopupDirectInvitation);
|
let directInvitationEditPopupOpen = $derived(!!directInvitationEditPopupDirectInvitation);
|
||||||
@@ -59,17 +66,19 @@
|
|||||||
{/snippet}
|
{/snippet}
|
||||||
|
|
||||||
{#snippet extraActions(directInvitation)}
|
{#snippet extraActions(directInvitation)}
|
||||||
<button
|
{#if linksEnabled}
|
||||||
class="cursor-pointer"
|
<button
|
||||||
title={copiedCode === directInvitation.code ? 'Link kopiert' : 'Link kopieren'}
|
class="cursor-pointer"
|
||||||
onclick={() => copyLink(directInvitation)}
|
title={copiedCode === directInvitation.code ? 'Link kopiert' : 'Link kopieren'}
|
||||||
>
|
onclick={() => copyLink(directInvitation)}
|
||||||
{#if copiedCode === directInvitation.code}
|
>
|
||||||
<span class="iconify iconify-[heroicons--clipboard-document-check]"></span>
|
{#if copiedCode === directInvitation.code}
|
||||||
{:else}
|
<span class="iconify iconify-[heroicons--clipboard-document-check]"></span>
|
||||||
<span class="iconify iconify-[heroicons--clipboard]"></span>
|
{:else}
|
||||||
{/if}
|
<span class="iconify iconify-[heroicons--clipboard]"></span>
|
||||||
</button>
|
{/if}
|
||||||
|
</button>
|
||||||
|
{/if}
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</DataTable>
|
</DataTable>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
---
|
---
|
||||||
|
import { DIRECT_INVITATION_LINKS_ENABLED } from 'astro:env/server';
|
||||||
import { Session } from '@util/session.ts';
|
import { Session } from '@util/session.ts';
|
||||||
import { Permissions } from '@util/permissions.ts';
|
import { Permissions } from '@util/permissions.ts';
|
||||||
import { siteUrl } from '@util/url.ts';
|
import { siteUrl } from '@util/url.ts';
|
||||||
@@ -12,5 +13,5 @@ if (!session) return Astro.redirect(siteUrl('admin'));
|
|||||||
|
|
||||||
<AdminLayout title="Direkte Einladungen">
|
<AdminLayout title="Direkte Einladungen">
|
||||||
<SidebarActions slot="actions" client:load />
|
<SidebarActions slot="actions" client:load />
|
||||||
<DirectInvitations client:load />
|
<DirectInvitations linksEnabled={DIRECT_INVITATION_LINKS_ENABLED} client:load />
|
||||||
</AdminLayout>
|
</AdminLayout>
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
---
|
---
|
||||||
|
import { DIRECT_INVITATION_LINKS_ENABLED } from 'astro:env/server';
|
||||||
import { db } from '@db/database.ts';
|
import { db } from '@db/database.ts';
|
||||||
import Signup from '@app/website/signup/Signup.astro';
|
import Signup from '@app/website/signup/Signup.astro';
|
||||||
|
|
||||||
const { code } = Astro.params;
|
const { code } = Astro.params;
|
||||||
|
|
||||||
|
if (!DIRECT_INVITATION_LINKS_ENABLED) return new Response(null, { status: 404 });
|
||||||
|
|
||||||
const directSignup = await db.getDirectSignupByCode({ code: code! });
|
const directSignup = await db.getDirectSignupByCode({ code: code! });
|
||||||
if (!directSignup) return new Response(null, { status: 404 });
|
if (!directSignup) return new Response(null, { status: 404 });
|
||||||
---
|
---
|
||||||
|
|||||||
Reference in new issue
Block a user