limiting, add iconify-icon dependency Add src/components/ContactForm.astro implementing OTP verify/send flows and server-side validation Add src/lib/Otp.ts (otplib-backed) with per-hour OTP and per-week message rate limits and helper functions Expose OTP_SUPER_SECRET_SALT in astro.config and add otplib Rename src/lib/cap.ts to src/lib/CapAdapter.ts and update imports Replace inline contact page logic with ContactForm and adjust SMS client Add iconify-icon dependency
56 lines
1.3 KiB
JavaScript
56 lines
1.3 KiB
JavaScript
import htmx from "astro-htmx";
|
|
// @ts-check
|
|
import { defineConfig, envField } from "astro/config";
|
|
import alpinejs from "@astrojs/alpinejs";
|
|
import sitemap from "@astrojs/sitemap";
|
|
import bun from "@nurodev/astro-bun";
|
|
import db from "@astrojs/db";
|
|
|
|
// https://astro.build/config
|
|
export default defineConfig({
|
|
site: "https://badblocks.dev",
|
|
trailingSlash: "never",
|
|
adapter: bun(),
|
|
output: "static",
|
|
devToolbar: { enabled: false },
|
|
prefetch: {
|
|
prefetchAll: true,
|
|
},
|
|
security: {
|
|
checkOrigin: true,
|
|
},
|
|
server: {
|
|
host: true,
|
|
port: 4321,
|
|
},
|
|
env: {
|
|
schema: {
|
|
ANDROID_SMS_GATEWAY_LOGIN: envField.string({
|
|
context: "server",
|
|
access: "secret",
|
|
}),
|
|
ANDROID_SMS_GATEWAY_PASSWORD: envField.string({
|
|
context: "server",
|
|
access: "secret",
|
|
}),
|
|
ANDROID_SMS_GATEWAY_RECIPIENT_PHONE: envField.string({
|
|
context: "server",
|
|
access: "secret",
|
|
}),
|
|
ANDROID_SMS_GATEWAY_URL: envField.string({
|
|
context: "server",
|
|
access: "secret",
|
|
}),
|
|
OTP_SUPER_SECRET_SALT: envField.string({
|
|
context: "server",
|
|
access: "secret",
|
|
}),
|
|
},
|
|
},
|
|
integrations: [alpinejs(), sitemap(), htmx(), db()],
|
|
experimental: {
|
|
preserveScriptOrder: true,
|
|
chromeDevtoolsWorkspace: true,
|
|
failOnPrerenderConflict: true,
|
|
},
|
|
});
|