Commit Graph

386 Commits

Author SHA1 Message Date
fang
2497283ff2
king: more code style weaks, remove stale todo's 2020-10-31 21:00:00 +01:00
pilfer-pandex
82606e03e3
Merge pull request #3852 from urbit/pp/fix-kh-again
king: fix a warning
2020-10-30 17:31:15 -07:00
Elliot Glaysher
15d2c18368
Merge pull request #3809 from urbit/kh-specify-eth-node
king: port the '-e' option to specify ethereum node endpoint.
2020-10-30 20:06:00 -04:00
pilfer-pandex
a211390e77 king: and fix a warning in Packet.hs 2020-10-30 16:35:52 -07:00
pilfer-pandex
06f3dc2d3e king: fix MonadFail issue in Packet.hs caused by merge 2020-10-30 16:29:57 -07:00
fang
c0f1fe8433
king: improve code style in KingSubsite 2020-10-30 23:42:33 +01:00
fang
77fc886570
Merge branch 'release/next-vere' into pppf/eyre-slog 2020-10-30 23:30:00 +01:00
pilfer-pandex
bd0672cb8e king: 1 TiB mapsize for event log 2020-10-30 14:54:33 -07:00
pilfer-pandex
6f0bb5990c
Merge pull request #3595 from urbit/pp/stateless
Implement stateless forwarding in the king
2020-10-30 14:48:38 -07:00
Joe Bryan
bafa1ef7f5
Merge pull request #3806 from urbit/release/next-ci
build: migrate to hercules ci, haskell.nix, and upgrade to ghc 8.8.4
2020-10-30 14:33:26 -07:00
fang
3f9cd4a794
king: get rid of unnecessary helper 2020-10-29 23:22:48 +01:00
Brendan Hay
6599a85b99
king: ensure tests are enabled on ci and don't depend on lfs pills 2020-10-29 16:20:41 +01:00
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
Elliot Glaysher
d1c5f97bd7 king: cancel http servers immediately on shutdown. 2020-10-28 14:24:52 -04:00
fang
418b9fda7e
king: add helper for escaping Text into @ta format
Behavior should match (scot %t the-text).
2020-10-28 19:13:23 +01:00
Elliot Glaysher
b3c145ee35 king: port the '-e' option to specify ethereum node endpoint. 2020-10-27 14:01:59 -04:00
Brendan Hay
de17409fd6
king: various warning and -Werror related fixes
This also removes -Werror from racqure due to the sheer number
build failures arising from compiler warnings.
2020-10-27 14:28:08 +01:00
Brendan Hay
74db584ad7
king: simplify parser types to avoid invalid existential newtype 2020-10-27 14:28:08 +01:00
Brendan Hay
2b74a8edd6
king: disable overlapping patterns for deriveNoun/Void usage 2020-10-27 14:28:08 +01:00
Brendan Hay
d752256126
king: replace use of deprecated network/socket address lookup 2020-10-27 14:28:08 +01:00
Brendan Hay
8a830934b1
build: reorganising top-level .gitignore and add nix ignores 2020-10-27 14:28:07 +01:00
Brendan Hay
345bf2c39a
king: remove broken/unused regex-tdfa-text dependency
Text instances are now contained in the parent regex-tdfa package.
2020-10-27 13:56:17 +01:00
Brendan Hay
eeff3034cd
king: update stackage resolver to lts-16.15
This allows us to drop flat/urbit-hob as they're now in the package set,
web3/vinyl need to be added to account for urbit-azimuth's dependencies.
2020-10-27 13:56:04 +01:00
Brendan Hay
ce3cbf0857
build: rework all nix expressions to support hercules-ci builds
This also removes nixcrpkgs and OSX cross compilation in favour of
compiling on the target. x86_64/musl targets are still supported
on Linux.

All sources are now managed via niv (see nix/sources.json) and Haskell
package sets are provided/organised via IOHK's haskell.nix.

