stork logo
Using Stork

Using Stork with your own repository

The Stork Repository is capable of hosting both metadata (information about packages) and the contents of the packages themselves.

However, for those people who already have a their own repository it is possible to use the Stork repository to host the metadata only, while continuing to use your own repository to provide access to the packages themselves. For this example, we will assume that you have a web-accessible repository at http://www.myrepository.com/packages/.

Using a custom repository involves several steps:

  1. Generate the .metadata files for your packages
  2. Upload the .metadata files to the stork repository
  3. Add the .metadata files to your trusted packages file
  4. Upload the trusted packages file to the stork repository

Step 1: Generating .metadata files

Metadata files are generated using the storkutil program. You will need access to the packages that you intend to make available, as storkutil needs to analyze the packages to generate the metadata and hashes. The following command will generate a .metadata file:

./storkutil.py extractmeta --baseurl <baseurl> <filename>

<filename> is the name of the package in your local file system, and is the file that storkutil will analyze to extract the metadata from.

<baseurl> is the URL of the directory where the file can be downloaded from. For example, if your package is at http://www.myrepository.com/packages/mypackage.rpm, then the baseurl is http://www.myrepository.com/packages. The baseurl is used by the clients when they need to fetch the package. Storkutil does not fetch the package from your server during metadata extraction as it can perform the analysis from the local copy of the file.

For example, assuming your files are hosted on your local machine in /var/www/html/packages and are available on the web at http://www.myrepository.com/packages, the following would generate metadata for the package amanda-2.4.5-2:

./storkutil.py extractmeta --baseurl http://www.myrepository.com/packages /var/www/html/packages/amanda-2.4.5-2.i386.rpm

This command will generate a file in the current working directory called amanda-2.4.5-2.i386.rpm.metadata that contains the metadata extracted from the package. This file may then be uploaded to the stork repository.

You may also generate metadata for a large number of packages at once by using a wildcard filename. For example:

./storkutil.py extractmeta --baseurl http://www.myrepository.com/packages /var/www/html/packages/*.rpm

Step 2: Upload .metadata files to the stork repository

Uploading a metadata file is the similar to upload a package to the stork repository. The difference is that rather than uploading the package itself, you are only uploading a metadata file, with an embedded URL to your own repository.

  1. Open the following url in your browser: https://stork-repository.cs.arizona.edu
  2. Log in
  3. Click the 'packages' link
  4. Enter the name of your .metadata file (for example, amanda-2.4.5-2.i386.rpm.metadata)
  5. Click the <Upload> button

Step 3: Add .metadata files to your trusted packages files

The trusted packages file (tpfile) contains a list of the packages that you trust. It is essential to maintaining security, and described in the Stork Tutorial.

Adding metadata to your tpfile is similar to adding packages to your tpfile. Instead of adding the package itself (i.e. a .rpm file), you will add the .metadata file.

For example,

./storkutil.py addfile amanda-2.4.5-2.i386.rpm.metadata

Step 4: Upload the trusted packages file to the stork repository

In the previous step, you modified your trusted packages file to include the new metadata files that you created. In order for the new tpfile to be available to clients, you need toupload it to the stork repository.

  1. Open the following url in your browser: https://stork-repository.cs.arizona.edu
  2. Log in
  3. Click the 'trusted packages files' link
  4. Enter the name of your trusted packages file
  5. Click the <Upload> button

Conclusion

Now that you have completed the above steps, the stork repository should be hosting the metadata for your packages.

 

Home Top
powered by planetlab University of Arizona, Computer Science logo