Browse Source

Change to symlink of lock, since it might not (and shouldnt) exists

Joachim M. Giæver 2 years ago
parent
commit
8a600878f2
3 changed files with 6 additions and 6 deletions
  1. 1 1
      snap/snapcraft.yaml
  2. 2 3
      src/helper/env-wrapper
  3. 3 2
      src/helper/functions

+ 1 - 1
snap/snapcraft.yaml

@@ -69,7 +69,7 @@ layout:
   /usr/local/share/.yarn:
     symlink: $SNAP/lib/node_modules
   $SNAP/lib/node_modules/zwavejs2mqtt/package.json.lock:
-    bind-file: $SNAP/lib/node_modules/zwavejs2mqtt/package.json.lock
+    symlink: $SNAP/lib/node_modules/zwavejs2mqtt/package.json.lock
   # Not needed anymore as of ZWAVEJS_EXTERNAL_CONFIG ?
   # $SNAP/lib/node_modules/zwavejs2mqtt/node_modules/@zwave-js/config:
   #   bind: $SNAP/lib/node_modules/zwavejs2mqtt/node_modules/@zwave-js/config

+ 2 - 3
src/helper/env-wrapper

@@ -92,9 +92,8 @@ export USE_SECURE_COOKIE=$(snapctl get session.cookie-secure)
 if [ "${HTTPS}" != true ]; then
     unset HTTPS
     unset SERVER_SSL
-fi
-
-if [ "${USE_SECURE_COOKIE}" != true ]; then
+    unset USE_SECURE_COOKIE
+elif [ "${USE_SECURE_COOKIE}" != true ]; then
     unset USE_SECURE_COOKIE
 fi
 

+ 3 - 2
src/helper/functions

@@ -105,9 +105,10 @@ function testnset_config {
 
 function test_default_config {
     testnset_config "server.ssl" false
+    testnset_config "session.cookie-secure" $(snap get server.ssl)
+    testnset_config "session.secret" $(uuid)
+
     testnset_config "server.host" "localhost"
     testnset_config "server.port" 8091
 
-    testnset_config "session.cookie-secure" false
-    testnset_config "session.secret" $(uuid)
 }