Make Nostr git servers configurable

This commit is contained in:
Alex Gleason committed 2025-10-14 20:53:32 -05:00
1 parent e4c3fc8b05
commit ab91a56da6
13 files changed
+145 -22

No files matched your search

+4 -4
View File
@@ -52,6 +52,7 @@ import { useToast } from '@/hooks/useToast';
import { useCurrentUser } from '@/hooks/useCurrentUser';
import { useNostr } from '@nostrify/react';
import { useNostrPublish } from '@/hooks/useNostrPublish';
import { useAppContext } from '@/hooks/useAppContext';
import { cn } from '@/lib/utils';
import { findCredentialsForRepo } from '@/lib/gitCredentials';
import { nip19 } from 'nostr-tools';
@@ -59,8 +60,6 @@ import { GitManagementDialog } from '@/components/git/GitManagementDialog';
import { MergeDialog } from '@/components/git/MergeDialog';
import { PullRequestDialog } from '@/components/git/PullRequestDialog';
const GRASP_SERVERS = ["git.shakespeare.diy", "relay.ngit.dev"];
interface GitDialogProps {
projectId: string;
children?: React.ReactNode;
@@ -92,6 +91,7 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog
const { user } = useCurrentUser();
const { nostr } = useNostr();
const { mutateAsync: publishEvent } = useNostrPublish();
const { config } = useAppContext();
const projectPath = `/projects/${projectId}`;
@@ -299,10 +299,10 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog
}
// Create repo announcement event (NIP-34 kind 30617)
const cloneUrls = GRASP_SERVERS.map(server =>
const cloneUrls = config.ngitServers.map(server =>
`https://${server}/${nip19.npubEncode(user.pubkey)}/${projectId}.git`
);
const relayUrls = GRASP_SERVERS.map(server => `wss://${server}`);
const relayUrls = config.ngitServers.map(server => `wss://${server}`);
await publishEvent({
kind: 30617,