Giter Site home page Giter Site logo

jackline's Introduction

Jackline - a minimalistic secure XMPP client

Screenshot

Binary packages

This is unreleased software... feedback welcome!

You can read more about jackline (January 2017).

Jackline uses several clean-slate libraries (OCaml-TLS, OCaml-OTR) and only has a minimal few features: no support for HTML markup, avatars, which music you're playing, timezone you're living in, ...

Supported features:

  • single XMPP account
  • OTR (built-in and enabled by default)
  • strict TLS certificate verification
  • plain text (no HTML!)
  • XEP-0184 (Message Delivery Receipts)
  • no import of OTR keys or configuration
  • no plaintext connections to XMPP server

I (so far successfully) try to preserve three core properties:

  • any data written on disk (using lots of silly parens) by jackline will stay being readable by every future jackline version
  • once the initial configuration file (and private key and maybe password) is created, it will never be written to by jackline
  • jackline will never transmit any data or open a network connection unless initiated by you (this means no "autoconnect on startup", or "user is typing" indication sent). There is an automated reconnect to the same server if the connection terminated.

NB: jackline and torsocks are friends: torify jackline works.

Security and trusted code base

The configuration file has to include the trust anchor for the server certificate (or the SHA256 fingerprint of the certificate) - otherwise there is no way how to ensure talking to the correct XMPP server. There won't be any 'ignore ssl warnings' option.

The trusted code base contains at the moment:

Transitive dependencies are only partially listed. For a complete list, use opam list --required-by=jackline --recursive.

Why should you trust this? Well, first of all whom do you trust? And why? Did you read through your kernel, libc and malloc implementation? What about OpenSSL? libotr? libpurple, loudmouth (or whatever XMPP implementation you use)? Programming language runtime?

OCaml is a game changer compared to C: automatic memory management; I try to stick to a purely functional (using immutable data and declarative) coding style (this code here is not there yet).

OPAM is the OCaml package manager, and not directly needed, but very convenient for installation and updating. It lacks package signing, but I've some work-in-progress.

Installing jackline

Be aware that this is unreleased software. Bug reports are welcome (pull requests as well).

Get OCaml (>= 4.08.0), get opam (>= 2.0.0), gmp is required as well. If you have an older OCaml compiler, run opam switch 4.08.1 and follow instructions.

Run the following commands:

A cryptographically signed package (using conex) is available, you have to follow the steps in the README.

Now you should have a ~/.opam/system/bin/jackline (or ~/.opam/4.08.1/bin/jackline), which should be in your PATH (if you executed eval `opam config env` ).

To update, simply run opam update followed by opam upgrade. This will get you the latest version (git master).

Compiling using a git checkout

If you clone this repository, and install the required dependencies (see above), you can compile jackline by running

  dune build

This will produce _build/default/bin/jackline.exe.

Configuration

Read the jackline --help output:

  -f configuration directory (defaults to ~/.config/ocaml-xmpp-client/)
  -d debug log (either filename or out.txt)
  -a ASCII only output
  --fd-gui File descriptor to receive GUI focus updates on.
  --fd-nfy File descriptor to send notification updates on.

When you start jackline for the first time (or with an empty configuration directory), it starts an interactive configuration dialog asking about account details. There is no need to provide optional information. Hostname and which common name should appear in the certificate is derived from the jabber id.

The configuration file is stored as config.sexp in your configuration directory. Next to it, there is a file containing your password (unless you decided to enter it on every start of jackline), otr_dsa.sexp containing your OTR key, a users directory with a file for each contact (OTR fingerprints, custom OTR policies, ...), and a histories directory if you enable logging for a specific contact (/log on).

Using jackline

Left is the contact list, in the middle the chat window, below the log buffer. F10 and F11 (and Shift + F10, Shift + F11) modify their sizes. The bottom line is read-line prompt with tab-completion.

In the contact list, mutual presence subscription information is indicated by [ and ] (F if contact is only subscribed to your presence updates, T if you are subscribed to the presence updates of the contact), ? for no presence subscription). The own contact uses curly braces { and }, and certain operations are not available. The presence is indicated by a single character (o = online, f = free, a = away, d = do not disturb, x = extended away, _ = offline).

