Test client for WildDuck WebAuthn API endpoints
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const Redis = require('ioredis'); | |
const redis = new Redis({ | |
port: 6379, | |
host: '127.0.0.1' | |
}); | |
async function rateLimitedIp(ip) { | |
const rlKey = 'ratelimits'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This example script submits large attachments | |
# Usage | |
# 1. Edit the variables below | |
# 2. Run the script | |
# $ bash ./submit.sh | |
## EDIT THE FOLLOWING VALUES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The following example sets up Nodemailer in a way that it does not perform any DNS resolving on its own | |
const hostname = 'smtp.gmail.com'; | |
const resolved = (await dns.promises.resolve(hostname))[0]; | |
const transporter = nodemailer.createTransport({ | |
host: resolved, // <- IP address of the SMTP server | |
name: 'my.machine.hostname', // <- PTR name of sender's public IP address, ends up in the Recieved: header | |
tls: { | |
servername: hostname, // <- hostname of the SMTP server, needed to verify TLS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
const fs = require("fs"); | |
const http = require("http"); | |
const API_PATH = "http://127.0.0.1:3000"; | |
const ACCESS_TOKEN = "b2d73a529d602c0c9dfec62227a22151af04ca45227a7c7f5e24c35a6b004584"; | |
const ACCOUNT_ID = "ekiri"; | |
const ATTACHMENT_ID = "AAAAAQAABPsy"; |
Register a new account with IMAP and SMTP settings (reference)
curl -XPOST "http://127.0.0.1:3000/v1/account" \
-H "Authorization: Bearer f77cf263b70488c7a35bf1539fd544a81a88711ff74326ce9793022df08d91b9" \
-H "Content-type: application/json" \
-d '{
"account": "example",
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SERVICE_NAME=$1 | |
DOMAIN_NAME=$2 | |
HTTP_PORT=$3 | |
SERVICE_USER=${4:-www-data} | |
DEPLOY_KEY=$5 | |
NODE_ENV=${6:-production} | |
DEPLOY_USER="deploy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// npm install bull bull-arena express | |
// node bull-ui.js | |
// open http://localhost:6789 | |
const Arena = require("bull-arena"); | |
const Bull = require("bull"); | |
const express = require("express"); | |
const app = express(); | |
const router = express.Router(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// npm install hi-base32 sha3 | |
const base32 = require("hi-base32"); | |
const { SHA3 } = require("sha3"); | |
function verifyOnionAddress(addr) { | |
const suffixLength = ".onion".length; | |
if (!/\.onion$/i.test(addr) || addr.length != 56 + suffixLength) { | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"dkim": { | |
"headerFrom": [ | |
"[email protected]" | |
], | |
"envelopeFrom": "[email protected]", | |
"results": [ | |
{ | |
"signingDomain": "out.srv.dev", | |
"selector": "smtp", |
NewerOlder