Commit Graph
249 Commits
Author SHA1 Message Date
pharpend dac533f136 make comment language more polite 2023-08-12 14:55:38 -06:00
pharpend f054744bbc add vdk_aeser lib (untested) 2023-08-12 13:17:54 -06:00
pharpend b627689133 [wip] jr can now tell the page script about current pubkey 2023-08-12 13:17:41 -06:00
pharpend 315ae9c315 [wip] i forgot to write the s2i function, but progress on showing address to user 2023-08-11 17:40:23 -06:00
pharpend c9f2365aa1 [wip] reorganize README 2023-08-11 14:37:12 -06:00
pharpend 700ee7cc5f remove internal todo list 2023-08-11 12:45:30 -06:00
pharpend fa0a344b3a remove mental disability notes, committed by accident 2023-08-11 12:45:08 -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 60f27b4952 [wip] jr addressing: fixed type errors; next thing to do is write serializer lib 2023-08-11 12:39:12 -06:00
pharpend a73da72382 [wip] jr: working on presenting address to user 2023-08-11 12:15:56 -06:00
pharpend 1e80a53051 idiomatically refactoring jr controller
I am trying to copy the Erlang idiom of "calling" another process through a
function call interface. That is, suppose I have two named processes
corresponding to modules `caller` and `callee`

caller.erl:

    foo() ->
        Result = callee:get_some_data(),
        do_something_with(Result).

callee.erl:
    get_some_data() ->
        gen_server:call(?MODULE, get_some_data)

    handle_call(get_some_data, CalleeState) ->
        {Result, NewState} = do_get_some_data(CalleeState),
        {reply, Result, NewState}.

I'm trying to replicate that in JS, because it's definitely the most pleasant
idiom for having different processes "talk" to each other.  This also allows
the callee process to define an API that black-boxes away the internal
messaging structure, thus giving the developer the flexibility to change that
internal messaging structure without breaking the calling code.
2023-08-01 15:15:15 -06:00
pharpend b3eba95520 starting jr controller api idiom 2023-07-30 22:58:55 -06:00
pharpend c54c57b37a shift script include URLs to be relative 2023-07-26 17:24:49 -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 d41f29aa1f website 2023-07-26 15:19:41 -06:00
pharpend 12b5a01394 organizing vanillae website
index.html is *just* going to be an index. it will factor out everything to
links, but it will have *all* the links
2023-07-22 01:24:24 -06:00
pharpend 301030d3b8 Merge branch 'pharpend/sidekick-tx-sign-yesprop' into pharpend/develop 2023-07-20 14:38:12 -06:00
pharpend 6e1189a789 version bump sk/awcp/parasite to add tx_sign_yesprop
There is now an explicit function to have superhero sign the transaction *and*
propagate it into the network.  JR will simply reject these requests.
2023-07-20 14:34:19 -06:00
pharpend 50cac48f99 [wip] updating sidekick 2023-07-19 00:38:03 -06:00
pharpend ff8670d592 committing because switching branches 2023-07-18 14:48:23 -06:00
pharpend 19203cc003 have page script talking to controller 2023-07-14 20:53:35 -06:00
pharpend 984f562579 wrote out architecture rant in readme 2023-07-12 17:17:03 -06:00
pharpend 373d43dd8c committing because commitment is good 2023-07-09 21:01:54 -06:00
pharpend b76397b723 jr code cleanups 2023-07-09 15:03:53 -06:00
pharpend ef112d7da4 apparently github doesn't understand what hyperlinks are anymore 2023-07-08 23:02:26 -06:00
pharpend 49ce304ec5 add readme to vrlp, assertion about encode->decode roundtrip 2023-07-08 23:00:45 -06:00
pharpend 890372f27f Merge branch 'pharpend/develop' of github.com:aeternity/Vanillae into pharpend/develop 2023-07-08 19:28:55 -06:00
pharpend c04fc74e97 site 2023-07-08 19:28:49 -06:00
pharpend 8fab36de60 jr 2023-07-08 19:28:41 -06:00
pharpend bf20eb0f09 just trying to get a bad jr working so it works 2023-07-07 00:20:26 -06:00
pharpend 8f09c41676 doccing things 2023-07-06 23:59:30 -06:00
pharpend e408ba9b2a add vrlp tests 2023-07-06 19:52:40 -06:00
pharpend 180a395092 Merge branch 'master' into pharpend/develop 2023-07-06 11:14:00 -06:00
pharpend c900e16e02 Merge branch 'pharpend/develop' of github.com:aeternity/Vanillae into pharpend/develop 2023-07-06 11:13:26 -06:00
pharpend 472c97df62 add vanillae rlp lib 2023-07-06 11:13:20 -06:00
pharpend 754a3faf89 add vrlp project 2023-07-06 11:08:25 -06:00
Craig Everett 3677709c89 v2 -> v3 2023-06-15 20:20:33 +09:00
pharpend 892bec960b add the TODO file 2023-05-28 15:41:53 -06:00
pharpend 812920cf2e all the tests pass 2023-05-28 15:40:54 -06:00
pharpend daea58c91e vdk_tests_cases appears done 2023-05-28 13:25:51 -06:00
pharpend 668fe623cd vdk_rlp appears done 2023-05-28 13:08:45 -06:00
pharpend 7b9df16196 fix vdk_base64 package name, faert appears to be done 2023-05-25 15:50:45 -06:00
pharpend e0fcb7b88a vdk_base58 appears done 2023-05-25 15:47:26 -06:00
pharpend be7b2dd219 base64 appears done 2023-05-25 15:15:19 -06:00
pharpend a548572de9 vdk_binary seems to be done 2023-05-25 15:13:16 -06:00
pharpend ee30eaaf7f [wip] factoring vdk out into several packages 2023-05-25 15:05:48 -06:00
pharpend 35ef2e0b1d vanillae project reorganization 2023-05-25 12:58:23 -06:00
pharpend 6c80c37efa bits more 2023-05-24 00:52:59 -06:00
pharpend 60f56cf25d i think i figured out the boundary case crap 2023-05-15 16:57:02 -06:00
pharpend 93ce93a3bf ts bitstring work 2023-05-12 18:31:30 -06:00