Commit Graph

191 Commits

Author SHA1 Message Date
fang
5615b5dc1a
king: factor scrying logic into helper lib
Takes care of constructing the full scry path based off the given
components. Fills in timestamp with the current time. Logs errors on
result conversion failures.
2020-10-28 19:59:48 +01:00
fang
af225f673a
king: scry to check authentication of webslog reqs
Instead of giving webslogs to anyone who asks, only acknowledge requests
with valid session cookies. Send 403s to all others.
2020-10-28 19:33:21 +01:00
fang
2e7b2ceedb
Merge branch 'pp/stateless' into pppf/eyre-slog 2020-10-26 16:34:41 +01:00
pilfer-pandex
e254c72788 king: address #3778 per joe 2020-10-23 00:10:33 -07:00
pilfer-pandex
66e3df0b06 king: address joe's comments 2020-10-22 16:13:26 -07:00
pilfer-pandex
c8159b7fe8 king: multi-request support lol 2020-10-20 16:42:20 -07:00
fang
7853c7df9b
king: improve king subsite implementation
Make KingSubsite part of ServConf, handle 404 case more gracefully, make
slog endpoint send SSE headers immediately.

Remaining work mostly revolves around the slog endpoint's slog queue. It
builds up even if nobody is listening, and only the first to pull from
the queue gets to handle/emit the slog event.
2020-10-16 14:13:07 +02:00
pilfer-pandex
359d6c881b king: scry reform 2020-10-15 21:22:48 -07:00
pilfer-pandex
b35f879502 king: implement ~_~/slog without cookies; problems with MultiEyre 2020-10-14 17:05:56 -07:00
pilfer-pandex
def318abd9 king: packet tests, scry tqueue 2020-10-12 21:57:01 -07:00
Elliot Glaysher
5eeb86a935 king: actually try shutting down the piers 2020-10-07 13:00:05 -04:00
Elliot Glaysher
ce92c405fe king: --serf="" is a host option, not a per ship option.
This means you don't need to specify this per ship in a multitenant
environment when you are alwyas going to set it to the same binary
if you're overriding it in the first place.
2020-10-07 13:00:00 -04:00
Elliot Glaysher
7e117f86b7 king: move internal IPC types to own file
This lets us put a StrictData annotation on these datas, without
touching the rest.
2020-10-05 14:28:17 -04:00
Elliot Glaysher
77a11a82be
Merge branch 'release/next-vere' into kh-strict 2020-10-05 13:26:46 -04:00
Elliot Glaysher
8d3e15c62b king: strictify all parsed nouns
At least some of the parsed plea structures were holding on to the raw
bytestrings through laziness.
2020-10-05 13:16:45 -04:00
Elliot Glaysher
0451953822 king: evaluate text which goes into the log 2020-10-05 13:15:57 -04:00
Elliot Glaysher
37a52136ab king: Use modifyTVar' instead of modifyTVar.
We mostly used modifyTVar', but there were a few lazy cases.
2020-10-05 13:12:22 -04:00
Elliot Glaysher
e7b69c9407 king: use Data.Map.Strict instead of Data.Map. 2020-10-05 13:12:22 -04:00
pilfer-pandex
45ad5da9e9 king: fix tests in a way that doesn't quite work 2020-10-04 16:04:47 -07:00
Elliot Glaysher
4698659bb2
Merge pull request #3575 from urbit/kh-printing-is-a-slog
King Haskell terminal fixes
2020-10-01 12:14:30 -04:00
Elliot Glaysher
4b2d2b5931 king: more review comments 2020-10-01 11:10:30 -04:00
Elliot Glaysher
dd18bf6f0f king: review comments 2020-09-28 10:56:51 -04:00
pilfer-pandex
52b917ee71 king: stateless forwarding 2020-09-26 16:10:25 -07:00
Elliot Glaysher
20a6c0331c king: set initial terminal size and react to resizes
This changes startup so we get the size of the current terminal
to send to Urbit on startup. We then subscribe to terminal size
change notifications and send those to your Urbit via the terminal
muxing system.

In the case where there are multiple terminal connections to your
Urbit, set the terminal size to the minimum of the widths.
2020-09-25 12:40:24 -04:00
Elliot Glaysher
e9f09e32c1 king: put slogs in the muxed scrollback
If you connect to an urbit using the remote terminal code,
slogs would not be printed to them since they were hard
coded to be printed to stderr. This threads slog printing
to the terminal driver, and puts them in scrollback.

