@logic-joe/fleek 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,25 @@
1
+ #!/bin/sh
2
+ # Both system and user units keep D-Bus + the unlocked OS keyring in the broker's own service cgroup.
3
+ set -eu
4
+ export GNOME_KEYRING_CONTROL="$RUNTIME_DIRECTORY/keyring"
5
+ mkdir -p -m 0700 "$GNOME_KEYRING_CONTROL"
6
+ if [ "${1:-}" != --inside-private-bus ]; then
7
+ exec dbus-run-session -- "$0" --inside-private-bus "$@"
8
+ fi
9
+ shift
10
+ [ "${1:-}" = review ] && [ "${2:-}" = /etc/fleek-agents/review.json ] || exit 2
11
+ /opt/fleek-agents/unlock-keyring
12
+ # WZ-CLI-SVC: host state for Fleek every minute (contract: "Alles grün" needs a report younger than 5 minutes). Same unit, same keyring;
13
+ # KillMode=control-group ends it with the service. The unit only starts with its provider credential: "ok" unless the last
14
+ # job recorded a failed provider sign-in ("expired", file written by run-job).
15
+ (
16
+ while :; do
17
+ auth=$(cat "$STATE_DIRECTORY/provider-auth" 2>/dev/null || true)
18
+ case $auth in expired) ;; *) auth=ok ;; esac
19
+ last=$(cat "$STATE_DIRECTORY/last-job-at" 2>/dev/null || true)
20
+ case $last in [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9]Z) set -- --last-job-at "$last" ;; *) set -- ;; esac
21
+ /opt/fleek/bin/fleek service host-report --provider-auth "$auth" "$@" --json >/dev/null 2>&1 || true
22
+ sleep 60
23
+ done
24
+ ) &
25
+ exec /opt/fleek/bin/fleek listen --name review --concurrency 1 --timeout 660 --quiet-children --exec /opt/fleek-agents/run-job /etc/fleek-agents/review.json
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ set -eu
3
+ # No shell expansion of credential values, argv, files or terminal output.
4
+ exec gnome-keyring-daemon --unlock --components=secrets --control-directory="$GNOME_KEYRING_CONTROL" < "$CREDENTIALS_DIRECTORY/keyring-unlock" > /dev/null 2>&1