Browse Source

Clear up logging, add root req. and reduce cert renewal

Joachim M. Giæver 4 years ago
parent
commit
36b374325d
3 changed files with 8 additions and 2 deletions
  1. 6 0
      scripts/bin/certs-daemon
  2. 1 1
      scripts/hooks/connect-plug-configurations
  3. 1 1
      snap/snapcraft.yaml

+ 6 - 0
scripts/bin/certs-daemon

@@ -1,9 +1,15 @@
 #!/usr/bin/env bash
 
+if [ `id -gn` != "root" ]; then
+    echo "Run as root!"
+    exit 1
+fi
+
 snapctl is-connected certs
 
 if [ $? -eq 0 ]; then
 
+    echo "See log (journal -exf --grep=snap.${SNAP_NAME}*) for result"
     DOMAIN=`snapctl get domain`
     if [ $? -ne 0 ]; then
         logger "Missing domain, use 'snap set ${SNAP_NAME} domain=<domain>'"

+ 1 - 1
scripts/hooks/connect-plug-configurations

@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-
+set -e
 snapctl set server.basepath.dir="${SNAP_COMMON}/configurations"
 snapctl set server.basepath.enforce=True
 snapctl get server | $SNAP/bin/update-settings "${SNAP_DATA}/settings.conf" update

+ 1 - 1
snap/snapcraft.yaml

@@ -25,7 +25,7 @@ apps:
     command: bin/certs-daemon
     daemon: oneshot
     restart-condition: always
-    timer: 00:00-24:00/287
+    timer: 00:00-24:00/5
     slots:
       - certs
     plugs: