gateone.js:  Fixed a couple of exceptions that could show up in the JS console in (very rare) circumstances and also cleaned up the code a bit.
gateone.js:  In the event that the apps list gets sent to the client very late (e.g. overloaded/slow server) the new Workspace Workspace (with the apps chooser) will be reloaded.
terminal.py:  A few very minor tweaks to `Terminal._spanify_screen()` to enhance code readability.
terminal_input.js:  Fixed a bug where the numpad enter key wasn't working properly on certain OS/browser combinations.
terminal_input.js:  Fixed a bug where the right-click context menu wasn't working to copy highlighted text.
IMPORTANT PACKAGING CHANGE:  /opt/gateone is no more!  See the commit message for full detauls...
In order for Gate One to be more easily packaged across a wider variety of systems (Linux distros, embedded systems, appliances, etc) it was necessary to change how it was packaged.  Previously, all Gate One files were treated as 'data_files' inside of setup.py and installed in /opt by default (with the option to install somewhere else using the --prefix).  This prevented Gate One from working properly inside of a virutalenv container which is a very important, modern way of packaging Python modules and applications.  The /opt installation method was also standing in the way of Gate One being included in several Linux distribution repositories.  For these reasons (and a few more) Gate One will now install itself like any other Python module in your site-packages directory.  See below for individual/important notes.
Changes to defaults:
 * The 'user_dir' option will now default to /var/lib/gateone/users
 * The 'log_file_prefix' will not default to /var/log/gateone
 * The 'settings_dir' will now default to /etc/gateone/conf.d
 * The 'pid_file' will now default to /var/run/gateone.pid (even though I know this will result in more support requests)
 * The 'keyfile.pem' and 'certificate.pem' will now default to /etc/gateone/ssl/{keyfile.pem,certificate.pem}
Gate One now requires Tornado version 3.1+.  This is changed from requiring 3.0+.  The reason for this requirement is the use of the new 'group=' keyword argument that is being used with calls to `define()`.
NEW 'gateone' SCRIPT:  The `setuptools.setup()` 'entry_points' option is now being used to automatically generate a 'gateone' script that will be installed in the default $PATH and can be run from anywhere on the system.  I hope to eventually replace this with a 'gateonectl' script which will provide fine-grained control over the gateone.py process(es).
NEW APPLICATION/PLUGIN HOOK:  Applications and plugins can now add CLI options to the 'gateone' command by adding a 'commands' dict (applications) or to the hooks dict (plugins).  This mechanism was added because the logical location for logviewer.py is inside 'applications/terminal' but that's a very inconvenient location for a command-line script (that also happens to be used as a module in the logging plugin).
NEW "gateone command":  You can now call gateone (or server.py) with 'termlog' and it will be equivalent to running 'logviewer.py' directly.  Try it:  gateone termlog /path/to/some/.golog # NOTE: Only works if your settings are proper
setup.py:  If an existing /opt/gateone directory is found it will copy your settings directory to /etc/gateone, preserving the existing locations for things like the user_dir, log_file_prefix, and whatnot.
RENAMES/MOVES:
    gateone.py has been renamed/moved to core/server.py
    utils.py has been moved to core/utils.py
    golog.py has been renamed/moved to core/log.py
    go_async.py has been renamed/moved to async/async.py
    gopam.py has been renamed/moved to auth/ctypes_pam.py
    pam.py has bee moved to auth/pam.py
    sso.py has been moved to auth/sso.py
    auth.py has been split up and moved to auth/authentication.py and auth/authorization.py
