Compare commits

...

3 Commits

Author SHA1 Message Date
k00b b6e4f97668 fix env loading in worker 2024-08-28 09:38:41 -05:00
ekzyis 17da24ce24
Add a.stacker.news to script-src (#1339) 2024-08-28 09:33:26 -05:00
ekzyis ae8cadd4be
Switch NWC from Damus to Primal relay (#1340) 2024-08-28 09:32:29 -05:00
5 changed files with 8 additions and 7 deletions

View File

@ -535,7 +535,7 @@ services:
entrypoint: entrypoint:
- 'nostr-wallet-connect-lnd' - 'nostr-wallet-connect-lnd'
- '--relay' - '--relay'
- 'wss://relay.damus.io' - 'wss://relay.primal.net'
- '--macaroon-file' - '--macaroon-file'
- '/root/.lnd/regtest/admin.macaroon' - '/root/.lnd/regtest/admin.macaroon'
- '--cert-file' - '--cert-file'

View File

@ -91,7 +91,7 @@ export function middleware (request) {
// Using nonces and strict-dynamic deploys a strict CSP. // Using nonces and strict-dynamic deploys a strict CSP.
// see https://cheatsheetseries.owasp.org/cheatsheets/Content_Security_Policy_Cheat_Sheet.html#strict-policy. // see https://cheatsheetseries.owasp.org/cheatsheets/Content_Security_Policy_Cheat_Sheet.html#strict-policy.
// Old browsers will ignore nonce and strict-dynamic and fallback to host-based matching and unsafe-inline // Old browsers will ignore nonce and strict-dynamic and fallback to host-based matching and unsafe-inline
`script-src 'self' 'unsafe-inline' 'wasm-unsafe-eval' 'nonce-${nonce}' 'strict-dynamic' https:` + devScriptSrc, `script-src 'self' a.stacker.news 'unsafe-inline' 'wasm-unsafe-eval' 'nonce-${nonce}' 'strict-dynamic' https:` + devScriptSrc,
// unsafe-inline for styles is not ideal but okay if script-src is using nonces // unsafe-inline for styles is not ideal but okay if script-src is using nonces
"style-src 'self' a.stacker.news 'unsafe-inline'", "style-src 'self' a.stacker.news 'unsafe-inline'",
"manifest-src 'self'", "manifest-src 'self'",

View File

@ -1,7 +1,7 @@
Use this NWC string to attach the wallet for payments: Use this NWC string to attach the wallet for payments:
``` ```
nostr+walletconnect://5224c44600696216595a70982ee7387a04bd66248b97fefb803f4ed6d4af1972?relay=wss%3A%2F%2Frelay.damus.io&secret=0d1ef06059c9b1acf8c424cfe357c5ffe2d5f3594b9081695771a363ee716b67 nostr+walletconnect://5224c44600696216595a70982ee7387a04bd66248b97fefb803f4ed6d4af1972?relay=wss%3A%2F%2Frelay.primal.net&secret=0d1ef06059c9b1acf8c424cfe357c5ffe2d5f3594b9081695771a363ee716b67
``` ```
This won't work for receives since it allows `pay_invoice`. This won't work for receives since it allows `pay_invoice`.

View File

@ -1,5 +1,6 @@
// environment variables are loaded from files and imports run before the rest of the code
import './loadenv.js'
import PgBoss from 'pg-boss' import PgBoss from 'pg-boss'
import nextEnv from '@next/env'
import createPrisma from '@/lib/create-prisma.js' import createPrisma from '@/lib/create-prisma.js'
import { import {
autoDropBolt11s, checkInvoice, checkPendingDeposits, checkPendingWithdrawals, autoDropBolt11s, checkInvoice, checkPendingDeposits, checkPendingWithdrawals,
@ -34,11 +35,8 @@ import {
import { thisDay } from './thisDay.js' import { thisDay } from './thisDay.js'
import { isServiceEnabled } from '@/lib/sndev.js' import { isServiceEnabled } from '@/lib/sndev.js'
const { loadEnvConfig } = nextEnv
const { ApolloClient, HttpLink, InMemoryCache } = apolloClient const { ApolloClient, HttpLink, InMemoryCache } = apolloClient
loadEnvConfig('.', process.env.NODE_ENV === 'development')
async function work () { async function work () {
const boss = new PgBoss(process.env.DATABASE_URL) const boss = new PgBoss(process.env.DATABASE_URL)
const models = createPrisma({ const models = createPrisma({

3
worker/loadenv.js Normal file
View File

@ -0,0 +1,3 @@
import nextEnv from '@next/env'
const { loadEnvConfig } = nextEnv
loadEnvConfig('.', process.env.NODE_ENV === 'development')