Some effort has been made to expose similar top-level attributes for
development, but in some cases there have been changes. Please see
the comments in the top-level default.nix and ci.nix files for usage.
2020-10-27 13:55:49 +01:00
fang
2e7b2ceedb
Merge branch 'pp/stateless' into pppf/eyre-slog 2020-10-26 16:34:41 +01:00
Elliot Glaysher
759ac51f27 king: Don't hard error on injected event failure. 2020-10-26 10:57:07 -04: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
Elliot Glaysher
5cdeecc627 king: undo undo 2020-10-22 13:06:57 -04:00
Elliot Glaysher
61af5b104e king: patch cleanup 2020-10-22 10:53:28 -04:00
Elliot Glaysher
04ab7b5eb6 king: implement -I and --inject-event-list
This makes it so during `run`, you can inject a series of Events
into your Urbit. The `-I` injection was implemented in Vere, and
has been ported to KH, with the extended `--inject-event-list`
flag which handles a jammed list of events.

Also included is a sample generator which builds a list of events.
2020-10-21 14:39:35 -04:00
pilfer-pandex
c8159b7fe8 king: multi-request support lol 2020-10-20 16:42:20 -07:00
Elliot Glaysher
c6de028fc2
Merge pull request #3728 from urbit/kh-fix-newline
Revert "king: fix zig-zag in stderr logging"
2020-10-16 10:30:49 -04: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
Elliot Glaysher
aa8634ecdd Revert "king: fix zig-zag in stderr logging"
This reverts commit e9ed97f8a8.
2020-10-15 13:58:41 -04:00
Elliot Glaysher
9e2039ee2f arvo: Simplify the actual +code implemetation in jael. 2020-10-15 13:20:06 -04:00
Elliot Glaysher
16b3edfbd0 king: derive +code from Ring and print login +code on startup
We need to be able to programatically get the +code outside of
Urbit, so add an implementation of the derivation in king haskell.
2020-10-15 13:17:43 -04:00
pilfer-pandex
b35f879502 king: implement ~_~/slog without cookies; problems with MultiEyre 2020-10-14 17:05:56 -07:00
pilfer-pandex
e9ed97f8a8 king: fix zig-zag in stderr logging 2020-10-13 12:01:04 -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
Elliot Glaysher
bf2aa9d2e6 king: remove dead code in noun conversion. 2020-09-23 11:27:53 -04: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
5f0fa9b2a0
Merge pull request #3354 from urbit/king-reestablish-natpmp
natpmp: when reopening laptop, reestablish a connection to the router.
2020-08-21 10:01:33 -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
pilfer-pandex
c164f12922
Merge pull request #3339 from urbit/jt/rehob
urbit-king: update urbit-hob to v0.3.3
2020-08-20 08:35:12 -07: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
5c7f846d71 natpmp: change the library's timeout system to not wait 4 minutes. 2020-08-19 12:05:13 -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
Jared Tobin
5662a085d5
urbit-king: update urbit-hob to v0.3.3
v0.3.2 fixed an important bug that should be pulled in here.
2020-08-18 13:48:05 -02:30
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
b25c0b3443 natpmp: oops. missed a sav_errno 2020-08-17 13:08:22 -04: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
Elliot Glaysher
1183ac0b22 natpmp: checkpoint while addressing comments 2020-08-13 11:12:26 -04:00
Elliot Glaysher
ac4b5a99e5 natpmp: Rename RunningEnv to HostEnv. 2020-08-13 10:19:35 -04:00
Elliot Glaysher
3e6fd0f8e8 natpmp: ~pilfer style nits 2020-08-13 10:08:02 -04:00
pilfer-pandex
36ee3da818
Merge pull request #3267 from urbit/pp/print-http-ports
king: eyre: add missing printouts with ports
2020-08-11 22:11:35 -07:00
pilfer-pandex
8e04cd12f0
Merge pull request #3230 from urbit/pp/ames-slow-startup
king: ames: add stderr when sending before having turfs
2020-08-10 17:47:43 -07:00
Elliot Glaysher
d4d99835b2 natpmp: aesthetic cleanups 2020-08-10 14:55:08 -04:00
Elliot Glaysher
2e66ae10ec natpmp: use MonadIO in the bindings to remove unsightly "io $" 2020-08-10 13:15:03 -04:00
Elliot Glaysher
4d8c6ad09a nat-pmp: improve error and diagnostic messages 2020-08-10 13:02:13 -04:00
pilfer-pandex
556d92107a king: eyre: add missing printouts with ports 2020-08-09 22:12:44 -07:00
Elliot Glaysher
b7bfa170a9
Merge pull request #3262 from urbit/king-fix-eth
king: fix dawn to use the wrapped ethereum server.
2020-08-07 14:31:07 -04:00
Elliot Glaysher
4c4712f4e8 king: fix dawn to use the wrapped ethereum server. 2020-08-07 13:18:16 -04:00
Elliot Glaysher
149565cd97 king: get tests passing after nat-pmp changes 2020-08-07 13:04:57 -04:00
Elliot Glaysher
6368aa2b02 king: Turn NAT-PMP on by default, with a flag to disable.
Also: error checking.
2020-08-07 12:42:00 -04:00
Elliot Glaysher
96723b3de0 nat-pmp: Add readme talking about providence. 2020-08-07 12:41:49 -04:00
Elliot Glaysher
a3e33644a9 king: port forward ames traffic behind a NAT.
Tested with a comet trying to receive traffic from a planet in the
cloud. (h/t ~master-morzod)
2020-08-06 16:26:22 -04:00
pilfer-pandex
1691c984dd king: ames: add stderr when sending before having turfs 2020-08-06 12:11:36 -07:00
pilfer-pandex
66fc6b668e
Merge pull request #3184 from urbit/pp/finding-that-darn-serf
king: use c vere's heuristics for finding the serf binary
2020-08-06 11:37:14 -07:00
Elliot Glaysher
86b445b7cb king: First attempt at integration with NATPMP.
This sets up a separate thread to handle scheduling of lease
renewals.
2020-08-05 15:33:37 -04:00
Elliot Glaysher
d39d7246d1 king: move MultiEyreApi to a new RunningEnv.
There was a TODO in runShips about how the different layers of the
RIO environment had to be changed, so that there was a layer between
KingEnv and PierEnv for things shared between individual Piers, but
which weren't used outside of any PierEnv. This addresses those
TODOs by creating RunningEnv, which for now just owns MultiEyreApi
and makes it so we don't have to pass the entire thing around
explicitly.

