Commit Graph
36 Commits
Author SHA1 Message Date
pharpend 18be0c53f2 fixed blake issue
turned out that i was using an outdated version of vdk_aecrypt in jr. updated
2023-10-07 15:47:59 -06:00
Craig Everett 1a9b12b27c Minor update to docs 2023-08-31 15:59:44 +09:00
pharpend 86710f5b1f add notes file for jex 2023-08-30 21:54:10 -06:00
pharpend b3cbbba803 jex no longer uses the github readme for package docs 2023-08-27 16:03:58 -06:00
pharpend 5dd28d9ed4 Remove the scripts I wrote when I was being dumb
Recall that I had the problem of not being able to load NaCl into the context
of my background script.  I thought the problem was some nonsense with the way
"security" works in browser extensions.  There are some contexts where in order
to load a script, you must explicitly specify the SHA-256 or SHA-384 hash of
the script, in base64 notation.  I wrote these scripts for the purpose of
quickly reading a file and spitting out those values, so that I could easily
update the manifest as I was fooling around with the scripts.

It turned out that entire hypothesis was wrong: https://github.com/aeternity/Vanillae/commit/b680336ba464eafe63daafd95002f09e798c09d9

And therefore these scripts are now just junk
2023-08-11 12:40:14 -06:00
pharpend b680336ba4 all this time i thought that it was the browser that was mentally disabled it turned out the mental disability was inside me all along
======================
NACL mental disability
======================

NACL is mentally disabled and can't be loaded as an ES6 module. That is, it can't be
"imported" using

```js
import * as nacl from './path/to/nacl.js';
```

Instead you have to include it in a page. So we have a page called
`background.html`.

I naively tried this

```html
<script src="dist/jex_include/local-nacl-1.0.3/nacl.js"></script>
```

That of course didn't work because we live in hell.

I initially thought the problem was an invalid hash. No. Notes as I figure it
out:

    Trying to figure out why TweetNaCl isn't loading

    ok so the problem is not an invalid hash, it's something specific
    to nacl

    to have an inline script, its hash must be specified in
    manifest.json

    example (integrity key is not necessary, it is there purely for
    comment purposes)

         beginning of line
        V
        |        <script integrity="sha256-8T3dvQxHPNQvgxzCemw3KGUCM5RhknpCQF6pCcTdFTw=">console.log('bg-test-inline.js line 1!');
        |</script>

    newline is there for hash purposes

    this works if and only if
    'sha256-8T3dvQxHPNQvgxzCemw3KGUCM5RhknpCQF6pCcTdFTw=' is included
    in the manifest.json

    example (top level key):

         "content_security_policy" : "script-src 'self' 'sha256-8T3dvQxHPNQvgxzCemw3KGUCM5RhknpCQF6pCcTdFTw='; object-src 'self'",

    Absent that explicit allow, I get this error from Firefox:

        Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”).

    Refs:
        1. https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_security_policy
        2. https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_Security_Policy#inline_javascript

    If I include the same script as a file,

        <script src="bg-test-inline.js"></script>

    this works irrespective of if I specify it as allowable in the manifest

    nacl is just refusing to load

        Loading failed for the <script> with source “moz-extension://eafd6a74-b75b-4312-9a34-8087b68395e7/dist/jex_include/local-nacl-1.0.3/nacl.js”.

    I initially thought it was a hash problem, but it is not

    TweetNaCL doesn't work as an ES6 module, it works by destructively
    updating the window namespace.  This I think was necessary before
    ES6, and that behavior is retained either because of laziness or
    because of backward compatibility reasons.

    hmm

    so this just plainly doesn't work and i cannot figure out why

        <script src="dist/jex_include/local-nacl-1.0.3/nacl.js"></script>

I think it works if I do it in the popup window instead. Let's try

oh no

no

oh my god

i am so stupid

the problem was that i typed the url wrong

the package is "tweetnacl" not "nacl", and i also need /dist/ too

    <script src="dist/jex_include/local-tweetnacl-1.0.3/dist/nacl.js"></script>

that works

all this time i thought that it was the browser that was mentally disabled

it turned out the mental disability was inside me all along

alright well I discovered a potential future pitfall at least
2023-07-26 17:21:17 -06:00
pharpend 478fcd123f trivial change to vb64 2023-04-28 18:44:52 -06:00
Foo Bar 7b5b1b82c9 base N tutorial video 1 2023-02-25 13:26:10 -07:00
Foo Bar 1d12ada843 add base64 erlang 2023-02-24 16:40:17 -07:00
Foo Bar 33393f592a [wip] jex and thinking about model thing on the jr thing" 2023-01-29 22:59:24 -07:00
pharpend aca416218d vw deompose ak function 2023-01-23 01:07:26 -07:00
pharpend da0fa03869 [wip] state management and keypair generation 2023-01-14 14:56:01 -07:00
pharpend ad722f8954 turn off stupid erlang warnings about unused variables 2022-12-28 03:23:54 -07:00
pharpend ce4047f795 add bip39 files from Hans 2022-12-22 00:24:26 -07:00
pharpend c4f71c8b4d generating a keypair works 2022-12-20 21:13:24 -07:00
pharpend cbe487618c [wip] generating keypair with ec_utils copied from zx's github 2022-12-20 20:58:21 -07:00
pharpend 434ed02e83 package tweetnacl correctly 2022-12-20 02:53:05 -07:00
pharpend c8ddd77004 got echo pkg_type done
working on packaging nacl, need to branch based on package type
2022-12-19 22:23:00 -07:00
Foo Bar fd9a0c10c7 add varuint module 2022-11-30 14:59:54 -07:00
Foo Bar 41249baf3c add msg_sign example to sidekick 2022-11-28 19:17:48 -07:00
Foo Bar 36cb75c51d [wip] packaging nacl 2022-11-27 20:32:22 -07:00
pharpend 3ddca3db2f ready for zx message sign demo 2022-11-27 00:12:15 -07:00
Foo Bar c3194b1ec2 [wip] updating sidekick/jex/awcp for message sign demo 2022-11-25 18:01:28 -07:00
Foo Bar 9d453d87d8 jex get_mindist command done 2022-11-21 21:37:41 -07:00
Foo Bar a013be547a add jex install (it works next up: jex get_mindist 2022-11-21 21:19:51 -07:00
Foo Bar 95f9b39293 WIP: add jex fulldist command 2022-11-21 20:41:52 -07:00
Foo Bar 8959f06b63 [wip] documentation generation/serving 2022-11-21 11:49:03 -07:00
Foo Bar c260c090d9 jex docs push thing command done 2022-11-20 21:25:49 -07:00
pharpend 86d0501b90 [wip] playing around with maybe making tarballs 2022-11-20 19:49:45 -07:00
pharpend 083e159096 add jex mkdocs command 2022-11-20 16:23:53 -07:00
pharpend 9589adaef8 [wip] various inconsequential changes 2022-11-17 16:01:19 -07:00
pharpend ab2b816f88 [wip] initial vw commit 2022-11-16 15:13:20 -07:00
pharpend 7fe7e1cc2b improvements to vanillae documentation 2022-10-19 01:25:29 -06:00
pharpend 601ad6baa3 start writing a manual 2022-10-12 18:09:39 -06:00
pharpend 2d66768951 add jex dwim[-+] commands, and a README 2022-10-12 01:18:35 -06:00
pharpend d1b40247be reorganizing because zx needs to feel special 2022-10-05 08:22:45 -06:00