Implement backend API and database services in Docker setup
- Added a new `api` service for the NestJS backend, including health checks and dependencies on PostgreSQL, Redis, and MinIO. - Introduced PostgreSQL and Redis services with health checks and configurations for data persistence. - Added MinIO for S3-compatible object storage and a one-shot service to initialize required buckets. - Updated the Nginx configuration to proxy requests to the new backend API and MinIO storage. - Enhanced the Dockerfile to support the new API environment variables and configurations. - Updated the `package.json` and `package-lock.json` to include new dependencies for QR code generation and other utilities. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -137,6 +137,7 @@
|
||||
import { ref, computed } from 'vue'
|
||||
import { useAuth } from '../composables/useAuth'
|
||||
import { useAccounts } from '../composables/useAccounts'
|
||||
import { accountManager } from '../lib/accounts'
|
||||
|
||||
interface Props {
|
||||
isOpen: boolean
|
||||
@@ -205,32 +206,19 @@ async function handleNostrLogin() {
|
||||
return
|
||||
}
|
||||
|
||||
// Get public key from extension
|
||||
const pubkey = await window.nostr.getPublicKey()
|
||||
// First, register the extension account in accountManager.
|
||||
// This sets up the signer that createNip98AuthHeader needs.
|
||||
await loginWithExtension()
|
||||
|
||||
// Create authentication event
|
||||
const authEvent = {
|
||||
kind: 27235, // NIP-98 HTTP Auth
|
||||
created_at: Math.floor(Date.now() / 1000),
|
||||
tags: [
|
||||
['u', window.location.origin],
|
||||
['method', 'POST'],
|
||||
],
|
||||
content: '',
|
||||
const pubkey = accountManager.active?.pubkey
|
||||
if (!pubkey) {
|
||||
errorMessage.value = 'Could not get public key from extension.'
|
||||
return
|
||||
}
|
||||
|
||||
// Sign event with extension
|
||||
const signedEvent = await window.nostr.signEvent(authEvent)
|
||||
|
||||
// Create session with backend (auth store — subscription/My List)
|
||||
await loginWithNostr(pubkey, signedEvent.sig, signedEvent)
|
||||
|
||||
// Also register extension account in accountManager (commenting/reactions)
|
||||
try {
|
||||
await loginWithExtension()
|
||||
} catch {
|
||||
// Non-critical — extension account already obtained pubkey above
|
||||
}
|
||||
// Create backend session (NIP-98 auth is handled internally
|
||||
// by authService using the active accountManager signer)
|
||||
await loginWithNostr(pubkey, 'extension', {})
|
||||
|
||||
emit('success')
|
||||
closeModal()
|
||||
|
||||
Reference in New Issue
Block a user