Skip to content

Commit

Permalink
Merge remote-tracking branch 'boltgolt/beta' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
tokox committed Jan 17, 2024
2 parents 5fd4216 + 344eb34 commit a033b10
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 19 deletions.
40 changes: 39 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ This will guide you through the installation.
Download the .deb file from the [Releases page](https://github.com/boltgolt/howdy/releases) and install with gdebi.

### Arch Linux

_Maintainer wanted._

Install the `howdy` package from the AUR. For AUR installation instructions, take a look at this [wiki page](https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages).

You will need to do some additional configuration steps. Please read the [ArchWiki entry](https://wiki.archlinux.org/index.php/Howdy) for more information.

### Fedora

_Maintainer: [@luyatshimbalanga](https://github.com/luyatshimbalanga)_

The `howdy` package is available as a [Fedora COPR repository](https://copr.fedorainfracloud.org/coprs/principis/howdy/), install it by simply executing the following commands in a terminal:
Expand All @@ -64,10 +66,45 @@ sudo dnf --refresh install howdy
See the link to the COPR repository for detailed configuration steps.

### openSUSE

_Maintainer: [@dmafanasyev](https://github.com/dmafanasyev)_

Go to the [openSUSE wiki page](https://en.opensuse.org/SDB:Facial_authentication) for detailed installation instructions.

### Building from source

If you want to build Howdy from source, a few dependencies are required.

#### Dependencies

- Python 3.6 or higher
* pip
* setuptools
* wheel
- meson version 0.64 or higher
- ninja
- INIReader (can be pulled from git automatically if not found)
- libevdev

To install them on Debian/Ubuntu for example:

```
sudo apt-get update && sudo apt-get install -y \
python3 python3-pip python3-setuptools python3-wheel \
cmake make build-essential \
libpam0g-dev libinih-dev libevdev-dev \
python3-dev libopencv-dev
```

#### Build

```sh
meson setup build
meson compile -C build
```

You can also install Howdy to your system with `meson install -C build`.

## Setup

After installation, Howdy needs to learn what you look like so it can recognise you later. Run `sudo howdy add` to add a face model.
Expand Down Expand Up @@ -107,7 +144,8 @@ Code contributions are also very welcome. If you want to port Howdy to another d

Any Python errors get logged directly into the console and should indicate what went wrong. If authentication still fails but no errors are printed, you could take a look at the last lines in `/var/log/auth.log` to see if anything has been reported there.

If you encounter an error that hasn't been reported yet, don't be afraid to open a new issue.
Please first check the [wiki on common issues](https://github.com/boltgolt/howdy/wiki/Common-issues) and
if you encounter an error that hasn't been reported yet, don't be afraid to open a new issue.

## A note on security

Expand Down
3 changes: 1 addition & 2 deletions howdy-gtk/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ if get_option('install_in_site_packages')
sources,
py_paths,
subdir: 'howdy-gtk',
install_mode: 'r--r--r--',
install_tag: 'py_sources',
)
else
Expand Down Expand Up @@ -79,4 +78,4 @@ install_data(
install_mode: 'rwxr-xr-x',
install_dir: get_option('prefix') / get_option('bindir'),
install_tag: 'bin',
)
)
5 changes: 1 addition & 4 deletions howdy-gtk/src/main.glade
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,11 @@
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">1</property>
Expand Down
9 changes: 6 additions & 3 deletions howdy-gtk/src/onboarding.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def __init__(self):
self.builder.connect_signals(self)

self.window = self.builder.get_object("onboardingwindow")
self.slidecontainer = self.builder.get_object("slidecontainer")
self.nextbutton = self.builder.get_object("nextbutton")

self.slides = [
Expand All @@ -53,6 +54,8 @@ def go_next_slide(self, button=None):
self.slides[self.window.current_slide].hide()
self.slides[self.window.current_slide + 1].show()
self.window.current_slide += 1
# the shown child may have zero/wrong dimensions
self.slidecontainer.queue_resize()

if self.window.current_slide == 1:
self.execute_slide1()
Expand Down Expand Up @@ -119,10 +122,10 @@ def is_gray(frame):
except Exception:
self.show_error(_("Error while importing OpenCV2"), _("Try reinstalling cv2"))

device_ids = os.listdir("/dev/v4l/by-path")
device_rows = []

if not device_ids:
try:
device_ids = os.listdir("/dev/v4l/by-path")
except Exception:
self.show_error(_("No webcams found on system"), _("Please configure your camera yourself if you are sure a compatible camera is connected"))

# Loop though all devices
Expand Down
2 changes: 2 additions & 0 deletions howdy-gtk/src/tab_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ def on_user_add(self, button):


def on_model_add(self, button):
if self.userlist.items == 0:
return
# Open question dialog
dialog = gtk.MessageDialog(parent=self, flags=gtk.DialogFlags.MODAL, type=gtk.MessageType.QUESTION, buttons=gtk.ButtonsType.OK_CANCEL)
dialog.set_title(_("Confirm Model Creation"))
Expand Down
5 changes: 3 additions & 2 deletions howdy-gtk/src/tab_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@

def on_page_switch(self, notebook, page, page_num):
if page_num == 1:
path = "/dev/video1"

try:
self.config = configparser.ConfigParser()
self.config.read(paths_factory.config_file_path())
except Exception:
print(_("Can't open camera"))

path = self.config.get("video", "device_path")

try:
# if not self.cv2:
import cv2
Expand All @@ -30,7 +31,7 @@ def on_page_switch(self, notebook, page, page_num):
print(_("Can't import OpenCV2"))

try:
self.capture = cv2.VideoCapture(self.config.get("video", "device_path"))
self.capture = cv2.VideoCapture(path)
except Exception:
print(_("Can't open camera"))

Expand Down
1 change: 0 additions & 1 deletion howdy/src/autocomplete/howdy.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
_howdy() {
local cur prev opts
local config_path="@config_path@"
source _variables
COMPREPLY=()
# The argument typed so far
cur="${COMP_WORDS[COMP_CWORD]}"
Expand Down
5 changes: 4 additions & 1 deletion howdy/src/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Import required modules
import sys
import os
import pwd
import getpass
import argparse
import builtins
Expand All @@ -13,8 +14,10 @@
# Try to get the original username (not "root") from shell
sudo_user = os.environ.get("SUDO_USER")
doas_user = os.environ.get("DOAS_USER")
pkexec_uid = os.environ.get("PKEXEC_UID")
pkexec_user = pwd.getpwuid(int(pkexec_uid))[0] if pkexec_uid else ""
env_user = getpass.getuser()
user = next((u for u in [sudo_user, doas_user, env_user] if u), "")
user = next((u for u in [sudo_user, doas_user, pkexec_user, env_user] if u), "")

# If that fails, error out
if user == "":
Expand Down
3 changes: 1 addition & 2 deletions howdy/src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ if get_option('install_in_site_packages')
py_sources,
subdir: 'howdy',
preserve_path: true,
install_mode: 'r--r--r--',
install_tag: 'py_sources',
)
else
Expand Down Expand Up @@ -167,4 +166,4 @@ install_data(
install_mode: 'rwxr-xr-x',
install_dir: get_option('bindir'),
install_tag: 'bin',
)
)
4 changes: 2 additions & 2 deletions howdy/src/pam/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Howdy PAM module

## Prepare
## Requirements

This module depends on `INIReader` and `libevdev`.
They can be installed with these packages:
Expand All @@ -19,7 +19,7 @@ it will be automatically pulled from git at the subproject's pinned version.

``` sh
meson setup build
ninja -C build
ninja -C build # or meson compile -C build
```

## Install
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ paths_dict = {
'log_path': logpath,
}

# We need to keep this order beause howdy-gtk defines the gtk script path
# We need to keep this order beause howdy-gtk defines the gtk script path which is used later in howdy
subdir('howdy-gtk')
subdir('howdy')

0 comments on commit a033b10

Please sign in to comment.