Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# We try to mock as much as possible so you don't have to have these set to anything real to contribute

# We also only use these variables when you're trying to use the APIs that need them (lazy initialization)

# If you need to work on the feature that uses the API, it must be set.
# If it's mocked in development, then you can set its value to nonsense.
# We'll label them by what feature you need them for and whether it's mocked.

SENTRY_DSN="https://[email protected]/5878963"

SENTRY_AUTH_TOKEN=some_token
SENTRY_ORG=some_org
SENTRY_PROJECT=some_project
Expand All @@ -13,6 +16,7 @@ SENTRY_PROJECT_ID=5878963
# Feature: /contact and /login
# Mocked: yes
# Check the logs which print out the content of every "email" sent for any manual verification you need to do or links you need to open

MAILGUN_SENDING_KEY=key-some-mailgun-key
MAILGUN_DOMAIN=some.domain.com

Expand All @@ -27,13 +31,14 @@ TITO_API_SECRET=secret_live_some_long_thing
# Feature: authentication
# Mocked: Unnecessary (any value can be used)
# Technically we have a fallback in development so this doesn't even need to be set

SESSION_SECRET=anything_works_here
MAGIC_LINK_SECRET=whatever_stuff

# Feature: basically everything
# Mocked: No, must run sqlite locally
DATABASE_FILENAME="sqlite.db"
DATABASE_URL="file:./sqlite.db?connection_limit=1"
DATABASE_URL="file:./prisma/sqlite.db"
CACHE_DATABASE_PATH="other/cache.db"
LITEFS_DIR="./prisma"

Expand Down Expand Up @@ -91,4 +96,4 @@ REFRESH_CACHE_SECRET=really_whatever
VERIFIER_API_KEY=some_api_key

# Feature: Cloudflare OAuth
CF_INTERNAL_SECRET=some_long_random_string
CF_INTERNAL_SECRET=some_long_random_string
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ node_modules/
tsconfig.tsbuildinfo
/prisma/sqlite.db
/prisma/sqlite.db-journal
/prisma/dev.db
/prisma/dev.db-journal
/prisma/*.db*
/prisma/*-journal

other/postcss.ignored

Expand All @@ -22,6 +26,7 @@ other/postcss.ignored
/playwright-report/
/playwright/.cache/
/other/cache.db
/cache.db

*.bkp.*

Expand Down
2 changes: 1 addition & 1 deletion app/routes/resources+/webauthn+/verify-registration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export async function action({ request }: ActionFunctionArgs) {
data: {
id: credential.id,
aaguid,
publicKey: Buffer.from(credential.publicKey),
publicKey: new Uint8Array(credential.publicKey),
userId: user.id,
webauthnUserId,
counter: credential.counter,
Expand Down
4 changes: 4 additions & 0 deletions app/utils/prisma.server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { remember } from '@epic-web/remember'
import { PrismaBetterSQLite3 } from '@prisma/adapter-better-sqlite3'
import { PrismaClient } from '@prisma/client'
import chalk from 'chalk'
import pProps from 'p-props'
Expand All @@ -16,6 +17,9 @@ function getClient(): PrismaClient {
// that this only runs once per server restart and won't automatically be
// re-run per request like everything else is.
const client = new PrismaClient({
adapter: new PrismaBetterSQLite3({
url: process.env.DATABASE_URL!,
}),
log: [
{ level: 'query', emit: 'event' },
{ level: 'error', emit: 'stdout' },
Expand Down
Binary file added cache.db
Binary file not shown.
Loading
Loading