Browse Source

Add disconnect-plug, fix wrong setting type and add missing deps

Joachim M. Giæver 4 years ago
parent
commit
2a4b6eb3e6
3 changed files with 10 additions and 1 deletions
  1. 1 1
      scripts/bin/update-settings
  2. 6 0
      scripts/hooks/diconnect-plug-configurations
  3. 3 0
      snap/snapcraft.yaml

+ 1 - 1
scripts/bin/update-settings

@@ -25,7 +25,7 @@ conv = {
     "ALLOWED_NETWORKS": ("allowed.networks", list),
     "ALLOWED_DOMAINS": ("allowed.domains", list),
     "BANNED_IPS": ("ban.ips", list),
-    "BANLIMIT": ("ban.limit", list),
+    "BANLIMIT": ("ban.limit", int),
     "IGNORE_PATTERN": ("ignore-pattern", list),
     "DIRSFIRST": ("dirs-first", bool),
     "SESAME": ("sesame.key", str),

+ 6 - 0
scripts/hooks/diconnect-plug-configurations

@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+set -e
+snapctl set server.basepath.dir=""
+snapctl set server.basepath.enforce=False
+snapctl get server | $SNAP/bin/update-settings "${SNAP_DATA}/settings.conf" update
+snapctl restart "${SNAP_NAME}.server"

+ 3 - 0
snap/snapcraft.yaml

@@ -63,6 +63,9 @@ parts:
     plugin: python
     source: https://github.com/danielperna84/hass-configurator.git
     source-tag: ${SNAPCRAFT_PROJECT_VERSION}
+    python-packages:
+      - GitPython
+      - pyotp
     build-environment:
       - PYTHONPATH: "/usr/lib/python3/dist-packages"
     build-packages: