diff --git a/Dockerfile b/Dockerfile index 572d206..d50b2d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,8 +33,6 @@ COPY --from=install /temp/prod/node_modules node_modules COPY --from=prerelease /usr/src/app/dist ./dist COPY --from=prerelease /usr/src/app/package.json ./ -ENV HOST=0.0.0.0 - USER node EXPOSE 4321 ENTRYPOINT ["node", "./dist/server/entry.mjs"] diff --git a/astro.config.mjs b/astro.config.mjs index 55f9366..1d64c19 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -10,12 +10,11 @@ export default defineConfig({ site: "https://badblocks.dev", trailingSlash: "never", // bun adapter is not official, also a little wonky, so use node adapter for now - // adapter: bun(), - // output: "static", adapter: node({ mode: "standalone", - staticHeaders: true, }), + // adapter: bun(), + // output: "static", compressHTML: false, devToolbar: { enabled: false }, prefetch: { @@ -30,6 +29,7 @@ export default defineConfig({ }), }, server: { + host: true, port: 4321, }, env: { @@ -57,4 +57,7 @@ export default defineConfig({ }, }, integrations: [alpinejs(), sitemap()], + experimental: { + chromeDevtoolsWorkspace: true, + }, }); diff --git a/compose.yaml b/compose.yaml index 39328bd..eeab30a 100644 --- a/compose.yaml +++ b/compose.yaml @@ -6,12 +6,12 @@ services: volumes: - ./db:/db environment: - ANDROID_SMS_GATEWAY_IP: ${ANDROID_SMS_GATEWAY_IP:?ANDROID_SMS_GATEWAY_IP is required} - ANDROID_SMS_GATEWAY_URL: ${ANDROID_SMS_GATEWAY_URL:? ANDROID_SMS_GATEWAY_URL is required} - ANDROID_SMS_GATEWAY_LOGIN: ${ANDROID_SMS_GATEWAY_LOGIN:? ANDROID_SMS_GATEWAY_LOGIN is required} - ANDROID_SMS_GATEWAY_PASSWORD: ${ANDROID_SMS_GATEWAY_PASSWORD:?ANDROID_SMS_GATEWAY_PASSWORD is required} - ANDROID_SMS_GATEWAY_RECIPIENT_PHONE: ${ANDROID_SMS_GATEWAY_RECIPIENT_PHONE:? ANDROID_SMS_GATEWAY_RECIPIENT_PHONE is required} - OTP_SUPER_SECRET_SALT: ${OTP_SUPER_SECRET_SALT:?OTP_SUPER_SECRET_SALT is required} + ANDROID_SMS_GATEWAY_IP: ${ANDROID_SMS_GATEWAY_IP:-192.168.0.1} + ANDROID_SMS_GATEWAY_URL: ${ANDROID_SMS_GATEWAY_URL:-http://192.168.0.1:8080} + ANDROID_SMS_GATEWAY_LOGIN: ${ANDROID_SMS_GATEWAY_LOGIN:-sms} + ANDROID_SMS_GATEWAY_PASSWORD: ${ANDROID_SMS_GATEWAY_PASSWORD:-super-secret-password} + ANDROID_SMS_GATEWAY_RECIPIENT_PHONE: ${ANDROID_SMS_GATEWAY_RECIPIENT_PHONE:-555-555-1234} + OTP_SUPER_SECRET_SALT: ${OTP_SUPER_SECRET_SALT:-super-secret-salt} healthcheck: test: [ diff --git a/package.json b/package.json index b1569f3..0f7e869 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,6 @@ "iconify-icon": "^3.0.2", "ofetch": "^1.5.1", "otplib": "12.0.1", - "thirty-two": "^1.0.2", "typescript": "^6.0.3", "validator": "^13.15.35" }, diff --git a/public/theme.css b/public/theme.css index 311b2a4..29ff08d 100644 --- a/public/theme.css +++ b/public/theme.css @@ -42,12 +42,12 @@ body { var(--color-accent-transparent), black 120% ); - background-attachment: fixed; color: var(--color-fg); column-gap: var(--gutter-large); display: grid; font-size: var(--pt-pica); grid-template-rows: auto 1fr auto; + height: 100dvb; left: 0; overflow-x: hidden; padding-inline: var(--page-padding-inline); diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index c567e96..a675fce 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -1,31 +1,19 @@ + - + - + - + @@ -46,16 +34,9 @@ diff --git a/src/lib/Otp.ts b/src/lib/Otp.ts index 37303d6..ce7d5b4 100644 --- a/src/lib/Otp.ts +++ b/src/lib/Otp.ts @@ -1,6 +1,5 @@ import { authenticator } from "otplib"; -import { createHmac } from "crypto"; -import base32 from "thirty-two"; +import { createHash } from "crypto"; const submissionTimestamps = new Map(); const otpRequestTimestamps = new Map(); @@ -53,9 +52,9 @@ function getUserSecret(phoneNumber: string, salt: string): string { "Phone number and salt are required to generate a user secret.", ); } - - const digest = createHmac("sha256", salt).update(phoneNumber).digest("hex"); - return base32.encode(digest).toString().replace(/=/g, ""); + return createHash("sha256") + .update(phoneNumber + salt) + .digest("hex"); } export function normalizePhone(phone: string) { diff --git a/src/pages/ai.astro b/src/pages/ai.astro new file mode 100644 index 0000000..4122804 --- /dev/null +++ b/src/pages/ai.astro @@ -0,0 +1,8 @@ +--- +import Layout from "@layouts/BaseLayout.astro"; +--- + + + AI Policy + + diff --git a/src/pages/contact.astro b/src/pages/contact.astro index c886b85..e57c4c5 100644 --- a/src/pages/contact.astro +++ b/src/pages/contact.astro @@ -157,12 +157,7 @@ const msgValue = pickValue("msg") || (await Astro.session?.get("msg")); {result?.error.message} Please correct any errors and try again.

- )) || ( -

- Inquiries, opportunities, or comments? Shoot me a quick text - here! -

- )} + )) ||

Use this form to shoot me a quick text!

}