Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3348331
D9180.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9180.diff
View Options
diff --git a/keyserver/src/keyserver.js b/keyserver/src/keyserver.js
--- a/keyserver/src/keyserver.js
+++ b/keyserver/src/keyserver.js
@@ -6,8 +6,11 @@
import express from 'express';
import expressWs from 'express-ws';
import os from 'os';
+import qrcode from 'qrcode';
import './cron/cron.js';
+import { qrCodeLinkURL } from 'lib/facts/links.js';
+
import { migrate } from './database/migrations.js';
import { jsonEndpoints } from './endpoints.js';
import { emailSubscriptionResponder } from './responders/comm-landing-responders.js';
@@ -41,6 +44,8 @@
getCommAppURLFacts,
} from './utils/urls.js';
+const shouldDisplayQRCodeInTerminal = false;
+
(async () => {
await Promise.all([olm.init(), prefetchAllURLFacts(), initENSCache()]);
@@ -76,6 +81,18 @@
console.warn('failed_identity_login');
}
+ if (shouldDisplayQRCodeInTerminal) {
+ try {
+ const aes256Key = new Uint8Array([]);
+ const ed25519Key = 'ed25519Key';
+
+ const url = qrCodeLinkURL(aes256Key, ed25519Key);
+ qrcode.toString(url, (error, encodedURL) => console.log(encodedURL));
+ } catch (e) {
+ console.log('Error generating QR code', e);
+ }
+ }
+
const cpuCount = os.cpus().length;
for (let i = 0; i < cpuCount; i++) {
cluster.fork();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 2:28 PM (19 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2571160
Default Alt Text
D9180.diff (1 KB)
Attached To
Mode
D9180: [keyserver] Print out a QR code to the terminal
Attached
Detach File
Event Timeline
Log In to Comment