(It does not actually fix slogs being printed on one line.)
2020-09-25 12:40:23 -04:00
Fang
6659c859f1
kh: abolish unicode syntax in favor of ascii 2020-09-25 01:43:03 +02:00
Fang
dd3112985e
kh: support rendering +stub as ansi escape codes
Adds support to term.hs for a %klr blit, containing a +stub describing
styled text.

Dill will start making use of this in a separate commit, for release
cutting reasons.
2020-09-15 16:50:25 +02:00
pilfer-pandex
ba79aa713a king: move most things from debug log level to info 2020-09-09 18:20:21 -07:00
Elliot Glaysher
0a3fe85c06
Merge pull request #3439 from urbit/kh-sending-chunk
king: change logging from tracing to info in Wai.hs
2020-09-08 10:32:23 -04:00
Elliot Glaysher
ecbcdf7d00 king: change logging from tracing to info in Wai.hs
I noticed that the king's text log file kept filling up, and it's
mostly 'sending chunk "\n"' from eyre. This changes the log level
of every partial send over an active eyre channel to info, instead
of always.
2020-09-05 21:49:23 -04:00
Elliot Glaysher
a42c90db9c king dawn: export functions used in tests 2020-09-04 17:02:11 -04:00
Elliot Glaysher
74b40e0e52 king dawn: nits 2020-09-04 14:44:26 -04:00
Elliot Glaysher
07089a1c93 king dawn: remove stray marks 2020-09-04 11:01:47 -04:00
Elliot Glaysher
4bd0882e7d king dawn: instead of crashing, return an error 2020-09-04 10:54:31 -04:00
Elliot Glaysher
4a7e1b2009 king dawn: replace web3 usage with hand rolled jsonrpc messages.
This replaces the autogenerated bindings to the Azimuth contracts
which use Network.Web3 with hand rolled json messages. Booting a
ship involved 256 individual galaxy point lookups using web3, while
Vere batched all of that into one JSONRPC message.

With this patch, we also batch everything at each phase into one
JSONRPC batch.
2020-09-03 16:05:08 -04:00
Elliot Glaysher
8255fc0e8c natpmp: formatting and cleanup old pmp handle 2020-08-20 20:23:25 -04:00
Elliot Glaysher
15f0df81f1 natpmp: when reopening laptop, reestablish a connection to the router. 2020-08-20 15:47:02 -04:00
Elliot Glaysher
88428961dd natpmp: also detect 172.16.0/0/12 ips as private. 2020-08-19 14:02:03 -04:00
Elliot Glaysher
1401d7bc5c natpmp: fix error handling and don't die on errors in getpubliaddress
This fixes a case where the natpmp async could pure () instead of
recursing, which would lock ames. This also adds some more error
handling on the haskell side of things and disables the raw fprintfs
in the c bindings layer.
2020-08-19 12:53:59 -04:00
Elliot Glaysher
60e2ae02a2 natpmp: cleanup by using a tristate 2020-08-18 15:43:31 -04:00
Elliot Glaysher
dca4344a45 natpmp: By default, only try to talk to the router on private ips.
Since startup hangs for seconds when you are not behind a router,
but still attempt to ask one to open ports for you, by default,
only try to contact the router if the local ip is 192.168.*.* or
10.*.*.*.

Also make port forwarding force on/off.
2020-08-18 12:22:45 -04:00
pilfer-pandex
750b986370 Merge branch 'release/next-vere' into pp/log-cli
Rename `koUseNatPmp` to `hUseNatPmp`; cleanup
2020-08-17 11:43:30 -07:00
pilfer-pandex
6a236a2749 king: use XDG cache directory for default log location 2020-08-17 11:27:30 -07:00
Elliot Glaysher
81e3a8f927 natpmp: cleanups for ~master-morzod 2020-08-17 10:58:48 -04:00
pilfer-pandex
2d1f3cdfa0 king: thread LogLevel through, make output better 2020-08-16 10:33:52 -07:00
pilfer-pandex
8ab60b9133 king: configure logging via cli flags 2020-08-14 19:40:48 -07:00
Elliot Glaysher
1b3a69e24d
Merge branch 'release/next-vere' into king-natpmp 2020-08-14 16:17:47 -04:00
Elliot Glaysher
14d1b59117 natpmp: even more cleanup 2020-08-14 10:23:39 -04:00
Elliot Glaysher
b4878a8b03 natpmp: Separate out the PortThreadMsgs from the heap actions. 2020-08-13 13:36:20 -04:00
Elliot Glaysher
a3336fde41 natpmp: more nits 2020-08-13 11:52:42 -04:00