A single contact is active, which can be modified by PgUp/PdDown. The active contact is shown in reversed foreground and background colour. Its chat content is displayed in the chat window. Certain commands and operations (such as sending a message) require an active contact.

XMPP allows a contact to be logged in several times. By default, the resource with the highest priority (and most online status) is used for communication. If a contact is logged in multiple times, a + occurs to its left side, and pressing return will expand the contact, displaying all its sessions. Communicating with the expanded base contact will deliver the message to the bare contact, if a specific resource is active, messages will be sent there. The chat log is filtered by messages to the specific resource, and merged in the base contact. An unexpanded contact equals to the resource with highest priority.

When a new message is received, this is indicated by blinking of the contact, a prepended * (or โ˜€ in case of collapsed contact), a yellow ## in the bottom left corner, execution of notification_callback, and a message to a file descriptor (if --fd-nfy is used).

The most basic callback would be a script that emits a BEL and a terminal that translates a bell to urgency (in your .Xdefaults, have the line Xterm*vt100.bellsUrgent: true);

bell.sh:

if [ $3 != "connect" ]; then
  printf '\a'
fi

A message is sent to the active contact by typing it followed by return.

In the chat window, each message is prefixed with 3 characters:

  • * - local
  • <-- - incoming unencrypted
  • <O- - incoming OTR encrypted
  • --> - outgoing unencrypted, delivered (XEP 184)
  • ?-> - outgoing unencrypted, waiting for receipt (XEP 184)
  • -O> - outgoing OTR encrypted, delivered (XEP 184)
  • ?O> - outgoing OTR encrypted, waiting for receipt (XEP 184)

Keybindings

  • PgUp, PgDown navigates through the contact list
  • Up, Down rotate through per-contact input history
  • Left, Right, Home, End navigate in input line
  • Ctrl-q jumps to next notification
  • Ctrl-x jumps to last active user
  • Ctrl-c cycle to next crypto user
  • F5 toggles display of offline contacts
  • F12 toggles between display of contact list, full screen chat, and raw (only received messages)
  • F11 and Shift-F11 (or Ctrl-F11) increases and decreases width of contact list (/buddywidth)
  • F10 and Shift-F10 (or Ctrl-F10) increases and decreases height of log window (/logheight)
  • Ctrl-PgUp (or Ctrl-p), Ctrl-PgDown (or Ctrl-n) scrolls chat window
  • <tab> tab completion (largest prefix, suggestions are displayed in grey while typingx)
  • Ctrl-a (jump to beginning of line), Ctrl-e (jump to end of line), Ctrl-k (kill text to the right of cursor), Ctrl-u (kill text to the left of cursor), Ctrl-left (jump word backwards), Ctrl-right (jump word forwards), Ctrl-f (forward one character), Ctrl-b (backward one character)
  • Ctrl-space (mark, indicated by underline), Ctrl-w (cut), Ctrl-y (yank)
  • Ctrl-_ undo

/help prints the available commands, /help command more detailed help of the given command.

Colours

Colours are mainly used to indicate security properties: enabled end-to-end encryption (of the active contact) let's the frame turn green, disabled end-to-end encryption makes the frame red. Green is also used to indicate verified public keys, red for unverified ones.

A contact in the contact list is green if there is an active end-to-end encrypted session, red if not and the contact is online, black if the contact is offline or a groupchat. Inverse highlights the active contact, and if the buddy name in the status bar is inverted, logging is turned on.

Default colours are:

  • Chat "empty"
  • GroupChat "empty"
  • Transit "gray 18"
  • Presence "gray 12"
  • Info "gray 18"
  • Warning "yellow"
  • Error "red"
  • Success "green"

To draw all presence messages in cyan instead of gray, create a colours.sexp in your config folder with the contents:

((Presence "cyan"))

