This will look up nostr pubkeys in the LDAP directory to allow or deny publishing notes to the relay.
24 lines
565 B
TypeScript
Executable File
24 lines
565 B
TypeScript
Executable File
#!/bin/sh
|
|
//bin/true; exec deno run -A "$0" "$@"
|
|
import {
|
|
antiDuplicationPolicy,
|
|
hellthreadPolicy,
|
|
pipeline,
|
|
rateLimitPolicy,
|
|
readStdin,
|
|
writeStdout,
|
|
} from 'https://gitlab.com/soapbox-pub/strfry-policies/-/raw/develop/mod.ts';
|
|
|
|
import ldapPolicy from './ldap-policy.ts';
|
|
|
|
for await (const msg of readStdin()) {
|
|
const result = await pipeline(msg, [
|
|
[hellthreadPolicy, { limit: 10 }],
|
|
[antiDuplicationPolicy, { ttl: 60000, minLength: 50 }],
|
|
[rateLimitPolicy, { whitelist: ['127.0.0.1'] }],
|
|
[ldapPolicy],
|
|
]);
|
|
|
|
writeStdout(result);
|
|
}
|