logviewer.py has been moved into the 'applications/terminal' directory.
Lots of __init__.py files were placed throughout the 'gateone' directory structure in order to facilitate the new filesystem layout and also allow things like plugins to be importable without having to add them to `sys.path`.
server.py:  The SESSIONS global has been relocated to 'gateone/__init__.py' so that it may be more easily shared amongst all applications/plugins.
server.py:  Fixed a bug with Python 3 where you'd get a MemoryError exception inside `ApplicationWebSocket.open()` around line 1770.  This should close issue #331 (https://github.com/liftoff/GateOne/issues/331).
app_terminal.py:  Moved 256colors.json and fallback_bell.txt into the 'static' directory.
app_terminal.py:  Modified to use the new SESSIONS global.
utils.py:  Added an exception check when minifying JavaScript (apparently slimit can have issues in Python 3--I'll see if I can fix them and submit another patch upstream).
terminal.js:  Added the '✈terminal_pre' class to the '<pre>' element that most stuff inside terminals gets wrapped in.  Related to this, aded that class to `GateOne.Utils.getRowsAndColumns()` inside gateone_utils_extra.js to ensure everything lines up.
terminal.js:  Added a BIG ASS WARNING in regards to a *very old* Firefox bug that is impacting people's ability to copy & paste.  I tried to work around it many different ways but all failed.  Go vote for this bug:  https://bugzilla.mozilla.org/show_bug.cgi?id=116083
terminal.js:  Fixed a number of bugs related to terminal scaling when rows/columns are explicitly set by the user (everything related to `GateOne.Terminal.alignTerminal()`).
terminal_input.js:  Fixed a transient/harmless exception that could appear in the JS console when you press a key after the last terminal has closed but before `GateOne.Terminal.Input.disableCapture()` gets called (it's really a very short time window but not impossible).
remote_syslog.py:  This file has been removed since it is no longer used.
sso.py:  Fixed a bug where you'd get an `UnboundLocalError` exception if something went wrong during Kerberos authentication.
gateone.js:  Fixed the bug where sometimes you'd get no applications listed in the New Workspace Workspace if the page loaded slow enough.
utils.py:  Fixed a bug in `gen_self_signed_openssl()` where it was always placing the keyfile.pem in the current working directory instead of the path specified via the 'keyfile' setting.
ssh_connect.py:  Modified to work in python 2 and 3 without requiring conversion via the 2to3 tool.
Terminal HTML plugin:  Fixed a bug that was causing exceptions (related to regular expression matching) in Python 3.
Documentation:  Updated to reflect the new module names/locations of things and rebuilt.
Init scripts:  Modified to use the new auto-generated 'gateone' script instead of a hard-coded path to gateone.py.
Bookmarks plugin:  Removed bundled html5lib.  It has been added as a global dependency in setup.py.
Terminal themes:  The '✈terminal pre' CSS has been changd to '✈terminal_pre'.
NEW INIT SCRIPT:  Added an init script for openwrt.  It isn't used by setup.py (yet) but I'm sure it will prove useful to some folks (yes, Gate One runs on OpenWRT just fine!).
Convenience plugin:  Fixed a couple of bugs that got introduced when it was switched over to "use strict".
IMPORTANT PACKAGING CHANGE:  /opt/gateone is no more!  See the commit message for full detauls...
In order for Gate One to be more easily packaged across a wider variety of systems (Linux distros, embedded systems, appliances, etc) it was necessary to change how it was packaged.  Previously, all Gate One files were treated as 'data_files' inside of setup.py and installed in /opt by default (with the option to install somewhere else using the --prefix).  This prevented Gate One from working properly inside of a virutalenv container which is a very important, modern way of packaging Python modules and applications.  The /opt installation method was also standing in the way of Gate One being included in several Linux distribution repositories.  For these reasons (and a few more) Gate One will now install itself like any other Python module in your site-packages directory.  See below for individual/important notes.
Changes to defaults:
 * The 'user_dir' option will now default to /var/lib/gateone/users
 * The 'log_file_prefix' will not default to /var/log/gateone
 * The 'settings_dir' will now default to /etc/gateone/conf.d
 * The 'pid_file' will now default to /var/run/gateone.pid (even though I know this will result in more support requests)
 * The 'keyfile.pem' and 'certificate.pem' will now default to /etc/gateone/ssl/{keyfile.pem,certificate.pem}
Gate One now requires Tornado version 3.1+.  This is changed from requiring 3.0+.  The reason for this requirement is the use of the new 'group=' keyword argument that is being used with calls to `define()`.
NEW 'gateone' SCRIPT:  The `setuptools.setup()` 'entry_points' option is now being used to automatically generate a 'gateone' script that will be installed in the default $PATH and can be run from anywhere on the system.  I hope to eventually replace this with a 'gateonectl' script which will provide fine-grained control over the gateone.py process(es).
NEW APPLICATION/PLUGIN HOOK:  Applications and plugins can now add CLI options to the 'gateone' command by adding a 'commands' dict (applications) or to the hooks dict (plugins).  This mechanism was added because the logical location for logviewer.py is inside 'applications/terminal' but that's a very inconvenient location for a command-line script (that also happens to be used as a module in the logging plugin).
NEW "gateone command":  You can now call gateone (or server.py) with 'termlog' and it will be equivalent to running 'logviewer.py' directly.  Try it:  gateone termlog /path/to/some/.golog # NOTE: Only works if your settings are proper
setup.py:  If an existing /opt/gateone directory is found it will copy your settings directory to /etc/gateone, preserving the existing locations for things like the user_dir, log_file_prefix, and whatnot.
RENAMES/MOVES:
    gateone.py has been renamed/moved to core/server.py
    utils.py has been moved to core/utils.py
    golog.py has been renamed/moved to core/log.py
    go_async.py has been renamed/moved to async/async.py
    gopam.py has been renamed/moved to auth/ctypes_pam.py
    pam.py has bee moved to auth/pam.py
    sso.py has been moved to auth/sso.py
    auth.py has been split up and moved to auth/authentication.py and auth/authorization.py
logviewer.py has been moved into the 'applications/terminal' directory.
Lots of __init__.py files were placed throughout the 'gateone' directory structure in order to facilitate the new filesystem layout and also allow things like plugins to be importable without having to add them to `sys.path`.
server.py:  The SESSIONS global has been relocated to 'gateone/__init__.py' so that it may be more easily shared amongst all applications/plugins.
server.py:  Fixed a bug with Python 3 where you'd get a MemoryError exception inside `ApplicationWebSocket.open()` around line 1770.  This should close issue #331 (https://github.com/liftoff/GateOne/issues/331).
app_terminal.py:  Moved 256colors.json and fallback_bell.txt into the 'static' directory.
app_terminal.py:  Modified to use the new SESSIONS global.
utils.py:  Added an exception check when minifying JavaScript (apparently slimit can have issues in Python 3--I'll see if I can fix them and submit another patch upstream).
terminal.js:  Added the '✈terminal_pre' class to the '<pre>' element that most stuff inside terminals gets wrapped in.  Related to this, aded that class to `GateOne.Utils.getRowsAndColumns()` inside gateone_utils_extra.js to ensure everything lines up.
terminal.js:  Added a BIG ASS WARNING in regards to a *very old* Firefox bug that is impacting people's ability to copy & paste.  I tried to work around it many different ways but all failed.  Go vote for this bug:  https://bugzilla.mozilla.org/show_bug.cgi?id=116083
terminal.js:  Fixed a number of bugs related to terminal scaling when rows/columns are explicitly set by the user (everything related to `GateOne.Terminal.alignTerminal()`).
terminal_input.js:  Fixed a transient/harmless exception that could appear in the JS console when you press a key after the last terminal has closed but before `GateOne.Terminal.Input.disableCapture()` gets called (it's really a very short time window but not impossible).
remote_syslog.py:  This file has been removed since it is no longer used.
sso.py:  Fixed a bug where you'd get an `UnboundLocalError` exception if something went wrong during Kerberos authentication.
gateone.js:  Fixed the bug where sometimes you'd get no applications listed in the New Workspace Workspace if the page loaded slow enough.
utils.py:  Fixed a bug in `gen_self_signed_openssl()` where it was always placing the keyfile.pem in the current working directory instead of the path specified via the 'keyfile' setting.
ssh_connect.py:  Modified to work in python 2 and 3 without requiring conversion via the 2to3 tool.
Terminal HTML plugin:  Fixed a bug that was causing exceptions (related to regular expression matching) in Python 3.
Documentation:  Updated to reflect the new module names/locations of things and rebuilt.
Init scripts:  Modified to use the new auto-generated 'gateone' script instead of a hard-coded path to gateone.py.
Bookmarks plugin:  Removed bundled html5lib.  It has been added as a global dependency in setup.py.
Terminal themes:  The '✈terminal pre' CSS has been changd to '✈terminal_pre'.
NEW INIT SCRIPT:  Added an init script for openwrt.  It isn't used by setup.py (yet) but I'm sure it will prove useful to some folks (yes, Gate One runs on OpenWRT just fine!).
Convenience plugin:  Fixed a couple of bugs that got introduced when it was switched over to "use strict".
server.py:  Fixed a bug where client log messages would result in server encoding exceptions.
app_terminal.py:  Fixed a cosmetic bug where the list of enabled plugins was being logged using the full plugin module paths (e.g. gateone.applications.terminal.plugins.playback) instead of the short plugin name (e.g. playback).
logviewer.py:  Fixed a bug where it wasn't working properly in Python 3 when invoked using the new 'gateone termlog' method.
terminal.js:  Worked around the bugs in Firefox and IE10 where newlines were not being lost when copying text from terminals.  As a result of this I have removed that big message asking users to vote/comment on that Firefox bug.  Hopefully this will close issue #330 (https://github.com/liftoff/GateOne/issues/330).
terminal.js:  Removed the `setTimeout()` at the top of `GateOne.Terminal.newTerminal()` so that it can be used in a synchronous fashion right at the beginning of the page load (even if font.css hasn't loaded yet).  When the font.css file gets loaded `GateOne.Terminal.sendDimensions()` will be called which should take care of any sizing issues automatically making that setTimeout unnecessary.
gateone.js:  Enhanced `GateOne.Utils.getQueryVariable()` so that if multiple query string parameters are given with the same name (e.g. https://gateone.company.com/?ssh=ssh://user@somehost&ssh=ssh://otheruser@otherhost) it will return an Array containing all of them.  Otherwise the single (string) value will be returned as before.
gateone-redhat.sh (init script):  Fixed the leftover reference to /opt/gateone/gateone.py.  This should close issue #333 (https://github.com/liftoff/GateOne/issues/333).
ssh_connect.py:  FINALLY FIXED SSH_ASKPASS!  Passing a password in an ssh:// URL works great now (and doesn't create zombie processes)!
ssh_connect.py:  You can now pass ?debug=True in an ssh:// URL to pass '-vvv' to the ssh command.  Example:  ssh://user@somehost?debug=True
ssh.js:  You can now specify 'ssh_once' as a URL query string parameter when passing a '?ssh=ssh://user@somehost' URL to the Gate One server to specify that only the first terminal should open a connection to the given SSH URL (as opposed to having *all* new terminals go to the given URL).  Example:  https://gateone.company.com/?ssh=ssh://user@somehost&ssh_once=True
ssh.js:  You can now specify *multiple* ssh:// URLs in the 'ssh=' query string parameter.  This will result in multiple terminals being opened simultaneously by loading a single Gate One URL.  Example:  https://gateone.company.com/?ssh=ssh://user@somehost&ssh=ssh://otheruser@otherhost would open two terminals immediately after the page loads; each connected to their respective ssh:// URLs.
NOTE:  Lots of tidying-up in this commit.  Functions were moved around and required little changes to lots of files.
New module:  gateone.core.configuration.  Some of the configuration-specific functions have been relocated out of server.py and into configuration.py as well as some things from utils.py.  The only reason is to keep things neat & tidy.
New module:  gateone.core.locale.  The `get_translation()` function has been relocated from utils.py into locale.py.
New script:  run_gateone.py.  It was created so that users could run Gate One without having to install it.  Use run_gateone.py if you wish to run Gate One out of the cloned/downloaded directory.
server.py:  *Actually* fixed the bug where client log messages could throw Unicode* exceptions in `ApplicationWebSocket.log_message()` (forgot something in the last commit).
server.py:  Modified the deprecated '--config' CLI argument `define()` so that it uses the old '/opt/gateone/server.conf' location (since it won't ever be in the new GATEONE_DIR).
server.py:  Removed the logic that adds the parent directory to sys.path since running Gate One out of the download directory is no longer supported.
server.py:  Fixed the default log_file_prefix path to be "/var/log/gateone" by default.
server.py:  Improved the situation where a user would run 'gateone' as non-root.  When that happens dropping privileges will not occur.
configuration.py:  The `generate_server_conf()` function has been modified to automatically include the port in the default origins if a '--port' is given on the command line when you run Gate One the first time.
setup.py:  Changed the wording of the 'TIP:' that gets presented at the end of calling 'python setup.py install' to be more useful/accurate (and also make sure it goes away if you do what it says).
setup.py:  Fixed the issue reported in #339 (https://github.com/liftoff/GateOne/issues/339) where data files were being installed to the wrong location.
MANIFEST.in:  Made a few tweaks here and there.  Nothing special.
gateone.service:  Fixed references to the old /opt/gateone location.  This should close issue #340 (https://github.com/liftoff/GateOne/issues/340).
Misc:  Removed __version__ and __version_info__ variables from many .py files since that is redundant (especialy the way Gate One is packaged now).
log.py:  Fixed a bug where users with unicode characters in their UPN would throw Unicode*Error exceptions.  This should close issue #332 (https://github.com/liftoff/GateOne/issues/332).
ssh_connect.py:  Fixed a bug where you could get encoding-related exceptions if a user's UPN contained unicode characters.
utils.py:  Fixed a bug in `cmd_var_swap()` where you could get encoding-related exceptions if one of the swapped variables contained unicode characters.
termio.py:  Fixed a bug where you could get encoding-related exceptions if an environment variable contained unicode characters.
Added a freeBsd init script.
automatically apply init script to bsd
Auto install init script for freeBSD
Auto intall freebsd init script
this needs to be marked as execute
INSTALL.txt:  Updated to reflect the new packaging locations and whatnot.
app_terminal.py:  Changed a couple of calls to `open()` to `io.open()` in order to standardize on utf-8 encoding.
app_terminal.py:  Simplified/enhanced the `TerminalApplication.get_bell()` method a bit to make it a bit more user-friendly.
app_terminal.py:  Changed the use of `options._options` everywhere to use the new Tornado 3.1+ API features (no need to access `._options` directly anymore).
app_terminal.py:  Changed how `logviewer.main()` gets imported so as to prevent Sphinx from throwing a ValueError exception when trying to build the docs.
app_terminal.py:  Added a little check for `self.ws.location` so you won't get a transient exception in the logs if the user disconnects the WebSocket in the middle of an operation.
server.py:  Fixed a bug where '--new_api_key' was storing generated API keys in an incorrect location.
server.py:  Changed the use of `options._options` everywhere to use the new Tornado 3.1+ API features (no need to access `._options` directly anymore).
server.py:  Added a placholder for `ApplicationWebSocket.location` so that you won't get an exception in the logs if the user disconnects in the middle of connecting to the WebSocket.
Everywhere:  The 20api_keys.conf file has been renamed to 30api_keys.conf because it was getting annoying having to type '20ap<tab>' (for autocompletion) inside of the conf.d directory.  Now you can just type '3<tab>' saving precious keystrokes.  (The problem was that 20authentication.conf also starts with '20').  This should impact absolutely nothing other than mine (and probably your) fingers.
configuration.py:  Changed the use of `options._options` everywhere to use the new Tornado 3.1+ API features (no need to access `options._options` directly anymore).
terminal.py:  Moved the log warning about the missing mutagen and/or PIL into the part of the code that actually uses these modules.  No reason to log a warning message unless people are actually trying to use that feature.
ssh_connect.py:  Added `from __future__ import unicode_literals` and switched all `u'whatever'` strings to just `'whatever'` in order to make this script truly compatible with both Python 2 and 3 simultaneously.  It also required a few minor conditionals here and there to check for `bytes`.  This should (hopefully) be the last item to fix in issue #335 (https://github.com/liftoff/GateOne/issues/335).
gateone-debian.sh:  Fixed the test for /lib/init/upstart-job (it was using -d instead of -x which is just silly and broken).  So the combination of upstart/init.d should work properly now.
setup.py:  Added support for systemd .service scripts (should be installed automatically in the correct location).
setup.py:  The path to 'gateone' will now be adjusted to an absolute path in any init scripts that get installed.
setup.py:  Added support for adding the OpenWRT init script.
Documentation:  Rebuilt the docs to reflect the latest & greatest docstrings and whatnot.
Merge pull request #329 from renecunningham/master

Call install-rpm.sh when building RPMs
Final changes to auto installing bsd init script
Merge pull request #341 from gr0undzer0/master

Added FreeBSD init script.
Improved the FreeBSD init script support in setup.py.  It will now automatically configure the exact location to the 'gateone' script based on the user's chosen installation destination.
NOTE:  YOU MAY HAVE TO REMOVE/REINSTALL GATE ONE (see setup.py notes below).
Terminal Logging plugin:  Added a check/WebSocket action that informs the client of whether or not 'session_logging' is enabled on the server.  If it isn't the "Log Viewer" button will be removed from the Terminal Application Panel.  The point being to prevent the user from always seeing an empty Log Viewer.
app_terminal.py:  Added `from __future__ import unicode_literals` to the top of the file and changed a few instances of unicode strings here and there to remove the 'u'.
app_terminal.py:  Modified `init()` slightly to ensure that all the necessary terminal settings are present before making a determination as to whether or not to generate a 50terminal.conf.
utils.py:  Commented out the warning messages about slimit and cssmin not being available to minify JS/CSS.  It's not worth having a zillion log messages repeat over and over again.
setup.py:  Switched from using `from distutils.command.install import install` to `from setuptools.command.install import install` since the former wasn't installing the console_script entry point properly.  As a result of this, the installation location has changed from site-packages/gateone to site-packages/gateone-whatever.egg.  So if you've got the former in your site-packages directory (just `find / -name server.py | grep gateone`) you'll probably have to remove it before `python setup.py install` will work properly.  You may also have to remove any reference to gateone* in your easy-install.pth file (just find / -name easy-install.pth).  How will you know if you need to do this?  If you get TypeError exceptions running `setup.py install` of course (don't you just love setuptools errors?  Ugh).
setup.py:  Removed an unnecessary systemd (--booted) check.  This should hopefully resolve issue #340 (https://github.com/liftoff/GateOne/issues/340).
setup.py:  Added support for a `--skip_init_scripts` option to skip the installation of init scripts.
gateone-gentoo.sh (Gentoo init script):  Fixed the leftover reference to gateone.py.
terminal.py:  Fixed the warnings about globals being defined earlier, blah blah.