No description
  • Haskell 98.7%
  • sed 0.7%
  • Makefile 0.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-12-25 00:00:00 +00:00
tools use lists for links in gmi2html.sed 2021-10-13 00:00:00 +00:00
tutorial add asciicast tutorial 2020-09-06 00:00:00 +00:00
ActiveIdentities.hs don't time-limit identities when noConfirm is enabled 2021-06-21 00:00:00 +00:00
Alias.hs fix incomplete patterns warnings 2023-05-28 00:00:06 +00:00
ANSIColour.hs fix stripping of control characters 2025-12-25 00:00:00 +00:00
BoundedBSChan.hs handle ^C during streaming by truncating the stream 2021-06-13 00:00:00 +00:00
BStack.hs rewrite log file only once it grows longer than 1.1*log_length 2023-07-05 00:00:09 +00:00
CHANGELOG.gmi bump 0.1.16 2024-11-09 00:00:03 +00:00
CHANGELOG.md bump 0.1.16 2024-11-09 00:00:03 +00:00
ClientCert.hs fix empty DN on anonymous client certs 2024-11-03 00:00:00 +00:00
ClientOptions.hs split more 2023-06-24 00:00:00 +00:00
ClientSessionManager.hs include port in resumption session key 2025-03-23 00:00:00 +00:00
ClientState.hs Revert "don't rewrite log at end if nothing appended" 2023-07-03 00:00:55 +00:00
Command.hs browse: shell-escape %s; add %S for unescaped 2024-09-17 00:00:00 +00:00
CommandLine.hs run $EDITOR on input/query ending with backslash 2023-06-24 00:00:00 +00:00
configure add Makefile 2020-09-03 00:00:00 +00:00
COPYING GPL 2020-05-27 00:00:04 +00:00
diohsc.1.md disable prompt by default in batch mode 2022-04-02 00:00:00 +00:00
diohsc.cabal bump upper bounds 2025-03-02 00:00:00 +00:00
diohsc.hs fix incompatibility with mtl-2.3 2023-08-09 00:00:00 +00:00
diohscrc.sample browse: shell-escape %s; add %S for unescaped 2024-09-17 00:00:00 +00:00
Fingerprint.hs reformat source with stylish-haskell 2020-12-12 00:00:00 +00:00
GeminiProtocol.hs include port in resumption session key 2025-03-23 00:00:00 +00:00
History.hs export resolveTarget to own module 2023-06-24 00:00:00 +00:00
Identity.hs interpret backslash-escapes when setting client cert CN 2025-09-19 00:00:00 +00:00
index.gmi.in tweak index.gmi formatting 2021-08-07 00:00:00 +00:00
LineClient.hs refactor: use more guards 2024-11-10 00:00:00 +00:00
Makefile bump 0.1.16 2024-11-09 00:00:03 +00:00
Marks.hs load marks lazily 2023-07-03 00:00:00 +00:00
MetaString.hs reformat source with stylish-haskell 2020-12-12 00:00:00 +00:00
Mundanities.hs remove Safe from Mundanities, since removed from directory-1.3.8 2023-08-09 00:00:00 +00:00
Opts.hs add --prompt option; clarify how it differs from --interactive 2021-05-14 00:00:00 +00:00
Pager.hs add note about ^C from pager 2023-08-11 00:00:00 +00:00
PrintFancy.hs Print -> PrintFancy 2023-06-24 00:00:03 +00:00
Prompt.hs quit on EOF 2021-03-24 00:00:00 +00:00
Queue.hs refactor enqueue 2023-06-25 00:00:00 +00:00
README.gmi update docs 2021-08-08 00:00:03 +00:00
README.md update docs 2021-08-08 00:00:03 +00:00
Request.hs compile with -Wall 2021-09-27 00:00:02 +00:00
ResolveTarget.hs Revert "don't rewrite log at end if nothing appended" 2023-07-03 00:00:55 +00:00
RunExternal.hs browse: shell-escape %s; add %S for unescaped 2024-09-17 00:00:00 +00:00
ServiceCerts.hs show count of how often a cert has been temporarily trusted 2022-10-02 00:00:00 +00:00
Setup.hs add Setup.hs 2022-05-15 00:00:00 +00:00
Slurp.hs write slurp info to stderr not stdout 2023-06-23 00:02:30 +00:00
Target.hs export resolveTarget to own module 2023-06-24 00:00:00 +00:00
TextGemini.hs refactor: use more guards 2024-11-10 00:00:00 +00:00
THANKS add THANKS 2020-08-09 00:00:01 +00:00
URI.hs interpret backslash-escapes when setting client cert CN 2025-09-19 00:00:00 +00:00
Util.hs reformat source with stylish-haskell 2020-12-12 00:00:00 +00:00
Version.hs bump 0.1.16 2024-11-09 00:00:03 +00:00
WCWidth.hs mark WCWidth and BStack as safe 2021-10-01 00:00:00 +00:00

