These instructions will deploy a new Packit instance to an existing machine. The instructions assume you already have a machine setup and an associated GitHub application. Assuming the machine already has one instance deployed, its GitHub application can be reused for the new instance. See the new machine playbook for details on creating a GitHub application.
These instructions use <hostname>
as a placeholder for the name of the
machine that will be hosting the instance and <instance>
as a placeholder for
the name of the instance. The instance name should only use alphanumerical
characters and -
. It should be unique within its machine, and preferably
globally unique among all machines to avoid confusion.
Edit the relevant machines/<hostname>.nix
file and add a new entry to the
services.multi-packit.instances
list.
You will need to customize the instance by configuring some of the
services.packit-api.<instance>
options. At the minimum, you will want to
set authentication.method
to "github"
and set authentication.github.org
.
All members of this organisation will be allowed to access the instance using
their GitHub account.
Additionally, you may set a authentication.github.team
value to restrict
access to just one team within that organisation.
Deploy the modified configuration to the server as usual.
The OAuth application on Github manually needs to be granted permission, by one of the organisation's admins, to access the organisation. See the GitHub documentation. Because we use a single OAuth app for all instances hosted on the same machine, this only needs to be done once per org and domain, even if it is used by multiple instances.
When the server is first deployed, no user has administrator priviledges. You must manually grant add you GitHub account to the ADMIN role:
- Log in to the instance with your GitHub account.
- SSH onto the server.
- Run
grant-role <instance> <username> ADMIN
where<username>
is your GitHub username. - Log out and back in for the changes to take effect.
Afterwards permissions may be managed through the web UI.