The IP handling stuff will go in RunningEnv in a following patch.
2020-08-04 16:56:32 -04:00
Elliot Glaysher
225d2a288b king: Add CLI options for NAT traversal.
(Not yet hooked up to anything.)
2020-08-04 16:08:35 -04:00
Elliot Glaysher
11c86df3ce natpmp: Make haskell bindings to libnatpmp and add them to the build. 2020-08-04 13:24:55 -04:00
pilfer-pandex
1e995e8f11 king: wtf use getExecutablePath 2020-07-24 21:05:23 -07:00
pilfer-pandex
fc92fd3611 king: use c vere's heuristics for finding the serf binary 2020-07-24 16:31:43 -07:00
Joe Bryan
c96705e755 vere: bumps urbit version to v0.10.8 2020-07-23 18:15:35 -07:00
Joe Bryan
1953e4e2b3
Merge pull request #3099 from urbit/philip/compact
Memory compaction
2020-07-23 14:53:52 -07:00
pilfer-pandex
942e60670e king: fix ames tests 2020-07-23 13:17:02 -07:00
pilfer-pandex
7eddb89b70 king: it was too clever of me to use stateTVar; compiler can't help 2020-07-22 22:52:46 -07:00
pilfer-pandex
8e14fb8086 king: fix comment about ames q behavior 2020-07-22 22:50:22 -07:00
pilfer-pandex
4c9cbb5d19 king: ames bounded q, now with logging and fifo 2020-07-22 22:48:35 -07:00
pilfer-pandex
3349ea511f king: fix goshdarn typo 2020-07-21 21:22:08 -07:00
pilfer-pandex
565be3cad6 king: drop ames packets when >1k are unprocessed 2020-07-21 21:15:06 -07:00
Joe Bryan
a580f96416 serf: adds subcommands to urbit-worker 2020-07-21 17:15:11 -07:00
Joe Bryan
2994e0e44e vere: wires |pack to new compaction; renames old |pack to |cram 2020-07-21 14:10:15 -07:00
Joe Bryan
a53f688d01 vere/serf/king: support timeouts and error response in %peek 2020-06-27 00:12:53 -07:00
Joe Bryan
6fa194d527 Merge branch 'master' into jb/ipc-redux
* master: (147 commits)
  vere: bump version to 0.10.7
  libsigsegv: disable stack vma check
  vere: bump version to 0.10.6
  ci: add travis as trusted user
  jets: use appropriate macro
  noun: add -C to control memo cache size
  jets: restore fond/play/peek hooks
  jam: add commented-out functionality to count size of atom
  jets: cap memo cache and remove peek, play, and fond jets
  noun: add functions to count size of noun
  release: urbit-os-v1.0.23
  interface/config: fix production build
  soto: run +on-load migration once
  publish, links: restore full height
  sh/build-interface: amend for SPA
  interface/CONTRIBUTING: amend for SPA / webpack
  solid: update pill
  hood + apps: fix OTA process for feat/SPA
  hood: add version %6 for %file-server upgrade
  chat: equally size both code + s3 buttons
  ...
