41 create tenant twilio config #62

Merged
BenjaminPalko merged 20 commits from 41-create-tenant-twilio-config into master 2025-01-26 23:36:06 -05:00
4 changed files with 29 additions and 3 deletions
Showing only changes of commit 3d73f9fa95 - Show all commits

View file

@ -13,6 +13,7 @@
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"format": "prettier --write .", "format": "prettier --write .",
"generate-secret": "bun ./scripts/generate-secret.ts",
"lint": "prettier --check . && eslint .", "lint": "prettier --check . && eslint .",
"test:unit": "vitest", "test:unit": "vitest",
"test": "bun run test:unit -- --run && bun run test:e2e", "test": "bun run test:unit -- --run && bun run test:e2e",
@ -44,7 +45,7 @@
"@sveltejs/adapter-auto": "^3.0.0", "@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/kit": "^2.15.3", "@sveltejs/kit": "^2.15.3",
"@sveltejs/vite-plugin-svelte": "^5.0.3", "@sveltejs/vite-plugin-svelte": "^5.0.3",
"@types/bun": "^1.1.14", "@types/bun": "^1.1.15",
"autoprefixer": "^10.4.20", "autoprefixer": "^10.4.20",
"daisyui": "^4.12.22", "daisyui": "^4.12.22",
"eslint": "^9.7.0", "eslint": "^9.7.0",

View file

@ -0,0 +1,6 @@
import { randomBytes } from 'node:crypto';
console.log('SECRET: ', {
password: randomBytes(16).toString('hex'),
salt: randomBytes(16).toString('hex'),
});

View file

@ -1,5 +1,5 @@
import { PhoneRegex } from '../src/lib/regex/phone';
import { z } from 'zod'; import { z } from 'zod';
import { PhoneRegex } from '../src/lib/regex/phone';
const ValidateEnvironment = () => { const ValidateEnvironment = () => {
const { success, error } = z const { success, error } = z
@ -9,7 +9,22 @@ const ValidateEnvironment = () => {
TWILIO_PHONE_NUMBER: z.string().regex(PhoneRegex), TWILIO_PHONE_NUMBER: z.string().regex(PhoneRegex),
SECRETS_PASSWORD: z.string().length(32), SECRETS_PASSWORD: z.string().length(32),
SECRETS_SALT: z.string().min(16), SECRETS_SALT: z.string().min(16),
SECRETS_IV_POSITION: z.number().positive(), SECRETS_IV_POSITION: z.string().transform((val, ctx) => {
const parsed = parseInt(val);
if (isNaN(parsed)) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: 'Not a number',
});
// This is a special symbol you can use to
// return early from the transform function.
// It has type `never` so it does not affect the
// inferred return type.
return z.NEVER;
}
return parsed;
}),
}) })
.safeParse(process.env); .safeParse(process.env);

View file

@ -0,0 +1,4 @@
<script lang="ts">
</script>
<div class="container"></div>