diff --git a/bin/solid.pill b/bin/solid.pill index ce17c6c868..9d257abc74 100644 --- a/bin/solid.pill +++ b/bin/solid.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1d56b7351a347a65c06999955114f196523a86c853390d5d1822a90a606619d6 -size 10357558 +oid sha256:f6b5e33e573818120051651c1182163527edbbe0dff0eb6591e12a55cfccb273 +size 10486101 diff --git a/nix/pkgs/docker-image/default.nix b/nix/pkgs/docker-image/default.nix index 467c06ac47..6c200a00ec 100644 --- a/nix/pkgs/docker-image/default.nix +++ b/nix/pkgs/docker-image/default.nix @@ -1,10 +1,24 @@ -{ urbit, libcap, coreutils, bashInteractive, dockerTools, writeScriptBin, amesPort ? 34343 }: +{ urbit, curl, libcap, coreutils, bashInteractive, dockerTools, writeScriptBin, amesPort ? 34343 }: let startUrbit = writeScriptBin "start-urbit" '' #!${bashInteractive}/bin/bash set -eu + # set defaults + amesPort=${toString amesPort} + + # check args + for i in "$@" + do + case $i in + -p=*|--port=*) + amesPort="''${i#*=}" + shift + ;; + esac + done + # If the container is not started with the `-i` flag # then STDIN will be closed and we need to start # Urbit/vere with the `-t` flag. @@ -23,7 +37,7 @@ let mv $keyname /tmp # Boot urbit with the key, exit when done booting - urbit $ttyflag -w $(basename $keyname .key) -k /tmp/$keyname -c $(basename $keyname .key) -p ${toString amesPort} -x + urbit $ttyflag -w $(basename $keyname .key) -k /tmp/$keyname -c $(basename $keyname .key) -p $amesPort -x # Remove the keyfile for security rm /tmp/$keyname @@ -34,7 +48,7 @@ let cometname=''${comets[0]} rm *.comet - urbit $ttyflag -c $(basename $cometname .comet) -p ${toString amesPort} -x + urbit $ttyflag -c $(basename $cometname .comet) -p $amesPort -x fi # Find the first directory and start urbit with the ship therein @@ -42,14 +56,44 @@ let dirs=( $dirnames ) dirname=''${dirnames[0]} - urbit $ttyflag -p ${toString amesPort} $dirname + exec urbit $ttyflag -p $amesPort $dirname + ''; + + getUrbitCode = writeScriptBin "get-urbit-code" '' + #!${bashInteractive}/bin/bash + + raw=$(curl -s -X POST -H "Content-Type: application/json" \ + -d '{ "source": { "dojo": "+code" }, "sink": { "stdout": null } }' \ + http://127.0.0.1:12321) + + # trim \n" from the end + trim="''${raw%\\n\"}" + + # trim " from the start + code="''${trim#\"}" + + echo "$code" + ''; + + resetUrbitCode = writeScriptBin "reset-urbit-code" '' + #!${bashInteractive}/bin/bash + + curl=$(curl -s -X POST -H "Content-Type: application/json" \ + -d '{ "source": { "dojo": "+hood/code %reset" }, "sink": { "app": "hood" } }' \ + http://127.0.0.1:12321) + + if [[ $? -eq 0 ]] + then + echo "OK" + else + echo "Curl error: $?" + fi ''; - in dockerTools.buildImage { name = "urbit"; tag = "v${urbit.version}"; - contents = [ bashInteractive urbit startUrbit coreutils ]; + contents = [ bashInteractive urbit curl startUrbit getUrbitCode resetUrbitCode coreutils ]; runAsRoot = '' #!${bashInteractive} mkdir -p /urbit diff --git a/nix/pkgs/hs/default.nix b/nix/pkgs/hs/default.nix index ab30f4c7dc..ea09883ba4 100644 --- a/nix/pkgs/hs/default.nix +++ b/nix/pkgs/hs/default.nix @@ -82,6 +82,8 @@ haskell-nix.stackProject { urbit-king.components.tests.urbit-king-tests.testFlags = [ "--brass-pill=${brass.lfs}" ]; + + lmdb.components.library.libs = lib.mkForce [ lmdb ]; }; }]; } diff --git a/pkg/arvo/app/contact-store.hoon b/pkg/arvo/app/contact-store.hoon index bd174a603f..8f39e75404 100644 --- a/pkg/arvo/app/contact-store.hoon +++ b/pkg/arvo/app/contact-store.hoon @@ -126,6 +126,14 @@ !=(contact(last-updated *@da) u.old(last-updated *@da)) == [~ state] + ~| "cannot add a data url to cover!" + ?> ?| ?=(~ cover.contact) + !=('data:' (cut 3 [0 5] u.cover.contact)) + == + ~| "cannot add a data url to avatar!" + ?> ?| ?=(~ avatar.contact) + !=('data:' (cut 3 [0 5] u.avatar.contact)) + == :- (send-diff [%add ship contact] =(ship our.bowl)) state(rolodex (~(put by rolodex) ship contact)) :: @@ -149,6 +157,14 @@ =/ contact (edit-contact old edit-field) ?: =(old contact) [~ state] + ~| "cannot add a data url to cover!" + ?> ?| ?=(~ cover.contact) + !=('data:' (cut 3 [0 5] u.cover.contact)) + == + ~| "cannot add a data url to avatar!" + ?> ?| ?=(~ avatar.contact) + !=('data:' (cut 3 [0 5] u.avatar.contact)) + == =. last-updated.contact timestamp :- (send-diff [%edit ship edit-field timestamp] =(ship our.bowl)) state(rolodex (~(put by rolodex) ship contact)) diff --git a/pkg/arvo/app/glob.hoon b/pkg/arvo/app/glob.hoon index 84b1eb34d5..0fb9ffa4a6 100644 --- a/pkg/arvo/app/glob.hoon +++ b/pkg/arvo/app/glob.hoon @@ -5,7 +5,7 @@ /- glob /+ default-agent, verb, dbug |% -++ hash 0v6.qafur.17301.j8obh.vbepn.7tq3l +++ hash 0v3.g6u13.haedt.jt4hd.61ek5.6t30q +$ state-0 [%0 hash=@uv glob=(unit (each glob:glob tid=@ta))] +$ all-states $% state-0 diff --git a/pkg/arvo/app/landscape/index.html b/pkg/arvo/app/landscape/index.html index d1f0081385..8a76a571f8 100644 --- a/pkg/arvo/app/landscape/index.html +++ b/pkg/arvo/app/landscape/index.html @@ -24,6 +24,6 @@
- +