mirror of
https://github.com/boltgolt/howdy.git
synced 2024-09-12 09:41:18 +02:00
Debian package updates
This commit is contained in:
parent
1c5dab4e1c
commit
8bedd5f2c0
4 changed files with 57 additions and 73 deletions
|
@ -9,7 +9,7 @@ Vcs-Git: https://github.com/boltgolt/howdy
|
|||
Package: howdy
|
||||
Homepage: https://github.com/boltgolt/howdy
|
||||
Architecture: amd64
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}, curl|wget, python3, python3-pip, python3-dev, python3-setuptools, libopencv-dev, cmake
|
||||
Depends: ${misc:Depends}, libc6, libgcc-s1, libpam0g, libstdc++6, curl | wget, python3, python3-pip, python3-dev, python3-setuptools, python3-numpy, python-opencv, libopencv-dev, cmake
|
||||
Recommends: libatlas-base-dev | libopenblas-dev | liblapack-dev, howdy-gtk
|
||||
Suggests: nvidia-cuda-dev (>= 7.5)
|
||||
Description: Howdy: Windows Hello style authentication for Linux.
|
||||
|
|
|
@ -40,84 +40,68 @@ def col(id):
|
|||
# Create shorthand for subprocess creation
|
||||
sc = subprocess.call
|
||||
|
||||
# We're not in fresh configuration mode so don't continue the setup
|
||||
if not os.path.exists("/tmp/howdy_picked_device"):
|
||||
# Check if we have an older config we can restore
|
||||
if len(sys.argv) > 2:
|
||||
if os.path.exists("/tmp/howdy_config_backup_v" + sys.argv[2] + ".ini"):
|
||||
# Get the config parser
|
||||
import configparser
|
||||
# If the package is being upgraded
|
||||
if "upgrade" in sys.argv:
|
||||
# If preinst has made a config backup
|
||||
if os.path.exists("/tmp/howdy_config_backup_v" + sys.argv[2] + ".ini"):
|
||||
# Get the config parser
|
||||
import configparser
|
||||
|
||||
# Load th old and new config files
|
||||
oldConf = configparser.ConfigParser()
|
||||
oldConf.read("/tmp/howdy_config_backup_v" + sys.argv[2] + ".ini")
|
||||
newConf = configparser.ConfigParser()
|
||||
newConf.read("/lib/security/howdy/config.ini")
|
||||
# Load th old and new config files
|
||||
oldConf = configparser.ConfigParser()
|
||||
oldConf.read("/tmp/howdy_config_backup_v" + sys.argv[2] + ".ini")
|
||||
newConf = configparser.ConfigParser()
|
||||
newConf.read("/lib/security/howdy/config.ini")
|
||||
|
||||
# Go through every setting in the old config and apply it to the new file
|
||||
for section in oldConf.sections():
|
||||
for (key, value) in oldConf.items(section):
|
||||
# Go through every setting in the old config and apply it to the new file
|
||||
for section in oldConf.sections():
|
||||
for (key, value) in oldConf.items(section):
|
||||
|
||||
# MIGRATION 2.3.1 -> 2.4.0
|
||||
# If config is still using the old device_id parameter, convert it to a path
|
||||
if key == "device_id":
|
||||
key = "device_path"
|
||||
value = "/dev/video" + value
|
||||
# MIGRATION 2.3.1 -> 2.4.0
|
||||
# If config is still using the old device_id parameter, convert it to a path
|
||||
if key == "device_id":
|
||||
key = "device_path"
|
||||
value = "/dev/video" + value
|
||||
|
||||
# MIGRATION 2.4.0 -> 2.5.0
|
||||
# Finally correct typo in "timout" config value
|
||||
if key == "timout":
|
||||
key = "timeout"
|
||||
# MIGRATION 2.4.0 -> 2.5.0
|
||||
# Finally correct typo in "timout" config value
|
||||
if key == "timout":
|
||||
key = "timeout"
|
||||
|
||||
# MIGRATION 2.5.0 -> 2.5.1
|
||||
# Remove unsafe automatic dismissal of lock screen
|
||||
if key == "dismiss_lockscreen":
|
||||
if value == "true":
|
||||
print("DEPRECATION: Config value dismiss_lockscreen is no longer supported because of login loop issues.")
|
||||
continue
|
||||
# MIGRATION 2.5.0 -> 2.5.1
|
||||
# Remove unsafe automatic dismissal of lock screen
|
||||
if key == "dismiss_lockscreen":
|
||||
if value == "true":
|
||||
print("DEPRECATION: Config value dismiss_lockscreen is no longer supported because of login loop issues.")
|
||||
continue
|
||||
|
||||
# MIGRATION 2.6.1 -> 3.0.0
|
||||
# Fix capture being enabled by default
|
||||
if key == "capture_failed" or key == "capture_successful":
|
||||
if value == "true":
|
||||
print("NOTICE: Howdy login image captures have been disabled by default, change the config to enable them again")
|
||||
value = "false"
|
||||
# MIGRATION 2.6.1 -> 3.0.0
|
||||
# Fix capture being enabled by default
|
||||
if key == "capture_failed" or key == "capture_successful":
|
||||
if value == "true":
|
||||
print("NOTICE: Howdy login image captures have been disabled by default, change the config to enable them again")
|
||||
value = "false"
|
||||
|
||||
# MIGRATION 2.6.1 -> 3.0.0
|
||||
# Rename config options so they don't do the opposite of what is commonly expected
|
||||
if key == "ignore_ssh":
|
||||
key = "abort_if_ssh"
|
||||
if key == "ignore_closed_lid":
|
||||
key = "abort_if_lid_closed"
|
||||
# MIGRATION 2.6.1 -> 3.0.0
|
||||
# Rename config options so they don't do the opposite of what is commonly expected
|
||||
if key == "ignore_ssh":
|
||||
key = "abort_if_ssh"
|
||||
if key == "ignore_closed_lid":
|
||||
key = "abort_if_lid_closed"
|
||||
|
||||
try:
|
||||
newConf.set(section, key, value)
|
||||
# Add a new section where needed
|
||||
except configparser.NoSectionError:
|
||||
newConf.add_section(section)
|
||||
newConf.set(section, key, value)
|
||||
try:
|
||||
newConf.set(section, key, value)
|
||||
# Add a new section where needed
|
||||
except configparser.NoSectionError:
|
||||
newConf.add_section(section)
|
||||
newConf.set(section, key, value)
|
||||
|
||||
# Write it all to file
|
||||
with open("/lib/security/howdy/config.ini", "w") as configfile:
|
||||
newConf.write(configfile)
|
||||
|
||||
# Install dlib data files if needed
|
||||
if not os.path.exists("/lib/security/howdy/dlib-data/shape_predictor_5_face_landmarks.dat"):
|
||||
print("Attempting installation of missing data files")
|
||||
handleStatus(subprocess.call(["./install.sh"], shell=True, cwd="/lib/security/howdy/dlib-data"))
|
||||
# Write it all to file
|
||||
with open("/lib/security/howdy/config.ini", "w") as configfile:
|
||||
newConf.write(configfile)
|
||||
|
||||
sys.exit(0)
|
||||
|
||||
log("Upgrading pip to the latest version")
|
||||
|
||||
# Update pip
|
||||
handleStatus(sc(["pip3", "install", "--upgrade", "pip"]))
|
||||
|
||||
log("Upgrading numpy to the latest version")
|
||||
|
||||
# Update numpy
|
||||
handleStatus(subprocess.call(["pip3", "install", "--upgrade", "numpy"]))
|
||||
|
||||
log("Downloading and unpacking data files")
|
||||
|
||||
# Run the bash script to download and unpack the .dat files needed
|
||||
|
@ -193,10 +177,6 @@ rmtree(DLIB_DIR)
|
|||
|
||||
print("Temporary dlib files removed")
|
||||
|
||||
log("Installing OpenCV")
|
||||
|
||||
handleStatus(subprocess.call(["pip3", "install", "--no-cache-dir", "opencv-python"]))
|
||||
|
||||
log("Configuring howdy")
|
||||
|
||||
# Manually change the camera id to the one picked
|
||||
|
|
|
@ -10,9 +10,13 @@ include /usr/share/dpkg/default.mk
|
|||
build:
|
||||
# Create build dir
|
||||
meson setup -Dinih:with_INIReader=true build src/pam
|
||||
# Compile shared object
|
||||
# Compile shared object
|
||||
meson compile -C build
|
||||
|
||||
clean:
|
||||
# Delete mason build directory
|
||||
rm -rf ./build
|
||||
# Force remove temp debian build directory
|
||||
rm -rf ./debian/howdy
|
||||
# Make sure subprojects get pulled locally
|
||||
meson subprojects download --sourcedir src/pam
|
||||
|
|
2
howdy/src/pam/.gitignore
vendored
2
howdy/src/pam/.gitignore
vendored
|
@ -1 +1 @@
|
|||
subprojects/*/
|
||||
subprojects/inih/
|
||||
|
|
Loading…
Reference in a new issue