Skip to content

Commit

Permalink
feat(nuxt3): custom cryption keys
Browse files Browse the repository at this point in the history
  • Loading branch information
LarchLiu committed Feb 5, 2024
1 parent b7085d6 commit 953830d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ ENV VAPID_PUBLIC_KEY=$VAPID_PUBLIC_KEY
ARG VAPID_PRIVATE_KEY
ENV VAPID_PRIVATE_KEY=$VAPID_PRIVATE_KEY

ARG CRYPTION_C1
ENV CRYPTION_C1=$CRYPTION_C1

ARG CRYPTION_C2
ENV CRYPTION_C2=$CRYPTION_C2

RUN npm i -g pnpm

ADD ./ /app
Expand Down Expand Up @@ -87,6 +93,12 @@ ENV VAPID_PUBLIC_KEY=$VAPID_PUBLIC_KEY
ARG VAPID_PRIVATE_KEY
ENV VAPID_PRIVATE_KEY=$VAPID_PRIVATE_KEY

ARG CRYPTION_C1
ENV CRYPTION_C1=$CRYPTION_C1

ARG CRYPTION_C2
ENV CRYPTION_C2=$CRYPTION_C2

EXPOSE 3000

ENV NODE_ENV=production
Expand Down
18 changes: 10 additions & 8 deletions server/nuxt3/.env.example
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
CRYPTION_C1=<custom number like 1234>
CRYPTION_C2=<custom number like 5678>
KV_DRIVER=<vercelKV|redis|cloudflareKVHTTP>
KV_REST_API_URL=
KV_REST_API_TOKEN=
KV_REST_API_URL=<get from vercel>
KV_REST_API_TOKEN=<get from vercel>
REDIS_URL=<redis://user:password@host:port>
CF_ACCOUNT_ID=
CF_NAMESPACE_ID=
CF_API_TOKEN=
CF_ACCOUNT_ID=<get from cloudflare>
CF_NAMESPACE_ID=<get from cloudflare>
CF_API_TOKEN=<get from cloudflare>
GITHUB_REPO_DISPATCH_URL=<https://api.github.com/repos/OWNER/REPO/dispatches>
GITHUB_TOKEN=
GITHUB_TOKEN=<get from github>
STARGRAM_ID=<generate from ./scripts/generateStargramID.js>
VAPID_PUBLIC_KEY=
VAPID_PRIVATE_KEY=
VAPID_PUBLIC_KEY=<get from firebase>
VAPID_PRIVATE_KEY=<get from firebase>

5 changes: 3 additions & 2 deletions server/nuxt3/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* eslint-disable node/prefer-global/process */
import { Cryption } from '@stargram/core/utils'

export const appName = 'Stargram'
export const appDescription = 'Manage all your Starred Pages'
export const DEFAULT_OG_IMAGE = 'https://kiafhufrshqyrvlpsdqg.supabase.co/storage/v1/object/public/pics-bed/stargram.png?v=stargramogimage'
export const DEFAULT_STARGRAM_HUB = 'https://stargram.cc'
export const C1 = 26739
export const C2 = 59874
export const C1 = Number.parseInt(process.env.CRYPTION_C1 || '1234')
export const C2 = Number.parseInt(process.env.CRYPTION_C2 || '1234')
export const cryption = new Cryption(C1, C2)

0 comments on commit 953830d

Please sign in to comment.