Commit graph

111 commits

Author SHA1 Message Date
007e639b0c Don't require the TLS_ in the environment variable.
It's redundant.
2023-03-24 00:25:44 +00:00
e13442c122 Fix strange behavior in TlsLibreSSL.
tls_read() and tls_write() may return TLS_WANT_POLLIN or TLS_WANT_POLLOUT
if data isn't ready to be read or written yet. We have to account for this
by converting it to EAGAIN, which is how a typical read() or write()
function should behave.

Also installed a SIGPIPE handler; we do not want to be terminated by
SIGPIPE, and it's safe to ignore this signal because it should be
handled thoroughly in the code.
2023-03-23 16:39:15 +00:00
2441f07848 Add support for spinning up multiple HTTP servers.
This is useful for having a TLS and a non-TLS version port, like Synapse.
I verified that the multiple-servers does in fact work as intended,
although the TLS server part is broken; I must be doing something
incorrectly with LibreSSL in setting up the server.
2023-03-23 02:12:45 +00:00
fccd15b239 Don't unconditionally close standard input; it may have been used and
closed before. If it was never used, it was never opened.
2023-03-22 18:12:46 +00:00
b8d00bc8bf Make td run warn if Memory.txt gets created. 2023-03-22 14:57:57 +00:00
b58ca7d22e Start working on adding TLS support to HttpServer. 2023-03-22 01:46:24 +00:00
6561b5bae1 Add TLS build support to td. 2023-03-22 01:17:42 +00:00
d1b4ecff48 Apparently the order of LDFLAGS matters to some compilers.
Also don't to -pg in debug mode, because that's not supported on all
compilers either.
2023-03-22 00:13:27 +00:00
63d07365db Don't close standard output twice, that leads to a segfault! 2023-03-22 00:12:04 +00:00
5289c16e2b Convert all code to new Stream API.
Also made a number of improvmements to tt, making it compatible with more
shells.
2023-03-18 14:32:09 +00:00
65f4c90df3 Rename HttpStream() to HttpServerStream() to match HttpClientStream() 2023-03-16 02:17:48 +00:00
5dbaf3c223 Apply #65, remove printf() in Db, and make tt show login messages. 2023-03-15 13:36:49 +00:00
62cd1cdc98 Misc changes. 2023-03-12 03:37:57 +00:00
64add9c9ab Fix unused variable warning. 2023-03-10 20:12:25 +00:00
3037f12907 Add tt and http-debug-server tools. 2023-03-10 18:48:52 +00:00
2d9b706f38 Fix I/O in JsonConsumeWhitespace() and UtilStreamCopy().
These functions previously operated on the assumption that fgetc() would
block; however it will not block on HttpServer streams because those are
non-blocking. They now check error conditions properly before failing
prematurely.
2023-03-10 18:46:03 +00:00
fd12dee62e Make sure a newline is printed after JSON object is pretty-printed. 2023-03-10 04:30:56 +00:00
8ead9cc93a Apply #63, make some general bug fixes. 2023-03-10 03:24:04 +00:00
7344d4fa46 Apparently some shells interpret the - in a string as an argument delimiter??? 2023-03-09 02:49:14 +00:00
ca053a12b1 Break out main() into Main.c, fix some compile warnings on Cygwin. 2023-03-09 02:46:04 +00:00
9a1300ff2e Make sure input is initialized. 2023-03-09 02:22:13 +00:00
012c334ee5 Make send-patch use json instead of jq. 2023-03-09 00:06:15 +00:00
20ebeb9c32 Switch tp from using jq to json; format td 2023-03-08 22:47:40 +00:00
efdf168085 Allow encoding user-provided strings. 2023-03-08 20:31:49 +00:00
50e599f1cd Implement a mostly-functional query language for JSON. 2023-03-08 19:49:06 +00:00
7b22fb02a2 Implement pretty-printing option in Json.
Telodendria itself doesn't use it, but the json CLI tool does.
2023-03-08 17:15:43 +00:00
cb8c4fceb5 Begin working on JSON CLI tool.
This is a similar situation to the HTTP CLI tool: since we have the
Json API anyway, we might as well have a little command line tool to
replace jq.
2023-03-08 04:06:43 +00:00
19e89110cd Bump version number to v0.3.0 2023-03-08 03:46:38 +00:00
1a169d1a2e Fix usage message. 2023-03-08 03:31:34 +00:00
8d75d8a023 Add simple HTTP CLI tool that uses the HttpClient API.
You might be asking why I would just write a simple curl replacement
when curl does the job just fine. Well, the most immediate reason is
to test the HttpClient API, but since Telodendria's goal is to not
be dependent on any third-party code if at all possible, it makes
sense to have a simple HTTP client to use not only for testing
Telodendria, but also for configuring it. When we move the
configuration to the database, we'll ship a script that uses this
tool to allow admins to easily submit API requests.

Do not be concerned that HttpClient does not support TLS yet. TLS
support is necessary for federation to work, so it is coming
eventually.
2023-03-08 03:30:36 +00:00
fc8fbc9a70 I forgot to set the date in the changelog. 2023-03-07 00:51:16 +00:00
17734c90e8 This is unnecessary. 2023-03-06 23:54:55 +00:00
154e5b82df Looks like CVS is being weird with Mdocdate strings. 2023-03-06 23:51:55 +00:00
7750963c29 Something weird is going on here. 2023-03-06 23:49:30 +00:00
8c2ed1c8f1 Apply #59 2023-03-04 15:34:44 +00:00
55b3728e7e Bake the platform name into the version number.
This is helpful as we're porting to different operating systems. I guess
it just makes the porting effort more satisfying. Seeing this header
makes me happy:

Server: Telodendria/0.2.0-Haiku
2023-03-01 03:19:21 +00:00
2b77681763 Move getent check to common.sh 2023-03-01 03:11:10 +00:00
dd1b26bad8 Only use getent if the command can be found. 2023-03-01 03:09:46 +00:00
755d08946a Add some more obscure platforms to td build script. 2023-03-01 03:08:53 +00:00
2e1220621c Use -pipe, supposedly this speeds things up.
The codebase is getting kind of big, we'll need all the help we can get.
2023-03-01 01:26:34 +00:00
26b0f33f96 -not is not portable, grep -v should work good enough though. 2023-02-24 02:02:47 +00:00
d81e8f3a32 We're building up some tools; let's print them out in env.sh 2023-02-17 18:26:08 +00:00
b05e81776a Be smart about the type of man page we generate. 2023-02-16 17:22:32 +00:00
c78dc3bd31 Fix a memory bug in StrRandom() with RandIntN().
We're storing integers in this buffer, so we have to allocate enough
memory for them. An integer is usually more than one byte.
2023-02-16 13:10:09 +00:00
1f1cbc0461 Fix a bad jq parameter. 2023-02-16 02:01:25 +00:00
2ce43ce457 Add a script for conveniently creating new library man pages. 2023-02-16 00:55:10 +00:00
cebc2959cc Fix a few things that were bothering me. 2023-02-15 21:53:39 +00:00
50aa65617a Fix some bugs in the man page index generation. 2023-02-15 16:00:36 +00:00
de0ece10e2 Use generated tables instead of hand-crafted tables. 2023-02-15 03:30:52 +00:00
27c4713e5d I actually decided I don't like this. 2023-02-11 00:07:18 +00:00