Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/google/restor
Restor is a user-friendly application to (mass) image macOS computers from a single source
https://github.com/google/restor
Last synced: 5 days ago
JSON representation
Restor is a user-friendly application to (mass) image macOS computers from a single source
- Host: GitHub
- URL: https://github.com/google/restor
- Owner: google
- License: apache-2.0
- Archived: true
- Created: 2017-09-27T19:12:52.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-01-31T19:12:03.000Z (almost 5 years ago)
- Last Synced: 2024-08-01T22:47:59.887Z (3 months ago)
- Language: Objective-C
- Homepage:
- Size: 439 KB
- Stars: 227
- Watchers: 32
- Forks: 37
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Restor
Restor is a user-friendly application to (mass) image macOS computers from a
single source. It is an application intended to be run interactively on a
machine.You can attach the machine-to-be-imaged via Thunderbolt or USB to the machine
running Restor.Restor will cache an image once it has been downloaded for future use, and will
validate the image via SHA256. Only if the signature has changed, will the image
be downloaded again.# Example Configuration
Restor has a few configurable options, 1 of which is required. These can be
specified using a local plist (stored at `/Library/Preferences/com.google.corp.restor.plist`)
or using a Configuration Profile for the com.google.corp.restor domain.### ConfigURL
__Required__
Set the `ConfigURL` preference to point at a plist containing the images to be
used.`sudo defaults write /Library/Preferences/com.google.corp.restor.plist ConfigURL "http://server/images.plist"`
The following format for the plist is required:
```xml
Images
Name
Sierra (10.12) All Models
URL
http://server/10.12.6.dmg
SHA-256
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
```
### CustomImage
__Optional__
Set the `CustomImage` preference to toggle the use of a local custom image.
`sudo defaults write /Library/Preferences/com.google.corp.restor.plist CustomImage -bool true`
### ConfigCheckInterval
__Optional__
Set how often Restor should download and validate the image configuration in the background.
Specified in seconds, defaults to 900 (15 minutes).`sudo defaults write /Library/Preferences/com.google.corp.restor.plist ConfigCheckInterval -int 600`
### DiskFilterPredicate
__Optional__
Allows you to customize which disks will appear in the Restor UI (or that will
be imaged automatically in auto-image mode). The default predicates, which
cannot be overridden, will filter out internal disks and system volumes such
as Recovery, VM, Preboot, etc. This key allows you to specify, using
[NSPredicate](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Predicates/AdditionalChapters/Introduction.html#//apple_ref/doc/uid/TP40001789)
other disks which should not be shown to the user. You can use any of the properties
on the [Disk](https://github.com/google/restor/blob/master/Common/Disk.h#L26)
object to create your predicate.You can also pass the `--debug-disk-filters` flag to Restor.app to see what effects the predicate is having.
Examples:
* Filter out disks larger than 5TB:
```shell
sudo defaults write /Library/Preferences/com.google.corp.restor.plist DiskFilterPredicate -string \
"(diskSize < 5497558138880)"
```* Filter out disks made by Seagate:
```shell
sudo defaults write /Library/Preferences/com.google.corp.restor.plist DiskFilterPredicate -string \
"(deviceVendor != 'Seagate')"
```* Filter out disks by their id:
```shell
sudo defaults write /Library/Preferences/com.google.corp.restor.plist DiskFilterPredicate -string \
"(bsdName != 'disk3s2')"
```### ASRAttempts
__Optional__
Set how many times Restor should attempt to run ASR until it runs successfully.
This may help with issues where the Volume is not unmountable by ASR due to some
external process (ie spotlight) holding onto it. Defaults to 1.`sudo defaults write /Library/Preferences/com.google.corp.restor.plist ASRAttempts -int 5`
## 10.13 and APFS Note
In order to restore an APFS 10.13 DMG to a machine, the host machine running
Restor must also be upgraded to High Sierra 10.13. Otherwise, you will receive
an error when attempting to image the machine.## Building from source
Building Restor from source is _not_ required for general usage. Please see the
[Releases](https://github.com/google/restor/releases) page to download a
pre-compiled version of Restor.#### Requirements
* Xcode 9+ installed
* [bazel](https://bazel.build) installed
* A valid "Mac Developer" Signing Certificate from Apple
* Xcode 9+ command line tools installed#### Build steps
1. `git clone https://github.com/google/restor.git`
1. `cd restor`
1. Find your certificate's common name (CN).
```bash
security find-certificate -p -c "Mac Developer" | openssl x509 -inform pem -subject | perl -ne '/CN=([\w :\(\)]+)\// && print $1'
```
1. Edit the `.bazelrc` file, filling in your CN.
1. Build with the following command, making sure to insert a valid Team Identifier from the previous step.
```bash
bazel build //Restor
```If the build was successful the last line will contain the path to your
compiled Restor.app.## Contributing
Patches to this library are very much welcome. Please see the
[CONTRIBUTING](https://github.com/google/restor/blob/master/CONTRIBUTING.md)
file.