forked from longtao.wu/droboticflow
📦 Harden drosync Linux packages
This commit is contained in:
parent
4e5166fe84
commit
eaec4c2cdc
@ -11,6 +11,14 @@ as root:
|
||||
sudo ./install-systemd-portable.sh --enable
|
||||
```
|
||||
|
||||
The portable binaries require Ubuntu's `libdbus-1-3` runtime package for the
|
||||
OS credential-store integration. Install it before running the installer:
|
||||
|
||||
```bash
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ca-certificates libdbus-1-3
|
||||
```
|
||||
|
||||
The installer uses `/opt/drosync` by default, creates the restricted `drosync`
|
||||
system account and `/var/lib/drosync`, writes `/etc/systemd/system/drosync.service`,
|
||||
and does not store access credentials. Configure credentials through the CLI or
|
||||
|
||||
@ -62,6 +62,10 @@ cp "$ROOT_DIR/packaging/linux/drosync.service" "$PACKAGE_ROOT/lib/systemd/system
|
||||
cp "$ROOT_DIR/packaging/linux/drosync-user.service" "$PACKAGE_ROOT/usr/lib/systemd/user/drosync.service"
|
||||
mkdir -p "$OUTPUT_DIR"
|
||||
dpkg-deb --root-owner-group --build "$PACKAGE_ROOT" "$OUTPUT_DIR/drosync_${VERSION}_${ARCH}.deb"
|
||||
(
|
||||
cd "$OUTPUT_DIR"
|
||||
sha256sum "drosync_${VERSION}_${ARCH}.deb" >"drosync_${VERSION}_${ARCH}.deb.sha256"
|
||||
)
|
||||
if [[ -n "${DROSYNC_DEB_SIGN_KEY:-}" ]]; then
|
||||
dpkg-sig --sign builder -k "$DROSYNC_DEB_SIGN_KEY" "$OUTPUT_DIR/drosync_${VERSION}_${ARCH}.deb"
|
||||
fi
|
||||
|
||||
@ -56,7 +56,10 @@ chmod 0755 "$PACKAGE_ROOT/install-systemd-portable.sh" "$PACKAGE_ROOT/uninstall-
|
||||
ARCHIVE="$OUTPUT_DIR/drosync-${VERSION}-${PLATFORM_KEY}.tar.gz"
|
||||
tar --sort=name --mtime='@0' --owner=0 --group=0 --numeric-owner \
|
||||
-C "$STAGE" -czf "$ARCHIVE" "$PACKAGE_NAME"
|
||||
sha256sum "$ARCHIVE" >"$ARCHIVE.sha256"
|
||||
(
|
||||
cd "$OUTPUT_DIR"
|
||||
sha256sum "$(basename "$ARCHIVE")" >"$(basename "$ARCHIVE").sha256"
|
||||
)
|
||||
if [[ -n "${DROSYNC_GPG_SIGN_KEY:-}" ]]; then
|
||||
gpg --batch --yes --local-user "$DROSYNC_GPG_SIGN_KEY" --detach-sign --armor "$ARCHIVE"
|
||||
fi
|
||||
|
||||
@ -4,7 +4,7 @@ Section: utils
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
Maintainer: D-Robotics <support@example.invalid>
|
||||
Depends: ca-certificates, debsig-verify, libsecret-1-0
|
||||
Depends: ca-certificates, debsig-verify, libdbus-1-3, libsecret-1-0
|
||||
Description: Secure one-way local-to-BOS synchronization client
|
||||
drosync provides a CLI, daemon, crash recovery, and signed updates. Some
|
||||
packages additionally include an optional tray GUI.
|
||||
|
||||
@ -48,6 +48,11 @@ for binary in drosync drosync-daemon; do
|
||||
}
|
||||
done
|
||||
|
||||
if ! ldconfig -p 2>/dev/null | grep -Fq 'libdbus-1.so.3'; then
|
||||
echo "missing runtime dependency libdbus-1.so.3; install it with: apt-get install libdbus-1-3" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! getent group drosync >/dev/null 2>&1; then
|
||||
groupadd --system drosync
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user