将config.ts中的部分配置移动到.env中,方便私有部署。

将public中的psd文件移出,防止被打包到dist。
判断TURNSTILE_SITE_KEY为空时不开启此功能。
pull/130/head
MoeGrid 2025-03-16 19:56:14 +08:00 committed by Azalea
parent a076d50cb3
commit 3ac6d79644
10 changed files with 23 additions and 9 deletions

9
AquaNet/.env 100644
View File

@ -0,0 +1,9 @@
VITE_AQUA_HOST=https://aquadx.net/aqua
VITE_DATA_HOST=https://aquadx.net
VITE_AQUA_CONNECTION=aquadx.hydev.org
VITE_TURNSTILE_SITE_KEY=0x4AAAAAAASGA2KQEIelo9P9
VITE_DISCORD_INVITE=https://discord.gg/FNgveqFF7s
VITE_TELEGRAM_INVITE=https://t.me/+zBL4RZdyfvUzZGU1
VITE_QQ_INVITE=https://qm.qq.com/q/wvNXbXbHbO

5
AquaNet/.gitignore vendored
View File

@ -32,4 +32,7 @@ dist-ssr
!.yarn/sdks
!.yarn/versions
public/chu3
public/chu3
# local env file
*.local

View File

@ -1,15 +1,15 @@
import type { ChusanMatchingOption } from "./generalTypes"
export const AQUA_HOST = 'https://aquadx.net/aqua'
export const DATA_HOST = 'https://aquadx.net'
export const AQUA_HOST = import.meta.env.VITE_AQUA_HOST
export const DATA_HOST = import.meta.env.VITE_DATA_HOST
// This will be displayed for users to connect from the client
export const AQUA_CONNECTION = 'aquadx.hydev.org'
export const AQUA_CONNECTION = import.meta.env.VITE_AQUA_CONNECTION
export const TURNSTILE_SITE_KEY = '0x4AAAAAAASGA2KQEIelo9P9'
export const DISCORD_INVITE = 'https://discord.gg/FNgveqFF7s'
export const TELEGRAM_INVITE = 'https://t.me/+zBL4RZdyfvUzZGU1'
export const QQ_INVITE = 'https://qm.qq.com/q/wvNXbXbHbO'
export const TURNSTILE_SITE_KEY = import.meta.env.VITE_TURNSTILE_SITE_KEY
export const DISCORD_INVITE = import.meta.env.VITE_DISCORD_INVITE
export const TELEGRAM_INVITE = import.meta.env.VITE_TELEGRAM_INVITE
export const QQ_INVITE = import.meta.env.VITE_QQ_INVITE
// UI
export const FADE_OUT = { duration: 200 }

View File

@ -51,7 +51,7 @@
return submitting = false
}
if (turnstile === "") {
if (TURNSTILE_SITE_KEY && turnstile === "") {
// Sleep for 100ms to allow Turnstile to finish
error = t("welcome.waiting-turnstile")
return setTimeout(submit, 100)
@ -137,11 +137,13 @@
{isSignup ? t('welcome.btn-signup') : t('welcome.btn-login')}
{/if}
</button>
{#if TURNSTILE_SITE_KEY}
<Turnstile siteKey={TURNSTILE_SITE_KEY} bind:reset={turnstileReset}
on:turnstile-callback={e => console.log(turnstile = e.detail.token)}
on:turnstile-error={_ => console.log(error = t("welcome.turnstile-error"))}
on:turnstile-expired={_ => window.location.reload()}
on:turnstile-timeout={_ => console.log(error = t('welcome.turnstile-timeout'))} />
{/if}
</div>
{:else if state === "verify"}
<div class="login-form" transition:slide>