forked from pool/pagure
Neal Gompa
64c63a5dbb
+ Allow viewing issues via the API using project-less API token + Various improvements to the srcfpo theme + Make pagure work with recent sqlalchemy versions (>= 1.3.0) + Add a new API endpoint to retrieve detailed stats about the issues + Improve the graphs displayed in the stats tab of each projects + Add a new graph tracking the number of open issues throughout the year + Improve loading tickets from git + Support pygit2 >= 1.1.0 + Add missing endpoints to the API documentation + Add support for wtforms >= 2.3 - Add dependency on email_validator in such case + Fix sorting users by their username when using python3 + Correct the API documentation for updating the watchers of a project + Ensure the name of the headers are always of the correct type (especially when using python3) + Ensure aclchecker and keyhelper can work with APP_URL having a trailing slash + Add a new git auth backend which can manage the .ssh/authorized_keys file directly + Update information about supported Git auth backends + Add support for arrow >= 0.15.6 + Fix getting the milter running with python3 + Fix mirroring project hosted remotely + Add url_path property to class User (and thus in the API) + Improve email text for new user registration + Set the USER environment variable when pushing over http + Add support for git push via http using basic auth relying on API token + If pagure is set up for local auth, allow git push via https to use it + Add an example nginx configuration file for pagure + Create two subpackages in the pagure for the apache and nginx configuration files + Add some documentation on how git push over http works in pagure + Make pagure compatible with the latest version of flake8 + Add PAGURE_PLUGINS_CONFIG setting in pagure configuration file - Refresh quick start instructions for new configuration options - Drop unneeded patch + Patch: 0501-Revert-Add-a-upper-limit-to-sqlalchemy.patch - Refresh default configuration patch + Patch: pagure-5.0-default-example-cfg.patch OBS-URL: https://build.opensuse.org/package/show/devel:tools:scm/pagure?expand=0&rev=31
149 lines
4.8 KiB
Plaintext
149 lines
4.8 KiB
Plaintext
# Setting up pagure
|
|
|
|
0. Prepare the filesystem (this step is usually performed on package install)
|
|
|
|
mkdir -p /srv/www/pagure-releases
|
|
mkdir -p /srv/gitolite/repositories/{,docs,forks,requests,tickets}
|
|
mkdir -p /srv/gitolite/pseudo
|
|
mkdir -p /srv/gitolite/remotes
|
|
mkdir -p /srv/gitolite/.gitolite/{conf,keydir,logs}
|
|
mkdir -p /srv/gitolite/.ssh
|
|
chmod 700 /srv/gitolite/.ssh
|
|
|
|
touch /srv/gitolite/.gitolite/conf/gitolite.conf
|
|
|
|
cp /usr/share/doc/packages/pagure/gitolite3.rc /srv/gitolite/.gitolite.rc
|
|
|
|
chown git:git -R /srv/gitolite
|
|
chown git:git /srv/www/pagure-releases
|
|
|
|
mkdir -p /srv/www/run
|
|
|
|
1. Install and set up a database
|
|
|
|
Option A: PostgreSQL
|
|
|
|
Note: If your PostgreSQL server is not on the same machine, just install 'python3-psycopg2'
|
|
on the pagure host machine and follow the installation and database creation steps below
|
|
on the designated database server. This also requires the database port opened on the
|
|
database server's firewall.
|
|
|
|
zypper install postgresql-server
|
|
systemctl start postgresql
|
|
|
|
A1. Edit /var/lib/pgsql/data/pg_hba.conf and change auth method from `ident` to `md5` for localhost
|
|
|
|
A2. Create the pagure database
|
|
|
|
sudo -u postgres psql
|
|
|
|
CREATE DATABASE pagure;
|
|
CREATE USER pagure;
|
|
ALTER USER pagure WITH ENCRYPTED PASSWORD '--PagureDBUserPW--';
|
|
GRANT ALL PRIVILEGES ON DATABASE pagure to pagure;
|
|
GRANT ALL PRIVILEGES ON ALL tables IN SCHEMA public TO pagure;
|
|
GRANT ALL PRIVILEGES ON ALL sequences IN SCHEMA public TO pagure;
|
|
\q
|
|
|
|
A3. Enable and restart PostgreSQL
|
|
|
|
systemctl stop postgresql
|
|
systemctl enable --now postgresql
|
|
|
|
Option B: MariaDB
|
|
|
|
Note: If your MariaDB server is not on the same machine, just install 'python3-PyMySQL'
|
|
on the pagure host machine and follow the installation and database creation steps below
|
|
on the designated database server. This also requires the database port opened on the
|
|
database server's firewall.
|
|
|
|
zypper install mariadb mariadb-client
|
|
systemctl enable --now mariadb
|
|
mysql_secure_installation
|
|
|
|
B1. Create the pagure database
|
|
|
|
mysql -u root -p
|
|
|
|
mysql> create database pagure;
|
|
mysql> grant all privileges on pagure.* to pagure identified by '--PagureDBUserPW--';
|
|
mysql> flush privileges;
|
|
mysql> exit
|
|
|
|
2. Install Redis
|
|
|
|
zypper install redis
|
|
|
|
3. Configure redis
|
|
|
|
cp /etc/redis/default.conf.example /etc/redis/default.conf
|
|
chown root:redis /etc/redis/default.conf
|
|
systemctl enable --now redis@default.service
|
|
|
|
4. Edit /etc/pagure/pagure.cfg to set up pagure settings as appropriate.
|
|
|
|
As we set up a database earlier using PostgreSQL or MariaDB, comment out the DB_URL for SQLite and
|
|
uncomment the correct one. Change the URL to match your database server location.
|
|
|
|
You'll also want to change email address and domain used for this instance to something real, especially if
|
|
you're using with HTTPS or having it public facing.
|
|
|
|
While currently Pagure defaults to the somewhat brittle legacy Gitolite backend, you should use
|
|
the more reliable and performant internal backend.
|
|
|
|
This is done by setting the following in /etc/pagure/pagure.cfg:
|
|
|
|
GIT_AUTH_BACKEND = "pagure_authorized_keys"
|
|
HTTP_REPO_ACCESS_GITOLITE = None
|
|
|
|
SSH_COMMAND_NON_REPOSPANNER = ([
|
|
"/usr/bin/%(cmd)s",
|
|
"/srv/gitolite/repositories/%(reponame)s",
|
|
], {"GL_USER": "%(username)s"})
|
|
|
|
|
|
For details on all the options in pagure.cfg, see https://docs.pagure.org/pagure/configuration.html
|
|
|
|
5. Populate the database
|
|
|
|
python3 /usr/share/pagure/pagure_createdb.py -c /etc/pagure/pagure.cfg -i /etc/pagure/alembic.ini
|
|
|
|
Note: On upgrades, just drop the "-i /etc/pagure/alembic.ini", and the script will do the correct
|
|
thing to upgrade the database.
|
|
|
|
6. Install either Apache HTTPD or Nginx web server and set up web configuration
|
|
|
|
Option A: Apache HTTPD
|
|
|
|
zypper install pagure-web-apache-httpd
|
|
|
|
A1. Edit /etc/apache2/vhosts.d/pagure.conf to set up web settings as appropriate.
|
|
|
|
Most of the settings just need to be uncommented to work. However, you may need to tweak based
|
|
on whether or not you're using HTTPS and if you are using HTTPS, where your certs are and what your domain(s) are.
|
|
|
|
Option B: Nginx
|
|
|
|
zypper install pagure-web-nginx
|
|
|
|
B1. Edit /etc/nginx/vhosts.d/pagure.conf to set up web settings as appropriate.
|
|
|
|
Most of the settings just need to be uncommented to work. However, you may need to tweak based
|
|
on whether or not you're using HTTPS and if you are using HTTPS, where your certs are and what your domain(s) are.
|
|
|
|
7. Open ports in the firewall as appropriate
|
|
|
|
firewall-cmd --add-service=ssh
|
|
firewall-cmd --add-service=http
|
|
firewall-cmd --add-service=https
|
|
firewall-cmd --add-service=redis
|
|
firewall-cmd --runtime-to-permanent
|
|
|
|
8. Enable and start pagure services
|
|
|
|
systemctl enable --now pagure_worker.service pagure_authorized_keys_worker.service pagure_api_key_expire_mail.timer pagure_mirror_project_in.timer
|
|
|
|
9. Enable and start your webserver, or restart if it's already running
|
|
|
|
For more details on setup, take a look at the official Pagure documentation: https://docs.pagure.org/pagure/
|