From 77cee95d2a34ec1bf67e7c74169ad58dcac496c2 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Sat, 6 Mar 2021 00:11:04 +0100 Subject: [PATCH 1/5] Update doip, add matrix and irc support --- package.json | 2 +- static/scripts.js | 4 ++-- yarn.lock | 39 +++++++++++++++++++++++++++++++++++---- 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 48a8531..85e7007 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "dependencies": { "bent": "^7.3.12", - "doipjs": "^0.10.5", + "doipjs": "^0.11.1", "dotenv": "^8.2.0", "express": "^4.17.1", "express-validator": "^6.8.0", diff --git a/static/scripts.js b/static/scripts.js index 94bd9b7..ffd10c3 100644 --- a/static/scripts.js +++ b/static/scripts.js @@ -1414,8 +1414,8 @@ if (elUtilProfileURL) { } function capitalizeLetteredServices(serviceName) { - var servName = serviceName.toLowerCase(); - if (servName === 'dns' || servName === 'xmpp') { + const servName = serviceName.toLowerCase(); + if (servName === 'dns' || servName === 'xmpp' || servName === 'irc') { return servName.toUpperCase(); } return serviceName; diff --git a/yarn.lock b/yarn.lock index 276dbe3..86f2885 100644 --- a/yarn.lock +++ b/yarn.lock @@ -780,6 +780,11 @@ decamelize@^1.2.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + decompress-response@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" @@ -872,16 +877,17 @@ doctypes@^1.1.0: resolved "https://registry.yarnpkg.com/doctypes/-/doctypes-1.1.0.tgz#ea80b106a87538774e8a3a4a5afe293de489e0a9" integrity sha1-6oCxBqh1OHdOijpKWv4pPeSJ4Kk= -doipjs@^0.10.5: - version "0.10.5" - resolved "https://registry.yarnpkg.com/doipjs/-/doipjs-0.10.5.tgz#df82dd70aff2903eddd7262e63f4e80ef4a9eb49" - integrity sha512-uFgt7rL5Olq2ByTDhjWNBlnWFsQAx6x5pJfDicnioJVNPFXcSdT2PFejfZGUTAfyI/1q3NWpSDn+vuPiR5udHg== +doipjs@^0.11.1: + version "0.11.1" + resolved "https://registry.yarnpkg.com/doipjs/-/doipjs-0.11.1.tgz#f708a53c6deb2a5a28e811f52d588f3bcd5c6a14" + integrity sha512-+QXjJfrfrQyWh/BrFfPmPdt1ClZ1OatTmfVBXxVYgfpXOjcBrpByGGN4x7unwg/rlmerO66SEzHP0/TYBUAP5Q== dependencies: bent "^7.3.12" browserify "^17.0.0" merge-options "^3.0.3" openpgp "^4.10.9" prettier "^2.1.2" + query-string "^6.14.1" valid-url "^1.0.9" domain-browser@^1.2.0: @@ -1093,6 +1099,11 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" +filter-obj@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/filter-obj/-/filter-obj-1.1.0.tgz#9b311112bc6c6127a16e016c6c5d7f19e0805c5b" + integrity sha1-mzERErxsYSehbgFsbF1/GeCAXFs= + finalhandler@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" @@ -2310,6 +2321,16 @@ qs@6.7.0: resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== +query-string@^6.14.1: + version "6.14.1" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.14.1.tgz#7ac2dca46da7f309449ba0f86b1fd28255b0c86a" + integrity sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw== + dependencies: + decode-uri-component "^0.2.0" + filter-obj "^1.1.0" + split-on-first "^1.0.0" + strict-uri-encode "^2.0.0" + querystring-es3@~0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" @@ -2569,6 +2590,11 @@ source-map@~0.5.3: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= +split-on-first@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/split-on-first/-/split-on-first-1.1.0.tgz#f610afeee3b12bce1d0c30425e76398b78249a5f" + integrity sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw== + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -2613,6 +2639,11 @@ stream-splicer@^2.0.0: inherits "^2.0.1" readable-stream "^2.0.2" +strict-uri-encode@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" + integrity sha1-ucczDHBChi9rFC3CdLvMWGbONUY= + string-replace-middleware@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/string-replace-middleware/-/string-replace-middleware-1.0.2.tgz#aa6a2f55322515d17e32b2f76327b777fb5c89f2" From a0fbbb698bb8d04df701fef10f520690f1baa6de Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Tue, 9 Mar 2021 11:01:51 +0100 Subject: [PATCH 2/5] Add IRC and Matrix guides --- content/guides/irc.md | 67 ++++++++++++++++++++++++++++++++++++++ content/guides/matrix.md | 69 ++++++++++++++++++++++++++++++++++++++++ views/guides.pug | 12 ++++--- 3 files changed, 144 insertions(+), 4 deletions(-) create mode 100644 content/guides/irc.md create mode 100644 content/guides/matrix.md diff --git a/content/guides/irc.md b/content/guides/irc.md new file mode 100644 index 0000000..47cab15 --- /dev/null +++ b/content/guides/irc.md @@ -0,0 +1,67 @@ +# Adding an IRC proof + +Let's add a decentralized IRC proof to your OpenPGP keys. + +[[toc]] + +### Add a property to your IRC taxonomy + +After logging in into the IRC server with your registered nickname, send the +following message (make sure to replace FINGERPRINT): + +``` +/msg NickServ SET PROPERTY KEY openpgp4fpr:FINGERPRINT +``` + +To check whether successful, send (make sure to replace NICK): + +``` +/msg NickServ TAXONOMY NICK +``` + +To add more fingerprints, send: + +``` +/msg NickServ SET PROPERTY KEY2 openpgp4fpr:FINGERPRINT +``` + +### Update the PGP key + +First, edit the key (make sure to replace FINGERPRINT): + +``` +gpg --edit-key FINGERPRINT +``` + +Add a new notation: + +``` +notation +``` + +Enter the notation (make sure to replace IRC_SERVER and NICK): + +``` +proof@metacode.biz=irc://IRC_SERVER/NICK +``` + +So, for user `foo` on the freenode server, this would be: + +``` +proof@metacode.biz=irc://chat.freenode.net/foo +``` + +Save the key: + +``` +save +``` + +Upload the key to WKD or use the following command to upload the key to +[keys.openpgp.org](https://keys.openpgp.org) (make sure to replace FINGERPRINT): + +``` +gpg --keyserver hkps://keys.openpgp.org --send-keys FINGERPRINT +``` + +And you're done! Reload your profile page, it should now show an IRC account. diff --git a/content/guides/matrix.md b/content/guides/matrix.md new file mode 100644 index 0000000..27c01a4 --- /dev/null +++ b/content/guides/matrix.md @@ -0,0 +1,69 @@ +# Adding a Matrix proof + +Let's add a decentralized Matrix proof to your OpenPGP keys. + +[[toc]] + +### Sending a proof message + +After logging in into Matrix, join the +[#doipver:matrix.org](https://matrix.to/#/#doipver:matrix.org) room and send the +following message (make sure to replace FINGERPRINT) + +``` +[Verifying my OpenPGP key: openpgp4fpr:FINGERPRINT] +``` + +Click on "View Source" for that message, you should now see the value for +`room_id` and `event_id`. + +The value for `room_id` should be `!dBfQZxCoGVmSTujfiv:matrix.org`. The value +for `event_id` is unique to your message. + +If your Matrix client does not support "View Source", choose "Share" or +"Permalink". The URL obtained should look like this: + +``` +https://matrix.to/#/ROOM_ID/EVENT_ID?via=... +``` + +### Update the PGP key + +First, edit the key (make sure to replace FINGERPRINT): + +``` +gpg --edit-key FINGERPRINT +``` + +Add a new notation: + +``` +notation +``` + +Enter the notation (make sure to replace USER_ID, ROOM_ID, EVENT_ID): + +``` +proof@metacode.biz=matrix:u/USER_ID?org.keyoxide.r=ROOM_ID&org.keyoxide.e=EVENT_ID +``` + +So, for user `@foo:matrix.org`, this would be: + +``` +proof@metacode.biz=matrix:u/@foo:matrix.org?org.keyoxide.r=!dBfQZxCoGVmSTujfiv:matrix.org&org.keyoxide.e=$3dVX1nv3lmwnKxc0mgto_Sf-REVr45Z6G7LWLWal10w +``` + +Save the key: + +``` +save +``` + +Upload the key to WKD or use the following command to upload the key to +[keys.openpgp.org](https://keys.openpgp.org) (make sure to replace FINGERPRINT): + +``` +gpg --keyserver hkps://keys.openpgp.org --send-keys FINGERPRINT +``` + +And you're done! Reload your profile page, it should now show a Matrix account. diff --git a/views/guides.pug b/views/guides.pug index c7d2a79..a11da1d 100644 --- a/views/guides.pug +++ b/views/guides.pug @@ -15,7 +15,7 @@ block content a(href='/guides/contributing') Contributing to Keyoxide br a(href='/guides/self-hosting-keyoxide') Self-hosting Keyoxide - + .guides__section h3 OpenPGP and identity proofs a(href='/guides/openpgp-proofs') How OpenPGP identity proofs work @@ -23,7 +23,7 @@ block content a(href='/guides/web-key-directory') Uploading keys using web key directory br a(href='/guides/signature-profiles') Using signature profiles - + .guides__section h3 Adding proofs a(href='/guides/devto') Dev.to @@ -40,8 +40,12 @@ block content br a(href='/guides/hackernews') Hackernews br + a(href='/guides/irc') IRC + br a(href='/guides/lobsters') Lobste.rs br + a(href='/guides/matrix') Matrix + br a(href='/guides/mastodon') Mastodon br a(href='/guides/owncast') Owncast @@ -53,13 +57,13 @@ block content a(href='/guides/twitter') Twitter br a(href='/guides/xmpp') XMPP+OMEMO - + .guides__section h3 Other services a(href='/guides/feature-comparison-keybase') Feature comparison with Keybase br a(href='/guides/migrating-from-keybase') Migrating from Keybase - + .guides__section h3 Managing proofs in GnuPG a(href='/guides/managing-proofs-listing') Listing proofs From 2cfe8a7244750a0407ee506b5ee62c6d106afd7a Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Tue, 9 Mar 2021 11:05:59 +0100 Subject: [PATCH 3/5] Gracefully handle fetching non-existing guides --- routes/main.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/routes/main.js b/routes/main.js index 642a064..8aad995 100644 --- a/routes/main.js +++ b/routes/main.js @@ -69,12 +69,21 @@ router.get('/guides', (req, res) => { router.get('/guides/:guideId', (req, res) => { let env = {}; - let rawContent = fs.readFileSync(`./content/guides/${req.params.guideId}.md`, "utf8", (err, data) => { - if (err) throw err; - return data; + fs.readFile(`./content/guides/${req.params.guideId}.md`, "utf8", (err, data) => { + if (err) { + res.render(`404`); + return + } + + const content = md.render(data, env); + res.render(`basic`, { title: `${env.title} - Keyoxide`, content: content }); }); - const content = md.render(rawContent, env); - res.render(`basic`, { title: `${env.title} - Keyoxide`, content: content }); + // let rawContent = fs.readFileSync(`./content/guides/${req.params.guideId}.md`, "utf8", (err, data) => { + // if (err) throw err; + // return data; + // }); + // const content = md.render(rawContent, env); + // res.render(`basic`, { title: `${env.title} - Keyoxide`, content: content }); }); module.exports = router; From 5aebacaa0364eaca1d60dccca0d60b38973f9e39 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Tue, 9 Mar 2021 11:47:02 +0100 Subject: [PATCH 4/5] Update doip --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 85e7007..6852546 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "dependencies": { "bent": "^7.3.12", - "doipjs": "^0.11.1", + "doipjs": "^0.11.2", "dotenv": "^8.2.0", "express": "^4.17.1", "express-validator": "^6.8.0", diff --git a/yarn.lock b/yarn.lock index 86f2885..cfec009 100644 --- a/yarn.lock +++ b/yarn.lock @@ -877,10 +877,10 @@ doctypes@^1.1.0: resolved "https://registry.yarnpkg.com/doctypes/-/doctypes-1.1.0.tgz#ea80b106a87538774e8a3a4a5afe293de489e0a9" integrity sha1-6oCxBqh1OHdOijpKWv4pPeSJ4Kk= -doipjs@^0.11.1: - version "0.11.1" - resolved "https://registry.yarnpkg.com/doipjs/-/doipjs-0.11.1.tgz#f708a53c6deb2a5a28e811f52d588f3bcd5c6a14" - integrity sha512-+QXjJfrfrQyWh/BrFfPmPdt1ClZ1OatTmfVBXxVYgfpXOjcBrpByGGN4x7unwg/rlmerO66SEzHP0/TYBUAP5Q== +doipjs@^0.11.2: + version "0.11.2" + resolved "https://registry.yarnpkg.com/doipjs/-/doipjs-0.11.2.tgz#150e5fbce97536ad2570b492ee25ab42b0e2a9f9" + integrity sha512-UZJegmUvMBJS5luh2a64JOVMGO80KdkGY7I9noxr5rmwuiSNzhSy5571DY1z2vacYOrZ1xpxUnlzB0bC9+NiNg== dependencies: bent "^7.3.12" browserify "^17.0.0" From 7bd91b4fe8aff9212f6514f16ecd7075c3cb33ca Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Tue, 9 Mar 2021 12:36:08 +0100 Subject: [PATCH 5/5] Release 2.5.0 --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6173154..6afa448 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.5.0] - 2021-03-09 +### Added +- IRC service provider +- Matrix service provider +### Fixed +- Gracefully handle fetching non-existing guides + ## [2.4.2] - 2021-03-02 ### Fixed - Twitter claim verification diff --git a/package.json b/package.json index 6852546..13b0ea1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "keyoxide-web", - "version": "2.4.2", + "version": "2.5.0", "description": "A modern, secure and privacy-friendly platform to establish your decentralized online identity", "main": "index.js", "dependencies": {