diff --git a/.travis.yml b/.travis.yml index 211962b..bbd8344 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,6 @@ script: # Check if the username passthough works correctly with sudo - 'howdy | ack-grep --passthru --color "current active user: travis"' - 'sudo howdy | ack-grep --passthru --color "current active user: travis"' - - sudo howdy list # Remove howdy from the installation - sudo apt purge howdy -y diff --git a/README.md b/README.md index 12b54a1..62918c5 100644 --- a/README.md +++ b/README.md @@ -14,15 +14,17 @@ sudo apt update sudo apt install howdy ``` +**Note:** The build of dlib can hang on 100% for over a minute, give it time. + This will guide you through the installation. When that's done run `sudo howdy add` to add a face model. If nothing went wrong we should be able to run sudo by just showing your face. Open a new terminal and run `sudo -i` to see it in action. -**Note:** The build of dlib can hang on 100% for over a minute, give it time. +If you're curious you can run `sudo howdy config` to open the central config file and see the options Howdy has. ### Command line -The installer adds a `howdy` command to manage face models for the current user. Use `howdy --help` to list the available options. +The installer adds a `howdy` command to manage face models for the current user. Use `howdy --help` or `man howdy` to list the available options. Usage: ``` @@ -31,12 +33,12 @@ howdy [-U user] [-y] command [argument] | Command | Description | |-----------|-----------------------------------------------| -| `add` | Add a new face model for the given user | -| `clear` | Remove all face models for the given user | -| `config` | Open the config file in nano | +| `add` | Add a new face model for an user | +| `clear` | Remove all face models for an user | +| `config` | Open the config file in gedit | | `disable` | Disable or enable howdy | -| `list` | List all saved face models for the given user | -| `remove` | Remove a specific model for the given user | +| `list` | List all saved face models for an user | +| `remove` | Remove a specific model for an user | | `test` | Test the camera and recognition methods | ### Troubleshooting diff --git a/debian/changelog b/debian/changelog index a8959b9..b9f4dda 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,21 @@ +howdy (2.0.1) xenial; urgency=medium + + * First complete PPA release + + -- boltgolt Fri, 13 Apr 2018 22:22:27 +0200 + +howdy (2.0.0-alpha+4) xenial; urgency=medium + + * Reworked CLI + + -- boltgolt Fri, 13 Apr 2018 22:07:27 +0200 + howdy (2.0.0-alpha+3) xenial; urgency=medium * Fixed issue where dlib dependency failed to install on some installations * Added preinst script for camera detection - -- boltgolt Thu, 12 Apr 2018 21:42:42 +0000 + -- boltgolt Thu, 12 Apr 2018 21:42:42 +0200 howdy (2.0.0-alpha+2) xenial; urgency=medium diff --git a/debian/howdy.1 b/debian/howdy.1 index 8d3d47b..7254e43 100644 --- a/debian/howdy.1 +++ b/debian/howdy.1 @@ -6,26 +6,42 @@ howdy \- Windows Hello style authentication for Ubuntu Howdy IR face recognition implements a PAM module to use your face as a authentication method. .SS "Usage:" .IP -howdy [user] [argument] +howdy [\-U USER] [\-y] [\-h] command [argument] .SS "Commands:" .TP -help -Show this help page -.TP -list -List all saved face models for the current user -.TP add -Add a new face model for the current user -.TP -remove -Remove a specific model +Add a new face model for an user. .TP clear -Remove all face models for the current user +Remove all face models for an user. +.TP +config +Open the config file in gedit. +.TP +disable +Disable or enable howdy. +.TP +list +List all saved face models for an user. +.TP +remove +Remove a specific model for an user. +.TP +clear +Remove all face models for an user. .TP test -Test the camera and recognition methods +Test the camera and recognition methods. +.SS "Optional arguments:" +.TP +\fB\-U\fR USER, \fB\-\-user\fR USER +Set the user account to use. +.TP +\fB\-y\fR +Skip all questions. +.TP +\fB\-h\fR, \fB\-\-help\fR +Show this help message and exit. .PP .SH AUTHOR Howdy was written by boltgolt. For more information visit https://github.com/Boltgolt/howdy diff --git a/src/cli.py b/src/cli.py index 3b1640f..8ec350a 100755 --- a/src/cli.py +++ b/src/cli.py @@ -23,11 +23,6 @@ if user == "root" or user == "": else: user = env_user -# Check if we have rootish rights -if os.getenv("SUDO_USER") is None: - print("Please run this command with sudo") - sys.exit(1) - # Basic command setup parser = argparse.ArgumentParser(description="Command line interface for Howdy face authentication.", formatter_class=argparse.RawDescriptionHelpFormatter, @@ -75,6 +70,12 @@ args = parser.parse_args() builtins.howdy_args = args builtins.howdy_user = args.user +# Check if we have rootish rights +# This is this far down the file so running the command for help is always possible +if os.getenv("SUDO_USER") is None: + print("Please run this command with sudo") + sys.exit(1) + # Beond this point the user can't change anymore, if we still have root as user we need to abort if args.user == "root": print("Can't run howdy commands as root, please run this command with the --user flag")