Available colours (notty documentation):

  • empty,
  • black, red, green, yellow, blue, magenta, cyan, white,
  • lightblack, lightred, lightgreen, lightyellow, lightblue, lightmagenta, lightcyan, lightwhite,
  • gray n (where n >= 0 && n <= 23,
  • rgb r g b (where r >= 0 && r <= 5 && g >= 0 && g <= 5 && b >= 0 && b <= 5)

FAQ

  • How do I update the fingerprint of the server certificate (getting authentication failure messages)? -- Currently you have to edit config.sexp: find the (Fingerprint XXX) data, and replace XXX with the new fingerprint (openssl s_client -connect SERVER:5222 -starttls xmpp | openssl x509 -fingerprint -sha256 -noout might be useful (or tlsclient using tlsclient --starttls xmpp -z SERVER:5222).
  • How do I prevent jackline from doing DNS lookups? -- Interactive configuration or specify (hostname ("146.255.57.229")) in config.sexp.
  • The server certificate does not match the server name, how do I fix this? -- Interactive configuration or specify (cert_hostname ("blabla.com")) in config.sexp.
  • I hate the default colours. -- they're now customisable
  • Keys do not work on MacOSX -- This might be useful.
  • I want to receive notifications. -- A hook script can be defined during interactive configuration or (notification_callback (/my/favorite/script.sh)) in config.sexp. It is executed with three (or four) arguments: the local user's jabber id, a summary of the state of jackline, the event type that caused this execution, and perhaps other things; see cli/cli_state.ml search for module Notify for details.
  • I want a systray icon. -- there are several projects, posiputt/jackification, cfcs/misc, jackline-gtk
  • I want to have notifications on MacOSX. - Andrej wrote a script using terminal notifier; otherwise this guide might help.
  • Support? -- join us at [email protected]
  • The interface is inspired by mcabber
  • The installation failed on OpenBSD - try with a larger stack size: ulimit -s 8192 should be good
  • How do I increase the multi-user chat history? - insert (muc_max_stanzas (500)) in your config.sexp (where 500 is the amount of messages to request from the server)

jackline's People

Contributors

andreasdotorg avatar christianpanton avatar hannesm avatar infinity0 avatar m4lu avatar mk270 avatar mneilsen avatar reynir avatar sg2342 avatar sternenseemann avatar tealg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jackline's Issues

reset notification.state when terminal is activated/focussed

currently clear is only done when the user moves the cursor in the buddy list (activating contact). would be fancy if it is cleared when the active contact is the only one with awaiting notifications and the window/terminal gets activated. but couldn't find an API/callback registration for this.

socket handling

do reconnects and actually discover when tcp/and or tls/and or xmpp is down (currently getting hours later an ECONNRESET, not very useful)

SMP challenges/questions containing spaces

Jackline should provide a way for users to ask SMP questions containing spaces.

New users often intuitively seem to attempt to accomplish this by quoting the question using double quotes, so maybe we should parse quotation?

What would be your preferred way to do this? Please discuss below :-)

separate config files a bit

secrets shouldn't be part of config.sexp - rather have:

  • otr.key.sexp for private OTR
  • password for password on server (provide a way to not have it, but enter it interactively each time)
  • config.sexp with OTR policy, server, etc.

Strip stupid libpurple HTML tags

Consider automatically stripping '' from the beginning of messages and '' from the end of messages so we don't have to look at libpurple's HTML crap.
Perhaps this should be left in -- so users can tell people to stop using libpurple?

roster handling

well, how about not handling that at all -- enable people to not save anything on the server -- but store contacts only locally (well, we won't receive presence then - but who needs those anyway?)

Display presence error reason

For contacts with presence errors (e.g. other server unreachable), the error message provided by the server isn't displayed to the user.

Inconsistent status messages / silent error messages?

I relatively often run into situations like this:

10 03:13:37 ***OTR*** encrypted connection established (ssid [xxFFxxFF] FFffFFff)
10 03:13:37 ***OTR key*** unverified key (used 20 times). please verify /fingerprint [fp] over second channel
10 03:13:37 ***OTR Warning*** didn't sent message, there was no encrypted connection: hey

It seems a bit counter-intuitive, does anyone have an idea what might be going?

release plan

before 0.1 I'd like to finish the following tasks:

  • #2 otr more dynamic policy and per-user
  • #17 heartbeat
  • XEP-0184 (Message Delivery Receipts)
  • fix subtle OTR/DSA bug (which I can reproduce and only need some brain hours)
  • #7 proper escaping of xml entities (both directions)
  • multiple session for individual contact (touches #51 #20)
  • notifications #38 #55 #56
  • multi-user chat #20

Make clock in ui optional

I request an option (via config file maybe?) to make the clock in the ui invisible.

My scenario is that I use jackline in a tmux session and every minute, I get an indication that something happened in that window. Tmux could work as a simple notification feature, but the clock makes that impossible.

Ability to supply separate jabber domain and TCP connection details

It would be useful to be able to provide the TCP IP/port pair separate from the jabber domain, for use with proxies and multi-homed servers. Right now the hostname from the jabber id is used, which makes it a pain to connect through SSH-forwarded ports and the like.

display git rev inside the client

otherwise I'm always confused which rev my running clients were using... (also, clean or dirty).. requires some build system hackery unfortunately

persistency should be more eager

atm, only on /quit anything is written (apart from configuration) -- but if computer crashes or jackline gets killed, the information is lost, specifically:

  • verified otr fingerprints
  • modified otr policies
  • potential logs

this should be either written when a modification took place, or every X minutes/seconds. prefered the former (with some sort of lock, similar to the notification.state, to avoid races)

Toggl/hide buddy list

It would be nice to have a feature to toggly/hide the buddy list to enable copy-paste of code and ASCII art, like mcabber has.

OTR issue when requesting presence authorization

I type:

hello
/authorization request
test

Results in:

19:36:07 ?O> hello
19:36:09 *** has been asked to sent presence updates to you
19:36:10 ***OTR Warning*** didn't sent message, there was no encrypted connection: test
19:36:10 ***OTR warning*** OTR error Malformed OTR data message: type

This is repeatable, any clue what's going on here?

My contact is using Pidgin. :-(

active contact is now sometimes gone

this is some regression:

  • if contact a@b/1 is active (unexpanded), and a@b/2 gets online (with higher priority)
  • if contact a@b/1 and a@b/2 are online, /1 is active (unexpanded) and gets offline
  • if contact a@b/1 is active, goes offline, and a@b/2 comes online
  • if self contact comes online another time (again, priorities etc)
  • if ctrl-q pressed, which jumps to an unexpanded contact

might be more cases as well... expand before focus/unfocus (or again: focus bare jid into unexpanded contact -- but i believe this gets worse)

disposal of sessions and otr sessions

some clients (such as mcabber) append a random number/string to its resource on reconnect, but carry over the otr session... how to handle this?

also, when to dispose a session once the contact is unavailable? obviously we'd like to reuse the otr session ('coz we didn't send/received a finished message)

`/otrpolicy` non-intuitive

writing foo bar baz to account [email protected] starts an OTR session (if require_encryption is set). if I now do /otrpolicy -REQUIRE_ENCRYPTION no messages are sent (since the otr ctx has the old policy).

need to adjust all the ctx whenever I /otrpolicy for a change

session handling

at the moment, session is selected when highlighted (actually also in make_prompt) -- now if there are presence changes, it doesn't change until make_prompt is called again (or highlight changes).

sending messages out should go to the best session available (until UI exposes sessions)...

auto-(re)-connect

whenever a session fails / jackline gets started... make this configurable!

Fix issues with message history scrolling

  • It shouldn't be possible to scroll beyond the last message in the history buffer.
  • New messages shouldn't reset or offset the scrolling, neither should they be marked as read if they haven't actually been displayed to the user
  • There should be a command for controlling the scrollback state: "/scroll reset", "/scroll [to line x]", maybe some kind of search functionality (like irssi /lastlog)
  • An individual scrollback state should be preserved for each window; tabbing away to a different user, then back, shouldn't reset the scrollback state.

Patch: F9: "copy-paste" mode

For copying pastes from other users,

  • toggles buddy list
  • turns off message formatting (timestamps + line wrapping)
  • hides own/local messages so your own messages don't interfere with the the selection
    cfcs@2dcf74b

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.