All Projects → cbreak-black → ZetaWatch

cbreak-black / ZetaWatch

Licence: BSD-3-Clause License
ZFS OSX Menu Bar widget

Programming Languages

Objective-C++
1391 projects
objective c
16641 projects - #2 most used programming language
C++
36643 projects - #6 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to ZetaWatch

osutil
Go library to easily detect current operating system, current Linux distribution, macOS version and more...
Stars: ✭ 22 (-80.18%)
Mutual labels:  mac
macOS-PiholeShortcuts
Manage and monitor your Pi-hole® instance through your status bar
Stars: ✭ 43 (-61.26%)
Mutual labels:  mac
iOS interviews
iOS Interviews - 史上最贴心 iOS 面试知识点分享!不只是 iOS !只为技术的执拗 !👍 全网火速更新中 🔥 期待你的讨论,期待你的 issue ! 🌟
Stars: ✭ 25 (-77.48%)
Mutual labels:  mac
UserDeviceTracker
快速定位一个IP或MAC在你的网络中的位置,是网络工程师提高工作效率的利器,也可以为CMDB提供基础网络数据。
Stars: ✭ 36 (-67.57%)
Mutual labels:  mac
autoChangeXode
一个自动修改unity生成的Xcode的脚本
Stars: ✭ 43 (-61.26%)
Mutual labels:  mac
LAPSforMac
Local Administrator Password Solution for Mac
Stars: ✭ 29 (-73.87%)
Mutual labels:  mac
soube
Music player based on electronjs
Stars: ✭ 32 (-71.17%)
Mutual labels:  mac
Mac-OS-Setup-Applications
👾 All I need to setup a new Mac and the applications I use everyday as a Web Developper
Stars: ✭ 96 (-13.51%)
Mutual labels:  mac
xbox-client-ffmpeg
Multi-platform Gamestreaming app
Stars: ✭ 17 (-84.68%)
Mutual labels:  mac
Jsonify
♨️A delightful JSON parsing framework.
Stars: ✭ 42 (-62.16%)
Mutual labels:  mac
Swift-3-Functional-Programming
Code repository for Swift 3 Functional Programming, published by Packt
Stars: ✭ 78 (-29.73%)
Mutual labels:  mac
kubernetes-zfs-provisioner
No description or website provided.
Stars: ✭ 39 (-64.86%)
Mutual labels:  zfs
PasswordX
Offline password manager for iOS/macOS
Stars: ✭ 26 (-76.58%)
Mutual labels:  mac
LogoRRR
A log viewer which visualises log events such that it is easy to identify problems or events of interest. This app was implemented using Scala and JavaFX, GluonHQ toolchain and GraalVM as platform.
Stars: ✭ 40 (-63.96%)
Mutual labels:  mac
Sensors
A macOS application displaying the thermal, voltage and current sensor values.
Stars: ✭ 70 (-36.94%)
Mutual labels:  mac
Darkorbit-client
Open source darkorbit client (cross-platform and with better performance)
Stars: ✭ 59 (-46.85%)
Mutual labels:  mac
subordination
subordination.cu.cc/
Stars: ✭ 27 (-75.68%)
Mutual labels:  mac
MacApp
网上整理Mac相关的好用应用
Stars: ✭ 35 (-68.47%)
Mutual labels:  mac
zfs exporter
Prometheus ZFS exporter
Stars: ✭ 52 (-53.15%)
Mutual labels:  zfs
isosim
ISO8583 Web Simulator - Built with Go!
Stars: ✭ 80 (-27.93%)
Mutual labels:  mac

ZetaWatch

ZetaWatch displaying pool status and filesystems

ZetaWatch is a small OS X program that displays the zfs status in the menu bar, similar to what iStat Menus does for other information. It is fairly well tested, but due to the current state of libzfs and libzfs_core, changes will be required until the API stabilizes. ZetaWatch is usually compiled for the latest available ZFS release for Mac OS, and might not be compatible with other releases.

Currently supported features are:

  • Show pool, vdev, filesystem stats
  • Show pool / filesystem properties
  • Start, stop, pause scrubs, and monitor their progress.
  • Import and Export pools manually, or auto-import when they become available
  • Mount / unmount datasets manually or at pool import automatically
  • Load/Unload encryption keys for encrypted datasets manually or automatically
  • Optionally store pass phrases in the Mac OS X Keychain
  • Create, Display, Delete, Clone Snapshots or roll back to them
  • Report errors in notification center when they are discovered

Installation

ZetaWatch Releases can be downloaded from the GitHub Releases Page. Please verify that the Version of ZetaWatch matches your ZFS Version. Usually, only the newest official Release is supported, since code changes are sometimes required to be fully compatible with the new library version.

ZetaWatch does not require manual installation. Simply copy it into /Application or where ever else it fits. The bundled helper tool gets installed automatically the first time the program is started. This requires user-authentication.

ZetaWatch supports auto updates, if enabled.

For Developers

ZFS Interaction

