Add lookups for static user list, make LDAP optional
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Context } from "@oak/oak";
|
||||
import { nip19 } from "@nostr/tools";
|
||||
import { log } from "../log.ts";
|
||||
import { lookupUsernameByPubkey } from "../ldap.ts";
|
||||
import { lookupUsernameByPubkey } from "../directory.ts";
|
||||
import notFoundHandler from "../handlers/not-found.ts";
|
||||
|
||||
const naddrHandler = async function (ctx: Context) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Context } from "@oak/oak";
|
||||
import { nip19 } from "@nostr/tools";
|
||||
import { log } from "../log.ts";
|
||||
import { lookupUsernameByPubkey } from "../ldap.ts";
|
||||
import { lookupUsernameByPubkey } from "../directory.ts";
|
||||
import notFoundHandler from "../handlers/not-found.ts";
|
||||
|
||||
const nprofileHandler = async function (ctx: Context) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Context } from "@oak/oak";
|
||||
import { nip19 } from "@nostr/tools";
|
||||
import { log } from "../log.ts";
|
||||
import { lookupUsernameByPubkey } from "../ldap.ts";
|
||||
import { lookupUsernameByPubkey } from "../directory.ts";
|
||||
import notFoundHandler from "../handlers/not-found.ts";
|
||||
|
||||
const npubHandler = async function (ctx: Context) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Context } from "@oak/oak";
|
||||
import { log } from "../log.ts";
|
||||
import { lookupPubkeyByUsername } from "../ldap.ts";
|
||||
import { lookupPubkeyByUsername } from "../directory.ts";
|
||||
import { fetchArticlesByAuthor, fetchProfileEvent } from "../nostr.ts";
|
||||
import { profileAtomFeed } from "../feeds.ts";
|
||||
import Article from "../models/article.ts";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Context } from "@oak/oak";
|
||||
import { log } from "../log.ts";
|
||||
import { lookupPubkeyByUsername } from "../ldap.ts";
|
||||
import { lookupPubkeyByUsername } from "../directory.ts";
|
||||
import { fetchProfileEvent, fetchReplaceableEvent } from "../nostr.ts";
|
||||
import Article from "../models/article.ts";
|
||||
import Profile from "../models/profile.ts";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Context } from "@oak/oak";
|
||||
import { log } from "../log.ts";
|
||||
import { lookupPubkeyByUsername } from "../ldap.ts";
|
||||
import { lookupPubkeyByUsername } from "../directory.ts";
|
||||
import { fetchArticlesByAuthor, fetchProfileEvent } from "../nostr.ts";
|
||||
import Article from "../models/article.ts";
|
||||
import Profile from "../models/profile.ts";
|
||||
@@ -27,6 +27,7 @@ const userProfileHandler = async function (ctx: Context) {
|
||||
|
||||
ctx.response.body = html;
|
||||
} else {
|
||||
log(`No profile event found for @${username}`, "yellow");
|
||||
notFoundHandler(ctx);
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user