2020-06-26 13:33:00 -07:00
Joe Bryan
db9472dbe2 vere/king: tweaks serf startup args (unconditionally send all) 2020-06-26 12:29:18 -07:00
Joe Bryan
6e9f8ec34b king: fixes --serf worker-path cli parser 2020-06-26 00:54:29 -07:00
Joe Bryan
81ff98c5d4 vere/king/serf: adds and enables event timeouts 2020-06-26 00:54:29 -07:00
~siprel
c523c90bf9 urbit-termsize: Change test executable name. 2020-06-12 18:33:10 +00:00
~siprel
57ef4254e4 Merge branch 'khrc' of https://github.com/urbit/urbit into siprel/sigwinch 2020-06-12 18:27:25 +00:00
~siprel
e8e46ee8c4 Merge branch 'master' of https://github.com/urbit/urbit into siprel/sigwinch 2020-06-12 18:19:51 +00:00
~siprel
2f02a6d0e6 king: Command line flag to enable verbose logging. 2020-06-11 02:07:10 +00:00
~siprel
eb81f5ca14 Less verbose log output. 2020-06-11 02:02:53 +00:00
~siprel
849d25044a king: disable "bullshit scry tester" 2020-06-11 00:32:15 +00:00
~siprel
2b3fb7a568 king: fix behn tests. 2020-06-11 00:31:59 +00:00
~siprel
ba5bd09724 CLI option for serf exe + serf exe/flags live in PierConfig. 2020-06-10 23:56:48 +00:00
~siprel
f0f82d7e14 king: Handle %vega/%exit, %wack on boot, and stop logging secrets. 2020-06-10 22:00:37 +00:00
~siprel
dabe38be0d In non-daemon mode, initial serf slogs are user-visiable. 2020-06-10 21:17:55 +00:00
~siprel
c721baee7f king: serf stderr goes to terminals. 2020-06-10 21:03:46 +00:00
~siprel
cefc25cbe1 king: ^C from connected terminals kills current event. 2020-06-10 20:53:55 +00:00
~siprel
7f780bbcd5 king: TODO.md updates. 2020-06-10 20:08:09 +00:00
~siprel
b552149610 king: handle tanks that are just a cord. 2020-06-10 20:04:09 +00:00
~siprel
e178ad353d king: Fix spinner bugs. 2020-06-10 19:25:51 +00:00
~siprel
c57c3023f9 king: Event prioritization and error handling for born events. 2020-06-10 19:22:45 +00:00
~siprel
cc772da03c king: Urbit.Vere.Pier cleanup. 2020-06-08 23:07:42 +00:00
~siprel
528e1d29ff king: Separate out urbit-eventlog-lmdb package. 2020-06-08 22:01:28 +00:00
~siprel
957f14ee40 king: Minor cleanup. 2020-06-08 21:22:04 +00:00
~siprel
1f4c823d92 king: Separate package for racquire + small cleanup. 2020-06-08 20:23:30 +00:00
~siprel
ff646f4830 king: Snapshot on shutdown; no snapshot on start if no events to replay. 2020-06-08 17:45:41 +00:00
~siprel
ba50eb94cd king: Spin off urbit-noun-core and urbit-noun packages. 2020-06-08 17:24:05 +00:00
~siprel
f3e484d5cd king: TODO notes about how to break into packages. 2020-06-08 01:29:29 +00:00
~siprel
a88849743c king: Module re-org in prepraration for new IO-Driver interface. 2020-06-08 01:19:43 +00:00