forked from wdas/reposado
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added intial reposado files to git repo.
- Loading branch information
Greg Neagle
committed
Apr 25, 2011
0 parents
commit f510d8f
Showing
14 changed files
with
1,720 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Copyright 2011 Disney Enterprises, Inc. All rights reserved | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in | ||
the documentation and/or other materials provided with the | ||
distribution. | ||
|
||
* The names "Disney", "Walt Disney Pictures", "Walt Disney Animation | ||
Studios" or the names of its contributors may NOT be used to | ||
endorse or promote products derived from this software without | ||
specific prior written permission from Walt Disney Pictures. | ||
|
||
Disclaimer: THIS SOFTWARE IS PROVIDED BY WALT DISNEY PICTURES AND | ||
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | ||
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS | ||
FOR A PARTICULAR PURPOSE, NONINFRINGEMENT AND TITLE ARE DISCLAIMED. | ||
IN NO EVENT SHALL WALT DISNEY PICTURES, THE COPYRIGHT HOLDER OR | ||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND BASED ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Reposado is a set of tools written in Python that replicate some of the functionality of Apple's Software Update Service, available as part of Mac OS X Server. | ||
|
||
Reposado, together with the "curl" binary tool and a web server such as Apache 2, enables one to host a local Apple Software Update Server on any hardware and OS of your choice. | ||
|
||
Reposado contains a tool (repo_sync) to download Software Update catalogs and (optionally) update packages from Apple's servers, enabling you to host them from a local web server. | ||
|
||
Additionally, Reposado provides a command-line tool (repoutil) that enables you to create any arbitrary number of "branches" of the Apple catalogs. These branches can contain any subset of the available updates. For example, one could create "testing" and "release" branches, and then set some clients to use the "testing" branch catalog to test newly-released updates. You would set most of your clients to use the "release" branch catalog, which would contain updates that had been through the testing process. | ||
|
||
If you configure Reposado to also download the actual updates as well as the catalogs, you can continue to offer updates that have been superseded by more recent updates. For example, if you are currently offering the 10.6.7 updates to your clients, and Apple releases a 10.6.8 update, you can continue to offer the (deprecated) 10.6.7 update until you are ready to release the newer update to your clients. You can even offer the 10.6.7 update to your "release" clients while offering the 10.6.8 update to your "testing" clients. Offering "deprecated" Apple Software Updates is a feature that is difficult with Apple's tools. | ||
|
||
Apple's Software Update Service does a few things. Primarily, it replicates software updates from Apple's servers, downloading them to a local machine. Secondly, it functions as a web server to actually serve these updates to client machines. Reposado does not duplicate the web server portion of Apple's Software Update Service. Instead you may use any existing web server you wish. | ||
|
||
Reposado also currently relies on the command-line "curl" binary to download updates from Apple's servers. curl is available on OS X, RedHat Linux, and many other OSes, including Win32 and Win64 versions. See http://curl.haxx.se for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Getting Started with Reposado | ||
|
||
What you need: | ||
|
||
- The Reposado tools | ||
- Python 2.5-2.7 (Reposado has been tested with Python 2.6, but should work with at least 2.5-2.7.) | ||
- curl binary | ||
- A web server | ||
- Storage space for the catalogs and update packages. If you are replicating the update packages, you'll need approximately 40GB of space as of April 2011. The need for space grows as additional updates are released by Apple. If you are only replicating catalogs, you'll probably need less than 100MB of space, though the exact amount of space needed depends on the number of branch catalogs you create. | ||
|
||
1) Download the Reposado tools. | ||
|
||
2) Create a directory in which to store replicated catalogs and updates, and another to store Reposado metadata. These may share a parent directory, like so: | ||
/Volumes/data/reposado/html | ||
/Volumes/data/reposado/metadata | ||
Make sure you have enough space for the replicated catalogs and updates. | ||
|
||
3) Configure your web server to serve the contents of the updates root directory you created ("/Volumes/data/reposado/html" in the example above). If you are planning to replicate and serve the actual update packages as well as the catalogs, make note of the URL needed to access the updates root directory via HTTP. This will be the LocalCatalogURLBase when configuring Reposado in the next step. | ||
|
||
4) Configure Reposado by creating a preferences.plist in the same directory as the repoutil script. See "reposado_preferences.txt" for details on this file. | ||
|
||
5) Run repo_sync to replicate update catalogs and (optionally) update packages to the UpdatesRootDir directory. The first time you do this it may take several hours to complete if you are replicating packages as well as catalogs. | ||
|
||
6) Test things so far by visiting a catalog URL in your browser. If http://su.myorg.com is the URL for the updates root directory you created earlier, then http://su.myorg.com/content/catalogs/others/index-leopard-snowleopard.merged-1.sucatalog | ||
is the CatalogURL for the Snow Leopard updates catalog. You should see a plist version of the updates catalog displayed in your browser. | ||
|
||
7) Next test: run softwareupdate on a client, again pointing it to your Catalog URL: | ||
|
||
softwareupdate -l --CatalogURL "http://su.myorg.com/content/catalogs/others/index-leopard-snowleopard.merged-1.sucatalog" | ||
|
||
If there are no errors, you've successfully configured Reposado and successfully replicated Apple Software Updates. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
This is a reference to the command-line options for the repoutil tool. | ||
|
||
repoutil --products [--sort <sort_key>] [--reverse] | ||
repoutil --updates [--sort <sort_key>] [--reverse] | ||
|
||
List available updates. You may optionally sort by date, title, or id, and optionally reverse the sort order. The default sort order is by post date, so that newest updates are listed last. | ||
Example: | ||
|
||
repoutil --products | ||
061-1688 Final Cut Express 2.0.3 2005-04-12 [] | ||
061-1704 iMovie HD Update 5.0.2 2005-04-14 [] | ||
061-1702 iDVD Update 5.0.1 2005-04-14 [] | ||
[...] | ||
zzz041-0453 Security Update 2011-002 1.0 2011-04-14 [] | ||
zzz041-0654 Security Update 2011-002 1.0 2011-04-14 [] | ||
zzz041-0656 Security Update 2011-002 1.0 2011-04-14 [] | ||
041-0560 Safari 5.0.5 2011-04-14 ['testing'] | ||
zzzz041-0565 Safari 5.0.5 2011-04-14 ['testing'] | ||
zzzz041-0531 iTunes 10.2.2 2011-04-18 ['testing'] | ||
zzzz041-0532 iTunes 10.2.2 2011-04-18 ['testing'] | ||
|
||
|
||
repoutil --deprecated | ||
|
||
List deprecated updates. These are updates that have been superseded by newer versions. Example: | ||
<to be generated> | ||
|
||
repoutil --branches | ||
|
||
List available branch catalogs. Example: | ||
|
||
repoutil --branches | ||
release | ||
testing | ||
|
||
repoutil --new-branch BRANCH_NAME | ||
|
||
Creates a new empty branch named BRANCH_NAME. Example: | ||
|
||
repoutil --new-branch testing | ||
|
||
repoutil --delete-branch BRANCH_NAME | ||
|
||
Deletes the branch named BRANCH_NAME. | ||
|
||
repoutil --copy-branch SOURCE_BRANCH DEST_BRANCH | ||
|
||
Copies all items from SOURCE_BRANCH to DEST_BRANCH, completely replacing the contents of DEST_BRANCH with the contents of SOURCE_BRANCH. If DEST_BRANCH does not exist, it will be created. | ||
|
||
repoutil --list-branch BRANCH_NAME [--sort <sort_key>] [--reverse] | ||
repoutil --list-catalog BRANCH_NAME [--sort <sort_key>] [--reverse] | ||
|
||
List updates in branch BRANCH_NAME. You may optionally sort these. | ||
|
||
repoutil--list-branch testing | ||
zzzz041-0565 Safari 5.0.5 2011-04-14 ['testing'] | ||
041-0560 Safari 5.0.5 2011-04-14 ['testing'] | ||
zzzz041-0532 iTunes 10.2.2 2011-04-18 ['testing'] | ||
zzzz041-0531 iTunes 10.2.2 2011-04-18 ['testing'] | ||
|
||
repoutil --product-info PRODUCT_ID | ||
repoutil --info PRODUCT_ID | ||
|
||
Prints detailed info on a specific update. Example: | ||
|
||
repoutil --info 041-0560 | ||
Product: 041-0560 | ||
Title: Safari | ||
Version: 5.0.5 | ||
Size: 47.1 MB | ||
Post Date: 2011-04-14 17:13:16 | ||
AppleCatalogs: | ||
http://swscan.apple.com/content/catalogs/index.sucatalog | ||
http://swscan.apple.com/content/catalogs/others/index-leopard.merged-1.sucatalog | ||
http://swscan.apple.com/content/catalogs/others/index-leopard-snowleopard.merged-1.sucatalog | ||
Branches: | ||
testing | ||
HTML Description: | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<meta http-equiv="Content-Style-Type" content="text/css"> | ||
<title></title> | ||
<style type="text/css"> | ||
body { font: 11.0px "Lucida Grande"; } | ||
p { margin-left: 0.0px; margin-top: 0.0px; } | ||
</style> | ||
</head> | ||
<body> | ||
<p>This update is recommended for all Safari users and includes the latest security updates.</p> | ||
|
||
<p>For information on the security content of this update, please visit this website: <a href = 'http://support.apple.com/kb/HT1222'>http://support.apple.com/kb/HT1222</a>.</p> | ||
</p> | ||
</body> | ||
</html> | ||
|
||
|
||
repoutil --add-product PRODUCT_ID [PRODUCT_ID ...] BRANCH_NAME | ||
repoutil --add-update=PRODUCT_ID [PRODUCT_ID ...] BRANCH_NAME | ||
repoutil --add=PRODUCT_ID [PRODUCT_ID ...] BRANCH_NAME | ||
|
||
Add one or more PRODUCT_IDs to catalog branch BRANCH_NAME. | ||
|
||
repoutil --remove-product=PRODUCT_ID [PRODUCT_ID ...] BRANCH_NAME | ||
|
||
Remove one or more PRODUCT_IDs from catalog branch BRANCH_NAME. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
A basic guide to Reposado operation. | ||
|
||
See "getting_started.txt" for initial setup, configuration, and testing. | ||
|
||
Once you have successfully set up and configured Reposado, you have a local mirror of Apple's Software Update servers. Your clients can use the locally mirrored catalogs (and optionally, update packages) for Apple updates. | ||
|
||
You'll almost certainly want to run the repo_sync tool periodically to download catalog and package updates. The exact mechanism by which you might do this varies from platform to platform. On a Linux or other flavor of Unix machine, you'd typically add a cron job to do this. You may also do this on OS X or OS X Server, or you can implement a periodic job, or a launchd task. You may run this as frequently or infrequently as you wish, but Apple's tools sync with Apple once a day, so you might consider that as a guide. | ||
|
||
If all you want or need is a local replica of Apple's Software Updates in order to conserve your organization's Internet bandwidth usage, you need not do anything other than the tasks of the initial configuration and setting up periodic execution of the sync script. If you'd like to be able to manage which updates are made available to your client machines, the repoutil tool provides the means to do so. | ||
|
||
CatalogURLs | ||
|
||
By default, Reposado replicates three update catalogs from Apple's servers: | ||
|
||
http://swscan.apple.com/content/catalogs/index.sucatalog | ||
http://swscan.apple.com/content/catalogs/others/index-leopard.merged-1.sucatalog | ||
http://swscan.apple.com/content/catalogs/others/index-leopard-snowleopard.merged-1.sucatalog | ||
|
||
These are the update catalogs for Tiger, Leopard, and Snow Leopard clients, respectively. You may point any or all of your client machines to the replicated versions of these catalogs. The clients will get the latest updates from Apple as soon as they've been replicated to your Reposado server. | ||
|
||
If you'd like to control the availability of updates, you must create "branch" catalogs, which contain subsets of the available updates. You then point some or all of your clients to these branch catalogs instead of the "raw" catalogs that come from Apple. | ||
|
||
Creating branch catalogs | ||
|
||
Start by creating an empty branch: | ||
|
||
repoutil --new-branch testing | ||
|
||
This creates a new, empty branch named "testing". This name is appended to the "raw" apple catalog names, so that the CatalogURLs become something like: | ||
|
||
http://su.myorg.com/content/catalogs/index_testing.sucatalog | ||
http://su.myorg.com/content/catalogs/others/index-leopard.merged-1_testing.sucatalog | ||
http://su.myorg.com/content/catalogs/others/index-leopard-snowleopard.merged-1_testing.sucatalog | ||
|
||
..but not until you've added something to the testing branch. | ||
|
||
Adding products to a branch catalog | ||
|
||
Get a list of products: | ||
|
||
repoutil --products | ||
...long list omitted for brevity... | ||
041-0560 Safari 5.0.5 2011-04-14 [] | ||
zzzz041-0565 Safari 5.0.5 2011-04-14 [] | ||
zzzz041-0531 iTunes 10.2.2 2011-04-18 [] | ||
zzzz041-0532 iTunes 10.2.2 2011-04-18 [] | ||
|
||
Add both Safaris and iTunes to testing: | ||
|
||
repoutil --add-product 041-0560 zzzz041-0565 zzzz041-0531 zzzz041-0532 testing | ||
Adding 041-0560 (Safari-5.0.5) to branch testing... | ||
Adding zzzz041-0565 (Safari-5.0.5) to branch testing... | ||
Adding zzzz041-0531 (iTunes-10.2.2) to branch testing... | ||
Adding zzzz041-0532 (iTunes-10.2.2) to branch testing... | ||
|
||
And now the testing catalogs are available at URLs similar to those listed above, and the testing catalogs offer only Safari and iTunes. | ||
|
||
Removing products from a branch catalog | ||
|
||
You can remove products from branch catalogs: | ||
|
||
repoutil --remove-product zzzz041-0531 zzzz041-0532 testing | ||
Removing zzzz041-0531 (iTunes-10.2.2) from branch testing... | ||
Removing zzzz041-0532 (iTunes-10.2.2) from branch testing... | ||
|
||
would remove both iTunes 10.2.2. | ||
|
||
You can list the contents of branch catalogs: | ||
|
||
repoutil --list-branch testing | ||
041-0560 Safari 5.0.5 2011-04-14 ['testing'] | ||
zzzz041-0565 Safari 5.0.5 2011-04-14 ['testing'] | ||
|
||
and copy one branch to another: | ||
|
||
repoutil --copy-branch testing release | ||
Really replace contents of branch release with branch testing? [y/n] y | ||
Copied contents of branch testing to branch release. | ||
|
||
One possible branch catalog workflow | ||
|
||
A very small number of your machines are configured to use the "raw" catalogs from Apple. As new updates are released, after a short delay (a day or so?) you add them to the "testing" branch. Your "testing" group of machines are configured to use the "testing" CatalogURLs for their updates. After a time of testing to make sure there are no issues, you add new updates to the "release" branch. Most machines in your organization are configured to use the "release" CatalogURLs. | ||
|
||
In this way, new updates are tested before being released to the majority of your machines. | ||
|
||
Another use for branch catalogs: if you had a set of machines that must remain on a specific OS release for compatibility with a specific application, you could create one or more special branch catalogs that contained no Mac OS X updates, but only updates to Safari, iTunes, the iLife and iWork apps. In this way you could update the other applications while leaving the OS itself at a specific version. | ||
|
||
Deprecated products | ||
|
||
Items from Apple's Software Update service can become "deprecated". This commonly occurs when a newer version of an update is made available. For example, when Apple releases a new update to iTunes, all older iTunes updates are deprecated and no longer available from Apple's Software Update servers. Similarly, new updates for Mac OS X cause older updates to be deprecated. | ||
|
||
This behavior can sometimes present problems for system administrators. Let's say you had made the 10.6.6 update available to all the machines you manage, and some had updated and some had not yet. Apple then released the Mac OS X 10.6.7 update, which causes the 10.6.6 update to disappear from Apple's update servers. If you are not ready to move to Mac OS X 10.6.7 (because you need testing time), but some of your machines are still running 10.6.5 or earlier, if you are using Apple's Software Update Service there is no way to update those machines to 10.6.6 using Apple's tools. | ||
|
||
However, Reposado caches all updates it downloads from Apple and does not automatically remove deprecated updates. This enables you to continue to offer deprecated updates in a branch catalog until you are ready to replace the deprecated update with the new version. | ||
|
||
This feature is also a responsibility -- it is the admin's responsibility to remove deprecated products from branch catalogs when adding their updated versions to the same branch. Deprecated products are tagged as such in product listings: | ||
|
||
repoutil --list-branch testing | ||
zzzz061-9636 iTunes 10.2 2011-03-02 ['release', 'testing'] (Deprecated) | ||
zzzz041-0306 iTunes 10.2 2011-03-02 ['release', 'testing'] (Deprecated) | ||
|
||
When adding a newer version of iTunes to the testing or release branches, you'd want to be certain to remove these older, deprecated versions. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
Reposado's configuration is defined in a plist file named "preferences.plist" located in the same directory as the repoutil script. | ||
|
||
Two key/values are required: | ||
|
||
UpdatesRootDir: a string providing a path where the catalogs and update packages should be stored. Example: /Volumes/data/reposado/html | ||
|
||
UpdatesMetadataDir: a string providing a path where metadata used by reposado should be should be stored. Example: /Volumes/data/reposado/metadata | ||
|
||
If you are replicating the updates as well as the catalogs, you must also include: | ||
|
||
LocalCatalogURLBase | ||
This is the "root" URL for your local Software Update repo. Reposado will re-write all product URLs in the update catalogs to use this root URL. For example, a LocalCatalogURLBase of "http://su.myorg.com" will result in a Snow Leopard update catalog URLs like: | ||
|
||
http://su.myorg.com/content/catalogs/others/index-leopard-snowleopard.merged-1.sucatalog | ||
|
||
If LocalCatalogURLBase is undefined, only Apple catalogs will be replicated and the URLs will not be re-written. This allows you to have custom catalogs for Apple Software Update, but clients will still download the actual update packages from Apple's servers. If Reposado is configured this way, you will not be able to offer deprecated updates to clients. | ||
|
||
Optional keys: | ||
|
||
AppleCatalogURLs | ||
This is an array of strings that specify the Apple SUS catalog URLs to replicate. If this is undefined, it defaults to: | ||
|
||
['http://swscan.apple.com/content/catalogs/index.sucatalog', | ||
'http://swscan.apple.com/content/catalogs/others/index-leopard.merged-1.sucatalog', | ||
'http://swscan.apple.com/content/catalogs/others/index-leopard-snowleopard.merged-1.sucatalog'] | ||
|
||
PreferredLocalizations | ||
A list of preferred language localizations for software update descriptions. Defaults to ['English', 'en']. | ||
|
||
CurlPath | ||
Path to the curl binary tool. Defaults to '/usr/bin/curl' | ||
|
||
Example preferences.plist: | ||
|
||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>LocalCatalogURLBase</key> | ||
<string>http://su.myorg.com</string> | ||
<key>UpdatesRootDir</key> | ||
<string>/Volumes/data/reposado/html</string> | ||
<key>UpdatesMetadataDir</key> | ||
<string>/Volumes/data/reposado/metadata</string> | ||
</dict> | ||
</plist> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.