Browse Source

some more really small doc fixes.

master
Georg Hopp 9 years ago
parent
commit
2009b41a5e
  1. 6
      README.md
  2. 383
      doc/accountmanager.md

6
README.md

@ -1,7 +1,5 @@
# accountmanager.sh # accountmanager.sh
------------------------------------------------------------------------
## NAME ## NAME
accountmanager.sh − source all functionality into the current shell accountmanager.sh − source all functionality into the current shell
@ -277,7 +275,7 @@ No known bugs.
## AUTHOR ## AUTHOR
Georg Hopp (georg@steffers.org.in)
Georg Hopp <georg@steffers.org>
## COPYRIGHT ## COPYRIGHT
@ -285,5 +283,3 @@ Copyright © 2017 Georg Hopp License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>. <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. There is NO WARRANTY, to the extent permitted by law.
------------------------------------------------------------------------

383
doc/accountmanager.md

@ -1,383 +0,0 @@
# man
[NAME](#NAME)
[SYNOPSIS](#SYNOPSIS)
[DESCRIPTION](#DESCRIPTION)
[OPTIONS](#OPTIONS)
[ENVIRONMENT](#ENVIRONMENT)
[DEPENDENCIES](#DEPENDENCIES)
[SEE ALSO](#SEE ALSO)
[BUGS](#BUGS)
[AUTHOR](#AUTHOR)
[COPYRIGHT](#COPYRIGHT)
* * *
## NAME<a name="NAME"></a>
accountmanager.sh − source all functionality into the current shell
General purpose functions:
random − create a non blocking stream of random data on stdout
rand_printable − create a random string a printable characters
Database management functions:
amngrdbinit − initialize the SQLite account database
amngrdbdestroy − remove the SQLite account database
Account management functions:
amngradd − add an account credential to the database
amngrcreate − create a new account credential to the database
amngrcrypt − crypt the given data with GnuPG
amngrdelete − delete an account
amngrgen − generate a encrypted random passphrase
amngrgetoldpass − copy previous password of account to X clipboard
amngrgetolduser − copy previous username of account to X clipboard
amngrgetpass − copy active password of account to X clipboard
amngrgetuser − copy active username of account to X clipboard
amngrid − write the database id of a given account name to stdout
amngrlist − list all accounts
amngrrename − rename an account
amngrsearch − pattern search accounts
## SYNOPSIS<a name="SYNOPSIS"></a>
source **${PATH}/accountmanager.sh**
**random**
**rand_printable** [_len_]
**amngrdbinit** [_dbfile_]
**amngrdbdestroy** [_dbfile_]
**amngradd -u** _username_ **-p** _password_ [**-d** _description_] [**-D** _dbfile_] [**-r** _recipient_] _account_
**amngrcreate -u** _username_ [**-d** _description_] [**-D** _dbfile_] [**-r** _recipient_] _account_
**amngrcrypt** [**-r** _recipient_] _password_
**amngrdelete** _account_
**amngrgen** [**-r** _recipient_] [_len_]
**amngrgetoldpass** _account_
**amngrgetolduser** _account_
**amngrgetpass** _account_
**amngrgetuser** _account_
**amngrid** _account_
**amngrlist** [**-s** _separator_]
**amngrrename** _old_account new_account_
**amngrsearch** [**-s** _separator_] _pattern_
## DESCRIPTION<a name="DESCRIPTION"></a>
This file can either be source into the current shell or used as a standalone shell script via the provided symlinks. When used as standalone script it will detect the function to call by the content of **$0**.
All _account_ as well as all _username_ arguments used below are limited to 128 characters. The _account_ argument is always a unique string identifier for the account to manage. The _username_ argument is the username part of a credential which is a (_username_, _password_) pair.
**random**
|
Takes no arguments and connect a non blocking random source to stdout.
|
**rand_printable** [_len_]
Uses **random** to write a string of random printable characters to stdout. All control characters ASCII-0 to ASCII-37 as well as ASCII-177 to 255, single and double quotes are filtered. The single and double quotes are filtered to prevent problems when they are used as string separators after shell expansion as in the SQL here documents used to communicate with the SQLite database.
The optional _len_ argument specifies the string length to be written and defaults to 512.
**amngrdbinit** [_dbfile_]
Create the SQLite database file. If the optional _dbfile_ argument is given it specifies the fill path to the file to use, else the value of **$AMNGRDB** environment variable is used.
**amngrdbdestroy** [_dbfile_]
Deletes the SQLite database file. If the optional _dbfile_ argument is given it specifies the fill path to the file to use, else the value of **$AMNGRDB** environment variable is used.
**amngradd -u** _username_ **-p** _password_ [**-d** _description_] [**-D** _dbfile_] [**-r**_
recipient_] _account_
Adds an account credential and marks it as active. If the account already exist, the credential (_username_ and _password_) is added to that account and the previously added credential is marked as old. If there was another even older credential that was already marked as old this will be marked as inactive and this becomes inaccessible with this tools (except for **amngrdelete**).
The necessary option **-u** specifies the username to be stored with this credential pair.
The also necessary option **-p** specifies the password to be stored and the length of _password_ is not limited at all.
With option **-d** one can add a _description_ to the account entry. One can specify the _dbfile_ with the option **-D** if that option is not given the **$AMNGRDB** environment variable is used.
**amngrcreate -u** _username_ [**-d** _description_] [**-D** _dbfile_] [**-r** _recipient_]_
account_
This will create a password with **amngrgen** and use that to add an credential via **amngradd**. (See there for options description)
The added password will be copied to the X clipboard with **amngrgetpass** for further use.
**amngrcrypt** [**-r** _recipient_] _password_
Crypt the given plain text _password_ with GnuPG and write it to stdout.
The option **-r** specifies the recipient to use with the call to **gpg**. If it is not given the value of the **$AMNGRID** environment variable is used.
**amngrdelete** _account_
Remove the _account_ and all credential associated to it.
**amngrgen** [**-r** _receipient_] [_len_]
Generate a password with **rand_printable** and encrypt it via **amngrcrypt**. By default the password will be 10 characters long. That can be modified by the optional _len_ argument.
**amngrgetoldpass** _account_
Read and decrypt the password associated with _account_ that is flagged as old and store it into the X clipboard.
**amngrgetolduser** _account_
Read and decrypt the username associated with _account_ that is flagged as old and store it into the X clipboard.
**amngrgetpass** _account_
Read and decrypt the password associated with _account_ that is flagged as active and store it into the X clipboard.
**amngrgetuser** _account_
Read and decrypt the username associated with _account_ that is flagged as active and store it into the X clipboard.
**amngrid** _account_
(This is primarily for internal use.) Get the database id associated to the given _account_ argument.
**amngrlist** [**-s** _separator_]
List all accounts currently stored within the database the output will contain the name of the account, the username and the description delimited by a _separator_ string that can be specified with the **-s** option. If the option is omitted the separator is " => ". Each row is one account.
**amngrrename** _old_account new_account_
Rename the account specified by _old_account_ to _new_account_.
**amngrsearch** [**-s** _separator_] _pattern_
List accounts where _pattern_ exists in either the account name, the username or the account description. The output is like the one described with **amngrlist**.
## OPTIONS<a name="OPTIONS"></a>
The options are consistent over all sub commands. However not all sub commands use all options and some sub commands take arguments that other get per option. (See **DESCRIPTION**)
**-u**
|
The login username of the credential for the account.
|
**-p**
|
The plain text password of the credential for the account.
|
**-d**
|
The description for the account.
|
**-D**
|
Select the database file to use instead of the one defined in the **$AMNGRDB** environment variable.
|
**-r**
|
Select a recipient id for GnuPG encryption to use instead of the one defined in the **$AMNGRID** environment variable.
|
**-s**
|
The column separator for the **amngrlist** and **amngrsearchcommands.**
|
## ENVIRONMENT<a name="ENVIRONMENT"></a>
**AMNGRDB**
The default SQLite database file to use. This will be created with **amngrdbinit** as long as the path to that file exists. This can be overruled with the **-D** command line option.
**AMNGRID**
The GnuPG recipient id to encrypt against. You should use one where you have both public and private key. Failure to do so will result in not decipherable data. This can be overruled with the **-r** command line option.
**AMNGRPWLEN**
The password length to be used when generating new passwords.
## DEPENDENCIES<a name="DEPENDENCIES"></a>
A set of POSIX compliant shell utilities including a POSIX compliant shell as well are needed to run this script.
The functions within this script expect that all the needed tools can be found by the shell, usually that means that the current **$PATH** environment variable is set accordingly or that the tools are a shell internal.
The existence of a reliable non blocking random source. By default this scripts use **$(cat /dev/urandom)** which can be changed by replacing the alias **random** with something useful for your system.
For data storage **Sqlite >= 3.6.19** is required. The version requirement comes from the use of foreign key constraints.
To store the data within the X clipboard the **xclip** is needed.
**The tools used are**
|
**awk**
|
|
**basename**
|
|
**cat**
|
|
**dnsdomainname**
|
|
**echo**
|
|
**getopts**
|
|
**gpg**
|
|
**head**
|
|
**printf**
|
|
**rm**
|
|
**shift**
|
|
**SQLite3** (>= 3.6.19 for foreign key constraints)
|
|
**test** and **[**
|
|
**tr**
|
|
**xclip**
|
## SEE ALSO<a name="SEE ALSO"></a>
gpg2(1), gpg-agent(1)
## BUGS<a name="BUGS"></a>
No known bugs.
## AUTHOR<a name="AUTHOR"></a>
Georg Hopp (georg@steffers.org.in)
## COPYRIGHT<a name="COPYRIGHT"></a>
Copyright © 2017 Georg Hopp License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
* * *
Loading…
Cancel
Save