mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 10:02:47 +03:00
Merge pull request #1317 from urbit/eyre-iris
renames lighter-than-eyre vanes to %eyre and %iris
This commit is contained in:
commit
ca66511883
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f90ed0c7ec18af3b3dad4e192dce2a43af97d5ed7070f57b1a535ef2d417aa33
|
||||
size 7954772
|
||||
oid sha256:0fc692ddfe9a7d869e8742e8cffa6f180c676e855d9e8ac185a372358125409f
|
||||
size 8473572
|
||||
|
@ -15,6 +15,18 @@ cleanup () {
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
# update pill strategy to ensure correct staging
|
||||
#
|
||||
herb ./pier -p hood -d "+hood/mount /=home="
|
||||
|
||||
cp $ARVO/lib/pill.hoon ./pier/home/lib/
|
||||
chmod -R u+rw ./pier/home/lib/
|
||||
|
||||
herb ./pier -p hood -d "+hood/commit %home"
|
||||
herb ./pier -p hood -d "+hood/unmount %home"
|
||||
|
||||
# stage new desk for pill contents
|
||||
#
|
||||
herb ./pier -p hood -d '+hood/merge %stage our %home'
|
||||
herb ./pier -p hood -d "+hood/mount /=stage="
|
||||
|
||||
@ -23,6 +35,7 @@ cp -r $ARVO ./pier/stage
|
||||
chmod -R u+rw ./pier/stage
|
||||
|
||||
herb ./pier -p hood -d "+hood/commit %stage"
|
||||
herb ./pier -p hood -d "+hood/unmount %stage"
|
||||
|
||||
herb ./pier -P solid.pill -d '+solid /=stage=/sys, =dub &'
|
||||
|
||||
|
@ -147,10 +147,10 @@
|
||||
:: +card: output effect payload
|
||||
::
|
||||
+$ card
|
||||
$% [%connect wire =binding:http-server app=term]
|
||||
$% [%connect wire =binding:eyre app=term]
|
||||
[%http-response =http-event:http]
|
||||
[%poke wire dock poke]
|
||||
[%request wire request:http outbound-config:http-client]
|
||||
[%request wire request:http outbound-config:iris]
|
||||
[%rule wire %cert (unit [wain wain])]
|
||||
[%wait wire @da]
|
||||
==
|
||||
@ -394,7 +394,7 @@
|
||||
++ request
|
||||
|= [wir=wire req=hiss]
|
||||
^- card
|
||||
[%request wir (hiss-to-request:html req) *outbound-config:http-client]
|
||||
[%request wir (hiss-to-request:html req) *outbound-config:iris]
|
||||
:: +signed-request: JWS JSON POST
|
||||
::
|
||||
++ signed-request
|
||||
@ -1131,7 +1131,7 @@
|
||||
==
|
||||
--
|
||||
++ http-response
|
||||
|= [=wire response=client-response:http-client]
|
||||
|= [=wire response=client-response:iris]
|
||||
^- (quip move _this)
|
||||
:: ignore progress reports
|
||||
::
|
||||
@ -1144,7 +1144,7 @@
|
||||
?: ?=(%cancel -.response)
|
||||
(retry:event t.wire)
|
||||
::
|
||||
=/ rep=httr (to-httr:http-client +.response)
|
||||
=/ rep=httr (to-httr:iris +.response)
|
||||
:: add nonce to pool, if present
|
||||
::
|
||||
=/ nonhed (skim q.rep |=((pair @t @t) ?=(%replay-nonce p)))
|
||||
@ -1193,7 +1193,7 @@
|
||||
:: Used to serve the domain validation challenge
|
||||
::
|
||||
++ poke-handle-http-request
|
||||
|= =inbound-request:http-server
|
||||
|= =inbound-request:eyre
|
||||
^- (quip move _this)
|
||||
~& [%handle-http +<]
|
||||
=/ url=(unit (pair pork:eyre quay:eyre))
|
||||
@ -1207,7 +1207,7 @@
|
||||
~| [%unknown-url url.request.inbound-request] !!
|
||||
::
|
||||
:: XX these crashes should be restored
|
||||
:: but %rver doesn't get an error notification from %gall
|
||||
:: but %eyre doesn't get an error notification from %gall
|
||||
::
|
||||
:: ?. ?=(^ reg.act) ~|(%no-account !!)
|
||||
:: ?. ?=(^ rod) ~|(%no-active-order !!)
|
||||
@ -1315,7 +1315,7 @@
|
||||
:: +bound: response to %connect binding request
|
||||
::
|
||||
++ bound
|
||||
|= [=wire accepted=? =binding:http-server]
|
||||
|= [=wire accepted=? =binding:eyre]
|
||||
?: accepted
|
||||
[~ this]
|
||||
:: XX better error message
|
||||
|
@ -477,7 +477,7 @@
|
||||
:: +bound: lient tells us we successfully bound our server to the ~chat url
|
||||
::
|
||||
++ bound
|
||||
|= [wir=wire success=? binding=binding:http-server]
|
||||
|= [wir=wire success=? binding=binding:eyre]
|
||||
^- (quip move _this)
|
||||
[~ this]
|
||||
::
|
||||
@ -485,7 +485,7 @@
|
||||
::
|
||||
++ poke-handle-http-request
|
||||
%- (require-authorization:app ost.bol move this)
|
||||
|= =inbound-request:http-server
|
||||
|= =inbound-request:eyre
|
||||
^- (quip move _this)
|
||||
::
|
||||
=+ request-line=(parse-request-line url.request.inbound-request)
|
||||
|
@ -21,7 +21,7 @@
|
||||
+$ card
|
||||
$% [%poke wire dock poke]
|
||||
[%http-response =http-event:http]
|
||||
[%connect wire binding:http-server term]
|
||||
[%connect wire binding:eyre term]
|
||||
[%diff %json json]
|
||||
==
|
||||
::
|
||||
@ -32,7 +32,7 @@
|
||||
++ this .
|
||||
::
|
||||
++ bound
|
||||
|= [wir=wire success=? binding=binding:http-server]
|
||||
|= [wir=wire success=? binding=binding:eyre]
|
||||
^- (quip move _this)
|
||||
[~ this]
|
||||
::
|
||||
@ -60,7 +60,7 @@
|
||||
::
|
||||
++ poke-handle-http-request
|
||||
%- (require-authorization:app ost.bol move this)
|
||||
|= =inbound-request:http-server
|
||||
|= =inbound-request:eyre
|
||||
^- (quip move _this)
|
||||
=/ request-line (parse-request-line url.request.inbound-request)
|
||||
=/ back-path (flop site.request-line)
|
||||
|
@ -15,7 +15,7 @@
|
||||
+$ in-poke-data
|
||||
$% [%dns-authority =authority]
|
||||
[%dns-bind =ship =target]
|
||||
[%handle-http-request =inbound-request:http-server]
|
||||
[%handle-http-request =inbound-request:eyre]
|
||||
==
|
||||
+$ out-poke-data
|
||||
$% [%dns-bind =ship =target]
|
||||
@ -62,7 +62,7 @@
|
||||
^- @t
|
||||
:: XX can't scry in +mule
|
||||
::
|
||||
:: =/ =hart:eyre .^(hart:eyre %r /(scot %p our)/host/real)
|
||||
:: =/ =hart:eyre .^(hart:eyre %e /(scot %p our)/host/real)
|
||||
(crip (en-purl:html [hart [~ path] ~]))
|
||||
::
|
||||
:: XX can't scry in +mule
|
||||
@ -821,7 +821,7 @@
|
||||
::
|
||||
;< ~ bind:m
|
||||
(send-request:stdio (retrieve-access-token:(oauth2-core bowl scry.pro.aut.nam) code))
|
||||
;< rep=(unit client-response:http-client) bind:m
|
||||
;< rep=(unit client-response:iris) bind:m
|
||||
take-maybe-response:stdio
|
||||
:: XX retry
|
||||
::
|
||||
|
@ -106,7 +106,7 @@
|
||||
++ card :: general card
|
||||
$% {$diff $sole-effect sole-effect} ::
|
||||
{$send wire {ship term} clap} ::
|
||||
[%request wire request:http outbound-config:http-client] :: %l
|
||||
[%request wire request:http outbound-config:iris] :: %l
|
||||
[%build wire ? schematic:ford]
|
||||
[%kill wire ~]
|
||||
{$deal wire sock term club} ::
|
||||
@ -363,7 +363,7 @@
|
||||
|= [way=wire =request:http]
|
||||
^+ +>+>
|
||||
?> ?=(~ pux)
|
||||
(he-card(poy `+>+<(pux `way)) %request way request *outbound-config:http-client)
|
||||
(he-card(poy `+>+<(pux `way)) %request way request *outbound-config:iris)
|
||||
::
|
||||
++ dy-stop :: stop work
|
||||
^+ +>
|
||||
@ -951,7 +951,7 @@
|
||||
:: +he-http-response: result from http-client
|
||||
::
|
||||
++ he-http-response
|
||||
|= [way=wire response=client-response:http-client]
|
||||
|= [way=wire response=client-response:iris]
|
||||
^+ +>
|
||||
?> ?=(^ poy)
|
||||
=< he-pine
|
||||
@ -960,7 +960,7 @@
|
||||
+>
|
||||
::
|
||||
~! response
|
||||
%. [%httr !>((to-httr:http-client response-header.response full-file.response))]
|
||||
%. [%httr !>((to-httr:iris response-header.response full-file.response))]
|
||||
=+ dye=~(. dy u.poy(pux ~))
|
||||
?+ way !!
|
||||
{$hand ~} dy-hand:dye
|
||||
|
@ -37,7 +37,7 @@
|
||||
^- move
|
||||
[ost.bol %poke / [our.bol %hall] %hall-action a]
|
||||
::
|
||||
++ ra-base-hart .^(hart:eyre %r /(scot %p our.bol)/host/(scot %da now.bol))
|
||||
++ ra-base-hart .^(hart:eyre %e /(scot %p our.bol)/host/(scot %da now.bol))
|
||||
::
|
||||
++ poke-fora-post
|
||||
|= {pax/path sup/spur hed/@t txt/@t}
|
||||
|
@ -27,7 +27,7 @@
|
||||
::
|
||||
+$ card
|
||||
$% [%http-response =http-event:http]
|
||||
[%connect wire binding:http-server term]
|
||||
[%connect wire binding:eyre term]
|
||||
[%peer wire dock path]
|
||||
[%diff %json json]
|
||||
==
|
||||
@ -53,7 +53,7 @@
|
||||
[~ this(sta u.old)]
|
||||
::
|
||||
++ bound
|
||||
|= [wir=wire success=? binding=binding:http-server]
|
||||
|= [wir=wire success=? binding=binding:eyre]
|
||||
^- (quip move _this)
|
||||
[~ this]
|
||||
::
|
||||
@ -110,7 +110,7 @@
|
||||
::
|
||||
++ poke-handle-http-request
|
||||
%- (require-authorization:app ost.bol move this)
|
||||
|= =inbound-request:http-server
|
||||
|= =inbound-request:eyre
|
||||
^- (quip move _this)
|
||||
::
|
||||
=+ request-line=(parse-request-line url.request.inbound-request)
|
||||
|
@ -10,7 +10,7 @@
|
||||
:: +card: output effect payload
|
||||
::
|
||||
+$ card
|
||||
$% [%connect wire binding:http-server term]
|
||||
$% [%connect wire binding:eyre term]
|
||||
[%http-response =http-event:http]
|
||||
[%peel wire dock mark path]
|
||||
[%poke wire dock poke]
|
||||
@ -41,13 +41,13 @@
|
||||
:: alerts us that we were bound. we need this because the vane calls back.
|
||||
::
|
||||
++ bound
|
||||
|= [wir=wire success=? binding=binding:http-server]
|
||||
|= [wir=wire success=? binding=binding:eyre]
|
||||
^- (quip move _this)
|
||||
[~ this]
|
||||
::
|
||||
++ poke-handle-http-request
|
||||
%- (require-authorization:app ost.bow move this)
|
||||
|= =inbound-request:http-server
|
||||
|= =inbound-request:eyre
|
||||
^- (quip move _this)
|
||||
?^ job.state
|
||||
:_ this
|
||||
@ -101,7 +101,7 @@
|
||||
:: +poke-handle-http-cancel: received when a connection was killed
|
||||
::
|
||||
++ poke-handle-http-cancel
|
||||
|= =inbound-request:http-server
|
||||
|= =inbound-request:eyre
|
||||
^- (quip move _this)
|
||||
:: the only long lived connections we keep state about are the stream ones.
|
||||
::
|
||||
|
@ -6,8 +6,8 @@
|
||||
:: +card: output effect payload
|
||||
::
|
||||
+$ card
|
||||
$% [%connect wire binding:http-server term]
|
||||
[%disconnect wire binding:http-server]
|
||||
$% [%connect wire binding:eyre term]
|
||||
[%disconnect wire binding:eyre]
|
||||
[%http-response =http-event:http]
|
||||
==
|
||||
::
|
||||
@ -28,7 +28,7 @@
|
||||
:: alerts us that we were bound. we need this because the vane calls back.
|
||||
::
|
||||
++ bound
|
||||
|= [wir=wire success=? binding=binding:http-server]
|
||||
|= [wir=wire success=? binding=binding:eyre]
|
||||
^- (quip move _this)
|
||||
[~ this]
|
||||
::
|
||||
@ -44,7 +44,7 @@
|
||||
::
|
||||
++ poke-handle-http-request
|
||||
%- (require-authorization:app ost.bow move this)
|
||||
|= =inbound-request:http-server
|
||||
|= =inbound-request:eyre
|
||||
^- (quip move _this)
|
||||
[[ost.bow %http-response (js-response:app session-js)]~ this]
|
||||
::
|
||||
|
@ -92,8 +92,8 @@
|
||||
::
|
||||
++ require-authorization
|
||||
|* [=bone move=mold this=*]
|
||||
|= handler=$-(inbound-request:http-server (quip move _this))
|
||||
|= =inbound-request:http-server
|
||||
|= handler=$-(inbound-request:eyre (quip move _this))
|
||||
|= =inbound-request:eyre
|
||||
^- (quip move _this)
|
||||
::
|
||||
?: authenticated.inbound-request
|
||||
@ -128,7 +128,7 @@
|
||||
:: alerts us that we were bound. we need this because the vane calls back.
|
||||
::
|
||||
++ bound
|
||||
|= [wir=wire success=? binding=binding:http-server]
|
||||
|= [wir=wire success=? binding=binding:eyre]
|
||||
~& [%bound success]
|
||||
[~ this]
|
||||
::
|
||||
@ -160,7 +160,7 @@
|
||||
::
|
||||
++ poke-handle-http-request
|
||||
%- (require-authorization ost.bow move this)
|
||||
|= =inbound-request:http-server
|
||||
|= =inbound-request:eyre
|
||||
^- (quip move _this)
|
||||
::
|
||||
=+ request-line=(parse-request-line url.request.inbound-request)
|
||||
@ -190,7 +190,7 @@
|
||||
:: +poke-handle-http-cancel: received when a connection was killed
|
||||
::
|
||||
++ poke-handle-http-cancel
|
||||
|= =inbound-request:http-server
|
||||
|= =inbound-request:eyre
|
||||
^- (quip move _this)
|
||||
:: the only long lived connections we keep state about are the stream ones.
|
||||
::
|
||||
|
@ -24,7 +24,7 @@
|
||||
+$ card
|
||||
$% [%poke wire dock poke]
|
||||
[%http-response =http-event:http]
|
||||
[%connect wire binding:http-server term]
|
||||
[%connect wire binding:eyre term]
|
||||
[%diff %json json]
|
||||
[%wait wire @da]
|
||||
[%rest wire @da]
|
||||
@ -37,7 +37,7 @@
|
||||
++ this .
|
||||
::
|
||||
++ bound
|
||||
|= [wir=wire success=? binding=binding:http-server]
|
||||
|= [wir=wire success=? binding=binding:eyre]
|
||||
^- (quip move _this)
|
||||
[~ this]
|
||||
::
|
||||
@ -87,7 +87,7 @@
|
||||
::
|
||||
++ poke-handle-http-request
|
||||
%- (require-authorization:app ost.bol move this)
|
||||
|= =inbound-request:http-server
|
||||
|= =inbound-request:eyre
|
||||
^- (quip move _this)
|
||||
=/ request-line (parse-request-line url.request.inbound-request)
|
||||
=/ back-path (flop site.request-line)
|
||||
|
@ -21,8 +21,8 @@
|
||||
$% [%poke wire dock poke]
|
||||
[%http-response =http-event:http]
|
||||
[%diff %json json]
|
||||
[%connect wire binding:http-server term]
|
||||
[%request wire request:http outbound-config:http-client]
|
||||
[%connect wire binding:eyre term]
|
||||
[%request wire request:http outbound-config:iris]
|
||||
[%wait wire @da]
|
||||
==
|
||||
+$ poke
|
||||
@ -38,7 +38,7 @@
|
||||
++ this .
|
||||
::
|
||||
++ bound
|
||||
|= [wir=wire success=? binding=binding:http-server]
|
||||
|= [wir=wire success=? binding=binding:eyre]
|
||||
^- (quip move _this)
|
||||
[~ this]
|
||||
::
|
||||
@ -69,7 +69,7 @@
|
||||
[~ this]
|
||||
=/ str/@t +.jon
|
||||
=/ req/request:http (request-darksky str)
|
||||
=/ out *outbound-config:http-client
|
||||
=/ out *outbound-config:iris
|
||||
?~ timer
|
||||
:- %+ weld
|
||||
`(list move)`[ost.bol %wait /timer (add now.bol ~d1)]~
|
||||
@ -101,12 +101,12 @@
|
||||
[bone %diff %json jon]
|
||||
::
|
||||
++ http-response
|
||||
|= [=wire response=client-response:http-client]
|
||||
|= [=wire response=client-response:iris]
|
||||
^- (quip move _this)
|
||||
:: ignore all but %finished
|
||||
?. ?=(%finished -.response)
|
||||
[~ this]
|
||||
=/ data/(unit mime-data:http-client) full-file.response
|
||||
=/ data/(unit mime-data:iris) full-file.response
|
||||
?~ data
|
||||
:: data is null
|
||||
[~ this]
|
||||
@ -126,7 +126,7 @@
|
||||
::
|
||||
++ poke-handle-http-request
|
||||
%- (require-authorization:app ost.bol move this)
|
||||
|= =inbound-request:http-server
|
||||
|= =inbound-request:eyre
|
||||
^- (quip move _this)
|
||||
=+ request-line=(parse-request-line url.request.inbound-request)
|
||||
=+ back-path=(flop site.request-line)
|
||||
@ -152,7 +152,7 @@
|
||||
^- (quip move _this)
|
||||
=/ req/request:http (request-darksky location)
|
||||
=/ lismov/(list move)
|
||||
`(list move)`[ost.bol %request /[(scot %da now.bol)] req *outbound-config:http-client]~
|
||||
`(list move)`[ost.bol %request /[(scot %da now.bol)] req *outbound-config:iris]~
|
||||
?~ timer
|
||||
:- (weld lismov `(list move)`[ost.bol %wait /timer (add now.bol ~h3)]~)
|
||||
this(timer `(add now.bol ~h3))
|
||||
|
@ -47,9 +47,9 @@
|
||||
[%diff diff]
|
||||
[%build wire ? schematic:ford]
|
||||
[%kill wire ~]
|
||||
[%connect wire binding:http-server term]
|
||||
[%connect wire binding:eyre term]
|
||||
[%http-response http-event:http]
|
||||
[%disconnect binding:http-server]
|
||||
[%disconnect binding:eyre]
|
||||
==
|
||||
::
|
||||
+$ poke
|
||||
@ -1237,7 +1237,7 @@
|
||||
==
|
||||
::
|
||||
++ bound
|
||||
|= [wir=wire success=? binding=binding:http-server]
|
||||
|= [wir=wire success=? binding=binding:eyre]
|
||||
^- (quip move _this)
|
||||
[~ this]
|
||||
::
|
||||
@ -1245,7 +1245,7 @@
|
||||
::
|
||||
++ poke-handle-http-request
|
||||
%- (require-authorization:app ost.bol move this)
|
||||
|= =inbound-request:http-server
|
||||
|= =inbound-request:eyre
|
||||
^- (quip move _this)
|
||||
::
|
||||
=/ request-line (parse-request-line url.request.inbound-request)
|
||||
@ -1431,7 +1431,7 @@
|
||||
:: +poke-handle-http-cancel: received when a connection was killed
|
||||
::
|
||||
++ poke-handle-http-cancel
|
||||
|= =inbound-request:http-server
|
||||
|= =inbound-request:eyre
|
||||
^- (quip move _this)
|
||||
[~ this]
|
||||
::
|
||||
|
@ -13,7 +13,7 @@
|
||||
=* our p.bec
|
||||
:: XX must be evaluated outside tapp core due to +mule
|
||||
::
|
||||
=/ =hart:eyre .^(hart:eyre %r /(scot %p our)/host/real)
|
||||
=/ =hart:eyre .^(hart:eyre %e /(scot %p our)/host/real)
|
||||
:: XX terrible
|
||||
=/ domain /com/googleapis
|
||||
=/ code
|
||||
|
@ -6,7 +6,7 @@
|
||||
::
|
||||
+$ card
|
||||
$% [%http-response =http-event:http]
|
||||
[%connect wire binding:http-server term]
|
||||
[%connect wire binding:eyre term]
|
||||
[%peer wire dock path]
|
||||
[%quit ~]
|
||||
[%poke wire dock poke]
|
||||
|
@ -42,7 +42,7 @@
|
||||
{$flog wire flog:dill} ::
|
||||
[%mint wire p=ship q=safe:rights:jael]
|
||||
{$nuke wire ship} ::
|
||||
[%serve wire binding:http-server generator:http-server]
|
||||
[%serve wire binding:eyre generator:eyre]
|
||||
{$poke wire dock pear} ::
|
||||
{$rest wire @da} ::
|
||||
{$wait wire @da} ::
|
||||
@ -218,11 +218,11 @@
|
||||
(emit %flog ~ %text "woot: {<[way cop]>}")
|
||||
::
|
||||
++ poke-serve
|
||||
|= [=binding:http-server =generator:http-server] =< abet
|
||||
|= [=binding:eyre =generator:eyre] =< abet
|
||||
(emit %serve /helm/serv binding generator)
|
||||
::
|
||||
++ take-bound
|
||||
|= [wir=wire success=? binding=binding:http-server] =< abet
|
||||
|= [wir=wire success=? binding=binding:eyre] =< abet
|
||||
(emit %flog ~ %text "bound: {<success>}")
|
||||
::
|
||||
++ poke-tlon-init-stream
|
||||
|
@ -196,7 +196,7 @@
|
||||
++ emit |=(a/card +>(..autoload (^emit a)))
|
||||
++ tracked-vanes
|
||||
^- (list @tas)
|
||||
~[%ames %behn %clay %dill %ford %gall %jael %lient %rver]
|
||||
~[%ames %behn %clay %dill %eyre %ford %gall %iris %jael]
|
||||
::
|
||||
++ our-home /(scot %p our)/home/(scot %da now)
|
||||
++ sys-hash |=(pax/path .^(@uvI %cz :(welp our-home /sys pax)))
|
||||
|
@ -14,19 +14,6 @@
|
||||
:~ :: sys/zuse: standard library
|
||||
::
|
||||
[%$ /zuse]
|
||||
:: TODO: I really want these to be named http-client and http-server,
|
||||
:: but this interacts badly with every piece of the system which
|
||||
:: assumes that vane names are one letter, and that one letter is the
|
||||
:: first letter of the file. This assumption is threaded through way
|
||||
:: too many places in the entire system to modify it while doing
|
||||
:: something else.
|
||||
::
|
||||
:: sys/vane/lient: http client
|
||||
::
|
||||
[%l /vane/lient]
|
||||
:: sys/vane/rver: http server
|
||||
::
|
||||
[%r /vane/rver]
|
||||
:: sys/vane/ames: network
|
||||
::
|
||||
[%a /vane/ames]
|
||||
@ -39,15 +26,18 @@
|
||||
:: sys/vane/dill: console
|
||||
::
|
||||
[%d /vane/dill]
|
||||
:: sys/vane/eyre: web
|
||||
:: sys/vane/eyre: http server
|
||||
::
|
||||
:: [%e /vane/eyre]
|
||||
[%e /vane/eyre]
|
||||
:: sys/vane/ford: build
|
||||
::
|
||||
[%f /vane/ford]
|
||||
:: sys/vane/gall: applications
|
||||
::
|
||||
[%g /vane/gall]
|
||||
:: sys/vane/iris: http client
|
||||
::
|
||||
[%i /vane/iris]
|
||||
:: sys/vane/jael: security
|
||||
::
|
||||
[%j /vane/jael]
|
||||
|
@ -1,4 +1,4 @@
|
||||
=, http-server
|
||||
=, eyre
|
||||
|%
|
||||
::
|
||||
:: +parse-request-line: take a cord and parse out a url
|
||||
@ -25,8 +25,8 @@
|
||||
::
|
||||
++ require-authorization
|
||||
|* [=bone move=mold this=*]
|
||||
|= handler=$-(inbound-request:http-server (quip move _this))
|
||||
|= =inbound-request:http-server
|
||||
|= handler=$-(inbound-request:eyre (quip move _this))
|
||||
|= =inbound-request:eyre
|
||||
^- (quip move _this)
|
||||
::
|
||||
?: authenticated.inbound-request
|
||||
@ -79,7 +79,7 @@
|
||||
[%start [404 ~] ~ %.y]
|
||||
::
|
||||
++ login-redirect
|
||||
|= =inbound-request:http-server
|
||||
|= =inbound-request:eyre
|
||||
^- http-event:http
|
||||
=/ redirect=cord
|
||||
%- crip
|
||||
|
@ -69,7 +69,7 @@
|
||||
=/ m (async ,~)
|
||||
^- form:m
|
||||
=/ =card
|
||||
[%request / request *outbound-config:http-client]
|
||||
[%request / request *outbound-config:iris]
|
||||
;< ~ bind:m (send-raw-card card)
|
||||
(set-raw-contract & %request ~)
|
||||
::
|
||||
@ -82,7 +82,7 @@
|
||||
:: Wait until we get an HTTP response or cancelation
|
||||
::
|
||||
++ take-response-raw
|
||||
=/ m (async (unit client-response:http-client))
|
||||
=/ m (async (unit client-response:iris))
|
||||
^- form:m
|
||||
|= =async-input
|
||||
:^ ~ ~ ~
|
||||
@ -108,9 +108,9 @@
|
||||
:: Wait until we get an HTTP response or cancelation and unset contract
|
||||
::
|
||||
++ take-maybe-response
|
||||
=/ m (async (unit client-response:http-client))
|
||||
=/ m (async (unit client-response:iris))
|
||||
^- form:m
|
||||
;< rep=(unit client-response:http-client) bind:m
|
||||
;< rep=(unit client-response:iris) bind:m
|
||||
take-response-raw
|
||||
;< ~ bind:m (set-raw-contract | %request ~)
|
||||
(pure:m rep)
|
||||
@ -118,9 +118,9 @@
|
||||
:: Wait until we get an HTTP response and unset contract
|
||||
::
|
||||
++ take-response
|
||||
=/ m (async (unit client-response:http-client))
|
||||
=/ m (async (unit client-response:iris))
|
||||
^- form:m
|
||||
;< rep=(unit client-response:http-client) bind:m
|
||||
;< rep=(unit client-response:iris) bind:m
|
||||
take-maybe-response
|
||||
?^ rep
|
||||
(pure:m rep)
|
||||
@ -132,7 +132,7 @@
|
||||
++ take-maybe-sigh
|
||||
=/ m (async (unit httr:eyre))
|
||||
^- form:m
|
||||
;< rep=(unit client-response:http-client) bind:m
|
||||
;< rep=(unit client-response:iris) bind:m
|
||||
take-maybe-response
|
||||
?~ rep
|
||||
(pure:m ~)
|
||||
@ -140,7 +140,7 @@
|
||||
::
|
||||
?. ?=(%finished -.u.rep)
|
||||
(pure:m ~)
|
||||
(pure:m (some (to-httr:http-client +.u.rep)))
|
||||
(pure:m (some (to-httr:iris +.u.rep)))
|
||||
::
|
||||
:: Wait until we get an HTTP response and unset contract
|
||||
::
|
||||
@ -198,7 +198,7 @@
|
||||
:: Incoming HTTP requests
|
||||
::
|
||||
++ bind-route-raw
|
||||
|= [=binding:http-server =term]
|
||||
|= [=binding:eyre =term]
|
||||
=/ m (async ,~)
|
||||
^- form:m
|
||||
(send-raw-card [%connect / binding term])
|
||||
@ -216,7 +216,7 @@
|
||||
[%done success.sign]
|
||||
::
|
||||
++ bind-route
|
||||
|= [=binding:http-server =term]
|
||||
|= [=binding:eyre =term]
|
||||
=/ m (async ?)
|
||||
^- form:m
|
||||
;< ~ bind:m (bind-route-raw binding term)
|
||||
|
@ -380,7 +380,7 @@
|
||||
:: Pass response to async
|
||||
::
|
||||
++ http-response
|
||||
|= [=wire response=client-response:http-client]
|
||||
|= [=wire response=client-response:iris]
|
||||
^- (quip move _this-tapp)
|
||||
(take-async bowl `[wire %http-response response])
|
||||
::
|
||||
@ -406,7 +406,7 @@
|
||||
:: Receive route binding notification
|
||||
::
|
||||
++ bound
|
||||
|= [=wire success=? =binding:http-server]
|
||||
|= [=wire success=? =binding:eyre]
|
||||
^- (quip move _this-tapp)
|
||||
(take-async bowl `[wire %bound success binding])
|
||||
::
|
||||
|
@ -14,7 +14,7 @@
|
||||
:: Link from relative path
|
||||
=, eyre
|
||||
=, html
|
||||
=+ hok=.^(hart %r /(scot %p our)/host/real)
|
||||
=+ hok=.^(hart %e /(scot %p our)/host/real)
|
||||
=+ ref=|=(a/path (en-purl hok `(weld tub a) ~))
|
||||
:: urb:front attrs confuse RSS validators, readers
|
||||
=+ no-meta=|=(a/marl ^+(a ?~(a ~ ?.(?=($meta n.g.i.a) a $(a t.a)))))
|
||||
|
@ -10,9 +10,9 @@
|
||||
[%peer wire dock path]
|
||||
[%pull wire dock ~]
|
||||
[%diff out-peer-data]
|
||||
[%request wire request:http outbound-config:http-client]
|
||||
[%request wire request:http outbound-config:iris]
|
||||
[%cancel-request wire ~]
|
||||
[%connect wire binding:http-server term]
|
||||
[%connect wire binding:eyre term]
|
||||
[%http-response =http-event:http]
|
||||
[%rule wire %turf %put turf]
|
||||
==
|
||||
@ -24,8 +24,8 @@
|
||||
[%coup =dock error=(unit tang)]
|
||||
[%quit =dock =path]
|
||||
[%reap =dock =path error=(unit tang)]
|
||||
[%bound success=? =binding:http-server]
|
||||
[%http-response response=client-response:http-client]
|
||||
[%bound success=? =binding:eyre]
|
||||
[%http-response response=client-response:iris]
|
||||
==
|
||||
::
|
||||
:: Outstanding contracts
|
||||
|
@ -466,8 +466,8 @@
|
||||
{@ $newt *} %a
|
||||
{@ $sync *} %c
|
||||
{@ $term *} %d
|
||||
{@ $http-client *} %l
|
||||
{@ $http-server *} %r
|
||||
{@ $http-client *} %i
|
||||
{@ $http-server *} %e
|
||||
{@ $behn *} %b
|
||||
==
|
||||
::
|
||||
|
@ -16,11 +16,11 @@
|
||||
$: a/(unit mass) ::
|
||||
b/(unit mass) ::
|
||||
c/(unit mass) ::
|
||||
e/(unit mass) ::
|
||||
f/(unit mass) ::
|
||||
g/(unit mass) ::
|
||||
i/(unit mass) ::
|
||||
j/(unit mass) ::
|
||||
l/(unit mass) ::
|
||||
r/(unit mass) ::
|
||||
== ::
|
||||
== ::
|
||||
++ axon :: dill per duct
|
||||
@ -63,6 +63,9 @@
|
||||
== ::
|
||||
task:able:dill ::
|
||||
== ::
|
||||
$: %e ::
|
||||
$>(%wegh task:able:eyre) ::
|
||||
== ::
|
||||
$: %f ::
|
||||
$>(%wegh task:able:ford) ::
|
||||
== ::
|
||||
@ -73,18 +76,15 @@
|
||||
== ::
|
||||
task:able:gall ::
|
||||
== ::
|
||||
$: %i ::
|
||||
$>(%wegh task:able:iris) ::
|
||||
== ::
|
||||
$: %j ::
|
||||
$> $? %dawn ::
|
||||
%fake ::
|
||||
%wegh ::
|
||||
== ::
|
||||
task:able:jael ::
|
||||
== ::
|
||||
$: %l ::
|
||||
$>(%wegh task:able:http-client) ::
|
||||
== ::
|
||||
$: %r ::
|
||||
$>(%wegh task:able:http-server) ::
|
||||
== == ::
|
||||
++ sign :: in result $<-
|
||||
$~ [%j %init *@p] ::
|
||||
@ -111,6 +111,9 @@
|
||||
$: %d ::
|
||||
$>(%blit gift:able:dill) ::
|
||||
== ::
|
||||
$: %e ::
|
||||
$>(%mass gift:able:eyre) ::
|
||||
== ::
|
||||
$: %f ::
|
||||
$>(%mass gift:able:ford) ::
|
||||
== ::
|
||||
@ -121,17 +124,14 @@
|
||||
== ::
|
||||
gift:able:gall ::
|
||||
== ::
|
||||
$: %i ::
|
||||
$>(%mass gift:able:iris) ::
|
||||
== ::
|
||||
$: %j ::
|
||||
$> $? %init ::
|
||||
%mass ::
|
||||
== ::
|
||||
gift:able:jael ::
|
||||
== ::
|
||||
$: %l ::
|
||||
$>(%mass gift:able:http-client) ::
|
||||
== ::
|
||||
$: %r ::
|
||||
$>(%mass gift:able:http-server) ::
|
||||
== == ::
|
||||
:::::::: :: dill tiles
|
||||
--
|
||||
@ -279,11 +279,11 @@
|
||||
:* [hen %pass /heft/ames %a %wegh ~]
|
||||
[hen %pass /heft/behn %b %wegh ~]
|
||||
[hen %pass /heft/clay %c %wegh ~]
|
||||
[hen %pass /heft/eyre %e %wegh ~]
|
||||
[hen %pass /heft/ford %f %wegh ~]
|
||||
[hen %pass /heft/gall %g %wegh ~]
|
||||
[hen %pass /heft/iris %i %wegh ~]
|
||||
[hen %pass /heft/jael %j %wegh ~]
|
||||
[hen %pass /heft/lient %l %wegh ~]
|
||||
[hen %pass /heft/rver %r %wegh ~]
|
||||
moz
|
||||
==
|
||||
==
|
||||
@ -385,7 +385,7 @@
|
||||
|= sih/sign
|
||||
^+ +>
|
||||
?- sih
|
||||
{?($a $b $c $f $g $j $l $r) $mass *}
|
||||
{?($a $b $c $e $f $g $i $j) $mass *}
|
||||
(wegh -.sih p.sih)
|
||||
::
|
||||
{$a $nice *}
|
||||
@ -440,31 +440,31 @@
|
||||
:: +wegh: receive a memory report from a vane and maybe emit full report
|
||||
::
|
||||
++ wegh
|
||||
|= {lal/?($a $b $c $f $g $j $l $r) mas/mass}
|
||||
|= [lal=?(%a %b %c %e %f %g %i %j) mas=mass]
|
||||
^+ +>
|
||||
:: update our listing of vane responses with this new one
|
||||
::
|
||||
=. hef.all
|
||||
?- lal
|
||||
$a ~?(?=(^ a.hef.all) %double-mass-a hef.all(a `mas))
|
||||
$b ~?(?=(^ b.hef.all) %double-mass-b hef.all(b `mas))
|
||||
$c ~?(?=(^ c.hef.all) %double-mass-c hef.all(c `mas))
|
||||
$f ~?(?=(^ f.hef.all) %double-mass-f hef.all(f `mas))
|
||||
$g ~?(?=(^ g.hef.all) %double-mass-g hef.all(g `mas))
|
||||
$j ~?(?=(^ j.hef.all) %double-mass-j hef.all(j `mas))
|
||||
$l ~?(?=(^ l.hef.all) %double-mass-l hef.all(l `mas))
|
||||
$r ~?(?=(^ r.hef.all) %double-mass-r hef.all(r `mas))
|
||||
%a ~?(?=(^ a.hef.all) %double-mass-a hef.all(a `mas))
|
||||
%b ~?(?=(^ b.hef.all) %double-mass-b hef.all(b `mas))
|
||||
%c ~?(?=(^ c.hef.all) %double-mass-c hef.all(c `mas))
|
||||
%e ~?(?=(^ e.hef.all) %double-mass-e hef.all(e `mas))
|
||||
%f ~?(?=(^ f.hef.all) %double-mass-f hef.all(f `mas))
|
||||
%g ~?(?=(^ g.hef.all) %double-mass-g hef.all(g `mas))
|
||||
%i ~?(?=(^ i.hef.all) %double-mass-i hef.all(i `mas))
|
||||
%j ~?(?=(^ j.hef.all) %double-mass-j hef.all(j `mas))
|
||||
==
|
||||
:: if not all vanes have responded yet, no-op
|
||||
::
|
||||
?. ?& ?=(^ a.hef.all)
|
||||
?=(^ b.hef.all)
|
||||
?=(^ c.hef.all)
|
||||
?=(^ e.hef.all)
|
||||
?=(^ f.hef.all)
|
||||
?=(^ g.hef.all)
|
||||
?=(^ i.hef.all)
|
||||
?=(^ j.hef.all)
|
||||
?=(^ l.hef.all)
|
||||
?=(^ r.hef.all)
|
||||
==
|
||||
+>.$
|
||||
:: clear vane reports from our state before weighing ourself
|
||||
@ -472,7 +472,7 @@
|
||||
:: Otherwise, the state of vanes printed after this one get absorbed
|
||||
:: into Dill's %dot catchall report.
|
||||
::
|
||||
=/ ven=(list mass) ~[u.a u.b u.c u.g u.f u.j u.l u.r]:hef.all
|
||||
=/ ven=(list mass) ~[u.a u.b u.c u.e u.f u.g u.i u.j]:hef.all
|
||||
=> .(hef.all [~ ~ ~ ~ ~ ~ ~ ~])
|
||||
:: wegh ourself now that our state doesn't include other masses
|
||||
::
|
||||
|
@ -2,7 +2,7 @@
|
||||
:: lighter than eyre
|
||||
::
|
||||
|= pit=vase
|
||||
=, http-server
|
||||
=, eyre
|
||||
:: internal data structures
|
||||
::
|
||||
=> =~
|
||||
@ -1460,7 +1460,7 @@
|
||||
^- (list move)
|
||||
:_ moves
|
||||
:+ p.state.u.channel %give
|
||||
^- gift:able:http-server
|
||||
^- gift:able
|
||||
:* %response %continue
|
||||
::
|
||||
^= data
|
||||
@ -1922,7 +1922,7 @@
|
||||
%give
|
||||
%mass
|
||||
^- mass
|
||||
:+ %rver %|
|
||||
:+ %eyre %|
|
||||
:~ bindings+&+bindings.server-state.ax
|
||||
auth+&+authentication-state.server-state.ax
|
||||
connections+&+connections.server-state.ax
|
@ -616,7 +616,7 @@
|
||||
:: $hiss `note-arvo`[%e %hiss +.q.q.cov]
|
||||
$send `note-arvo`[%g %deal [our p.q.q.cov] q.q.q.cov]
|
||||
$meta `note-arvo`[`@tas`p.q.q.cov %meta `vase`q.q.q.cov]
|
||||
:: $response `note-arvo`[%l %response raw-http-response.q.q.cov]
|
||||
:: $response `note-arvo`[%i %response raw-http-response.q.q.cov]
|
||||
==
|
||||
::
|
||||
:: I'm sort of stumped on how to get a %give out of the above; it's
|
||||
@ -1342,12 +1342,12 @@
|
||||
%wind `%j
|
||||
%wipe `%f
|
||||
::
|
||||
%request `%l
|
||||
%cancel-request `%l
|
||||
%serve `%r
|
||||
%connect `%r
|
||||
%disconnect `%r
|
||||
%rule `%r
|
||||
%request `%i
|
||||
%cancel-request `%i
|
||||
%serve `%e
|
||||
%connect `%e
|
||||
%disconnect `%e
|
||||
%rule `%e
|
||||
==
|
||||
--
|
||||
--
|
||||
|
@ -2,7 +2,7 @@
|
||||
:: http-client
|
||||
::
|
||||
|= pit=vase
|
||||
=, http-client
|
||||
=, iris
|
||||
::
|
||||
::
|
||||
:: internal data structures
|
||||
@ -146,7 +146,7 @@
|
||||
^- [(list move) ^state]
|
||||
::
|
||||
?~ cancel-id=(~(get by connection-by-duct.state) duct)
|
||||
~& %invalid-lient-cancel
|
||||
~& %iris-invalid-cancel
|
||||
[~ state]
|
||||
::
|
||||
:- [outbound-duct.state %give %cancel-request u.cancel-id]~
|
||||
@ -365,7 +365,7 @@
|
||||
%give
|
||||
%mass
|
||||
^- mass
|
||||
:+ %lient %|
|
||||
:+ %iris %|
|
||||
:~ nex+&+next-id.state.ax
|
||||
outbound+&+outbound-duct.state.ax
|
||||
by-id+&+connection-by-id.state.ax
|
@ -110,12 +110,12 @@
|
||||
$: %a :: to %ames
|
||||
$>(%want task:able:ames) :: send message
|
||||
== ::
|
||||
$: %i :: to %iris
|
||||
$>(%request task:able:iris) :: http request
|
||||
== ::
|
||||
$: %j :: to self
|
||||
$>(%look task) :: set ethereum source
|
||||
== ::
|
||||
$: %l :: to %lient
|
||||
$>(%request task:able:http-client) :: http request
|
||||
== ::
|
||||
$: @tas ::
|
||||
$% $>(%init vane-task) :: report install
|
||||
$>(%sunk vane-task) :: report death
|
||||
@ -126,7 +126,7 @@
|
||||
$% [%b $>(%wake gift:able:behn)] :: wakeup
|
||||
[%j $>(%vent gift)] :: ethereum changes
|
||||
[%a $>(%woot gift:able:ames)] :: message result
|
||||
[%l $>(%http-response gift:able:http-client)] :: http response
|
||||
[%i $>(%http-response gift:able:iris)] :: http response
|
||||
== ::
|
||||
-- ::
|
||||
:: ::::
|
||||
@ -758,7 +758,7 @@
|
||||
^- (list move)
|
||||
:~ [hen %pass /(scot %p our)/init %b %wait +(now)]
|
||||
[hen %give %init our]
|
||||
[hen %slip %r %init our]
|
||||
[hen %slip %e %init our]
|
||||
[hen %slip %d %init our]
|
||||
[hen %slip %g %init our]
|
||||
[hen %slip %c %init our]
|
||||
@ -807,7 +807,7 @@
|
||||
%+ weld moz
|
||||
^- (list move)
|
||||
:~ [hen %give %init our]
|
||||
[hen %slip %r %init our]
|
||||
[hen %slip %e %init our]
|
||||
[hen %slip %d %init our]
|
||||
[hen %slip %g %init our]
|
||||
[hen %slip %c %init our]
|
||||
@ -1001,7 +1001,7 @@
|
||||
::TODO fail:et
|
||||
+>.$
|
||||
::
|
||||
[%l %http-response *]
|
||||
[%i %http-response *]
|
||||
?. ?=(%finished -.client-response.hin)
|
||||
+>.$
|
||||
~! hin
|
||||
@ -1756,10 +1756,10 @@
|
||||
|= [wir=wire jon=json]
|
||||
^- move
|
||||
%+ wrap-note wir
|
||||
:^ %l %request
|
||||
:^ %i %request
|
||||
?> ?=(%| -.source)
|
||||
(light-json-request node.p.source jon)
|
||||
*outbound-config:http-client
|
||||
*outbound-config:iris
|
||||
::
|
||||
:: +| source-operations
|
||||
::
|
||||
@ -1983,11 +1983,11 @@
|
||||
(complete-with-rpc-response cuz rep)
|
||||
::
|
||||
++ finished
|
||||
|= [cuz=wire =response-header:http full-file=(unit mime-data:http-client)]
|
||||
|= [cuz=wire =response-header:http full-file=(unit mime-data:iris)]
|
||||
^+ +>
|
||||
?: ?=(%& -.source) +>
|
||||
::
|
||||
=+ rep=(httr-to-rpc-response (to-httr:http-client response-header full-file))
|
||||
=+ rep=(httr-to-rpc-response (to-httr:iris response-header full-file))
|
||||
(complete-with-rpc-response cuz rep)
|
||||
::
|
||||
++ complete-with-rpc-response
|
||||
|
@ -270,7 +270,7 @@
|
||||
::
|
||||
^- (list move)
|
||||
:~ [hen %give %init our]
|
||||
[hen %slip %r %init our]
|
||||
[hen %slip %e %init our]
|
||||
[hen %slip %d %init our]
|
||||
[hen %slip %g %init our]
|
||||
[hen %slip %c %init our]
|
||||
@ -321,7 +321,7 @@
|
||||
%+ weld moz
|
||||
^- (list move)
|
||||
:~ [hen %give %init our]
|
||||
[hen %slip %r %init our]
|
||||
[hen %slip %e %init our]
|
||||
[hen %slip %d %init our]
|
||||
[hen %slip %g %init our]
|
||||
[hen %slip %c %init our]
|
||||
|
@ -864,16 +864,167 @@
|
||||
== ::
|
||||
-- ::dill
|
||||
:: ::::
|
||||
:::: ++eyre :: (1e) oldweb
|
||||
:::: ++eyre :: (1e) http-server
|
||||
:: ::::
|
||||
++ eyre ^?
|
||||
|%
|
||||
++ bale :: driver state
|
||||
|* a/_* :: %jael keys type
|
||||
$: {our/ship now/@da eny/@uvJ byk/beak} :: base info
|
||||
{usr/user dom/(list @t)} :: req user, domain
|
||||
key/a :: secrets from %jael
|
||||
== ::
|
||||
++ able
|
||||
|%
|
||||
++ gift
|
||||
$% :: set-config: configures the external http server
|
||||
::
|
||||
:: TODO: We need to actually return a (map (unit @t) http-config)
|
||||
:: so we can apply configurations on a per-site basis
|
||||
::
|
||||
[%set-config =http-config]
|
||||
:: response: response to an event from earth
|
||||
::
|
||||
[%response =http-event:http]
|
||||
:: response to a %connect or %serve
|
||||
::
|
||||
:: :accepted is whether :binding was valid. Duplicate bindings are
|
||||
:: not allowed.
|
||||
::
|
||||
[%bound accepted=? =binding]
|
||||
:: memory usage report
|
||||
::
|
||||
[%mass p=mass]
|
||||
==
|
||||
::
|
||||
++ task
|
||||
$~ [%vega ~]
|
||||
$% :: event failure notification
|
||||
::
|
||||
$>(%crud vane-task)
|
||||
:: initializes ourselves with an identity
|
||||
::
|
||||
$>(%init vane-task)
|
||||
:: new unix process
|
||||
::
|
||||
$>(%born vane-task)
|
||||
:: report upgrade
|
||||
::
|
||||
$>(%vega vane-task)
|
||||
:: notifies us of the ports of our live http servers
|
||||
::
|
||||
[%live insecure=@ud secure=(unit @ud)]
|
||||
:: update http configuration
|
||||
::
|
||||
[%rule =http-rule]
|
||||
:: starts handling an inbound http request
|
||||
::
|
||||
[%request secure=? =address =request:http]
|
||||
:: starts handling an backdoor http request
|
||||
::
|
||||
[%request-local secure=? =address =request:http]
|
||||
:: cancels a previous request
|
||||
::
|
||||
[%cancel-request ~]
|
||||
:: connects a binding to an app
|
||||
::
|
||||
[%connect =binding app=term]
|
||||
:: connects a binding to a generator
|
||||
::
|
||||
[%serve =binding =generator]
|
||||
:: disconnects a binding
|
||||
::
|
||||
:: This must be called with the same duct that made the binding in
|
||||
:: the first place.
|
||||
::
|
||||
[%disconnect =binding]
|
||||
:: memory usage request
|
||||
::
|
||||
$>(%wegh vane-task)
|
||||
==
|
||||
::
|
||||
--
|
||||
:: +binding: A rule to match a path.
|
||||
::
|
||||
:: A +binding is a system unique mapping for a path to match. A +binding
|
||||
:: must be system unique because we don't want two handlers for a path;
|
||||
:: what happens if there are two different actions for [~ /]?
|
||||
::
|
||||
+$ binding
|
||||
$: :: site: the site to match.
|
||||
::
|
||||
:: A ~ will match the Urbit's identity site (your.urbit.org). Any
|
||||
:: other value will match a domain literal.
|
||||
::
|
||||
site=(unit @t)
|
||||
:: path: matches this prefix path
|
||||
::
|
||||
:: /~myapp will match /~myapp or /~myapp/longer/path
|
||||
::
|
||||
path=(list @t)
|
||||
==
|
||||
:: +generator: a generator on the local ship that handles requests
|
||||
::
|
||||
:: This refers to a generator on the local ship, run with a set of
|
||||
:: arguments. Since http requests are time sensitive, we require that the
|
||||
:: generator be on the current ship.
|
||||
::
|
||||
+$ generator
|
||||
$: :: desk: desk on current ship that contains the generator
|
||||
::
|
||||
=desk
|
||||
:: path: path on :desk to the generator's hoon file
|
||||
::
|
||||
path=(list @t)
|
||||
:: args: arguments passed to the gate
|
||||
::
|
||||
args=*
|
||||
==
|
||||
:: +http-config: full http-server configuration
|
||||
::
|
||||
+$ http-config
|
||||
$: :: secure: PEM-encoded RSA private key and cert or cert chain
|
||||
::
|
||||
secure=(unit [key=wain cert=wain])
|
||||
:: proxy: reverse TCP proxy HTTP(s)
|
||||
::
|
||||
proxy=_|
|
||||
:: log: keep HTTP(s) access logs
|
||||
::
|
||||
log=?
|
||||
:: redirect: send 301 redirects to upgrade HTTP to HTTPS
|
||||
::
|
||||
:: Note: requires certificate.
|
||||
::
|
||||
redirect=?
|
||||
==
|
||||
:: +http-rule: update configuration
|
||||
::
|
||||
+$ http-rule
|
||||
$% :: %cert: set or clear certificate and keypair
|
||||
::
|
||||
[%cert cert=(unit [key=wain cert=wain])]
|
||||
:: %turf: add or remove established dns binding
|
||||
::
|
||||
[%turf action=?(%put %del) =turf]
|
||||
==
|
||||
:: +address: client IP address
|
||||
::
|
||||
+$ address
|
||||
$% [%ipv4 @if]
|
||||
[%ipv6 @is]
|
||||
:: [%ames @p]
|
||||
==
|
||||
:: +inbound-request: +http-request and metadata
|
||||
::
|
||||
+$ inbound-request
|
||||
$: :: authenticated: has a valid session cookie
|
||||
::
|
||||
authenticated=?
|
||||
:: secure: whether this request was encrypted (https)
|
||||
::
|
||||
secure=?
|
||||
:: address: the source address of this request
|
||||
::
|
||||
=address
|
||||
:: request: the http-request itself
|
||||
::
|
||||
=request:http
|
||||
==
|
||||
::
|
||||
++ cred :: credential
|
||||
$: hut/hart :: client host
|
||||
@ -995,12 +1146,6 @@
|
||||
(gte i.b 224)
|
||||
==
|
||||
++ rout {p/(list host) q/path r/oryx s/path} :: http route (new)
|
||||
++ sec-move :: driver effect
|
||||
$% {$send p/hiss} :: http out
|
||||
{$show p/purl} :: direct user to url
|
||||
{$give p/httr} :: respond immediately
|
||||
{$redo ~} :: restart request qeu
|
||||
== ::
|
||||
++ user knot :: username
|
||||
-- ::eyre
|
||||
:: ::::
|
||||
@ -1793,6 +1938,119 @@
|
||||
++ suss (trel dude @tas @da) :: config report
|
||||
++ well (pair desk term) ::
|
||||
-- ::gall
|
||||
:: %iris http-client interface
|
||||
::
|
||||
++ iris ^?
|
||||
|%
|
||||
++ able
|
||||
|%
|
||||
:: +gift: effects the client can emit
|
||||
::
|
||||
++ gift
|
||||
$% :: %request: outbound http-request to earth
|
||||
::
|
||||
:: TODO: id is sort of wrong for this interface; the duct should
|
||||
:: be enough to identify which request we're talking about?
|
||||
::
|
||||
[%request id=@ud request=request:http]
|
||||
:: %cancel-request: tell earth to cancel a previous %request
|
||||
::
|
||||
[%cancel-request id=@ud]
|
||||
:: %response: response to the caller
|
||||
::
|
||||
[%http-response =client-response]
|
||||
:: memory usage report
|
||||
::
|
||||
[%mass p=mass]
|
||||
==
|
||||
::
|
||||
++ task
|
||||
$~ [%vega ~]
|
||||
$% :: event failure notification
|
||||
::
|
||||
$>(%crud vane-task)
|
||||
:: system started up; reset open connections
|
||||
::
|
||||
$>(%born vane-task)
|
||||
:: report upgrade
|
||||
::
|
||||
$>(%vega vane-task)
|
||||
:: fetches a remote resource
|
||||
::
|
||||
[%request =request:http =outbound-config]
|
||||
:: cancels a previous fetch
|
||||
::
|
||||
[%cancel-request ~]
|
||||
:: receives http data from outside
|
||||
::
|
||||
[%receive id=@ud =http-event:http]
|
||||
:: memory usage request
|
||||
::
|
||||
$>(%wegh vane-task)
|
||||
==
|
||||
--
|
||||
:: +client-response: one or more client responses given to the caller
|
||||
::
|
||||
+$ client-response
|
||||
$% :: periodically sent as an update on the duct that sent %fetch
|
||||
::
|
||||
$: %progress
|
||||
:: http-response-header: full transaction header
|
||||
::
|
||||
:: In case of a redirect chain, this is the target of the
|
||||
:: final redirect.
|
||||
::
|
||||
=response-header:http
|
||||
:: bytes-read: bytes fetched so far
|
||||
::
|
||||
bytes-read=@ud
|
||||
:: expected-size: the total size if response had a content-length
|
||||
::
|
||||
expected-size=(unit @ud)
|
||||
:: incremental: data received since the last %http-progress
|
||||
::
|
||||
incremental=(unit octs)
|
||||
==
|
||||
:: final response of a download, parsed as mime-data if successful
|
||||
::
|
||||
[%finished =response-header:http full-file=(unit mime-data)]
|
||||
:: canceled by the runtime system
|
||||
::
|
||||
[%cancel ~]
|
||||
==
|
||||
:: mime-data: externally received but unvalidated mimed data
|
||||
::
|
||||
+$ mime-data
|
||||
[type=@t data=octs]
|
||||
:: +outbound-config: configuration for outbound http requests
|
||||
::
|
||||
+$ outbound-config
|
||||
$: :: number of times to follow a 300 redirect before erroring
|
||||
::
|
||||
:: Common values for this will be 3 (the limit most browsers use), 5
|
||||
:: (the limit recommended by the http standard), or 0 (let the
|
||||
:: requester deal with 300 redirects).
|
||||
::
|
||||
redirects=_5
|
||||
:: number of times to retry before failing
|
||||
::
|
||||
:: When we retry, we'll automatically try to use the 'Range' header
|
||||
:: to resume the download where we left off if we have the
|
||||
:: 'Accept-Range: bytes' in the original response.
|
||||
::
|
||||
retries=_3
|
||||
==
|
||||
:: +to-httr: adapts to old eyre interface
|
||||
::
|
||||
++ to-httr
|
||||
|= [header=response-header:http full-file=(unit mime-data)]
|
||||
^- httr:eyre
|
||||
::
|
||||
=/ data=(unit octs)
|
||||
?~(full-file ~ `data.u.full-file)
|
||||
::
|
||||
[status-code.header headers.header data]
|
||||
--
|
||||
:: ::::
|
||||
:::: ++jael :: (1h) security
|
||||
:: ::::
|
||||
@ -2161,287 +2419,6 @@
|
||||
++ oath @ :: signature
|
||||
-- :: pki
|
||||
-- :: kale
|
||||
::
|
||||
++ http-client ^?
|
||||
|%
|
||||
++ able
|
||||
|%
|
||||
:: +gift: effects the client can emit
|
||||
::
|
||||
++ gift
|
||||
$% :: %request: outbound http-request to earth
|
||||
::
|
||||
:: TODO: id is sort of wrong for this interface; the duct should
|
||||
:: be enough to identify which request we're talking about?
|
||||
::
|
||||
[%request id=@ud request=request:http]
|
||||
:: %cancel-request: tell earth to cancel a previous %request
|
||||
::
|
||||
[%cancel-request id=@ud]
|
||||
:: %response: response to the caller
|
||||
::
|
||||
[%http-response =client-response]
|
||||
:: memory usage report
|
||||
::
|
||||
[%mass p=mass]
|
||||
==
|
||||
::
|
||||
++ task
|
||||
$~ [%vega ~]
|
||||
$% :: event failure notification
|
||||
::
|
||||
$>(%crud vane-task)
|
||||
:: system started up; reset open connections
|
||||
::
|
||||
$>(%born vane-task)
|
||||
:: report upgrade
|
||||
::
|
||||
$>(%vega vane-task)
|
||||
:: fetches a remote resource
|
||||
::
|
||||
[%request =request:http =outbound-config]
|
||||
:: cancels a previous fetch
|
||||
::
|
||||
[%cancel-request ~]
|
||||
:: receives http data from outside
|
||||
::
|
||||
[%receive id=@ud =http-event:http]
|
||||
:: memory usage request
|
||||
::
|
||||
$>(%wegh vane-task)
|
||||
==
|
||||
--
|
||||
:: +client-response: one or more client responses given to the caller
|
||||
::
|
||||
+$ client-response
|
||||
$% :: periodically sent as an update on the duct that sent %fetch
|
||||
::
|
||||
$: %progress
|
||||
:: http-response-header: full transaction header
|
||||
::
|
||||
:: In case of a redirect chain, this is the target of the
|
||||
:: final redirect.
|
||||
::
|
||||
=response-header:http
|
||||
:: bytes-read: bytes fetched so far
|
||||
::
|
||||
bytes-read=@ud
|
||||
:: expected-size: the total size if response had a content-length
|
||||
::
|
||||
expected-size=(unit @ud)
|
||||
:: incremental: data received since the last %http-progress
|
||||
::
|
||||
incremental=(unit octs)
|
||||
==
|
||||
:: final response of a download, parsed as mime-data if successful
|
||||
::
|
||||
[%finished =response-header:http full-file=(unit mime-data)]
|
||||
:: canceled by the runtime system
|
||||
::
|
||||
[%cancel ~]
|
||||
==
|
||||
:: mime-data: externally received but unvalidated mimed data
|
||||
::
|
||||
+$ mime-data
|
||||
[type=@t data=octs]
|
||||
:: +outbound-config: configuration for outbound http requests
|
||||
::
|
||||
+$ outbound-config
|
||||
$: :: number of times to follow a 300 redirect before erroring
|
||||
::
|
||||
:: Common values for this will be 3 (the limit most browsers use), 5
|
||||
:: (the limit recommended by the http standard), or 0 (let the
|
||||
:: requester deal with 300 redirects).
|
||||
::
|
||||
redirects=_5
|
||||
:: number of times to retry before failing
|
||||
::
|
||||
:: When we retry, we'll automatically try to use the 'Range' header
|
||||
:: to resume the download where we left off if we have the
|
||||
:: 'Accept-Range: bytes' in the original response.
|
||||
::
|
||||
retries=_3
|
||||
==
|
||||
:: +to-httr: adapts to old eyre interface
|
||||
::
|
||||
++ to-httr
|
||||
|= [header=response-header:http full-file=(unit mime-data)]
|
||||
^- httr:eyre
|
||||
::
|
||||
=/ data=(unit octs)
|
||||
?~(full-file ~ `data.u.full-file)
|
||||
::
|
||||
[status-code.header headers.header data]
|
||||
--
|
||||
::
|
||||
::::
|
||||
::
|
||||
++ http-server ^?
|
||||
|%
|
||||
++ able
|
||||
|%
|
||||
++ gift
|
||||
$% :: set-config: configures the external http server
|
||||
::
|
||||
:: TODO: We need to actually return a (map (unit @t) http-config)
|
||||
:: so we can apply configurations on a per-site basis
|
||||
::
|
||||
[%set-config =http-config]
|
||||
:: response: response to an event from earth
|
||||
::
|
||||
[%response =http-event:http]
|
||||
:: response to a %connect or %serve
|
||||
::
|
||||
:: :accepted is whether :binding was valid. Duplicate bindings are
|
||||
:: not allowed.
|
||||
::
|
||||
[%bound accepted=? =binding]
|
||||
:: memory usage report
|
||||
::
|
||||
[%mass p=mass]
|
||||
==
|
||||
::
|
||||
++ task
|
||||
$~ [%vega ~]
|
||||
$% :: event failure notification
|
||||
::
|
||||
$>(%crud vane-task)
|
||||
:: initializes ourselves with an identity
|
||||
::
|
||||
$>(%init vane-task)
|
||||
:: new unix process
|
||||
::
|
||||
:: XX use +vane-task
|
||||
::
|
||||
[%born p=(list host)]
|
||||
:: report upgrade
|
||||
::
|
||||
$>(%vega vane-task)
|
||||
:: notifies us of the ports of our live http servers
|
||||
::
|
||||
[%live insecure=@ud secure=(unit @ud)]
|
||||
:: update http configuration
|
||||
::
|
||||
[%rule =http-rule]
|
||||
:: starts handling an inbound http request
|
||||
::
|
||||
[%request secure=? =address =request:http]
|
||||
:: starts handling an backdoor http request
|
||||
::
|
||||
[%request-local secure=? =address =request:http]
|
||||
:: cancels a previous request
|
||||
::
|
||||
[%cancel-request ~]
|
||||
:: connects a binding to an app
|
||||
::
|
||||
[%connect =binding app=term]
|
||||
:: connects a binding to a generator
|
||||
::
|
||||
[%serve =binding =generator]
|
||||
:: disconnects a binding
|
||||
::
|
||||
:: This must be called with the same duct that made the binding in
|
||||
:: the first place.
|
||||
::
|
||||
[%disconnect =binding]
|
||||
:: memory usage request
|
||||
::
|
||||
$>(%wegh vane-task)
|
||||
==
|
||||
::
|
||||
--
|
||||
:: +binding: A rule to match a path.
|
||||
::
|
||||
:: A +binding is a system unique mapping for a path to match. A +binding
|
||||
:: must be system unique because we don't want two handlers for a path;
|
||||
:: what happens if there are two different actions for [~ /]?
|
||||
::
|
||||
+$ binding
|
||||
$: :: site: the site to match.
|
||||
::
|
||||
:: A ~ will match the Urbit's identity site (your.urbit.org). Any
|
||||
:: other value will match a domain literal.
|
||||
::
|
||||
site=(unit @t)
|
||||
:: path: matches this prefix path
|
||||
::
|
||||
:: /~myapp will match /~myapp or /~myapp/longer/path
|
||||
::
|
||||
path=(list @t)
|
||||
==
|
||||
:: +generator: a generator on the local ship that handles requests
|
||||
::
|
||||
:: This refers to a generator on the local ship, run with a set of
|
||||
:: arguments. Since http requests are time sensitive, we require that the
|
||||
:: generator be on the current ship.
|
||||
::
|
||||
+$ generator
|
||||
$: :: desk: desk on current ship that contains the generator
|
||||
::
|
||||
=desk
|
||||
:: path: path on :desk to the generator's hoon file
|
||||
::
|
||||
path=(list @t)
|
||||
:: args: arguments passed to the gate
|
||||
::
|
||||
args=*
|
||||
==
|
||||
:: +host: http host
|
||||
::
|
||||
+$ host
|
||||
(each (list @t) @if)
|
||||
:: +http-config: full http-server configuration
|
||||
::
|
||||
+$ http-config
|
||||
$: :: secure: PEM-encoded RSA private key and cert or cert chain
|
||||
::
|
||||
secure=(unit [key=wain cert=wain])
|
||||
:: proxy: reverse TCP proxy HTTP(s)
|
||||
::
|
||||
proxy=_|
|
||||
:: log: keep HTTP(s) access logs
|
||||
::
|
||||
log=?
|
||||
:: redirect: send 301 redirects to upgrade HTTP to HTTPS
|
||||
::
|
||||
:: Note: requires certificate.
|
||||
::
|
||||
redirect=?
|
||||
==
|
||||
:: +http-rule: update configuration
|
||||
::
|
||||
+$ http-rule
|
||||
$% :: %cert: set or clear certificate and keypair
|
||||
::
|
||||
[%cert cert=(unit [key=wain cert=wain])]
|
||||
:: %turf: add or remove established dns binding
|
||||
::
|
||||
[%turf action=?(%put %del) =turf]
|
||||
==
|
||||
:: +address: client IP address
|
||||
::
|
||||
+$ address
|
||||
$% [%ipv4 @if]
|
||||
[%ipv6 @is]
|
||||
:: [%ames @p]
|
||||
==
|
||||
:: +inbound-request: +http-request and metadata
|
||||
::
|
||||
+$ inbound-request
|
||||
$: :: authenticated: has a valid session cookie
|
||||
::
|
||||
authenticated=?
|
||||
:: secure: whether this request was encrypted (https)
|
||||
::
|
||||
secure=?
|
||||
:: address: the source address of this request
|
||||
::
|
||||
=address
|
||||
:: request: the http-request itself
|
||||
::
|
||||
=request:http
|
||||
==
|
||||
--
|
||||
:: ::::
|
||||
:::: ++xmas :: (1i) new network
|
||||
:: ::::
|
||||
@ -7600,22 +7577,22 @@
|
||||
gift:able:behn
|
||||
gift:able:clay
|
||||
gift:able:dill
|
||||
gift:able:eyre
|
||||
gift:able:ford
|
||||
gift:able:gall
|
||||
gift:able:iris
|
||||
gift:able:jael
|
||||
gift:able:http-client
|
||||
gift:able:http-server
|
||||
==
|
||||
++ task-arvo :: in request ->$
|
||||
$% task:able:ames
|
||||
task:able:clay
|
||||
task:able:behn
|
||||
task:able:dill
|
||||
task:able:iris
|
||||
task:able:ford
|
||||
task:able:gall
|
||||
task:able:eyre
|
||||
task:able:jael
|
||||
task:able:http-client
|
||||
task:able:http-server
|
||||
==
|
||||
++ note-arvo :: out request $->
|
||||
$~ [%a %wake ~]
|
||||
@ -7623,11 +7600,11 @@
|
||||
{$b task:able:behn}
|
||||
{$c task:able:clay}
|
||||
{$d task:able:dill}
|
||||
[%e task:able:eyre]
|
||||
{$f task:able:ford}
|
||||
{$g task:able:gall}
|
||||
[%i task:able:iris]
|
||||
{$j task:able:jael}
|
||||
[%l task:able:http-client]
|
||||
[%r task:able:http-server]
|
||||
{@tas $meta vase}
|
||||
==
|
||||
++ sign-arvo :: in result $<-
|
||||
@ -7640,10 +7617,10 @@
|
||||
{$c gift:able:clay}
|
||||
{$d gift:able:dill}
|
||||
{$f gift:able:ford}
|
||||
[%e gift:able:eyre]
|
||||
{$g gift:able:gall}
|
||||
[%i gift:able:iris]
|
||||
{$j gift:able:jael}
|
||||
[%l gift:able:http-client]
|
||||
[%r gift:able:http-server]
|
||||
==
|
||||
::
|
||||
+$ unix-task :: input from unix
|
||||
@ -7660,12 +7637,10 @@
|
||||
:: %clay: new process
|
||||
::
|
||||
$>(%boat task:able:clay)
|
||||
:: %behn/%lient/%rver: new process
|
||||
::
|
||||
:: XX %rver includes payload
|
||||
:: %behn/%eyre/%iris: new process
|
||||
::
|
||||
$>(%born vane-task)
|
||||
:: %rver: cancel request
|
||||
:: %eyre: cancel request
|
||||
::
|
||||
[%cancel-request ~]
|
||||
:: any vane: error report
|
||||
@ -7683,18 +7658,18 @@
|
||||
:: %clay: external edit
|
||||
::
|
||||
$>(%into task:able:clay)
|
||||
:: %rver: learn ports of live http servers
|
||||
:: %eyre: learn ports of live http servers
|
||||
::
|
||||
$>(%live task:able:http-server)
|
||||
:: %lient: hear (partial) http response
|
||||
$>(%live task:able:eyre)
|
||||
:: %iris: hear (partial) http response
|
||||
::
|
||||
$>(%receive task:able:http-client)
|
||||
:: %rver: starts handling an inbound http request
|
||||
$>(%receive task:able:iris)
|
||||
:: %eyre: starts handling an inbound http request
|
||||
::
|
||||
$>(%request task:able:http-server)
|
||||
:: %rver: starts handling an backdoor http request
|
||||
$>(%request task:able:eyre)
|
||||
:: %eyre: starts handling an backdoor http request
|
||||
::
|
||||
$>(%request-local task:able:http-server)
|
||||
$>(%request-local task:able:eyre)
|
||||
:: %behn: wakeup
|
||||
::
|
||||
$>(%wake task:able:behn)
|
||||
|
@ -47,7 +47,7 @@
|
||||
%request
|
||||
/acme/try/2/directory
|
||||
[%'GET' (crip (en-purl:html directory-base:app)) ~ ~]
|
||||
*outbound-config:http-client
|
||||
*outbound-config:iris
|
||||
== ==
|
||||
!> moves
|
||||
--
|
||||
|
@ -1,6 +1,6 @@
|
||||
/+ *test, *test-ford
|
||||
::
|
||||
/= http-server-raw /: /===/sys/vane/rver /!noun/
|
||||
/= http-server-raw /: /===/sys/vane/eyre /!noun/
|
||||
::
|
||||
!:
|
||||
::
|
@ -1,6 +1,6 @@
|
||||
/+ *test
|
||||
::
|
||||
/= http-client-raw /: /===/sys/vane/lient /!noun/
|
||||
/= http-client-raw /: /===/sys/vane/iris /!noun/
|
||||
::
|
||||
!:
|
||||
::
|
||||
@ -39,7 +39,7 @@
|
||||
:* duct=~[/http-get-request] ~
|
||||
%request
|
||||
request
|
||||
*outbound-config:http-client
|
||||
*outbound-config:iris
|
||||
==
|
||||
^= expected-moves
|
||||
^- (list move:http-client-gate)
|
||||
@ -61,7 +61,7 @@
|
||||
scry=*sley
|
||||
^= call-args
|
||||
:+ duct=~[/initial-born-duct] ~
|
||||
^- task:able:http-client
|
||||
^- task:able:iris
|
||||
:* %receive
|
||||
id=0
|
||||
^- http-event:http
|
||||
@ -135,7 +135,7 @@
|
||||
:* duct=~[/http-get-request] ~
|
||||
%request
|
||||
request
|
||||
*outbound-config:http-client
|
||||
*outbound-config:iris
|
||||
==
|
||||
^= expected-moves
|
||||
^- (list move:http-client-gate)
|
||||
@ -157,7 +157,7 @@
|
||||
scry=*sley
|
||||
^= call-args
|
||||
:+ duct=~[/initial-born-duct] ~
|
||||
^- task:able:http-client
|
||||
^- task:able:iris
|
||||
:* %receive
|
||||
id=0
|
||||
^- http-event:http
|
||||
@ -194,7 +194,7 @@
|
||||
scry=*sley
|
||||
^= call-args
|
||||
:+ duct=~[/initial-born-duct] ~
|
||||
^- task:able:http-client
|
||||
^- task:able:iris
|
||||
:* %receive
|
||||
id=0
|
||||
^- http-event:http
|
||||
@ -227,7 +227,7 @@
|
||||
scry=*sley
|
||||
^= call-args
|
||||
:+ duct=~[/initial-born-duct] ~
|
||||
^- task:able:http-client
|
||||
^- task:able:iris
|
||||
:* %receive
|
||||
id=0
|
||||
^- http-event:http
|
||||
@ -292,7 +292,7 @@
|
||||
:* duct=~[/http-get-request] ~
|
||||
%request
|
||||
request
|
||||
*outbound-config:http-client
|
||||
*outbound-config:iris
|
||||
==
|
||||
^= expected-moves
|
||||
^- (list move:http-client-gate)
|
||||
@ -314,7 +314,7 @@
|
||||
scry=*sley
|
||||
^= call-args
|
||||
:+ duct=~[/initial-born-duct] ~
|
||||
^- task:able:http-client
|
||||
^- task:able:iris
|
||||
:* %receive
|
||||
id=0
|
||||
^- http-event:http
|
||||
@ -398,7 +398,7 @@
|
||||
:* duct=~[/http-get-request] ~
|
||||
%request
|
||||
request
|
||||
*outbound-config:http-client
|
||||
*outbound-config:iris
|
||||
==
|
||||
^= expected-moves
|
||||
^- (list move:http-client-gate)
|
||||
@ -420,7 +420,7 @@
|
||||
scry=*sley
|
||||
^= call-args
|
||||
:+ duct=~[/initial-born-duct] ~
|
||||
^- task:able:http-client
|
||||
^- task:able:iris
|
||||
:* %receive
|
||||
id=0
|
||||
^- http-event:http
|
||||
@ -471,7 +471,7 @@
|
||||
:* duct=~[/http-get-request] ~
|
||||
%request
|
||||
request
|
||||
*outbound-config:http-client
|
||||
*outbound-config:iris
|
||||
==
|
||||
^= expected-moves
|
||||
^- (list move:http-client-gate)
|
||||
@ -492,7 +492,7 @@
|
||||
scry=*sley
|
||||
^= call-args
|
||||
:+ duct=~[/secondary-born-duct] ~
|
||||
^- task:able:http-client
|
||||
^- task:able:iris
|
||||
:* %born
|
||||
~
|
||||
==
|
||||
@ -515,7 +515,7 @@
|
||||
|= $: http-client-gate=_http-client-gate
|
||||
now=@da
|
||||
scry=sley
|
||||
call-args=[=duct type=* wrapped-task=(hobo task:able:http-client)]
|
||||
call-args=[=duct type=* wrapped-task=(hobo task:able:iris)]
|
||||
expected-moves=(list move:http-client-gate)
|
||||
==
|
||||
^- [tang _http-client-gate]
|
@ -30,7 +30,7 @@
|
||||
[hen %slip %c %init ~nul]
|
||||
[hen %slip %g %init ~nul]
|
||||
[hen %slip %d %init ~nul]
|
||||
[hen %slip %r %init ~nul]
|
||||
[hen %slip %e %init ~nul]
|
||||
[hen %give %init ~nul]
|
||||
[hen %pass /~nul/init %b %wait +(~1234.5.6)]
|
||||
== ==
|
||||
@ -70,7 +70,7 @@
|
||||
^= comparator
|
||||
|= moves=(list move:jael-gate)
|
||||
?> ?=(^ moves)
|
||||
?> ?=([* %pass * %l %request *] i.moves)
|
||||
?> ?=([* %pass * %i %request *] i.moves)
|
||||
;: weld
|
||||
%+ expect-eq
|
||||
!> 1
|
||||
|
@ -1431,103 +1431,15 @@ _http_release_ports_file(c3_c *pax_c)
|
||||
free(paf_c);
|
||||
}
|
||||
|
||||
|
||||
/* _http_czar_host(): galaxy hostname as (unit host:eyre)
|
||||
*/
|
||||
static u3_noun
|
||||
_http_czar_host(void)
|
||||
{
|
||||
u3_noun dom = u3_nul;
|
||||
return dom;
|
||||
|
||||
// XX revisit
|
||||
#if 0
|
||||
if ( (0 == u3_Host.ops_u.imp_c) || (c3n == u3_Host.ops_u.net) ) {
|
||||
return dom;
|
||||
}
|
||||
|
||||
{
|
||||
c3_c* dns_c = u3_Host.ops_u.dns_c;
|
||||
c3_w len_w = strlen(dns_c);
|
||||
c3_w dif_w;
|
||||
c3_c* dom_c;
|
||||
c3_c* dot_c;
|
||||
|
||||
while ( 0 != len_w ) {
|
||||
if ( 0 == (dot_c = strchr(dns_c, '.'))) {
|
||||
len_w = 0;
|
||||
dom = u3nc(u3i_string(dns_c), dom);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
dif_w = dot_c - dns_c;
|
||||
dom_c = c3_malloc(1 + dif_w);
|
||||
strncpy(dom_c, dns_c, dif_w);
|
||||
dom_c[dif_w] = 0;
|
||||
|
||||
dom = u3nc(u3i_string(dom_c), dom);
|
||||
|
||||
// increment to skip leading '.'
|
||||
dns_c = dot_c + 1;
|
||||
free(dom_c);
|
||||
|
||||
// XX confirm that underflow is impossible here
|
||||
len_w -= c3_min(dif_w, len_w);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( u3_nul == dom ) {
|
||||
return dom;
|
||||
}
|
||||
|
||||
// increment to skip '~'
|
||||
dom = u3nc(u3i_string(u3_Host.ops_u.imp_c + 1), u3kb_flop(u3k(dom)));
|
||||
|
||||
return u3nt(u3_nul, c3y, u3kb_flop(u3k(dom)));
|
||||
#endif
|
||||
}
|
||||
|
||||
/* u3_http_ef_bake(): notify %eyre that we're live
|
||||
*/
|
||||
void
|
||||
u3_http_ef_bake(void)
|
||||
{
|
||||
u3_noun ipf = u3_nul;
|
||||
u3_noun pax = u3nq(u3_blip, u3i_string("http-server"),
|
||||
u3k(u3A->sen), u3_nul);
|
||||
|
||||
{
|
||||
struct ifaddrs* iad_u;
|
||||
getifaddrs(&iad_u);
|
||||
|
||||
struct ifaddrs* dia_u = iad_u;
|
||||
|
||||
while ( iad_u ) {
|
||||
struct sockaddr_in* adr_u = (struct sockaddr_in *)iad_u->ifa_addr;
|
||||
|
||||
if ( (0 != adr_u) && (AF_INET == adr_u->sin_family) ) {
|
||||
c3_w ipf_w = ntohl(adr_u->sin_addr.s_addr);
|
||||
|
||||
if ( INADDR_LOOPBACK != ipf_w ) {
|
||||
ipf = u3nc(u3nc(c3n, u3i_words(1, &ipf_w)), ipf);
|
||||
}
|
||||
}
|
||||
|
||||
iad_u = iad_u->ifa_next;
|
||||
}
|
||||
|
||||
freeifaddrs(dia_u);
|
||||
}
|
||||
|
||||
u3_noun hot = _http_czar_host();
|
||||
|
||||
if ( u3_nul != hot ) {
|
||||
ipf = u3nc(u3k(u3t(hot)), ipf);
|
||||
u3z(hot);
|
||||
}
|
||||
|
||||
u3_noun pax = u3nq(u3_blip, u3i_string("http-server"), u3k(u3A->sen), u3_nul);
|
||||
|
||||
u3_pier_plan(pax, u3nc(c3__born, ipf));
|
||||
u3_pier_plan(pax, u3nc(c3__born, u3_nul));
|
||||
}
|
||||
|
||||
static u3_hreq*
|
||||
|
Loading…
Reference in New Issue
Block a user