forward-ports http-config management to %rver

This commit is contained in:
Joe Bryan 2019-03-20 22:28:32 -07:00
parent 84bc3ad4a3
commit 592b51e590
3 changed files with 50 additions and 11 deletions

View File

@ -1319,7 +1319,6 @@
$ogre `%c $ogre `%c
$perm `%c $perm `%c
$rest `%b $rest `%b
$rule `%e
$serv `%e $serv `%e
$snap `%j $snap `%j
$them `%e $them `%e
@ -1332,6 +1331,7 @@
$request `%l $request `%l
$serve `%r $serve `%r
$connect `%r $connect `%r
$rule `%r
== ==
-- --
-- --

View File

@ -110,6 +110,15 @@
:: channel-state: state managed by the +channel core :: channel-state: state managed by the +channel core
:: ::
=channel-state =channel-state
:: domains: domain-names that resolve to us
::
domains=(set turf)
:: http-config: our server configuration
::
=http-config
:: ports: live servers
::
ports=[insecure=@ud secure=(unit @ud)]
== ==
:: +outstanding-connection: open http connections not fully complete: :: +outstanding-connection: open http connections not fully complete:
:: ::
@ -1705,7 +1714,7 @@
;: weld ;: weld
:: hand back default configuration for now :: hand back default configuration for now
:: ::
[duct %give %set-config *http-config]~ [duct %give %set-config http-config.server-state.ax]~
:: ::
closed-connections closed-connections
== ==
@ -1713,15 +1722,42 @@
:: ::
=/ event-args [[our eny duct now scry-gate] server-state.ax] =/ event-args [[our eny duct now scry-gate] server-state.ax]
=/ server (per-server-event event-args) =/ server (per-server-event event-args)
?- -.task
:: ::
:: %live: notifies us of our running server config ?- -.task
:: :: %live: notifies us of the ports of our live http servers
:: [insecure-port=@ud secure-port=(unit @ud)]
:: ::
%live %live
~& [%todo-live task] =. ports.server-state.ax +.task
[~ http-server-gate] [~ http-server-gate]
:: %rule: updates our http configuration
::
%rule
?- -.http-rule.task
:: %cert: install tls certificate
::
%cert
=* config http-config.server-state.ax
?: =(secure.config cert.http-rule.task)
[~ http-server-gate]
=. secure.config cert.http-rule.task
:_ http-server-gate
[duct %give %set-config config]~
:: %turf: add or remove domain name
::
%turf
=* domains domains.server-state.ax
=/ mod/(set turf)
?: ?=(%put action.http-rule.task)
(~(put in domains) turf.http-rule.task)
(~(del in domains) turf.http-rule.task)
?: =(domains mod)
[~ http-server-gate]
=. domains mod
:_ http-server-gate
=/ cmd
[%acme %poke `cage`[%acme-order !>(mod)]]
[duct %pass /acme/order %g %deal [our our] cmd]~
==
:: ::
%request %request
=^ moves server-state.ax (request:server +.task) =^ moves server-state.ax (request:server +.task)

View File

@ -928,10 +928,10 @@
+= http-rule += http-rule
$% :: %cert: set or clear certificate and keypair $% :: %cert: set or clear certificate and keypair
:: ::
[%cert p=(unit [key=wain cert=wain])] [%cert cert=(unit [key=wain cert=wain])]
:: %turf: add or remove established dns binding :: %turf: add or remove established dns binding
:: ::
[%turf p=?(%put %del) q=turf] [%turf action=?(%put %del) =turf]
== ==
++ httq :: raw http request ++ httq :: raw http request
$: p/meth :: method $: p/meth :: method
@ -2240,9 +2240,12 @@
:: report upgrade :: report upgrade
:: ::
[%vega ~] [%vega ~]
:: set http ports (?) :: notifies us of the ports of our live http servers
:: ::
[%live p=@ud q=(unit @ud)] [%live insecure=@ud secure=(unit @ud)]
:: update http configuration
::
[%rule =http-rule:eyre]
:: starts handling an inbound http request :: starts handling an inbound http request
:: ::
[%request secure=? =address =request:http] [%request secure=? =address =request:http]