LOC-22: Command line options

Issue Information

Issue Type: New Feature
Priority: Major
Status: Closed

Reported By:
Ben Tasker
Assigned To:
Ben Tasker
Project: LocalChat (LOC)
Resolution: Done (2018-05-26 11:04:51)
Target version: V0.0.2,
Components: Client ,

Created: 2018-05-15 09:45:49
Time Spent Working

The client should accept some options on the command line to adjust it's behaviour.

Current thinking is something along the following lines

./LocalChat.py [--auth|--verify] [server]

Where server should always be the final option (and if a valid string - i.e. http/https prefix - not provided, use the built in default).

--verify should enable SSL cert authentication. It's off by default because the server uses Ad-hoc certs (you almost certainly aren't going to want to expose your activities by first going to a publicly trusted CA to get a cert, plus it uses loopback by default, so you aren't going to get one).

It's use case is for when deploying the server as a "hidden" path on an existing website (so for example https://www.example.com/mysecretchat might be proxied through to the server). In that scenario, you'd already have a trusted cert on the main website, so probably want to verify the cert.

--auth should tell the client that the user wants to add Basic authentication (or maybe digest) headers to every request. Once the client has launched it should prompt the user to enter the credentials (we don't want them on the commandline as they'll appear in ps output).

The use-case is an extension of that for --verify. If I "hide" the server under https://www.example.com/mysecretchat I may want to ignore (or better, 404) any requests that do not include a valid authentication header so that the path cannot so easily be discovered.

This FR is only for adding support for accepting options from the command line. I'll raise separate subtasks for the functionality described above once the support is in place.


LOC-26: Allow enabling of SSL cert verification
Toggle State Changes


Repo: LocalChat

commit c2e963c8fc561f4c97699df90f31de4fb22e0bfc
Author: B Tasker <github@<Domain Hidden>>
Date: Sat May 26 10:04:40 2018 +0100

Commit Message: LOC-22 Allow server address to be specified on the commandline

If the final argument to the client begins with 'ht' it'll be taken as a URL and used as the server address.

It must be https as there's no handling for plain http within the client.

client/LocalChatClient.py | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)

View Commit | View Changes
I'm going to bump --auth support into v0.0.3 to give some more time to think about how best to implement it without blocking release of .2 - raised as LOC-27
btasker changed status from 'Open' to 'Resolved'
btasker added 'Done' to resolution
btasker changed status from 'Resolved' to 'Closed'