mirror of
https://github.com/urbit/shrub.git
synced 2024-11-30 22:15:47 +03:00
add |moon, |moon-cycle-keys, and |moon-breach
This commit is contained in:
parent
eed4c6a236
commit
c453450d9c
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c84bb3630f7f4cd080c48eba65de6b55d0dbb6b9238db112cc67f103daa681bb
|
||||
size 9655452
|
||||
oid sha256:38f3248052e057fcea95b240a4c586cef5ba9bce06568203a692312a9cfcb4cf
|
||||
size 9731837
|
||||
|
@ -161,6 +161,7 @@
|
||||
++ poke-helm-send-hi (wrap poke-send-hi):from-helm
|
||||
++ poke-helm-verb (wrap poke-verb):from-helm
|
||||
++ poke-helm-rekey (wrap poke-rekey):from-helm
|
||||
++ poke-helm-moon (wrap poke-moon):from-helm
|
||||
++ poke-helm-nuke (wrap poke-nuke):from-helm
|
||||
++ poke-helm-automass (wrap poke-automass):from-helm
|
||||
++ poke-helm-cancel-automass (wrap poke-cancel-automass):from-helm
|
||||
|
33
pkg/arvo/gen/hood/moon-breach.hoon
Normal file
33
pkg/arvo/gen/hood/moon-breach.hoon
Normal file
@ -0,0 +1,33 @@
|
||||
:: Create a private key-file for a random (or specified) moon
|
||||
::
|
||||
:::: /hoon/moon/hood/gen
|
||||
::
|
||||
/- *sole
|
||||
/+ *generators
|
||||
::
|
||||
::::
|
||||
::
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvJ bec=beak]
|
||||
[mon=@p ~]
|
||||
=rift
|
||||
==
|
||||
:- %helm-moon
|
||||
^- (unit [=ship =udiff:point:able:jael])
|
||||
=* our p.bec
|
||||
=/ ran (clan:title our)
|
||||
?: ?=({?($earl $pawn)} ran)
|
||||
%- %- slog :_ ~
|
||||
leaf+"can't manage a moon from a {?:(?=($earl ran) "moon" "comet")}"
|
||||
~
|
||||
=/ seg=ship (sein:title our now mon)
|
||||
?. =(our seg)
|
||||
%- %- slog :_ ~
|
||||
:- %leaf
|
||||
"can't create keys for {(scow %p mon)}, which belongs to {(scow %p seg)}"
|
||||
~
|
||||
=/ =^rift
|
||||
?. =(*^rift rift)
|
||||
rift
|
||||
+(.^(^rift j+/(scot %p our)/rift/(scot %da now)/(scot %p mon)))
|
||||
`[mon *id:block:able:jael %rift rift]
|
45
pkg/arvo/gen/hood/moon-cycle-keys.hoon
Normal file
45
pkg/arvo/gen/hood/moon-cycle-keys.hoon
Normal file
@ -0,0 +1,45 @@
|
||||
:: Create a private key-file for a random (or specified) moon
|
||||
::
|
||||
:::: /hoon/moon/hood/gen
|
||||
::
|
||||
/- *sole
|
||||
/+ *generators
|
||||
::
|
||||
::::
|
||||
::
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvJ bec=beak]
|
||||
[mon=@p ~]
|
||||
=life
|
||||
public-key=pass
|
||||
==
|
||||
:- %helm-moon
|
||||
^- (unit [=ship =udiff:point:able:jael])
|
||||
=* our p.bec
|
||||
=/ ran (clan:title our)
|
||||
?: ?=({?($earl $pawn)} ran)
|
||||
%- %- slog :_ ~
|
||||
leaf+"can't manage a moon from a {?:(?=($earl ran) "moon" "comet")}"
|
||||
~
|
||||
=/ seg=ship (sein:title our now mon)
|
||||
?. =(our seg)
|
||||
%- %- slog :_ ~
|
||||
:- %leaf
|
||||
"can't create keys for {(scow %p mon)}, which belongs to {(scow %p seg)}"
|
||||
~
|
||||
=/ =^life
|
||||
?. =(*^life life)
|
||||
life
|
||||
+(.^(^life j+/(scot %p our)/life/(scot %da now)/(scot %p mon)))
|
||||
=/ =pass
|
||||
?. =(*pass public-key)
|
||||
public-key
|
||||
=/ cub (pit:nu:crub:crypto 128 (sham mon life eny))
|
||||
=/ =seed:able:jael
|
||||
[mon 1 sec:ex:cub ~]
|
||||
%- %- slog
|
||||
:~ leaf+"moon: {(scow %p mon)}"
|
||||
leaf+(scow %uw (jam seed))
|
||||
==
|
||||
pub:ex:cub
|
||||
`[mon *id:block:able:jael %keys life 1 pass]
|
44
pkg/arvo/gen/hood/moon.hoon
Normal file
44
pkg/arvo/gen/hood/moon.hoon
Normal file
@ -0,0 +1,44 @@
|
||||
:: Create a private key-file for a random (or specified) moon
|
||||
::
|
||||
:::: /hoon/moon/hood/gen
|
||||
::
|
||||
/- *sole
|
||||
/+ *generators
|
||||
::
|
||||
::::
|
||||
::
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvJ bec=beak]
|
||||
arg=?(~ [mon=@p ~])
|
||||
public-key=pass
|
||||
==
|
||||
:- %helm-moon
|
||||
^- (unit [=ship =udiff:point:able:jael])
|
||||
=* our p.bec
|
||||
=/ ran (clan:title our)
|
||||
?: ?=({?($earl $pawn)} ran)
|
||||
%- %- slog :_ ~
|
||||
leaf+"can't create a moon from a {?:(?=($earl ran) "moon" "comet")}"
|
||||
~
|
||||
=/ mon=ship
|
||||
?^ arg
|
||||
mon.arg
|
||||
(add our (lsh 5 1 (end 5 1 (shaz eny))))
|
||||
=/ seg=ship (sein:title our now mon)
|
||||
?. =(our seg)
|
||||
%- %- slog :_ ~
|
||||
:- %leaf
|
||||
"can't create keys for {(scow %p mon)}, which belongs to {(scow %p seg)}"
|
||||
~
|
||||
=/ =pass
|
||||
?. =(*pass public-key)
|
||||
public-key
|
||||
=/ cub (pit:nu:crub:crypto 128 (sham mon life=1 eny))
|
||||
=/ =seed:able:jael
|
||||
[mon 1 sec:ex:cub ~]
|
||||
%- %- slog
|
||||
:~ leaf+"moon: {(scow %p mon)}"
|
||||
leaf+(scow %uw (jam seed))
|
||||
==
|
||||
pub:ex:cub
|
||||
`[mon *id:block:able:jael %keys 1 1 pass]
|
@ -1,37 +0,0 @@
|
||||
:: Create a private key-file for a random (or specified) moon
|
||||
::
|
||||
:::: /hoon/moon/gen
|
||||
::
|
||||
/? 310
|
||||
/- *sole
|
||||
/+ *generators
|
||||
::
|
||||
::::
|
||||
::
|
||||
:- %ask
|
||||
|= $: [now=@da eny=@uvJ bec=beak]
|
||||
arg=?(~ [mon=@p ~])
|
||||
~
|
||||
==
|
||||
=* our p.bec
|
||||
=/ ran (clan:title our)
|
||||
?: ?=({?($earl $pawn)} ran)
|
||||
%- produce
|
||||
:- %tang :_ ~
|
||||
leaf+"can't create a moon from a {?:(?=($earl ran) "moon" "comet")}"
|
||||
=/ mon=ship
|
||||
?^ arg
|
||||
mon.arg
|
||||
(add our (lsh 5 1 (end 5 1 (shaz eny))))
|
||||
=/ seg=ship (sein:title our now mon)
|
||||
?. =(our seg)
|
||||
%- produce
|
||||
:- %tang :_ ~
|
||||
leaf+"can't create keys for {(scow %p mon)}, which belongs to {(scow %p seg)}"
|
||||
=/ lyf=life .^(@ud j+/(scot %p our)/life/(scot %da now)/(scot %p our))
|
||||
=/ sed=seed:able:jael
|
||||
.^ seed:able:jael
|
||||
j+/(scot %p our)/earl/(scot %da now)/(scot %p mon)/(scot %ud lyf)
|
||||
==
|
||||
%+ print leaf+"moon: {(scow %p mon)}"
|
||||
%- produce [%atom (scot %uw (jam sed))]
|
@ -46,6 +46,7 @@
|
||||
{$rest wire @da} ::
|
||||
{$wait wire @da} ::
|
||||
{$rekey wire life ring} ::
|
||||
{$moon wire ship udiff:point:able:jael} ::
|
||||
== ::
|
||||
++ move (pair bone card) :: user-level move
|
||||
++ pear :: poke fruit
|
||||
@ -79,15 +80,14 @@
|
||||
?. =(our who.u.sed)
|
||||
~& [%wrong-private-key-ship who.u.sed]
|
||||
+>.$
|
||||
=/ lyf=life .^(@ud j+/(scot %p our)/life/(scot %da now)/(scot %p our))
|
||||
?. =(+(lyf) lyf.u.sed)
|
||||
~& [%wrong-private-key-life expected=+(lyf) actual=lyf.u.sed]
|
||||
+>.$
|
||||
:: our new private key, as a +tree of +rite
|
||||
::
|
||||
=/ rit (sy [%jewel (my [lyf.u.sed key.u.sed] ~)] ~)
|
||||
(emit %rekey / lyf.u.sed key.u.sed)
|
||||
+>.$
|
||||
::
|
||||
++ poke-moon :: rotate moon keys
|
||||
|= sed=(unit [=ship =udiff:point:able:jael])
|
||||
=< abet
|
||||
?~ sed
|
||||
+>.$
|
||||
(emit %moon / u.sed)
|
||||
::
|
||||
++ poke-nuke :: initialize
|
||||
|= him/ship =< abet
|
||||
|
@ -252,13 +252,19 @@
|
||||
|= who=ship
|
||||
=/ m (ph ,~)
|
||||
^- form:m
|
||||
;< now=@da bind:m
|
||||
|= pin=ph-input
|
||||
[& ~ %done now.pin]
|
||||
(raw-ship:(ph-tests our) who `(dawn who now))
|
||||
?. =(%earl (clan:title who))
|
||||
(raw-ship:(ph-tests our) who `(dawn who ~))
|
||||
=/ spon=ship (^sein:title who)
|
||||
=/ cub (pit:nu:crub:crypto 128 (sham who life=1 %entropy))
|
||||
=/ =seed:able:jael
|
||||
[who 1 sec:ex:cub ~]
|
||||
=/ =pass pub:ex:cub
|
||||
=/ com=tape "|moon {(scow %p who)}, =public-key {(scow %uw pass)}"
|
||||
;< ~ bind:m (just-events:(ph-tests our) (dojo spon com))
|
||||
(raw-ship:(ph-tests our) who `(dawn who `seed))
|
||||
::
|
||||
++ dawn
|
||||
|= [who=ship now=@da]
|
||||
|= [who=ship seed=(unit seed:able:jael)]
|
||||
^- dawn-event
|
||||
=/ spon
|
||||
=/ =ship (^sein:title who)
|
||||
@ -279,14 +285,8 @@
|
||||
`[life=life pass rift spon-spon ~]
|
||||
~
|
||||
=/ =seed:able:jael
|
||||
?: =(%earl (clan:title who))
|
||||
=/ pax
|
||||
;: weld
|
||||
/i/(scot %p ship.spon)/j/(scot %p ship.spon)/earl/(scot %da now)
|
||||
/(scot %p who)/(scot %ud life.spon)
|
||||
/noun
|
||||
==
|
||||
(need (scry-aqua (unit seed:able:jael) our now pax))
|
||||
?^ seed
|
||||
u.seed
|
||||
=/ life-rift (~(got by lives) who)
|
||||
=/ =life lyfe.life-rift
|
||||
[who life sec:ex:(get-keys who life) ~]
|
||||
|
@ -1,16 +0,0 @@
|
||||
::
|
||||
:::: /hoon/snap/mar
|
||||
::
|
||||
=, mimes:html
|
||||
|_ snap/snapshot:jael
|
||||
++ grow
|
||||
|%
|
||||
++ mime [/application/octet-stream (jam snap)]
|
||||
--
|
||||
++ grab
|
||||
|%
|
||||
++ noun snapshot:jael
|
||||
++ mime |=([p=mite:eyre q=octs:eyre] (cue q.q))
|
||||
--
|
||||
++ grad %mime
|
||||
--
|
@ -1337,6 +1337,7 @@
|
||||
%listen `%j
|
||||
%merg `%c
|
||||
%mont `%c
|
||||
%moon `%j
|
||||
%nuke `%a
|
||||
%ogre `%c
|
||||
%perm `%c
|
||||
|
@ -413,6 +413,18 @@
|
||||
%- curd =< abet
|
||||
(private-keys:~(feel su hen our pki etn) life.tac ring.tac)
|
||||
::
|
||||
:: update private keys
|
||||
::
|
||||
%moon
|
||||
?. =(%earl (clan:title ship.tac))
|
||||
~& [%not-moon ship.tac]
|
||||
+>.$
|
||||
?. =(our (^sein:title ship.tac))
|
||||
~& [%not-our-moon ship.tac]
|
||||
+>.$
|
||||
%- curd =< abet
|
||||
(~(new-event su hen our pki etn) [ship udiff]:tac)
|
||||
::
|
||||
:: watch public keys
|
||||
:: [%public-keys ships=(set ship)]
|
||||
::
|
||||
@ -697,24 +709,10 @@
|
||||
|- ^+ ..feed
|
||||
?~ moonl
|
||||
..feed
|
||||
?. =(our spon.i.moonl)
|
||||
=. ..feed (sources:feel ships.i.moonl [%& spon.i.moonl])
|
||||
?: =(our spon.i.moonl)
|
||||
$(moonl t.moonl)
|
||||
:: Our moon
|
||||
::
|
||||
=/ sec (~(got by jaw.own.pki) lyf.own.pki)
|
||||
=/ points=(map ship point)
|
||||
=/ our-moonl ~(tap in ships.i.moonl)
|
||||
%- malt
|
||||
|- ^- (list [ship point])
|
||||
?~ our-moonl
|
||||
~
|
||||
=/ moon-sec (shaf %earl (sham our lyf.own.pki sec i.our-moonl))
|
||||
=/ cub (pit:nu:crub:crypto 128 moon-sec)
|
||||
=/ =pass pub:ex:cub
|
||||
:- [i.our-moonl 1 1 (malt [1 1 pass] ~) `our]
|
||||
$(our-moonl t.our-moonl)
|
||||
(public-keys-give (sy hen ~) [%full points])
|
||||
=. ..feed (sources:feel ships.i.moonl [%& spon.i.moonl])
|
||||
$(moonl t.moonl)
|
||||
:: Add to subscriber list
|
||||
::
|
||||
=. ney.zim
|
||||
@ -830,6 +828,8 @@
|
||||
=. jaw.own (~(put by jaw.own) life ring)
|
||||
(exec yen.own [%give %private-keys lyf.own jaw.own])
|
||||
::
|
||||
:: Change sources for ships
|
||||
::
|
||||
++ sources
|
||||
|= [whos=(set ship) =source]
|
||||
^+ ..feel
|
||||
|
@ -2083,6 +2083,7 @@
|
||||
[%listen whos=(set ship) =source] :: set ethereum source
|
||||
::TODO %next for generating/putting new private key
|
||||
[%meet =ship =life =pass] :: met after breach
|
||||
[%moon =ship =udiff:point] :: register moon keys
|
||||
[%nuke whos=(set ship)] :: cancel tracker from
|
||||
[%private-keys ~] :: sub to privates
|
||||
[%public-keys ships=(set ship)] :: sub to publics
|
||||
|
@ -563,14 +563,12 @@
|
||||
c3_w kno_w; // -K, kernel version
|
||||
c3_c* key_c; // -k, private key file
|
||||
c3_o net; // -L, local-only networking
|
||||
c3_c* sap_c; // -m, eth snapshot url
|
||||
c3_o pro; // -P, profile
|
||||
c3_s por_s; // -p, ames port
|
||||
c3_o qui; // -q, quiet
|
||||
c3_o rep; // -R, report build info
|
||||
c3_o has; // -S, Skip battery hashes
|
||||
c3_o git; // -s, pill url from arvo git hash
|
||||
c3_o etn; // -t, trust snapshot for pre-boot
|
||||
c3_c* url_c; // -u, pill url
|
||||
c3_o vno; // -V, replay without reboots
|
||||
c3_o veb; // -v, verbose (inverse of -q)
|
||||
|
Loading…
Reference in New Issue
Block a user