Skip to content
Thulium-Drake edited this page Aug 3, 2016 · 1 revision

Welcome to the freight wiki!

Table of Contents

Setup

  • See main page for installation instructions and the different ways to do so.
  • Copy the example configuration and edit it:
 cp /etc/freight.conf.example /etc/freight.conf
 # Default `Origin` and `Label` fields for `Release` files.
 ORIGIN="Custom"
 LABEL="Custom"
 
 # Cache the control files after each run (on), or regenerate them every
 # time (off).
 CACHE="off"
 
 # GPG key to use to sign repositories.  This is required by the `apt`
 # repository provider.  Use `gpg --gen-key` (see `gpg`(1) for more 
 # details) to generate a key and put its email address here.
 GPG="[email protected]"
 
 # Whether to follow symbolic links in `$VARLIB` to produce extra components
 # in the cache directory (on) or not (off).
 SYMLINKS="off"
  • Place the GPG key you configured in ~/.gnupg
  • Install a webserver
 apt-get install nginx-light
  • Configurer a website (/etc/nginx/sites-enabled/repo):
 	root /repos/cache;
 
 	server_name repo.example.com repo;
 
 	location / {
 		autoindex on;
 	}
 
 }

Add a package

To add a package you need to do the following:

 freight add $packagefile $type/$repo[/$component]
 freight cache

This will add the package to the repo, build it and sign the Release files.

 $packagefile: the .deb file that you wish to add
 $type: type of repo, at this time Freight only supports apt
 $repo: the name of the repository
 $component: optional, default value is 'main'

Example:

 root@repo:~# freight add freight_0.3.5-1_all.deb apt/custom
 # [freight] added freight_0.3.5-1_all.deb to apt/custom
 root@repo:~# freight cache
 # [freight] adding freight_0.3.5-1_all.deb to pool

Don't forget to remove the downloaded package after you have added it to the repository!

Remove a package

To remove a package, delete the source file and update Freight

 rm $VARLIB/apt/$repo/$packagefile
 freight cache

Example:

 root@repo:~# rm /repos/lib/apt/custom/freight_0.3.5-1_all.deb
 root@repo:~# freight cache

NOTE: This script doesn't report packages that are removed, but it will still update the packagelist!

Use repository

The url for a Freight repository looks like this:

 deb http://$hostname $repo $component

In our case:

 deb http://repo.example.com custom main
Clone this wiki locally