Diohsc: Denotationally Intricate Obedient Haskell Smallnet Client

diohsc [URI]

Features

  • Simple line-based command-response terminal user interface with ANSI colour.
  • Terse but combinatorially expressive command language.
  • Navigational aids: history, marks, queue.
  • Facilities to invoke external commands and use per-scheme proxies.
  • Responses streamed to pager or external command.
  • Certificate checking with TOFU and/or explicitly trusted CAs.
  • Support for TLS resuming, 0RTT, and client certificates.
  • All configuration and certificates stored as user-manipulable files.
  • Extensive help.

Building

Install the haskell package manager cabal; e.g. on a debian system:

$ sudo apt-get install cabal-install

Then in the diohsc directory, run

$ cabal update && cabal install

The resulting binary will be installed as ~/.cabal/bin/diohsc.

Compile-time options

  • cabal install -f magic: use libmagic to detect mimetypes of local files
  • cabal install -f irilinks: allow IRIs in gemtext links

Trusting server certificates

Diohsc uses "Trust On First Use": if a host provides a certificate chain you do not currently trust, the client will ask for confirmation then add the certificate for the host to a collection stored in ~/.diohsc/known_hosts/ if there isn't already one stored; if there is one already stored, it will give some details and ask if you want to overwrite it with the newly provided one.

You can also trust Certificate Authorities by putting their certificates in ~/.diohsc/trusted_certs/. For example, if you want to trust all the certificates installed on your system,

$ ln -s /etc/ssl/certs/* ~/.diohsc/trusted_certs/

or if you just want to trust Let's Encrypt:

$ mkdir ~/.diohsc/trusted_certs
$ wget -O ~/.diohsc/trusted_certs/lets-encrypt-x3-cross-signed.pem https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem
$ sha256sum ~/.diohsc/trusted_certs/lets-encrypt-x3-cross-signed.pem
e446c5e9dbef9d09ac9f7027c034602492437a05ff6c40011d7235fca639c79a /home/me/.diohsc/trusted_certs/lets-encrypt-x3-cross-signed.pem

Configuration

See diohscrc.sample for ideas for configuration options, in particular indicating how to make use of third-party software to allow diohsc to access gopher and the web, parse markdown and html, and provide ascii-art previews of image files. Copy the file to ~/.diohsc/diohscrc and uncomment lines as appropriate.

Multiple instances

Multiple simultaneous diohsc instances may share ~/.diohsc without serious conflict. However, command history is written only on exit, so the last instance to exit will determine that history. The log is appended to continuously, but read only on startup, so logs from simultaneous instances will be interleaved. Uris in ~/.diohsc/queue are taken by an instance on startup and whenever it processes a command, and leftover queue items are written there on exit.

To ensure that an instance won't interfere with other running instances: either use "--datadir" to specify an alternative directory to ~/.diohsc, or use the "--ghost" option (which also acts as a "private browsing" mode).

Running under Windows

It is apparently possible to compile and run diohsc on Windows. However, it requires a terminal with ANSI and unicode support, which it seems is not the default situation in even the most recent versions of Windows. On Windows 10, following the instructions of this link has been reported to work: https://akr.am/blog/posts/using-utf-8-in-the-windows-terminal