Show commit builds and mandate automatic node updates
Hop-State: A_06FP97T67MMQBS4JYJVZ710 Hop-Proposal: R_06FP97R88JYXTBZTNVXV08G Hop-Task: T_06FP95PNKD7PXAMPWPRWSD8 Hop-Attempt: AT_06FP95PNKE2R52XYNMKVRWG
This commit is contained in:
@@ -31,6 +31,7 @@ export function RightSidebar() {
|
||||
});
|
||||
const [version, setVersion] = useState<{
|
||||
version: string;
|
||||
commit: string | null;
|
||||
buildDate: string | null;
|
||||
} | null>(null);
|
||||
|
||||
@@ -79,7 +80,7 @@ export function RightSidebar() {
|
||||
fetch('/api/version')
|
||||
.then(res => res.json())
|
||||
.then(data => setVersion(data))
|
||||
.catch(() => setVersion({ version: 'unknown', buildDate: null }));
|
||||
.catch(() => setVersion({ version: 'unknown', commit: null, buildDate: null }));
|
||||
|
||||
return () => window.removeEventListener('synapsis:node-updated', handleNodeUpdated);
|
||||
}, []);
|
||||
@@ -152,8 +153,12 @@ export function RightSidebar() {
|
||||
<h3 style={{ fontWeight: 600, marginBottom: '12px' }}>Network Info</h3>
|
||||
<p style={{ color: 'var(--foreground-secondary)', fontSize: '13px' }}>
|
||||
Running{' '}
|
||||
<a href="https://synapsis.social" target="_blank" rel="noopener noreferrer" style={{ color: 'var(--accent)' }}>Synapsis</a>
|
||||
{version?.version ? ` ${version.version}` : ''}
|
||||
<a href="https://synapsis.gnosyslabs.xyz" target="_blank" rel="noopener noreferrer" style={{ color: 'var(--accent)' }}>Synapsis</a>
|
||||
{version?.commit
|
||||
? ` ${version.commit.slice(0, 7)}`
|
||||
: version?.version
|
||||
? ` ${version.version}`
|
||||
: ''}
|
||||
</p>
|
||||
|
||||
{nodeInfo.admins.length > 0 && (
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
import { db, nodes, users, posts } from '@/db';
|
||||
import { eq, sql } from 'drizzle-orm';
|
||||
import type { SwarmAnnouncement, SwarmNodeInfo, SwarmCapability } from './types';
|
||||
import { getCurrentBuildInfo } from '@/lib/version';
|
||||
import { upsertSwarmNode, getSeedNodes, markNodeSuccess, markNodeFailure } from './registry';
|
||||
import {
|
||||
getCanonicalSwarmSeedDomain,
|
||||
@@ -22,6 +23,7 @@ const PUBLIC_SWARM_DOMAIN_ERROR = 'Public swarm participation requires a real IC
|
||||
*/
|
||||
export async function buildAnnouncement(): Promise<SwarmAnnouncement> {
|
||||
const domain = process.env.NEXT_PUBLIC_NODE_DOMAIN || 'localhost:43821';
|
||||
const buildInfo = getCurrentBuildInfo();
|
||||
|
||||
let name = 'Synapsis Node';
|
||||
let description: string | undefined;
|
||||
@@ -61,7 +63,7 @@ export async function buildAnnouncement(): Promise<SwarmAnnouncement> {
|
||||
description,
|
||||
logoUrl,
|
||||
publicKey,
|
||||
softwareVersion: '0.1.0', // TODO: Get from package.json
|
||||
softwareVersion: buildInfo.commit || buildInfo.version,
|
||||
userCount,
|
||||
postCount,
|
||||
capabilities,
|
||||
|
||||
Reference in New Issue
Block a user