ZetaWatch communicates with zfs using libzfs.dylib, libzfs_core.dylib , libzpool.dylib and libnvpair.dylib, just like the command line tools do. This gives it all the flexibility of the command line tools, at the cost of having to reimplement functionality that is found in the tools and not the library. And since the libraries are explicitly not meant to provide a stable ABI, ZetaWatch is also closely coupled to the ZFS version it is built and written for.

All the ZFS interaction is wrapped in the ZFSWrapper library. This C++ library isolates the issues mentioned above and provides a more convenient and safe API than the original C interface does. The library is used both by the helper tool and the frontend app. This is the most reusable part of ZetaWatch, and might be split out as separate project later.

  • ZFSUtils contains most of the advanced functionality, such as C++ Wrappers around the library, pool, vdev or file system handles. Those classes also have functionality to query state and iterate over members.
  • ZFSNVList provides a wrapper around the nvpair_t / nvlist_t data structure that is used in ZFS for a lot of userland / kernel communication. It manages resources in both owning and non-owning fashion, and allows for easier iteration over sequences.
  • ZFSStrings translate ZFS status enums into the user facing emoji or string description, optionally with localization. (Localization is not well tested or supported at the moment.)

Helper Tool

The implementation of the helper tool follows apple's EvenBetterAuthorizationSample.

The helper tool communicates with the user application via AuthorizationService and NSXPCConnection. The application side of code for this is in ZetaAuthorization.m. The RPC protocol can be found in ZetaAuthorizationHelperProtocol.h, and is implemented in ZetaAuthorizationHelper.mm. The CommonAuthorization.m file contains the supported commands and associated default permissions.

The helper tool can be uninstalled with the uninstall-helper.sh script. This is useful for debugging the installation of the helper, or updating the helper without increasing the bundle version.

Authorization

The ZetaWatch helper tool uses the Security framework to authorize users before performing privileged operations. It currently supports the following permissions.

  • net.the-color-black.ZetaWatch.import, allowed by default, required for importing a pool.
  • net.the-color-black.ZetaWatch.export, allowed by default, required for exporting a pool.
  • net.the-color-black.ZetaWatch.mount, allowed by default, required for mounting a dataset.
  • net.the-color-black.ZetaWatch.unmount, allowed by default, required for unmounting a dataset.
  • net.the-color-black.ZetaWatch.snapshot, allowed by default, required for creating a snapshot.
  • net.the-color-black.ZetaWatch.rollback, requires admin authentication by default, required for rolling back a filesystem.
  • net.the-color-black.ZetaWatch.clone, requires admin authentication by default, required for cloning a filesystem.
  • net.the-color-black.ZetaWatch.create, requires admin authentication by default, required for creating a new filesystem.
  • net.the-color-black.ZetaWatch.destroy, requires admin authentication by default, required for destroying a filesystem or snapshot.
  • net.the-color-black.ZetaWatch.key, allowed by default, required for loading or unloading a key for a dataset. This also includes the ability to auto mount / unmount them.
  • net.the-color-black.ZetaWatch.scrub, allowed by default, required for starting, stopping or pausing scrubs.

These permissions can be manipulated via the security command line program. To inspect the current dataset creation permissions, and switching it to allow this to all users:

security authorizationdb read net.the-color-black.ZetaWatch.create
security authorizationdb write net.the-color-black.ZetaWatch.create allow

Permissions include allow, deny or authenticate-admin.

More detailed information about this topic can be found in the article apples documentation about AuthorizationServices and Managing the Authorization Database in OS X Mavericks.

Security & Code Signing

Official release builds are signed and notarized, and should run without issues even on newer Mac OS X. But there are still issues with authentication reported with the program not being recognized as signed. To verify security manually, the following commands can be used:

codesign -v -v -d ZetaWatch.app
xcrun stapler validate -v ZetaWatch.app

Building ZetaWatch requires an apple developer account with DeveloperID signing capabilities, since it uses SMJobBless to run a helper service as root. This service executes actions on behalf of the user, such as mounting, unmounting or loading a key. Notarization is required to create binaries that can be run without without warning on the newest Mac OS X.

Self Updating

The self-updating uses SparkleFramework. Since the newest released sparkle does not yet support hardened runtime, it needs to be compiled manually. Building the "Distribution" target in the Sparkle submodule in release mode is sufficient. The sparkle submodule contains a version that is slimmed down by removing most languages, which saves space. Since ZetaWatch is not localized, this is not a problem. To create a working fork, adjust the public key and update url in the Info.plist file.

ZFS Binary Compatibility

Since ZetaWatch directly links to the zfs libraries, it only works if those are compatible. And while Sparkle has built-in support for OS compatibility checking, it doesn't have the same for other dependencies. There is support for custom appcast filtering, to select a suitable version, but since the ZFS version and the ZetaWatch version are kind of orthogonal, this didn't seem fitting.

The chosen solution was to have a ZFS version specific appcast URL, and make ZetaWatch query the appropriate appcast. This allows updating ZetaWatch when the used ZFS version changes, but also have several supported parallel builds. Currently, the only supported ZFS version is 1.9.

License

This program is copyrighted by me, because I wrote it. This program is licensed under the "3-clause BSD" License. See the LICENSE.md file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].