mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 14:42:02 +03:00
Boots with %light instead of %eyre. Stubs for system cofiguration events.
This commit is contained in:
parent
041bd29aab
commit
a15220a2e4
@ -53,6 +53,7 @@
|
||||
[%g /vane/gall]
|
||||
[%e /vane/eyre]
|
||||
[%j /vane/jael]
|
||||
[%l /vane/light]
|
||||
==
|
||||
|- ^+ all
|
||||
?~ vay all
|
||||
|
@ -82,7 +82,7 @@
|
||||
?: ?=($pawn myr)
|
||||
[[%base %collections] [%base %hall] [%base %talk] [%base %dojo] ~]
|
||||
:~ [%home %collections]
|
||||
[%home %acme]
|
||||
:: [%home %acme]
|
||||
[%home %dns]
|
||||
[%home %dojo]
|
||||
[%home %hall]
|
||||
|
@ -180,6 +180,7 @@
|
||||
[%e /vane/eyre]
|
||||
[%f /vane/ford]
|
||||
[%g /vane/gall]
|
||||
[%l /vane/light]
|
||||
[%j /vane/jael]
|
||||
==
|
||||
|= {p/@tas q/path}
|
||||
@ -206,6 +207,7 @@
|
||||
[%e %eyre]
|
||||
[%f %ford]
|
||||
[%g %gall]
|
||||
[%l %light]
|
||||
[%j %jael]
|
||||
==
|
||||
|= {p/@tas q/@tas}
|
||||
|
@ -173,6 +173,7 @@
|
||||
++ slur-e ~/(%slur-e |=({gat/vase hil/mill} =+(%e (slur gat hil))))
|
||||
++ slur-f ~/(%slur-f |=({gat/vase hil/mill} =+(%f (slur gat hil))))
|
||||
++ slur-g ~/(%slur-g |=({gat/vase hil/mill} =+(%g (slur gat hil))))
|
||||
++ slur-l ~/(%slur-l |=({gat/vase hil/mill} =+(%l (slur gat hil))))
|
||||
++ slur-j ~/(%slur-j |=({gat/vase hil/mill} =+(%j (slur gat hil))))
|
||||
++ slur-z ~/(%slur-z |=({gat/vase hil/mill} =+(%z (slur gat hil))))
|
||||
::
|
||||
@ -187,6 +188,7 @@
|
||||
$e (slur-e gat hil)
|
||||
$f (slur-f gat hil)
|
||||
$g (slur-g gat hil)
|
||||
$l (slur-l gat hil)
|
||||
$j (slur-j gat hil)
|
||||
==
|
||||
::
|
||||
@ -379,7 +381,7 @@
|
||||
{@ $newt *} %a
|
||||
{@ $sync *} %c
|
||||
{@ $term *} %d
|
||||
{@ $http *} %e
|
||||
{@ $http *} %l
|
||||
{@ $behn *} %b
|
||||
==
|
||||
::
|
||||
|
@ -2,159 +2,11 @@
|
||||
:: lighter than eyre
|
||||
::
|
||||
|= pit=vase
|
||||
=, light
|
||||
:: internal data structures
|
||||
::
|
||||
=> =~
|
||||
::
|
||||
|%
|
||||
--
|
||||
:: TODO: this becomes the +eyre interface arm in zuse
|
||||
::
|
||||
|%
|
||||
+| %vane-interface
|
||||
++ able
|
||||
|%
|
||||
++ gift
|
||||
$% :: http-response: response from urbit to earth
|
||||
::
|
||||
[%http-response =raw-http-response]
|
||||
:: response to a %connect or %serve
|
||||
::
|
||||
:: :accepted is whether :binding was valid. Duplicate bindings are not allowed.
|
||||
::
|
||||
[%bound accepted=? =binding]
|
||||
==
|
||||
::
|
||||
++ task
|
||||
$% :: initializes ourselves with an identity
|
||||
::
|
||||
:: TODO: Remove this once we single home.
|
||||
::
|
||||
[%init our=@p]
|
||||
:: starts handling an inbound http request
|
||||
::
|
||||
[%inbound-request secure=? =address =http-request]
|
||||
:: connects a binding to an app
|
||||
::
|
||||
[%connect =binding app=term]
|
||||
:: connects a binding to a generator
|
||||
::
|
||||
[%serve =binding generator=[=desk path=(list @t)] arguments=*]
|
||||
:: disconnects a binding
|
||||
::
|
||||
:: This must be called with the same duct that made the binding in
|
||||
:: the first place.
|
||||
::
|
||||
[%disconnect =binding]
|
||||
==
|
||||
--
|
||||
::
|
||||
+| %bindings
|
||||
:: +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)
|
||||
==
|
||||
::
|
||||
+| %http
|
||||
:: +header-list: an ordered list of http headers
|
||||
::
|
||||
+$ header-list
|
||||
(list [key=@t value=@t])
|
||||
:: +http-method: exhaustive list of http verbs
|
||||
::
|
||||
+$ http-method
|
||||
$? _'CONNECT'
|
||||
_'DELETE'
|
||||
_'GET'
|
||||
_'HEAD'
|
||||
_'OPTIONS'
|
||||
_'POST'
|
||||
_'PUT'
|
||||
_'TRACE'
|
||||
==
|
||||
:: +http-request: a single http-request
|
||||
::
|
||||
+$ http-request
|
||||
$: :: http-method:
|
||||
::
|
||||
method=http-method
|
||||
:: url: the url requested
|
||||
::
|
||||
:: The url is not escaped. There is no escape.
|
||||
::
|
||||
url=@t
|
||||
:: header-list: headers to pass with this request
|
||||
::
|
||||
=header-list
|
||||
:: body: optionally, data to send with this request
|
||||
::
|
||||
body=(unit octs)
|
||||
==
|
||||
:: +raw-http-response: http-response to sent to earth
|
||||
::
|
||||
:: Urbit treats Earth's HTTP servers as pipes, where Urbit sends one or
|
||||
:: more %http-response replies on the wire. The first of these will
|
||||
:: always be a %start or an %error, and the last will always be %error
|
||||
:: or will have :complete set to %.y to finish the connection.
|
||||
::
|
||||
:: Calculation of control headers such as 'Content-Length' or
|
||||
:: 'Transfer-Encoding' should be performed at a higher level; this structure
|
||||
:: is merely for what gets sent to Earth.
|
||||
::
|
||||
+$ raw-http-response
|
||||
$% :: %start: the first packet in a response
|
||||
::
|
||||
$: %start
|
||||
:: status: http status code
|
||||
::
|
||||
status-code=@ud
|
||||
:: headers: http headers
|
||||
::
|
||||
headers=header-list
|
||||
:: data: data to pass to the pipe
|
||||
::
|
||||
data=(unit octs)
|
||||
:: whether this completes the request
|
||||
::
|
||||
complete=?
|
||||
==
|
||||
:: %continue: every subsequent packet
|
||||
::
|
||||
$: %continue
|
||||
:: data: data to pass to the pipe
|
||||
::
|
||||
data=(unit octs)
|
||||
:: complete: whether this completes the request
|
||||
::
|
||||
complete=?
|
||||
==
|
||||
:: %cancel: whether the connection should terminate unsuccessfully
|
||||
::
|
||||
[%cancel ~]
|
||||
==
|
||||
:: +address: client IP address
|
||||
::
|
||||
+$ address
|
||||
$% [%ipv4 @if]
|
||||
[%ipv6 @is]
|
||||
:: [%ames @p]
|
||||
==
|
||||
--
|
||||
:: internal data structures that won't go in zuse
|
||||
::
|
||||
|%
|
||||
@ -740,6 +592,7 @@
|
||||
=/ task=task:able
|
||||
?. ?=(%soft -.wrapped-task)
|
||||
wrapped-task
|
||||
~| [%call p.wrapped-task]
|
||||
((hard task:able) p.wrapped-task)
|
||||
::
|
||||
?- -.task
|
||||
@ -754,6 +607,22 @@
|
||||
:~ [[~ /~/login] duct [%login-handler ~]]
|
||||
==
|
||||
[~ light-gate]
|
||||
:: %born: new unix process
|
||||
::
|
||||
%born
|
||||
::
|
||||
~& [%todo-handle-born p.task]
|
||||
:: hand back a default configuration for now
|
||||
::
|
||||
[[duct %give %form *http-config]~ light-gate]
|
||||
::
|
||||
:: %live: no idea what this is for
|
||||
::
|
||||
%live
|
||||
::
|
||||
~& [%todo-live p.task q.task]
|
||||
::
|
||||
[~ light-gate]
|
||||
::
|
||||
:: %inbound-request: handles an inbound http request
|
||||
::
|
||||
@ -813,4 +682,20 @@
|
||||
--
|
||||
::
|
||||
++ light-gate ..$
|
||||
:: +load: migrate old state to new state (called on vane reload)
|
||||
::
|
||||
++ load
|
||||
|= old=axle
|
||||
^+ ..^$
|
||||
::
|
||||
~! %loading
|
||||
..^$(ax old)
|
||||
:: +stay: produce current state
|
||||
::
|
||||
++ stay `axle`ax
|
||||
:: +scry: request a path in the urbit namespace
|
||||
::
|
||||
++ scry
|
||||
|= *
|
||||
[~ ~]
|
||||
--
|
||||
|
191
sys/zuse.hoon
191
sys/zuse.hoon
@ -1,3 +1,4 @@
|
||||
!:
|
||||
:: :: /van/zuse
|
||||
:: :: %reference/1
|
||||
:: %zuse: arvo library.
|
||||
@ -2177,6 +2178,196 @@
|
||||
++ safe (tree rite) :: rights set
|
||||
-- :: rights
|
||||
-- :: jael
|
||||
::
|
||||
::::
|
||||
::
|
||||
++ light ^?
|
||||
|%
|
||||
+| %vane-interface
|
||||
++ able
|
||||
|%
|
||||
++ gift
|
||||
$% :: form: configures the http server
|
||||
::
|
||||
:: TODO: We need to actually return a (map (unit @t) http-config)
|
||||
:: so we can apply configurations on a per-site basis
|
||||
::
|
||||
:: TODO: %form is a terrible name, but it's what vere currently
|
||||
:: accepts. Rename it.
|
||||
::
|
||||
[%form =http-config]
|
||||
:: http-response: response from urbit to earth
|
||||
::
|
||||
[%http-response =raw-http-response]
|
||||
:: response to a %connect or %serve
|
||||
::
|
||||
:: :accepted is whether :binding was valid. Duplicate bindings are
|
||||
:: not allowed.
|
||||
::
|
||||
[%bound accepted=? =binding]
|
||||
==
|
||||
::
|
||||
++ task
|
||||
$% :: initializes ourselves with an identity
|
||||
::
|
||||
:: TODO: Remove this once we single home.
|
||||
::
|
||||
[%init our=@p]
|
||||
:: new unix process (?)
|
||||
::
|
||||
[%born p=(list host)]
|
||||
:: set http ports (?)
|
||||
::
|
||||
[%live p=@ud q=(unit @ud)]
|
||||
:: starts handling an inbound http request
|
||||
::
|
||||
[%inbound-request secure=? =address =http-request]
|
||||
:: connects a binding to an app
|
||||
::
|
||||
[%connect =binding app=term]
|
||||
:: connects a binding to a generator
|
||||
::
|
||||
[%serve =binding generator=[=desk path=(list @t)] arguments=*]
|
||||
:: disconnects a binding
|
||||
::
|
||||
:: This must be called with the same duct that made the binding in
|
||||
:: the first place.
|
||||
::
|
||||
[%disconnect =binding]
|
||||
==
|
||||
--
|
||||
::
|
||||
+| %bindings
|
||||
:: +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)
|
||||
==
|
||||
:: %config: http configuration
|
||||
::
|
||||
+| %config
|
||||
:: +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
|
||||
:: +header-list: an ordered list of http headers
|
||||
::
|
||||
+$ header-list
|
||||
(list [key=@t value=@t])
|
||||
:: +http-method: exhaustive list of http verbs
|
||||
::
|
||||
+$ http-method
|
||||
$? _'CONNECT'
|
||||
_'DELETE'
|
||||
_'GET'
|
||||
_'HEAD'
|
||||
_'OPTIONS'
|
||||
_'POST'
|
||||
_'PUT'
|
||||
_'TRACE'
|
||||
==
|
||||
:: +http-request: a single http-request
|
||||
::
|
||||
+$ http-request
|
||||
$: :: http-method:
|
||||
::
|
||||
method=http-method
|
||||
:: url: the url requested
|
||||
::
|
||||
:: The url is not escaped. There is no escape.
|
||||
::
|
||||
url=@t
|
||||
:: header-list: headers to pass with this request
|
||||
::
|
||||
=header-list
|
||||
:: body: optionally, data to send with this request
|
||||
::
|
||||
body=(unit octs)
|
||||
==
|
||||
:: +raw-http-response: http-response to sent to earth
|
||||
::
|
||||
:: Urbit treats Earth's HTTP servers as pipes, where Urbit sends one or
|
||||
:: more %http-response replies on the wire. The first of these will
|
||||
:: always be a %start or an %error, and the last will always be %error
|
||||
:: or will have :complete set to %.y to finish the connection.
|
||||
::
|
||||
:: Calculation of control headers such as 'Content-Length' or
|
||||
:: 'Transfer-Encoding' should be performed at a higher level; this structure
|
||||
:: is merely for what gets sent to Earth.
|
||||
::
|
||||
+$ raw-http-response
|
||||
$% :: %start: the first packet in a response
|
||||
::
|
||||
$: %start
|
||||
:: status: http status code
|
||||
::
|
||||
status-code=@ud
|
||||
:: headers: http headers
|
||||
::
|
||||
headers=header-list
|
||||
:: data: data to pass to the pipe
|
||||
::
|
||||
data=(unit octs)
|
||||
:: whether this completes the request
|
||||
::
|
||||
complete=?
|
||||
==
|
||||
:: %continue: every subsequent packet
|
||||
::
|
||||
$: %continue
|
||||
:: data: data to pass to the pipe
|
||||
::
|
||||
data=(unit octs)
|
||||
:: complete: whether this completes the request
|
||||
::
|
||||
complete=?
|
||||
==
|
||||
:: %cancel: whether the connection should terminate unsuccessfully
|
||||
::
|
||||
[%cancel ~]
|
||||
==
|
||||
:: +address: client IP address
|
||||
::
|
||||
+$ address
|
||||
$% [%ipv4 @if]
|
||||
[%ipv6 @is]
|
||||
:: [%ames @p]
|
||||
==
|
||||
--
|
||||
:: ::::
|
||||
:::: ++xmas :: (1i) new network
|
||||
:: ::::
|
||||
|
Loading…
Reference in New Issue
Block a user