|
| 1 | +.\" Manpage for Standard (?) Unix Notes |
| 2 | +.\" aka notes |
| 3 | +.\" See https://github.com/Standard-Unix-Notes/unix-notes |
| 4 | +.TH notes 1 "10 June 2021" "1.0" "Notes man page" |
| 5 | +.SH NAME |
| 6 | +Notes \- GPG encrypted notes |
| 7 | +.SH SYNOPSIS |
| 8 | +.B |
| 9 | +notes |
| 10 | +[ |
| 11 | +.IB |
| 12 | +command |
| 13 | +] [ |
| 14 | +.I |
| 15 | +filename |
| 16 | +| |
| 17 | +.I \fInote_title\fP |
| 18 | +] |
| 19 | + |
| 20 | +.SH CONFIGURATION |
| 21 | + |
| 22 | +Manual configuration for the GPG key can be added using the phrase \fBKEY <email |
| 23 | +address>\fP in the file \fB<notesdir>/config\fP. |
| 24 | + |
| 25 | +.SH DESCRIPTION |
| 26 | + |
| 27 | +The Standard(?) Unix Notes notebook system is a GPG encrypted 'notebook' where each note |
| 28 | +is individually encrypted into a notebook folder. It can handle multiple notebook folders |
| 29 | +and can decrypt/re-encrypt for a new GPG key easily. The program is based upon |
| 30 | +Password-Store the standard Unix password manager of which it borrows some code. |
| 31 | + |
| 32 | +If no command is given then Notes simply runs 'notes help' which outputs a list of |
| 33 | +commands to STDOUT. |
| 34 | + |
| 35 | +Before using the system the user should create a GPG key if they haven't got one. Notes |
| 36 | +will automatically search the user's GPG keyring and default to using the first private |
| 37 | +key it finds (Note that the code currently isn't clever enough to distinguish if that key |
| 38 | +is expired). If this is the wrong key you can change it in two ways: |
| 39 | + |
| 40 | +1. Simply edit the \fB~/.notes/config\fP file and replace the KEY parameter with the correct |
| 41 | +email address. This will only work if you only have one key with that email address. If |
| 42 | +you have two keys with that email address, (for example if one has expired but you have |
| 43 | +kept it for decrypting old files) then you should replace the email address with the |
| 44 | +KEYID of the private key you wish to use. |
| 45 | + |
| 46 | +2. If you know the GPG keyid and there are no duplicate email address issues with other |
| 47 | +keys, then run 'notes newkey <keyid>'. Notes will replace the keyid automatically in the |
| 48 | +config file. |
| 49 | + |
| 50 | +.SH COMMANDS |
| 51 | + |
| 52 | +The notes program takes a set of commands which allows the user to manipulate the |
| 53 | +encrypted notes in the system. |
| 54 | +.RE |
| 55 | + |
| 56 | +.SY init |
| 57 | +.YS |
| 58 | +Setup your notes system. This command takes no arguments and creates the notes directory |
| 59 | +(\fB~/.notes\fP). It then creates the default notebook called 'notes' and sets the |
| 60 | +DEFAULT and USE links pointing to the default notebook (notes). |
| 61 | + |
| 62 | +The program then examines your GPG keyring for private keys. It then adds the first GPG |
| 63 | +KeyID to your config file for later use. With each command issued the program will use |
| 64 | +this key for any encryption needed. |
| 65 | + |
| 66 | +.SY config |
| 67 | +.YS |
| 68 | +Displays the config file |
| 69 | +.B |
| 70 | +~/.notes/config |
| 71 | +to the terminal. This is a quick way of determining which GPG KeyID is in use. |
| 72 | + |
| 73 | +.SY help |
| 74 | +.YS |
| 75 | +Displays a quick help page displaying available commands. |
| 76 | + |
| 77 | +.SY version |
| 78 | +.YS |
| 79 | +Displays the program version number. |
| 80 | + |
| 81 | +.SY "show|ls|list" |
| 82 | +.YS |
| 83 | +List notes in current notebook. All note files found in the directory pointed to by |
| 84 | +~/.notes/USE are displayed to the STDOUT. |
| 85 | + |
| 86 | +.SY "newkey KeyID" |
| 87 | +.YS |
| 88 | +.OP KeyID |
| 89 | +The GPG KeyID can be in one of two formats. The standard 40 character full KeyID, or the |
| 90 | +shorter 16 character version (this is the last 16 characters of the full KeyID). |
| 91 | +.PP |
| 92 | +Change GPG key encryption for all notebooks. The newkey command takes either a |
| 93 | +full 40 character GPG KeyID or the shortened 16 character KeyID |
| 94 | +(the last 16 characters of the full KeyID as shown by format=short). |
| 95 | +The newkey command will then find all the notes from all notebooks, decrypt the note |
| 96 | +before re-encrypting the note with the new KeyID. |
| 97 | + |
| 98 | + |
| 99 | +.SY "find|search search term" |
| 100 | +.YS |
| 101 | +.OP "search term" |
| 102 | +The search term is passed to grep inside the program for processing the search. |
| 103 | +THIS OPTION IS NOT CURRENTLY IMPLEMENTED. |
| 104 | +See ROADMAP for details. |
| 105 | + |
| 106 | +.SY "insert|add note title" |
| 107 | +.YS |
| 108 | +Add a note to the system. The program takes the note title and replaces any spaces within |
| 109 | +it with underscores. It then creates a temporary file in the CURRENT notebook and calls |
| 110 | +your editor ($EDITOR) to edit the file. After editing the file to enter your notes the |
| 111 | +program calls GPG to encrypt the file (to a file named |
| 112 | +.B |
| 113 | +note-title.gpg |
| 114 | +). Finally the temporary file is scrubbed and deleted. |
| 115 | + |
| 116 | +.OP "note title" |
| 117 | +If the note title contains spaces they will be replaced with underscores in the final note file. |
| 118 | + |
| 119 | +.SY "view|cat note title" |
| 120 | +.YS |
| 121 | +View a note. Notes decrypts the selected notes to the STDOUT (so no temporary files are |
| 122 | +created exposing the security of your notes). |
| 123 | + |
| 124 | +.SY "import file-path" |
| 125 | +.YS |
| 126 | +Import a text file as a note into the system, encrypting the note as it is imported. |
| 127 | + |
| 128 | +.SY "rename|mv note title" |
| 129 | +.YS |
| 130 | +Rename a note. The program will prompt for a new note title to be entered. Original |
| 131 | +encrypted note is NOT decrypted in the process. Any spaces entered in the new title will be replaced by underscores. |
| 132 | + |
| 133 | +.SY "copy|cp note title" |
| 134 | +.YS |
| 135 | +Duplicate a note in the SAME directory. The program will prompt for a new note title to |
| 136 | +be entered before copying the note to a new note title. |
| 137 | +As of version 1.0, this command does not copy between notebooks and the user is advised to |
| 138 | +manually move the file into the desired notebook directory. |
| 139 | + |
| 140 | +.SY "delete|rm note title" |
| 141 | +.YS |
| 142 | +Delete a note. The note specified on the command line will be deleted. |
| 143 | + |
| 144 | +.SY "edit|ed note title" |
| 145 | +.YS |
| 146 | +The program will take the note title specified on the command line and decrypt the note. |
| 147 | +After calling the user's default editor ($EDITOR) it will encrypt the file using the |
| 148 | +user's currently configured encryption KeyID. The temporary file used to edit will be |
| 149 | +then securely scrubbed. |
| 150 | + |
| 151 | +.SH NOTEBOOKS |
| 152 | + |
| 153 | +The program comes with a sister program called \fBnotebook\fP that supports the managing |
| 154 | +of notebooks (sub-directories of the main ~/.notes directory containing notes). See |
| 155 | +\fBnotebook(1)\fP for details. |
| 156 | + |
| 157 | +.SH OPTIONS |
| 158 | + |
| 159 | +Most commands take either a \fBnote title\fP, \fBfile-path\fP or a \fBGPG KeyID\fP. See |
| 160 | +the individual COMMANDS for details on which options each command takes. The notes and |
| 161 | +notebook commands strip spaces from note filenames and notebook directory names. It |
| 162 | +replaces them with underscores. This behaviour occurs even if the user encloses the |
| 163 | +filename with spaces in quotes because there are other issues that occur when handling |
| 164 | +notes with spaces in particularly when replacing the encryption key. |
| 165 | + |
| 166 | +.SH EXIT STATUS |
| 167 | + |
| 168 | +Upon an error notes returns a non zero value upon aborting. |
| 169 | + |
| 170 | +.SH ENVIRONMENT |
| 171 | + |
| 172 | +\fB$EDITOR\fP |
| 173 | +Notes uses the shell variable to determine which editor the user prefers. If unset it |
| 174 | +will default to 'nano'. |
| 175 | + |
| 176 | +By default notes creates it's notes directory in ~/.notes for the user. This can be |
| 177 | +changed by modifying the shell script. |
| 178 | + |
| 179 | +.SH FILES |
| 180 | + |
| 181 | +The following files are found in the notes directory (~/.notes by default): |
| 182 | + |
| 183 | +.TP |
| 184 | +\fBconfig\fP |
| 185 | +The configuration file for notes. Currently the only option is for specifying the key to |
| 186 | +be used for encryption (KEY <email address>). |
| 187 | + |
| 188 | +.TP |
| 189 | +\fBDEFAULT\fP |
| 190 | +This link points to the default notebook (notes). This can be reassigned by using the |
| 191 | +command 'notebook default <notebook name>'. |
| 192 | + |
| 193 | +.TP |
| 194 | +\fBUSE \fP |
| 195 | +This link points to the currently used notebook. It can be changed by issuing the command |
| 196 | +'notebook use <notebook name>'. You can also set this to the default notebook by omitting |
| 197 | +the notebook name parameter. |
| 198 | + |
| 199 | +.SH CONFORMANCE |
| 200 | + |
| 201 | +The script is written to use the Bourne Shell and avoid all Bash-isms (which would have |
| 202 | +made the coding a little easier in some cases. Although Bash is installed by default on |
| 203 | +most Linuxes, it is not installed by default on a number of other Unix-like operating |
| 204 | +systems including FreeBSD. |
| 205 | + |
| 206 | +This is deliberate as all Unix and Linux systems should have a POSIX compliant shell (or |
| 207 | +at least be backwards compatible to one). Hence the application was written for the |
| 208 | +lowest common denominator. |
| 209 | + |
| 210 | +.SH NOTES |
| 211 | + |
| 212 | +There is currently no sync built into this application. However, the user can simply run |
| 213 | +a rsync or scp in order to synchronise between two machines running Notes. |
| 214 | + |
| 215 | +.SH BUGS |
| 216 | + |
| 217 | +See https://github.com/Standard-Unix-Notes/unix-notes/issues for details on any Bugs and |
| 218 | +Issues with the project. |
| 219 | + |
| 220 | +Please report any bugs on the GitHub page. |
| 221 | + |
| 222 | +.SH EXAMPLES |
| 223 | + |
| 224 | +.EX |
| 225 | +Show help: |
| 226 | +\fB$ notes\fP |
| 227 | +
|
| 228 | +Initialises notes directory (~/.notes): |
| 229 | +\fB$ notes init\fP |
| 230 | +
|
| 231 | +Add a note called 'mynote' in the current notebook encrypting it with your GPG key: |
| 232 | +\fB$ notes add mynote\fP |
| 233 | +
|
| 234 | +Add note called another_note in the current notebook encrypting it with your GPG key: |
| 235 | +\fB$ notes add another note\fP |
| 236 | +
|
| 237 | +Rename 'mynote' to 'installation_instructions': |
| 238 | +\fB$ notes rename mynote\fP |
| 239 | +Please enter new name for note: installation instructions |
| 240 | +/home/ian/.notes/USE/mynote.gpg exists .... moving |
| 241 | +
|
| 242 | +List notes in current notebooks: |
| 243 | +\fB$ notes list\fP |
| 244 | +another_note.gpg installation_instructions.gpg |
| 245 | +demo.gpg |
| 246 | +
|
| 247 | +Import a text file into Notes: |
| 248 | +\fB$ notes import ~/Projects/evil_master_plan\fP |
| 249 | +
|
| 250 | +Edit a note (.gpg extension not necessary) in your current editor ($EDITOR): |
| 251 | +\fB$ notes edit evil_master_plan\fP |
| 252 | +
|
| 253 | +Delete Note: |
| 254 | +\fB$ notes rm another_note.gpg\fP |
| 255 | +
|
| 256 | +View note: |
| 257 | +\fB$ notes view evil_master_plan\fP |
| 258 | +gpg: encrypted with 2048-bit RSA key, ID 8E34F9151120CF01, created 2020-11-27 |
| 259 | + |
| 260 | +EVIL MASTER PLAN |
| 261 | +
|
| 262 | +1. Take over world |
| 263 | +2. Stroke white cat |
| 264 | +.EE |
| 265 | + |
| 266 | +.SH SEE ALSO |
| 267 | + |
| 268 | +.IP \fBnotebook(1)\fP The companion command for managing notebooks for notes. |
| 269 | + |
| 270 | + |
| 271 | +.SH PROJECT PAGE |
| 272 | +.UR https://github.com/Standard-Unix-Notes/unix-notes |
| 273 | +GitHub Project page |
| 274 | +.UE |
| 275 | + |
| 276 | +.SS ROADMAP |
| 277 | +.UR https://github.com/Standard-Unix-Notes/unix-notes/raw/ROADMAP |
| 278 | +Project GitHub |
| 279 | +.UE |
| 280 | + |
| 281 | +.SS CONTRIBUTING |
| 282 | + |
| 283 | +Contributions are welcome, see CONTRIBUTING in the tarball or in the |
| 284 | +.UR https://github.com/Standard-Unix-Notes/unix-notes/raw/CONTRIBUTING |
| 285 | +GitHub repository |
| 286 | +.UE |
| 287 | + |
| 288 | +.SS LICENCE |
| 289 | + |
| 290 | +The Standard(?) Unix Notes program is licensed under the BSD 3-clause licence. |
| 291 | + |
| 292 | +.SS AUTHOR |
| 293 | + |
| 294 | +Ian Stanley can be contacted via project |
| 295 | +.UR https://github.com/iandstanley |
| 296 | +GitHub page |
| 297 | +.UE |
0 commit comments