C Shell Python
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


== Contents ==

 * './do' script options
 * Quick startup guide
 * CMake configuration variables

== './do' script commands ==

 * dependencies: (simplistic informative) dependency check

 * configure:
  * automatically detect dependencies;
  * use default values for installation and configuration;
 * configure-ui: start a nice curses UI for configuration;

 * make:
  * make: build everything;
  * make install: ...;

 * clean: ...;

 * (local installation of tools):
  * cmake-install: installs CMake
  * bdb-install: installs BerkeleyDB
  * openssl-install: installs OpenSSL

 * test-shell:
  * configure and install the test installation in /tmp/notary.$USER;
  * open a shell to allow testing of executables and scripts;
 * test-clean: removes the test installation from /tmp/notary.$USER;

 * help: ...;
 * license: ...;

== Quick startup guide ==

0. Dependency checking:
>> ./do dependencies

  0a. (optional) Install CMake (if missing):
  >> ./do cmake-install
  >> export cmake_EXEC=... # see the output of the previous command

  0b. (optional) Install BerkeleyDB (if missing):
  >> ./do bdb-install
  >> export bdb_PREFIX=... # see the output of the previous command

  0c. (optional) Install OpenSSL (if missing):
  >> ./do openssl-install
  >> export openssl_PREFIX=... # see the output of the previous command

1. Configure:
>> ./do configure

 1a. Configure with prefix (without "extra-prefix"):
 >> ./do configure -Dnotary_PATH=/opt/notary
 * will create /opt/notary/etc, /opt/notary/var/db, etc.

 1b. Configure with prefix and with "extra-prefix":
 >> ./do configure -Dnotary_PATH=/usr/local -Dnotary_PATH_MANGLING=notary
 * will create /usr/local/etc/notary, /usr/local/var/notary/db, etc.
 * the "extra-prefix" is in fact a subfolder for some 'system-wide' folders like /etc and /var.

 1c. Configure static building (usefull for chroot-ing):
 >> ./do configure -Dnotary_static_ENABLED=on
 * prepare to receive warnings and maybe even a fail; (libcrypt and glibc have issues with this?)

 1d. Configure all the scripts to use a certain user (usefull when running the scripts as root):
 >> ./do configure -Dnotary_USER=notary
 * all the start / stop, control and maintenance scripts will check for this user,
 * and in case they were started with root, they automatically `su` into this user;

2. Build:
>> ./do make

3. Install into '/tmp/notary_@VERSION@':
>> ./do make install

4. Add the '/tmp/notary_@VERSION@/bin' to PATH:
>> export PATH="/tmp/notary_@VERSION@/bin:$PATH"

5. Initialize in one step (all sub-steps bellow at once):
>> notary_@VERSION@_initialize

  5a. Create cryptographic keys:
  >> notary_@VERSION@_create_keys

  5b. Create record database:
  >> notary_@VERSION@_create_db

  5c. Start daemons:
  >> notary_@VERSION@_start_daemons

6. (Optional) Check daemons:
>> notary_@VERSION@_check_daemons

7. (For later) Do maintenance in one step (all sub-steps bellow at once):
>> notary_@VERSION@_maintenance

  7a. Prime record database (recover and delete un-needed transaction logs):
  >> notary_@VERSION@_prime_db

  7b. Backup record database:
  >> notary_@VERSION@_backup_db

  7c. Refresh record database:
  >> notary_@VERSION@_refresh_db

8. (For later) Stop daemons:
>> notary_@VERSION@_stop_daemons

9. (For administrators) Add control script to init.d and rcX.d:
>> ln -s -T `which notary_@VERSION@_control` /etc/init.d/notary_@VERSION@
>> # for startup
>> ln -s -T /etc/init.d/notary_@VERSION@ /etc/rcX.d/S99notary_@VERSION@
>> # for shutdown, reboot and single-user
>> ln -s -T /etc/init.d/notary_@VERSION@ /etc/rc0.d/K01notary_@VERSION@
>> ln -s -T /etc/init.d/notary_@VERSION@ /etc/rc1.d/K01notary_@VERSION@
>> ln -s -T /etc/init.d/notary_@VERSION@ /etc/rc6.d/K01notary_@VERSION@

10. (For administrators) Add maintenance script to cron:
>> # as the current user (advised)
>> { crontab -l ; echo '59 0,12 * * *' `which notary_@VERSION@_control` maintenance ; } | crontab -
>> # as root, system wide (unadvised)
>> echo '59 0,12 * * *' `which notary_@VERSION@_control` maintenance >>/etc/crontab

== CMake configuration variables ==

* notary_PATH: Prefix for the installation folders.
* notary_PATH_MANGLING: Extra-prefix for some installation folders (resulting in /etc/notary, /var/lib/notary, /var/run/notary, etc.)
* notary_bin_PREFIX: Prefix of the executable files (those in bin).
* notary_libexec_PREFIX: Prefix of the (internal) executable files (those in libexec).

* notary_static_ENABLED: Enables static linking of executables.
* bdb_static_ENABLED: Enables static linking of only the BerkeleyDB library.
* openssl_static_ENABLED: Enables static linking of only the OpenSSL library.

* notary_USER: User to run all notary scripts / agents.
* notary_http_listen_IP: Listening IP of the notary http server.
* notary_http_listen_PORT: Listening port of the notary http server.

* bdb_PREFIX: Prefix for a custom BerkeleyDB installation. (Defaults to bdb_PREFIX environment variable.)
* openssl_PREFIX: Prefix for a custom OpenSSL installation. (Defaults to openssl_PREFIX environment variable.)

== Environment variables ==

* cmake_PREFIX: Prefix for a custom CMake installation.
* bdb_PREFIX: Prefix for a custom BerkeleyDB installation.
* openssl_PREFIX: Prefix for a custom OpenSSL installation.