There are two ways to install pagure:
Here as well there are two ways of obtaining the RPM:
Pagure is packaged for Fedora since Fedora 21 and is available for RHEL and its derivative via the EPEL repository <https://fedoraproject.org/wiki/EPEL>. So installing it is as easy as:
dnf install pagure pagure-milters pagure-ev
or
The pagure package contains the core of the application and the doc server. (See the Overview page for a global overview of the structure of the project).
The pagure-milters package contains, as the name says, the milter (a mail filter to hook into a MTA).
The pagure-ev package contains the eventsource server.
If you wish to run a newer version of pagure than what is in the repositories you can easily rebuild it as RPM.
Simply follow these steps: # Clone the sources:
git clone https://pagure.io/pagure.git
# Go to the folder:
cd pagure
# Build a tarball of the latest version of pagure:
python setup.py sdist
# Build the RPM:
rpmbuild -ta dist/pagure*.tar.gz
This will build pagure from the version present in your clone.
Once, the RPM is installed the services pagure_milter and pagure_ev are ready to be used but the database and the web-application parts still need to be configured.
Pagure includes in its sources a setup.py automatint the installation of the web applications of pagure (ie: the core + the doc server).
To install pagure via this mechanism simply follow these steps: # Clone the sources:
git clone https://pagure.io/pagure.git
# Go to the folder:
cd pagure
# Install the latest version of pagure:
python setup.py build
sudo python setup.py install
# Install the additional files as follow:
Source | Destination | ||
---|---|---|
files/pagure.cfg.sample | /etc/pagure/pagure.cfg | ||
files/alembic.ini | /etc/pagure/alembic.ini | |
files/pagure.conf | /etc/httpd/conf.d/pagure.conf | |
files/pagure.wsgi | /usr/share/pagure/pagure.wsgi | |
createdb.py | /usr/share/pagure/pagure_createdb.py |
Once pagure’s files are installed, you still need to set up some things.
This folder is used by project maintainers to upload the tarball of the releases of their project.
This folder must be accessible by the user under which the application is running (in our case: git).
mkdir -p /var/www/releases
chown git:git /var/www/releases
Pagure stores the sources of a project in a git repo, offers a place to store the project’s documentation in another repo, stores a JSON dump of all issues and of all pull-requests in another two repos, and keeps a local checkout of remote projects when asked to do remote pull-requests. All these repositories are stored in different folders that must be created manually.
For example you can place them under /srv/git/repositories/ which would make /srv/git the home of your gitolite user.
You would then create the folders with:
mkdir /srv/git/repositories/{docs,forks,tickets,requests,checkouts}
If installed by RPM, you will find an example apache configuration file at: /etc/httpd/conf.d/pagure.conf.
If not installed by RPM, the example files is present in the sources at: files/pagure.conf.
Adjust it for your needs.
If you installed by RPM, you will find an example WSGI file at: /usr/share/pagure/pagure.wsgi and /usr/share/pagure/docs_pagure.wsgi for the doc server.
If you did not install by RPM, these files are present in the sources at: files/pagure.wsgi and files/doc_pagure.wsgi.
Adjust them for your needs
For the sake of this document, we assume that the web application runs under the git user, the same user as your gitolite user, but apache itself runs under the httpd (or apache2) user. So by default, apache will not be allowed to read git repositories created and managed by gitolite.
To give apache this permission (required to make git clone via http work), we use file access control lists (aka FACL):
setfacl -m user:apache:rx --default
setfacl -Rdm user:apache:rx /srv/git
setfacl -Rm user:apache:rx /srv/git
Where /srv/git is the home of your gitolite user (which will thus need to be adjusted for your configuration).
This is an important step which concerns the file /etc/pagure/pagure.cfg. If you have installed pagure by RPM, this file is already there, otherwise you can find an example one in the sources at: files/pagure.cfg.sample that you will have to copy to the right location.
Confer the Configuration section of this documentation for a full explanation of all the options of pagure.