Skip to content

Commit

Permalink
Merge pull request #4 from itsmegood/latest
Browse files Browse the repository at this point in the history
update to latest
  • Loading branch information
itsmegood authored Apr 11, 2024
2 parents 7556b7d + 750fa42 commit 1ac32f9
Show file tree
Hide file tree
Showing 15 changed files with 759 additions and 1,131 deletions.
7 changes: 3 additions & 4 deletions app/routes/_auth+/onboarding_.$provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,15 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
const prefilledProfile = verifySession.get(prefilledProfileKey)

const formError = authSession.get(authenticator.sessionErrorKey)
const hasError = typeof formError === 'string'

return json({
email,
status: 'idle',
submission: {
status: 'error',
status: hasError ? 'error' : undefined,
initialValue: prefilledProfile ?? {},
error: {
'': typeof formError === 'string' ? [formError] : [],
},
error: { '': hasError ? [formError] : [] },
} as SubmissionResult,
})
}
Expand Down
2 changes: 2 additions & 0 deletions app/utils/env.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const schema = z.object({
GITHUB_CLIENT_ID: z.string().default('MOCK_GITHUB_CLIENT_ID'),
GITHUB_CLIENT_SECRET: z.string().default('MOCK_GITHUB_CLIENT_SECRET'),
GITHUB_TOKEN: z.string().default('MOCK_GITHUB_TOKEN'),
ALLOW_INDEXING: z.enum(['true', 'false']).optional(),
})

declare global {
Expand Down Expand Up @@ -50,6 +51,7 @@ export function getEnv() {
return {
MODE: process.env.NODE_ENV,
SENTRY_DSN: process.env.SENTRY_DSN,
ALLOW_INDEXING: process.env.ALLOW_INDEXING,
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/utils/honeypot.server.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Honeypot, SpamError } from 'remix-utils/honeypot/server'

export const honeypot = new Honeypot({
validFromFieldName: process.env.TESTING ? null : undefined,
validFromFieldName: process.env.NODE_ENV === 'test' ? null : undefined,
encryptionSeed: process.env.HONEYPOT_SECRET,
})

Expand Down
5 changes: 1 addition & 4 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
app = "epic-stack-template"
app = "my-remix-app-b66d"
primary_region = "sjc"
kill_signal = "SIGINT"
kill_timeout = 5
Expand All @@ -12,9 +12,6 @@ auto_rollback = true
source = "data"
destination = "/data"

[deploy]
release_command = "node ./other/sentry-create-release"

[[services]]
internal_port = 8080
processes = [ "app" ]
Expand Down
3 changes: 0 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dotenv/config'
import * as fs from 'fs'
import { installGlobals } from '@remix-run/node'
import chalk from 'chalk'
import closeWithGrace from 'close-with-grace'
import sourceMapSupport from 'source-map-support'
Expand All @@ -19,8 +18,6 @@ sourceMapSupport.install({
},
})

installGlobals()

closeWithGrace(async ({ err }) => {
if (err) {
console.error(chalk.red(err))
Expand Down
9 changes: 8 additions & 1 deletion other/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ RUN npm prune --omit=dev
# Build the app
FROM base as build

ARG COMMIT_SHA
ENV COMMIT_SHA=$COMMIT_SHA

WORKDIR /myapp

COPY --from=deps /myapp/node_modules /myapp/node_modules
Expand All @@ -37,7 +40,11 @@ ADD prisma .
RUN npx prisma generate

ADD . .
RUN npm run build

# Mount the secret and set it as an environment variable and run the build
RUN --mount=type=secret,id=SENTRY_AUTH_TOKEN \
export SENTRY_AUTH_TOKEN=$(cat /run/secrets/SENTRY_AUTH_TOKEN) && \
npm run build

# Finally, build the production image with minimal footprint
FROM base
Expand Down
8 changes: 8 additions & 0 deletions other/litefs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,12 @@ exec:
- cmd: npx prisma migrate deploy
if-candidate: true

# Set the journal mode for the database to WAL. This reduces concurrency deadlock issues
- cmd: sqlite3 $DATABASE_PATH "PRAGMA journal_mode = WAL;"
if-candidate: true

# Set the journal mode for the cache to WAL. This reduces concurrency deadlock issues
- cmd: sqlite3 $CACHE_DATABASE_PATH "PRAGMA journal_mode = WAL;"
if-candidate: true

- cmd: npm start
Loading

0 comments on commit 1ac32f9

Please sign in to comment.