From 4cf4bdcbe24cab19b53646c5ec86470ed98a7929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Habov=C5=A1tiak?= Date: Tue, 11 Jun 2019 09:08:51 +0200 Subject: [PATCH 1/3] Inform about how to create the QR code using shell People might want to avoid adding another dependencies and compiling stuff for such simple task. The URL can be easily created using shell, so dependencies aren't even needed. This change helps people to use command line, so they don't have to invent it themselves. --- lnd_connect_uri.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lnd_connect_uri.md b/lnd_connect_uri.md index 0c45421..ae050ac 100644 --- a/lnd_connect_uri.md +++ b/lnd_connect_uri.md @@ -30,6 +30,13 @@ var macaroon = base64url(new Buffer(macaroonData)); var url = 'lndconnect://' + ip.address() + ':10009?cert=' + cert + '&macaroon=' + macaroon ``` +### Create and show a QR code using command line + +This is useful when one doesn't want to bring dependencies. + +``` +lndconnect://example.com?cert='"`grep -v 'CERTIFICATE' tls.cert`"'&macaroon='"`base64 admin.macaroon`" | tr -d '\n' | qrencode -o /tmp/out.png && xdg-open /tmp/out.png +``` ## Example: From 845c8b97fb19a62a13146b50b38b7330689107c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Habov=C5=A1tiak?= Date: Wed, 12 Jun 2019 11:15:29 +0200 Subject: [PATCH 2/3] Added missing `echo'` --- lnd_connect_uri.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lnd_connect_uri.md b/lnd_connect_uri.md index ae050ac..04ed777 100644 --- a/lnd_connect_uri.md +++ b/lnd_connect_uri.md @@ -35,7 +35,7 @@ var url = 'lndconnect://' + ip.address() + ':10009?cert=' + cert + '&macaroon=' This is useful when one doesn't want to bring dependencies. ``` -lndconnect://example.com?cert='"`grep -v 'CERTIFICATE' tls.cert`"'&macaroon='"`base64 admin.macaroon`" | tr -d '\n' | qrencode -o /tmp/out.png && xdg-open /tmp/out.png +echo 'lndconnect://example.com?cert='"`grep -v 'CERTIFICATE' tls.cert`"'&macaroon='"`base64 admin.macaroon`" | tr -d '\n' | qrencode -o /tmp/out.png && xdg-open /tmp/out.png ``` ## Example: From 92795c0e09916f039bda252aeb52de05bc65c169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Habov=C5=A1tiak?= Date: Sun, 16 Jun 2019 15:43:13 +0200 Subject: [PATCH 3/3] Change to base64-URL encoding and remove xdg-open URL version of base64 encoding should be used instead, therefore appropriate conversion is applied in the command. Further, `xdg-open` isn't cross-platform, so it was removed. --- lnd_connect_uri.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lnd_connect_uri.md b/lnd_connect_uri.md index 04ed777..805dc16 100644 --- a/lnd_connect_uri.md +++ b/lnd_connect_uri.md @@ -35,7 +35,7 @@ var url = 'lndconnect://' + ip.address() + ':10009?cert=' + cert + '&macaroon=' This is useful when one doesn't want to bring dependencies. ``` -echo 'lndconnect://example.com?cert='"`grep -v 'CERTIFICATE' tls.cert`"'&macaroon='"`base64 admin.macaroon`" | tr -d '\n' | qrencode -o /tmp/out.png && xdg-open /tmp/out.png +echo 'lndconnect://example.com?cert='"`grep -v 'CERTIFICATE' tls.cert | tr -d '=' | tr '/+' '_-'`"'&macaroon='"`base64 admin.macaroon | tr -d '=' | tr '/+' '_-'`" | tr -d '\n' | qrencode -o /tmp/out.png ``` ## Example: