Simple note-posting system for shared UNIX boxes
Go to file
Ben Morrison ad215ba851
install target: check for clinte.json before copying
removed upgrade target since it's now redundant
2020-06-16 15:03:51 -04:00
assets new screenshot 2019-09-04 17:59:24 -04:00
src moved startup timer to end of execution, as run timer 2020-06-15 17:51:43 -04:00
.gitignore init 2019-08-27 00:17:02 -04:00
.travis.yml travis using single-threaded testing 2020-05-28 13:00:40 -04:00
Cargo.lock bumped version in Cargo.toml 2020-05-28 12:32:18 -04:00
Cargo.toml bumped version in Cargo.toml 2020-05-28 12:32:18 -04:00
LICENSE MIT -> ISC 2019-09-07 02:25:21 -04:00
Makefile install target: check for clinte.json before copying 2020-06-16 15:03:51 -04:00
README.md updated usage for linewrap 2020-06-09 03:06:02 -04:00
clinte.json more testing 2020-05-28 03:31:43 -04:00

README.md

clinte   Build Status codecov

Command-line community notice board for public-access UNIX systems. Post text-only notes for other users to see.

Features

  • Username is tagged based on the executing user
  • Shows the 15 most recent posts in descending order
  • Able to edit or delete your own posts
  • Title <= 30 chars
  • Body <= 500 chars
  • Calls $EDITOR when creating or modifying the body of a post
  • If $EDITOR is unset, calls nano
  • Stores posts in JSON
  • Uses advisory locking via flock(2) to synchronize access to the posts file

Screenshot

Installation

Clone the repository and jump into the directory:

$ git clone git://github.com/gbmor/clinte.git
...
$ cd clinte

Run the makefile and install:

$ make
...
...Done!

$ sudo make install

make will automatically checkout the latest tag and build from there.

Upgrading

Note: v1.0.0 used sqlite3, which presented some issues. v2.0.0 uses a json structure for posts, as this will be safer on a multi-user system. When upgrading from v1.0.0 to v2.0.0, you won't be able to save the posts without using a third-party tool to dump the posts table to json, and manually adjusting it to fit the expected format (which can be seen in the included clinte.json).

If upgrading from v1.0.0 -> v2.0.0, do a fresh install, including removing the database directory /usr/local/clinte. The following applies to upgrading when already running at least v2.0.0

$ make update
$ make
$ make upgrade

This will:

  • checkout master
  • pull / rebase changes from upstream
  • checkout the latest tag
  • rebuild
  • replace the clinte binary, but leave the posts file untouched.

Usage

Issuing the program name itself will list the currently available posts, like in the screenshot above.

Display recent posts

$ clinte

Create a post

$ clinte post

clinte will then ask for the title of the post, and the body. The username will be tagged automatically by your logged-in username, reflecting its intended use on multi-user UNIX-like systems.

Edit a post

$ clinte update [id]

If the [id] argument is absent, clinte will ask for the ID number of the post. If it's been authored by you, then you will be asked for the new title. Your $EDITOR will be called, and will be populated with the previous body.

Delete a post

$ clinte delete [id]

If the [id] argument is absent, clinte asks for the numeric ID of the post to delete.

Verbose logging

$ clinte -v [post|update|delete] [id]

Use this flag if something's going wrong. Additional information will be written to `/tmp/clinte_$USER.log** that will, hopefully, reveal the cause of the error.

Line Wrapping

$ clinte -l 80

Wraps posts at the given line length. Set to <10 to disable line wrapping. Defaults to 80.

Notes

The file where the posts are stored, /usr/local/clinte/clinte.json, must be writeable by all users on the system. Keep this in mind.