mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-05 13:55:54 +03:00
Merge branch 'master' into newbreach
Conflicts: urb/urbit.pill urb/zod/arvo/ames.hoon
This commit is contained in:
commit
77b65f5ab4
@ -1,4 +1,4 @@
|
||||
::
|
||||
!:
|
||||
:: ames (4a), networking
|
||||
::
|
||||
|= pit=vase
|
||||
@ -380,7 +380,7 @@
|
||||
vix=(bex +((cut 0 [25 2] mag))) :: width of sender
|
||||
tay=(cut 0 [27 5] mag) :: message type
|
||||
==
|
||||
?> =(4 vez)
|
||||
?> =(6 vez)
|
||||
?> =(chk (end 0 20 (mug bod)))
|
||||
:+ [(end 3 wix bod) (cut 3 [wix vix] bod)]
|
||||
(kins tay)
|
||||
@ -400,7 +400,7 @@
|
||||
=+ tay=(ksin q.kec)
|
||||
%+ mix
|
||||
%+ can 0
|
||||
:~ [3 4]
|
||||
:~ [3 6]
|
||||
[20 (mug bod)]
|
||||
[2 yax]
|
||||
[2 qax]
|
||||
@ -983,7 +983,7 @@
|
||||
++ gnaw :: gnaw:am
|
||||
|= [kay=cape ryn=lane pac=rock] :: process packet
|
||||
^- [p=(list boon) q=furt]
|
||||
?. =(4 (end 0 3 pac)) [~ fox]
|
||||
?. =(6 (end 0 3 pac)) [~ fox]
|
||||
=+ kec=(bite pac)
|
||||
?: (goop p.p.kec) [~ fox]
|
||||
?. (~(has by urb.ton.fox) q.p.kec)
|
||||
@ -1290,7 +1290,8 @@
|
||||
(gth now (add ~s32 u.rue.puz))
|
||||
(lth u.rue.puz hop.fox)
|
||||
==
|
||||
== +>.$
|
||||
==
|
||||
+>.$
|
||||
(wool [/a hen] /q/pi ~)
|
||||
::
|
||||
++ thaw :: thaw:ho:um:am
|
||||
@ -1531,7 +1532,7 @@
|
||||
?> =(%re cak)
|
||||
[[%c `path`t.t.t.q.q.bon] hen]
|
||||
?: =(%e ven)
|
||||
?> =(%pr cak)
|
||||
?> |(=(%pr cak) =(%pc cak))
|
||||
[[%e `path`t.t.t.q.q.bon] hen]
|
||||
[[ven `path`t.t.t.q.q.bon] t.neh]
|
||||
`card`[%waft q.p.bon r.bon]
|
||||
@ -1548,7 +1549,7 @@
|
||||
%pi :: ping
|
||||
$(bon [%wine p.bon " sent a ping at {(scow %da now)}"])
|
||||
::
|
||||
%pr :: %pr
|
||||
?(%pr %pc) :: %pr, %pc
|
||||
:_ fox
|
||||
:~ :- [~ %iron p.p.bon]
|
||||
[[/e hen] `card`[%wart q.p.bon i.t.q.q.bon t.t.q.q.bon r.bon]]
|
||||
@ -1673,6 +1674,8 @@
|
||||
=+ luw=(rick mar our law.saf.u.gys)
|
||||
?. &(?=(^ muc) ?=(^ luw)) ~
|
||||
[~ `buck`[u.muc u.luw]]
|
||||
?: ?=([%code ~] tyl)
|
||||
[~ (end 6 1 (shaf %code (shax sec:ex:q:sen:u.gys)))]
|
||||
?: ?=([%tick @ ~] tyl)
|
||||
=+ hur=(slaw %p i.t.tyl)
|
||||
?~ hur ~
|
||||
|
@ -1,4 +1,4 @@
|
||||
::
|
||||
!:
|
||||
:: batz (4b), shell
|
||||
::
|
||||
|= pit=vase
|
||||
|
@ -1,4 +1,4 @@
|
||||
::
|
||||
!:
|
||||
:: clay (4c), revision control
|
||||
::
|
||||
|= pit=vase
|
||||
|
456
arvo/eyre.hoon
456
arvo/eyre.hoon
@ -5,6 +5,24 @@
|
||||
^- vane :: kernel instrument
|
||||
=> =~
|
||||
|% :: structures
|
||||
++ ju :: jug engine
|
||||
|/ a=(jug)
|
||||
+- get
|
||||
|* b=*
|
||||
=+ c=(~(get by a) b)
|
||||
?~(c ~ u.c)
|
||||
::
|
||||
+- has
|
||||
|* [b=* c=*]
|
||||
^- ?
|
||||
(~(has in (get(+< a) b)) c)
|
||||
::
|
||||
+- put
|
||||
|* [b=* c=*]
|
||||
^+ a
|
||||
=+ d=(get(+< a) b)
|
||||
(~(put by a) b (~(put in d) c))
|
||||
--
|
||||
++ bolo :: eyre state
|
||||
$: gub=@t :: random identity
|
||||
hov=(unit ,@p) :: master for remote
|
||||
@ -41,6 +59,7 @@
|
||||
[%fin p=love] :: ready to send
|
||||
[%haz p=riot] :: clay responded
|
||||
[%raw p=hiss] :: wild url
|
||||
[%who p=@tas q=@ta] :: awaiting auth
|
||||
== ::
|
||||
++ pimp :: traced request
|
||||
$: ful=? :: | === HEAD
|
||||
@ -88,6 +107,27 @@
|
||||
=+ zeb=(~(get by mah) cus)
|
||||
$(hed t.hed, mah (~(put by mah) cus ?~(zeb [q.i.hed ~] [q.i.hed u.zeb])))
|
||||
::
|
||||
++ loga :: tanks to manx
|
||||
|= [til=tape mog=(list manx) tac=(list tank)]
|
||||
^- manx
|
||||
=+ ^= wol
|
||||
|- ^- wall
|
||||
?~ tac ~
|
||||
(weld (~(win re i.tac) 0 120) $(tac t.tac))
|
||||
=+ ^= tax
|
||||
|- ^- (list manx)
|
||||
(turn wol |=(a=tape [/p ;"{a}"]))
|
||||
;html
|
||||
;head
|
||||
;title: {til}
|
||||
==
|
||||
;body
|
||||
;code
|
||||
;* (weld tax mog)
|
||||
==
|
||||
==
|
||||
==
|
||||
::
|
||||
++ lofi :: insert scripts
|
||||
|= [mog=(list manx) luv=love]
|
||||
^- love
|
||||
@ -115,12 +155,8 @@
|
||||
|- ^- (list ,@)
|
||||
?~(p.luv ~ [i.p.luv 10 $(p.luv t.p.luv)])
|
||||
%zap :+ p.luv
|
||||
~[content-type/'text/plain']
|
||||
:- ~
|
||||
%- tell
|
||||
|- ^- wall
|
||||
?~ q.luv ~
|
||||
(weld (~(win re i.q.luv) 0 120) $(q.luv t.q.luv))
|
||||
~[content-type/'text/html']
|
||||
[~ (tact (xmlt | (loga "server error" ~ q.luv) ~))]
|
||||
==
|
||||
--
|
||||
|% :: functions
|
||||
@ -208,6 +244,7 @@
|
||||
?> ?=([~ @ ~] hot)
|
||||
[[sec (rash i.u.hot thor:epur)] p.ryp q.ryp]
|
||||
==
|
||||
=. p.p.pul |(p.p.pul =([& /localhost] r.p.pul))
|
||||
(hell pul +.fav [p.heq mah s.heq])
|
||||
::
|
||||
%thud :: cancel request
|
||||
@ -225,12 +262,13 @@
|
||||
(hajj (need (slaw %p i.tea)) t.tea p.fav)
|
||||
::
|
||||
%wart :: remote request
|
||||
?> ?=(^ wru)
|
||||
?+ q.fav
|
||||
~& [%strange-wart p.fav q.fav]
|
||||
+.$
|
||||
::
|
||||
%pr
|
||||
(hare r.fav p.fav s.fav)
|
||||
%pr (hare r.fav p.fav s.fav)
|
||||
%pc (here q.u.wru p.fav s.fav)
|
||||
==
|
||||
::
|
||||
%waft
|
||||
@ -299,6 +337,11 @@
|
||||
?~ cuz +>.$
|
||||
abet:work:(~(iota ya [our ses] u.suf u.cuz) num rot)
|
||||
::
|
||||
++ haji :: send %pc login
|
||||
|= [him=ship ses=hole]
|
||||
^+ +>
|
||||
+>.$(mow :_(mow [wru [/a /e hen] [%want him [%r %pc ~] ses]]))
|
||||
::
|
||||
++ hajj :: send %pr response
|
||||
|= [him=ship tus=path har=httr]
|
||||
^+ +>
|
||||
@ -314,6 +357,12 @@
|
||||
[wru [/e [%e (scot %p him) tus] hen] ?~(hux [%thud ~] [%this u.hux])]
|
||||
==
|
||||
::
|
||||
++ here :: receive auth
|
||||
|= [our=ship him=ship hez=*]
|
||||
^+ +>
|
||||
=+ boy=(myth our (need ((sand %ta) ((hard ,@) hez))))
|
||||
?~(boy +>.$ abet:(auth:u.boy him))
|
||||
::
|
||||
++ hell :: request, no ship
|
||||
|= [pul=purl hyx=httx moh=moth]
|
||||
^+ +>
|
||||
@ -368,6 +417,8 @@
|
||||
?^ own [~ p.n.own]
|
||||
~
|
||||
?~ sur (fail 500 "no vessel available to proxy {<him>}")
|
||||
?. (gth (met 3 him) (met 3 u.sur)) :: very permissive
|
||||
(fail 500 "<u.sur> cannot proxy for <him>")
|
||||
=+ ^= rot ^- rote
|
||||
=+ rut=(~(get by fon) him)
|
||||
?^ rut u.rut
|
||||
@ -531,6 +582,174 @@
|
||||
?~ cuz ~
|
||||
[~ u=~(. ya [our ses] u.suf u.cuz)]
|
||||
::
|
||||
++ noon :: login page
|
||||
|= [our=ship whu=(unit ship) rul=tape ruf=tape]
|
||||
^- manx
|
||||
=+ ^= sic ^- manx
|
||||
;script
|
||||
;
|
||||
; var seal = {
|
||||
; who: goal,
|
||||
; url: burl,
|
||||
; pas: null
|
||||
; }
|
||||
; var hist = []
|
||||
; var hind = 0
|
||||
; $(
|
||||
; function() {
|
||||
; $input = $('#input .line')
|
||||
; $prompt = $('#input .prompt')
|
||||
; $prompt.addClass('prefix')
|
||||
; $output = $('#output')
|
||||
; $input.focus()
|
||||
; $('body').click(function() { $input.focus() })
|
||||
; ctrl = false;
|
||||
;
|
||||
; start = function(ship) {
|
||||
; $prompt.text('vessel: ~')
|
||||
; $input.attr('placeholder', 'ship-name')
|
||||
; if(ship) {
|
||||
; $input.val(ship)
|
||||
; }
|
||||
; }
|
||||
;
|
||||
; ident = function() {
|
||||
; seal.who = $input.val()
|
||||
;
|
||||
; if( (seal.who.length != 13) &&
|
||||
; (seal.who.length != 6) &&
|
||||
; (seal.who.length != 3) )
|
||||
; {
|
||||
; $output.text('not a ship name - try again.');
|
||||
; return false;
|
||||
; }
|
||||
;
|
||||
; if(seal.who !== host) {
|
||||
; var foreign = {oth: host, ses: session};
|
||||
; var all = $.extend({}, seal, foreign);
|
||||
;
|
||||
; console.log('redirect')
|
||||
; window.location="http://"+seal.who+".urbit.org/gul"
|
||||
; + $.params(all);
|
||||
; return false;
|
||||
; }
|
||||
;
|
||||
; $output.text($prompt.text() + " " + seal.who)
|
||||
; $input.val('')
|
||||
; $input.attr('placeholder', 'ronber-bacnub-hanmev-labnyd')
|
||||
; $prompt.text('secret: ~')
|
||||
;
|
||||
; return true;
|
||||
; }
|
||||
;
|
||||
; login = function() {
|
||||
; seal.pas = $input.val()
|
||||
;
|
||||
; output = $output.html()
|
||||
; console.log($output.html())
|
||||
; $output.html(output.replace('sorry. please try again.<br>',''))
|
||||
;
|
||||
; $.post(form, seal, function(data,xhr,status) {
|
||||
; console.log(data);
|
||||
; if(data.ok == true) {
|
||||
; document.location = data.next;
|
||||
; } else {
|
||||
; $output.prepend('sorry. please try again.<br>')
|
||||
; }
|
||||
; })
|
||||
; }
|
||||
;
|
||||
; steps = [ident,login]
|
||||
; step = 0
|
||||
; start(seal.who)
|
||||
; if(seal.who) {
|
||||
; ident()
|
||||
; step++
|
||||
; }
|
||||
;
|
||||
; $input.on('keydown', function(e) {
|
||||
; if(e.keyCode == 17) {
|
||||
; ctrl = true
|
||||
; return;
|
||||
; }
|
||||
;
|
||||
; if(e.keyCode == 68 &&
|
||||
; ctrl == true &&
|
||||
; step == 1) {
|
||||
; $output.text('')
|
||||
; step = 0
|
||||
; start(null)
|
||||
; return;
|
||||
; }
|
||||
;
|
||||
; if(e.keyCode == 13) {
|
||||
; if(steps[step]() && step < steps.length-1)
|
||||
; step++
|
||||
; return;
|
||||
; }
|
||||
; });
|
||||
;
|
||||
; $input.on('keyup', function(e) {
|
||||
; if(e.keyCode == 17) {
|
||||
; ctrl = false
|
||||
; }
|
||||
; });
|
||||
; })
|
||||
==
|
||||
=+ ^= cof
|
||||
;=
|
||||
; var host = '{(trip (rsh 3 1 (scot %p our)))}';
|
||||
; var goal = '{?~(whu ~ (trip (rsh 3 1 (scot %p u.whu))))}';
|
||||
; var burl = '{rul}';
|
||||
; var form = '{ruf}';
|
||||
==
|
||||
=> .(+.sic (weld `marl`cof `marl`+.sic))
|
||||
=+ jqu="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"
|
||||
=+ ^= hed
|
||||
;head
|
||||
;title: urbit login
|
||||
;script(type "text/javascript", src jqu);
|
||||
;style
|
||||
; body {
|
||||
; margin: 60px 120px;
|
||||
; font: normal 12px "Menlo" monospace;
|
||||
; background-color: #000;
|
||||
; color: #fff;
|
||||
; }
|
||||
;
|
||||
; #output {
|
||||
;
|
||||
; }
|
||||
;
|
||||
; #input .prompt {
|
||||
; display: inline-block;
|
||||
; margin-right: 12px;
|
||||
; }
|
||||
;
|
||||
; #input .line {
|
||||
; outline: none;
|
||||
; width: 80%;
|
||||
; border: 0;
|
||||
; background-color: transparent;
|
||||
; color: #fff;
|
||||
; font: normal 12px "Menlo" monospace;
|
||||
; }
|
||||
==
|
||||
==
|
||||
=+ ^= bod ^- manx
|
||||
;body
|
||||
;div@output;
|
||||
;div@input
|
||||
;div/prompt;
|
||||
;input/line(type "text");
|
||||
==
|
||||
==
|
||||
=. +.bod (weld `marl`+.bod `marl`~[sic])
|
||||
;html
|
||||
;+ hed
|
||||
;+ bod
|
||||
==
|
||||
::
|
||||
++ ya :: session engine
|
||||
=| [[our=ship ses=hole] serf cyst]
|
||||
=* sef ->-
|
||||
@ -543,6 +762,10 @@
|
||||
(~(put by own) our sef(wup (~(put by wup) ses cyz)))
|
||||
==
|
||||
::
|
||||
++ auth :: remote authorize
|
||||
|= him=ship
|
||||
%_(+> aut.ced (~(put ju aut.ced) %$ (scot %p him)))
|
||||
::
|
||||
++ dodo :: console s->c
|
||||
|= [con=@ud fav=card]
|
||||
^+ +>
|
||||
@ -583,6 +806,17 @@
|
||||
?> ?=(%way pez.u.pup)
|
||||
$(yov t.yov, q.rey (~(put by q.rey) i.yov u.pup(pez noz)))
|
||||
::
|
||||
++ fake
|
||||
^- (unit seam)
|
||||
:+ ~ %app
|
||||
;html
|
||||
;head ;title: not an application
|
||||
==
|
||||
;body
|
||||
;p: Not an application, on {<our>}, with {<aut.ced>}
|
||||
==
|
||||
==
|
||||
::
|
||||
++ flea :: permissive decimal
|
||||
|= txt=@t
|
||||
^- (unit ,@ud)
|
||||
@ -599,34 +833,38 @@
|
||||
?~ uru ~
|
||||
(rush u.uru auri:epur)
|
||||
::
|
||||
++ folk :: seal from query
|
||||
|= quy=quay
|
||||
^- (unit seal)
|
||||
=+ yaq=(~(gas by *(map ,@t ,@t)) quy)
|
||||
=+ pyl=(foal %url yaq)
|
||||
=+ wit==(%yes (fall (~(get by yaq) %wit) %no))
|
||||
=+ huw=(~(get by yaq) %who)
|
||||
=+ whu=?~(huw ~ (rush u.huw fed:ag))
|
||||
=+ pus=(~(get by yaq) %pas)
|
||||
=+ tuh=(~(get by yaq) %oth)
|
||||
=+ thu=?~(tuh ~ (rush u.tuh fed:ag))
|
||||
=+ sus=(~(get by yaq) %ses)
|
||||
=+ foy=?~(sus ~ ?~(thu ~ [~ u.thu u.sus]))
|
||||
?~ pyl ~
|
||||
?: &(wit |(=(~ whu) =(~ ses))) ~
|
||||
:: ~& [%folk-quay whu u.pyl wit foy pus]
|
||||
[~ whu u.pyl wit foy pus]
|
||||
::
|
||||
++ fool :: domestic login get
|
||||
|= quy=quay
|
||||
^- (unit seam)
|
||||
=+ yaq=(~(gas by *(map ,@t ,@t)) quy)
|
||||
=+ pyl=(foal %url yaq)
|
||||
?~ pyl ~
|
||||
=+ wuh=(~(get by yaq) %who)
|
||||
[~ %lon ?~(wuh ~ (rush u.wuh fed:ag)) u.pyl]
|
||||
(bind (folk quy) |=(a=seal [%lon a]))
|
||||
::
|
||||
++ foom :: domestic login post
|
||||
|= moh=moth
|
||||
^- (unit seam)
|
||||
?. ?& ?=(^ r.moh)
|
||||
.= [~ 'application/x-www-form-urlencoded' ~]
|
||||
(~(get by q.moh) 'content-type')
|
||||
:: .= [~ 'application/x-www-form-urlencoded' ~]
|
||||
:: (~(get by q.moh) 'content-type')
|
||||
== ~
|
||||
=+ yuq=(rush q.u.r.moh yquy:epur)
|
||||
?~ yuq ~
|
||||
=+ yaq=(~(gas by *(map ,@t ,@t)) u.yuq)
|
||||
=+ pas=(~(get by yaq) %pas)
|
||||
?~ pas ~
|
||||
=+ pyl=(foal %url yaq)
|
||||
?~ pyl ~
|
||||
=+ ^= whu ^- (unit ,@p)
|
||||
=+ sip=(~(get by yaq) %who)
|
||||
?~(sip ~ (rush u.sip fed:ag))
|
||||
?~ whu ~
|
||||
[~ %log u.whu u.pyl u.pas]
|
||||
?~(yuq ~ (fool u.yuq))
|
||||
::
|
||||
++ flub :: console request
|
||||
|= [paw=(list ,@t) muh=(unit moth)]
|
||||
@ -779,11 +1017,9 @@
|
||||
::
|
||||
?+ two |
|
||||
%e & :: stranger
|
||||
::%u p.p.pul :: guest
|
||||
%u &
|
||||
%u p.p.pul :: guest
|
||||
%i p.p.pul :: neighbor
|
||||
::%o p.p.pul :: identified
|
||||
%o &
|
||||
%o p.p.pul :: identified
|
||||
==
|
||||
::
|
||||
?= $? %p :: application
|
||||
@ -800,14 +1036,9 @@
|
||||
=(3 (met 3 nep))
|
||||
==
|
||||
~
|
||||
~& [%aut aut.ced]
|
||||
?: &(=(%i two) =(~ aut.ced))
|
||||
(holt ~ pul)
|
||||
?: ?& =(%o two)
|
||||
=+ urb=(~(get by aut.ced) %$)
|
||||
~& [%urb urb]
|
||||
?~(urb & !(levy u.urb |=(a=@ =(our (need (rush a fed:ag))))))
|
||||
==
|
||||
?: &(=(%o two) !(~(has ju aut.ced) %$ (scot %p our)))
|
||||
(holt [~ our] pul)
|
||||
?+ one ~
|
||||
%g
|
||||
@ -816,6 +1047,7 @@
|
||||
%v (foin p.q.pul paw r.pul)
|
||||
%c (flub paw ~)
|
||||
%l (fool r.pul)
|
||||
%p fake
|
||||
==
|
||||
::
|
||||
%p
|
||||
@ -896,6 +1128,11 @@
|
||||
?: ?=(| -.mud) +>.$
|
||||
+>.$(cah.sef (~(put by cah.sef) p.u.q.ank p.mud))
|
||||
::
|
||||
++ lass :: load secret
|
||||
^- @ta
|
||||
%^ rsh 3 1
|
||||
(scot %p (,@ (need (sky %a (scot %p our) %code (scot %da now) ~))))
|
||||
::
|
||||
++ lend :: load directory node
|
||||
|= pax=path
|
||||
^- arch
|
||||
@ -1160,6 +1397,9 @@
|
||||
%way [[~ pip] +>.$]
|
||||
%new
|
||||
?- -.som.pip
|
||||
%app :: XX a mere stub
|
||||
:_(+>.$ [~ pip(pez [%fin %ham p.som.pip])])
|
||||
::
|
||||
%con
|
||||
:_ +>.$
|
||||
=+ cal==+(cal=(~(get by cow) p.som.pip) ?^(cal u.cal *clue))
|
||||
@ -1173,7 +1413,9 @@
|
||||
=+ jqu="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"
|
||||
=+ ^= sac
|
||||
;script
|
||||
;
|
||||
;
|
||||
; var hist = []
|
||||
; var hind = 0
|
||||
; $(
|
||||
; function() {
|
||||
; $input = $('#input .line')
|
||||
@ -1181,6 +1423,10 @@
|
||||
; $output = $('#output')
|
||||
; $input.focus()
|
||||
;
|
||||
; $('body').click(function() {
|
||||
; $input.focus()
|
||||
; })
|
||||
;
|
||||
; send = function(com) {
|
||||
; if(com.line !== undefined &&
|
||||
; com.line.indexOf('error') != -1) {
|
||||
@ -1250,11 +1496,60 @@
|
||||
; send({ling:true})
|
||||
; return;
|
||||
; }
|
||||
; if(e.keyCode == 13) {
|
||||
; send({line:$input.val()})
|
||||
; $input.val('')
|
||||
;
|
||||
; if(e.keyCode == 69 && ctrl == true) {
|
||||
; console.log('^e')
|
||||
; $input[0].selectionStart =
|
||||
; $input[0].selectionEnd = $input.val().length;
|
||||
; return
|
||||
; }
|
||||
; if(e.keyCode == 65 && ctrl == true) {
|
||||
; console.log('^a')
|
||||
; $input[0].selectionStart = $input[0].selectionEnd = 0
|
||||
; return
|
||||
; }
|
||||
;
|
||||
;
|
||||
; if(e.keyCode == 40) {
|
||||
; if(hist.length > 1) {
|
||||
; hind++
|
||||
; if(hind > hist.length-1) {
|
||||
; hind = hist.length-1
|
||||
; }
|
||||
; }
|
||||
; }
|
||||
; if(e.keyCode == 38) {
|
||||
; if(hist.length > 1) {
|
||||
; hind--
|
||||
; if(hind < 0) {
|
||||
; hind = 0
|
||||
; }
|
||||
; }
|
||||
; }
|
||||
; if(e.keyCode == 38 ||
|
||||
; e.keyCode == 40) {
|
||||
; console.log('set from hist')
|
||||
; $input.val(hist[hind])
|
||||
; return;
|
||||
; }
|
||||
;
|
||||
; if(e.keyCode == 13) {
|
||||
; val = $input.val()
|
||||
; send({line:val})
|
||||
; $output.append($('.prompt').text()+" "+val+"<br>")
|
||||
; hind = hist.length-1
|
||||
; if(hind<0)
|
||||
; hind = 0
|
||||
; hist[hind] = val
|
||||
; hist.push('')
|
||||
; hind = hist.length-1
|
||||
; $input.val('')
|
||||
; $('body').scrollTop($('html').height() -
|
||||
; $('.line').offset().top)
|
||||
; return;
|
||||
; }
|
||||
; if(hind == hist.length-1)
|
||||
; hist[hind] = $input.val()
|
||||
; });
|
||||
;
|
||||
; $input.on('keyup', function(e) {
|
||||
@ -1279,7 +1574,7 @@
|
||||
; }
|
||||
;
|
||||
; #output {
|
||||
;
|
||||
; line-height: 18px;
|
||||
; }
|
||||
;
|
||||
; #input .prompt {
|
||||
@ -1368,46 +1663,55 @@
|
||||
?~ syt
|
||||
[%err 404 [[%leaf "{<p.som.pip>} not found"] ~]]
|
||||
?- -.u.syt
|
||||
| [%err 500 (flop p.u.syt)]
|
||||
| =+ mad=(loga "server error" r.som.pip p.u.syt)
|
||||
:- %fin
|
||||
:- %raw
|
||||
^- httr
|
||||
:+ 500
|
||||
~[content-type/'text/html']
|
||||
[~ (tact (xmlt | mad ~))]
|
||||
& [%fin (lofi r.som.pip p.u.syt)]
|
||||
:: & [%fin p.u.syt]
|
||||
==
|
||||
==
|
||||
::
|
||||
%lof !!
|
||||
%lon
|
||||
:_ +>.$
|
||||
=+ rul=(earn q.som.pip)
|
||||
=+ ruf=(earn (earl our q.som.pip(q.q /pul, r ~)))
|
||||
=+ ^= ham
|
||||
;html
|
||||
;body
|
||||
;form(method "post", action ruf)
|
||||
;* ?^ p.som.pip
|
||||
=+ nam=(trip (rsh 3 1 (scot %p u.p.som.pip)))
|
||||
;= ;input(type "hidden", name "who", value nam);
|
||||
==
|
||||
;= ; vessel: ;{input(type "text", name "who")}
|
||||
==
|
||||
; password: ;{input(type "password", name "pas")}
|
||||
;input(type "hidden", name "url", value rul);
|
||||
;input(type "submit", value "submit");
|
||||
==
|
||||
==
|
||||
?^ pus.p.som.pip
|
||||
?. =(lass u.pus.p.som.pip)
|
||||
:_ +>.$
|
||||
:- ~
|
||||
%= pip
|
||||
pez
|
||||
[%fin %mid /text/json (tact (pojo (jobe [%ok [%b |]]~)))]
|
||||
==
|
||||
=. aut.ced (~(put ju aut.ced) %$ (scot %p (need whu.p.som.pip)))
|
||||
?~ foy.p.som.pip
|
||||
=+ ^= jon
|
||||
%- jobe
|
||||
:~ [%ok [%b &]]
|
||||
[%next (jape (earn pul.p.som.pip))]
|
||||
==
|
||||
:_(+>.$ [~ pip(pez [%fin %mid /text/json (tact (pojo jon))])])
|
||||
=. ..ya (haji u.foy.p.som.pip)
|
||||
=+ ^= lup ^- purl
|
||||
:+ ^- hart
|
||||
:+ & ~
|
||||
[%& ~[%org %urbit (rsh 3 1 (scot %p p.u.foy.p.som.pip))]]
|
||||
^- pork
|
||||
[~ /gul]
|
||||
^- quay
|
||||
:~ [%who (rsh 3 1 (scot %p (need whu.p.som.pip)))]
|
||||
[%url (crip (earn pul.p.som.pip))]
|
||||
[%wit %yes]
|
||||
==
|
||||
=+ jon=(jobe ~[[%ok [%b &]] [%next (jape (earn lup))]])
|
||||
:_(+>.$ [~ pip(pez [%fin %mid /text/json (tact (pojo jon))])])
|
||||
:_ +>.$
|
||||
?: wit.p.som.pip
|
||||
[~ pip(pez [%who %$ (scot %p (need whu.p.som.pip))])]
|
||||
=+ rul=(earn pul.p.som.pip)
|
||||
=+ ruf=(earn (earl our pul.p.som.pip(q.q /pul, r ~)))
|
||||
=+ ham=(noon our whu.p.som.pip rul ruf)
|
||||
[~ pip(pez [%fin %ham ham])]
|
||||
::
|
||||
%log
|
||||
?. =(%foobar r.som.pip)
|
||||
~& [%login-bad som.pip]
|
||||
$(som.pip [%lon [~ p.som.pip] q.som.pip])
|
||||
=+ tau=(~(get by aut.ced) %$)
|
||||
=+ hoo=`@t`(rsh 3 1 (scot %p p.som.pip))
|
||||
~& [%login-good hoo som.pip]
|
||||
%= $
|
||||
som.pip [%red q.som.pip]
|
||||
aut.ced (~(put by aut.ced) %$ ?~(tau [hoo ~] [hoo u.tau]))
|
||||
==
|
||||
::
|
||||
%red
|
||||
:_ +>.$
|
||||
@ -1442,6 +1746,10 @@
|
||||
?~ hoy
|
||||
pip(pez [%err 404 [[%leaf "invalid request"] ~]])
|
||||
pip(som u.hoy, pez %new)
|
||||
::
|
||||
[%who *]
|
||||
:_ +>.$
|
||||
?.((~(has ju aut.ced) p.pez.pip q.pez.pip) [~ pip] [~ pip(pez %new)])
|
||||
==
|
||||
::
|
||||
++ work
|
||||
|
155
arvo/ford.hoon
Normal file
155
arvo/ford.hoon
Normal file
@ -0,0 +1,155 @@
|
||||
!: :: %ford, new execution control
|
||||
!? 164
|
||||
::::
|
||||
|= pit=vase
|
||||
^- vane
|
||||
=> =~
|
||||
|% :: structures
|
||||
++ axle :: all %ford state
|
||||
$: tad=(map duct task) :: tasks by duct
|
||||
== ::
|
||||
++ bone ,@ud :: abstract duct
|
||||
++ claw :: startup chain
|
||||
$: est=@da :: startup date
|
||||
eny=@ :: entropy
|
||||
joy=(unit viol) :: local context
|
||||
ran=(unit viol) :: arguments
|
||||
jiv=(unit viol) :: app configuration
|
||||
kyq=(unit viol) :: app customization
|
||||
gam=(unit viol) :: app image
|
||||
== ::
|
||||
++ crab :: ascending card
|
||||
$% [%halt ~] :: interrupt
|
||||
[%ride p=(list silk)] :: start/restart task
|
||||
== ::
|
||||
++ croc ,* :: descending card
|
||||
++ hawk :: untyped effect
|
||||
$% [%call p=bone q=wire r=*] :: advance card
|
||||
[%give p=bone q=*] :: produce card
|
||||
[%play p=bone q=*] :: reprocess card
|
||||
== ::
|
||||
++ hide :: engine state
|
||||
$: own=[p=ship q=@tas] :: static identity
|
||||
^= seq :: dynamic sequence
|
||||
$: num=@ud :: change number
|
||||
eny=@ :: entropy
|
||||
now=@da :: date
|
||||
== == ::
|
||||
++ hive :: typed engine
|
||||
|* $: cud=,_* :: events (++card)
|
||||
wad=,_* :: actions (++hawk)
|
||||
bag=_,* :: condensed state
|
||||
== ::
|
||||
$_ ^? ::
|
||||
|_ hide ::
|
||||
++ pack *bag :: save as bag
|
||||
++ poke :: apply
|
||||
|+ $: kul=(unit keel) :: acting agent
|
||||
tea=wire :: logical place
|
||||
fav=cud :: present event
|
||||
== ::
|
||||
[*(list wad) +>] :: effects
|
||||
++ poll :: current subchange
|
||||
|+ tea=wire ::
|
||||
_@ud ::
|
||||
++ peek :: view
|
||||
|+ $: kyl=keel :: inspecting agent
|
||||
asp=?(%view %diff) :: desired aspect
|
||||
tea=wire :: logical place
|
||||
dev=path :: device identity
|
||||
== ::
|
||||
[*?(%view %diff) *vase] ::
|
||||
++ prep :: restore from bag
|
||||
|+ bux=bag ::
|
||||
+> ::
|
||||
== ::
|
||||
++ keel (unit ship khan) :: general identity
|
||||
++ khan ,[p=@tas q=@tas] :: foreign identity
|
||||
++ lamp :: task definition
|
||||
$: wor=writ :: authority
|
||||
sac=(list skit) :: library structure
|
||||
lac=(each path twig) :: indirect/direct
|
||||
== ::
|
||||
++ logo ,@tas :: logical type
|
||||
++ silk :: construction layer
|
||||
$% [%a p=vase] :: nominal
|
||||
[%b p=twig] :: direct
|
||||
[%c p=path] :: indirect
|
||||
[%d p=(list silk) q=(list silk)] :: functional
|
||||
== ::
|
||||
++ task :: execution
|
||||
$: kyl=keel :: logical owner
|
||||
lam=(list silk) :: task definition
|
||||
kit=(map ,@ud kite) :: dependencies
|
||||
eve=(qeu ,[p=wire q=card]) :: pending cards
|
||||
vax=(unit vase) :: current state
|
||||
== ::
|
||||
++ vial ,* :: untyped vase
|
||||
--
|
||||
|%
|
||||
++ ye :: per event
|
||||
=| $: $: $: kul=(unit keel) :: event authority
|
||||
tea=wire :: event place
|
||||
hen=duct :: event floor
|
||||
fav=card :: event data
|
||||
== ::
|
||||
$: now=@da :: event date
|
||||
eny=@ :: unique entropy
|
||||
sky=$+(* (unit)) :: system namespace
|
||||
== ::
|
||||
mow=(list move) :: pending actions
|
||||
== ::
|
||||
bolo :: all vane state
|
||||
== ::
|
||||
=* bol ->
|
||||
|%
|
||||
++ abet
|
||||
^- [(list move) bolo]
|
||||
[(flop mow) bol]
|
||||
. ==
|
||||
=| axle
|
||||
=* lex -
|
||||
|= [now=@da eny=@ sky=$+(* (unit))] :: activate
|
||||
^? :: opaque core
|
||||
|% ::
|
||||
++ beat :: process move
|
||||
|= [wru=(unit writ) tea=wire hen=duct fav=curd]
|
||||
=> .(fav ((hard card) fav))
|
||||
^- [p=(list move) q=vane]
|
||||
=+ ^= kul ^- (unit keel)
|
||||
?: |(?=(%
|
||||
=^ mos bol
|
||||
abet:apex:~(adit ye [[wru tea hen fav] [now eny sky] ~] lex)
|
||||
[mos ..^$]
|
||||
::
|
||||
++ come
|
||||
|= [sam=? old=vase]
|
||||
^- vane
|
||||
(load old)
|
||||
::
|
||||
++ doze
|
||||
|= [now=@da hen=duct]
|
||||
^- (unit ,@da)
|
||||
~
|
||||
::
|
||||
++ load
|
||||
|= old=vase
|
||||
^- vane
|
||||
?. (~(nest ut -:!>(`bolo`+>-.^$)) | p.old)
|
||||
~& %eyre-reset
|
||||
..^$
|
||||
..^$(+>- (bolo q.old))
|
||||
::
|
||||
++ raze
|
||||
^- vane
|
||||
..$(+>- *bolo)
|
||||
::
|
||||
++ scry
|
||||
|= [our=ship ren=@tas who=ship syd=disc lot=coin tyl=path]
|
||||
^- (unit)
|
||||
~
|
||||
::
|
||||
++ stay
|
||||
`vase`!>((colt `bolo`+>-.$))
|
||||
++ vern [164 0]
|
||||
--
|
@ -1404,9 +1404,9 @@
|
||||
=+ c=(~(get by a) b)
|
||||
?~(c ~ u.c)
|
||||
::
|
||||
+- add :: XX slow
|
||||
+- add
|
||||
|* [b=* c=*]
|
||||
=+ d=(get b)
|
||||
=+ d=(get(a +>) b)
|
||||
(~(put by a) [d c])
|
||||
--
|
||||
::
|
||||
@ -1417,10 +1417,16 @@
|
||||
=+ c=(~(get by a) b)
|
||||
?~(c ~ u.c)
|
||||
::
|
||||
+- put :: XX slow
|
||||
+- has
|
||||
|* [b=* c=*]
|
||||
=+ d=(get b)
|
||||
(~(put by a) (~(put in d) c))
|
||||
^- ?
|
||||
(~(has in (get(+< a) b)) c)
|
||||
::
|
||||
+- put
|
||||
|* [b=* c=*]
|
||||
^+ a
|
||||
=+ d=(get(+< a) b)
|
||||
(~(put by a) b (~(put in d) c))
|
||||
--
|
||||
::
|
||||
++ by :: map engine
|
||||
@ -8719,7 +8725,11 @@
|
||||
--
|
||||
--
|
||||
::
|
||||
++ vial :: vane tools
|
||||
++ vint :: create vane
|
||||
|= [vil=vile bud=vase pax=path txt=@ta] ::
|
||||
(vent vil bud (slam (slap bud (rain pax txt)) [viz.vil bud]))
|
||||
::
|
||||
++ viol :: vane tools
|
||||
|= but=type
|
||||
^- vile
|
||||
=+ pal=|=(a=@t ^-(type (~(play ut but) (vice a))))
|
||||
@ -8730,10 +8740,6 @@
|
||||
viz=(pal '_vase')
|
||||
==
|
||||
::
|
||||
++ vint :: create vane
|
||||
|= [vil=vile bud=vase pax=path txt=@ta] ::
|
||||
(vent vil bud (slam (slap bud (rain pax txt)) [viz.vil bud]))
|
||||
::
|
||||
++ is :: operate in time
|
||||
|= [eny=@ vil=vile bud=vase fan=(list ,[p=@tas q=vase])]
|
||||
|_ now=@da
|
||||
@ -8831,7 +8837,7 @@
|
||||
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
=+ pit=`vase`!>(.) ::
|
||||
=+ bud=pit :: becomes tang
|
||||
=+ vil=(vial p.bud) ::
|
||||
=+ vil=(viol p.bud) ::
|
||||
=| eny=@ :: entropy
|
||||
=| fan=(list ,[p=@tas q=vase]) ::
|
||||
=| hom=path :: source path
|
||||
|
@ -1342,7 +1342,7 @@
|
||||
++ head
|
||||
^- tape
|
||||
;: weld
|
||||
?:(p.p.pul "https://" "http://")
|
||||
?:(&(p.p.pul !=([& /localhost] r.p.pul)) "https://" "http://")
|
||||
::
|
||||
?- -.r.p.pul
|
||||
| (trip (rsh 3 1 (scot %if p.r.p.pul)))
|
||||
@ -1370,8 +1370,13 @@
|
||||
::
|
||||
++ epur :: url/header parser
|
||||
|%
|
||||
++ apat (cook deft ;~(pfix fas (more fas smeg))) :: 2396 abs_path
|
||||
++ apat :: 2396 abs_path
|
||||
%+ cook deft
|
||||
(ifix [fas ;~(pose fas (easy ~))] (more fas smeg))
|
||||
++ auri
|
||||
%+ cook
|
||||
|= a=purl
|
||||
?.(=([& /localhost] r.p.a) a a(p.p &))
|
||||
;~ plug
|
||||
;~ plug
|
||||
%+ sear
|
||||
@ -1393,6 +1398,7 @@
|
||||
;~(plug aln (star alp))
|
||||
::
|
||||
++ fque (cook crip (plus pquo)) :: normal query field
|
||||
++ fquu (cook crip (star pquo)) :: optional field
|
||||
++ pcar ;~(pose pure pesc psub col pat) :: 2396 path char
|
||||
++ pcok ;~ pose :: cookie char
|
||||
(just `@`0x21)
|
||||
@ -1455,7 +1461,7 @@
|
||||
;~ pose :: proper query
|
||||
%+ more
|
||||
;~(pose pam sem)
|
||||
;~(plug fque ;~(pfix tis fque))
|
||||
;~(plug fque ;~(pfix tis fquu))
|
||||
::
|
||||
%+ cook :: funky query
|
||||
|=(a=tape [[%$ (crip a)] ~])
|
||||
@ -2166,7 +2172,7 @@
|
||||
++ clip (each ,@if ,@is) :: client IP
|
||||
++ cred :: credential
|
||||
$: hut=hoot :: client host
|
||||
aut=(map ,@tas (list ,@t)) :: client identities
|
||||
aut=(jug ,@tas ,@t) :: client identities
|
||||
orx=oryx :: CSRF secret
|
||||
acl=(unit ,@t) :: accept-language
|
||||
cip=(each ,@if ,@is) :: client IP
|
||||
@ -2503,15 +2509,21 @@
|
||||
hoc=(map ship door) :: neighborhood
|
||||
==
|
||||
++ salt ,@uv :: entropy
|
||||
++ seal :: auth conversation
|
||||
$: whu=(unit ship) :: client identity
|
||||
pul=purl :: destination url
|
||||
wit=? :: wait for partner
|
||||
foy=(unit ,[p=ship q=hole]) :: partner to notify
|
||||
pus=(unit ,@ta) :: password
|
||||
== ::
|
||||
++ seam :: logical request
|
||||
$% [%cog p=@ud q=@ud] :: console get
|
||||
$% [%app p=manx] :: (fake) app
|
||||
[%cog p=@ud q=@ud] :: console get
|
||||
[%con p=@ud] :: console face
|
||||
[%cop p=@ud q=@ud r=json] :: console put
|
||||
[%det p=disc q=moat] :: load changes
|
||||
[%fun p=term q=tube r=(list manx)] :: functional
|
||||
[%lof p=ship q=hole] :: foreign auth
|
||||
[%lon p=(unit ship) q=purl] :: domestic auth as/to
|
||||
[%log p=ship q=purl r=@ta] :: password
|
||||
[%lon p=seal] :: authentication flow
|
||||
[%red p=purl] :: redirect
|
||||
== ::
|
||||
++ seat :: functional path
|
||||
|
9
main/bin/secret.hoon
Normal file
9
main/bin/secret.hoon
Normal file
@ -0,0 +1,9 @@
|
||||
!:
|
||||
:: /=main=/bin/secret/hoon
|
||||
::
|
||||
=> .(-< `who=@p`-<)
|
||||
|= [est=time *]
|
||||
|= ~
|
||||
^- bowl
|
||||
:_ ~ :_ ~
|
||||
[%la %leaf (scow %p (,@p .^(%a (scot %p who) %code (scot %da est) ~)))]
|
@ -118,7 +118,7 @@
|
||||
'<figure>' '<footer>' '<form>' '<h1>' '<h2>' '<h3>' '<h4>'
|
||||
'<h5>' '<h6>' '<header>' '<hgroup>' '<hr>' '<noscript>'
|
||||
'<ol>' '<output>' '<p>' '<pre>' '<section>' '<table>'
|
||||
'<tfoot>' '<ul>' '<video>'
|
||||
'<tfoot>' '<ul>' '<video>' '<style>'
|
||||
==
|
||||
++ inle
|
||||
%+ knee *@t |. ~+
|
||||
|
Loading…
Reference in New Issue
Block a user