Add NIP-05 handles for Vereinsmitglieders :D

This commit is contained in:
Dennis Reimann
2026-01-21 08:40:09 +01:00
parent fa0ef9e6ba
commit b47f5e2b70
3 changed files with 24 additions and 4 deletions

View File

@@ -8,13 +8,14 @@ on:
pull_request: pull_request:
branches: branches:
- master - master
# Used to trigger the build for Anchor feed updates. Can by kicked off via: # Used to trigger the build via external updates (e.g. Anchor feed or Verein). Can by kicked off via:
# curl -X POST -H "Authorization: token $GH_PAT" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/Einundzwanzig-Podcast/einundzwanzig.space/dispatches --data '{"event_type": "build_docs"}' # curl -X POST -H "Authorization: token $GH_PAT" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/Einundzwanzig-Podcast/einundzwanzig.space/dispatches --data '{"event_type": "anchor_update"}'
repository_dispatch: repository_dispatch:
types: types:
- anchor_update - anchor_update
# schedule: - verein_update
# - cron: "0 7 * * *" schedule:
- cron: "0 7 * * *"
jobs: jobs:
build: build:

View File

@@ -13,6 +13,7 @@
"init": "run-s clean copy && run-p fetch build:data", "init": "run-s clean copy && run-p fetch build:data",
"start": "cross-env NODE_ENV=development npm run init && cross-env NODE_ENV=development run-p start:*", "start": "cross-env NODE_ENV=development npm run init && cross-env NODE_ENV=development run-p start:*",
"start:data": "onchange -k 'content/**/*' 'tasks/generate_site_data.js' -- npm run build:data", "start:data": "onchange -k 'content/**/*' 'tasks/generate_site_data.js' -- npm run build:data",
"start:nostr": "onchange -i -k 'content/participants' 'tasks/generate_nostr.js' -- npm run build:nostr",
"start:feed": "onchange -i -k 'generated/feed.json' 'tasks/generate_feed.js' -- npm run build:feed", "start:feed": "onchange -i -k 'generated/feed.json' 'tasks/generate_feed.js' -- npm run build:feed",
"start:pages": "onchange -i -k 'pug.config.js' 'markdown.js' 'content/**' 'generated/**' 'src/**/*.pug' 'tasks/generate_pages.js' -- npm run build:pages -- {{file}}", "start:pages": "onchange -i -k 'pug.config.js' 'markdown.js' 'content/**' 'generated/**' 'src/**/*.pug' 'tasks/generate_pages.js' -- npm run build:pages -- {{file}}",
"start:styles": "onchange -i -k 'src/**/*.css' -- npm run build:styles", "start:styles": "onchange -i -k 'src/**/*.css' -- npm run build:styles",

View File

@@ -1,9 +1,18 @@
const { mkdirSync, writeFileSync } = require('fs') const { mkdirSync, writeFileSync } = require('fs')
const { dirname, resolve } = require('path') const { dirname, resolve } = require('path')
const { NDKUser } = require('@nostr-dev-kit/ndk') const { NDKUser } = require('@nostr-dev-kit/ndk')
const request = require('sync-request')
const participants = require('../content/participants.json') const participants = require('../content/participants.json')
const { npub } = require('../content/meta.json') const { npub } = require('../content/meta.json')
let members = []
try {
const jsonBody = request('GET', 'https://verein.einundzwanzig.space/api/members/2026').getBody('utf8')
members = JSON.parse(jsonBody)
} catch (err) {
console.error('Could not load members:', err)
}
const einundzwanzig = new NDKUser({ npub: npub.einundzwanzig }) const einundzwanzig = new NDKUser({ npub: npub.einundzwanzig })
const nostrtalk = new NDKUser({ npub: npub.nostrTalk }) const nostrtalk = new NDKUser({ npub: npub.nostrTalk })
const zitadelle = new NDKUser({ npub: npub.zitadelle }) const zitadelle = new NDKUser({ npub: npub.zitadelle })
@@ -25,6 +34,15 @@ Object.entries(participants).forEach(([key, { nostr: npub }]) => {
names[id] = new NDKUser({ npub }).pubkey names[id] = new NDKUser({ npub }).pubkey
}) })
Object.entries(members).forEach(([key, { npub, pubkey, nip05_handle }]) => {
if (!nip05_handle) return
const id = nip05_handle.replace(/[\s]/g, '_')
// don't overwrite participant entry
if (names[id]) return
names[id] = new NDKUser({ npub }).pubkey
})
const dst = resolve(__dirname, '..', 'dist', '.well-known', 'nostr.json') const dst = resolve(__dirname, '..', 'dist', '.well-known', 'nostr.json')
const dir = dirname(dst) const dir = dirname(dst)
const res = { names, relays } const res = { names, relays }