diff --git a/0501-Revert-Add-a-upper-limit-to-sqlalchemy.patch b/0501-Revert-Add-a-upper-limit-to-sqlalchemy.patch deleted file mode 100644 index 5c104f6..0000000 --- a/0501-Revert-Add-a-upper-limit-to-sqlalchemy.patch +++ /dev/null @@ -1,36 +0,0 @@ -From ee99a5a4a503b5b1b6b6c20876fafafa4dd6b96a Mon Sep 17 00:00:00 2001 -From: Neal Gompa -Date: Fri, 29 Mar 2019 08:24:05 -0400 -Subject: [PATCH] Revert "Add a upper limit to sqlalchemy as 1.3.0 breaks our - tests" - -This is required so that Pagure is installable with SQLAlchemy 1.3.0+. -The issues that affect the tests are limited to the SQLite backend, -and do not affect production deployments using PostgreSQL or MySQL/MariaDB. - -This reverts commit b92a6f378bc81890ed2c1c70c84bce687238b617. ---- - requirements.txt | 7 +------ - 1 file changed, 1 insertion(+), 6 deletions(-) - -diff --git a/requirements.txt b/requirements.txt -index c877d94e..996fb063 100644 ---- a/requirements.txt -+++ b/requirements.txt -@@ -26,12 +26,7 @@ python-openid-teams - redis - requests - six --# sqlalchemy minimum 0.8 --# sqlalchemy 1.3.0 is causing issues on the pip container leading --# test_pagure_lib.py to raise a: --# "(sqlite3.OperationalError) no such column: users.user" --# in test_search_projects_private line 319 --sqlalchemy < 1.3.0 -+sqlalchemy >= 0.8 - # 1.4.0 is broken, 1.4.0-post-1 works but gives odd results on newer setuptools - # the latest version 1.5.0 is also known to work - straight.plugin --- -2.20.1 - diff --git a/pagure-5.0-default-example-cfg.patch b/pagure-5.0-default-example-cfg.patch index 2b07765..70325e0 100644 --- a/pagure-5.0-default-example-cfg.patch +++ b/pagure-5.0-default-example-cfg.patch @@ -1,6 +1,6 @@ -diff -rup pagure-5.0/files/gitolite3.rc pagure-5.0.cfg-defs/files/gitolite3.rc ---- pagure-5.0/files/gitolite3.rc 2018-08-20 05:28:38.000000000 -0400 -+++ pagure-5.0.cfg-defs/files/gitolite3.rc 2018-09-24 17:29:01.927780974 -0400 +diff -rup pagure/files/gitolite3.rc pagure.cfg-defs/files/gitolite3.rc +--- pagure/files/gitolite3.rc 2020-05-08 21:32:56.673172022 -0400 ++++ pagure.cfg-defs/files/gitolite3.rc 2020-05-08 21:37:03.018641878 -0400 @@ -16,7 +16,7 @@ # ------------------------------------------------------------------ @@ -10,10 +10,61 @@ diff -rup pagure-5.0/files/gitolite3.rc pagure-5.0.cfg-defs/files/gitolite3.rc # default umask gives you perms of '0700'; see the rc file docs for # how/why you might change this -diff -rup pagure-5.0/files/pagure.cfg.sample pagure-5.0.cfg-defs/files/pagure.cfg.sample ---- pagure-5.0/files/pagure.cfg.sample 2018-09-24 15:57:50.000000000 -0400 -+++ pagure-5.0.cfg-defs/files/pagure.cfg.sample 2018-09-24 17:29:01.928780964 -0400 -@@ -68,21 +68,21 @@ GIT_URL_GIT = 'git://localhost.localdoma +diff -rup pagure/files/pagure-apache-httpd.conf pagure.cfg-defs/files/pagure-apache-httpd.conf +--- pagure/files/pagure-apache-httpd.conf 2020-05-08 21:33:38.860594994 -0400 ++++ pagure.cfg-defs/files/pagure-apache-httpd.conf 2020-05-08 21:39:33.815153778 -0400 +@@ -29,9 +29,9 @@ + ## Use secure TLSv1.1 and TLSv1.2 ciphers + #Header always add Strict-Transport-Security "max-age=15768000; includeSubDomains; preload" + +- #SSLCertificateFile /etc/pki/tls/....crt +- #SSLCertificateChainFile /etc/pki/tls/....intermediate.crt +- #SSLCertificateKeyFile /etc/pki/tls/....key ++ #SSLCertificateFile /etc/ssl/....crt ++ #SSLCertificateChainFile /etc/ssl/....intermediate.crt ++ #SSLCertificateKeyFile /etc/ssl/....key + + #Alias /static /usr/lib/pythonX.Y/site-packages/pagure/static/ + +@@ -60,9 +60,9 @@ + ## Use secure TLSv1.1 and TLSv1.2 ciphers + #Header always add Strict-Transport-Security "max-age=15768000; includeSubDomains; preload" + +- #SSLCertificateFile /etc/pki/tls/....crt +- #SSLCertificateChainFile /etc/pki/tls/....intermediate.crt +- #SSLCertificateKeyFile /etc/pki/tls/....key ++ #SSLCertificateFile /etc/ssl/....crt ++ #SSLCertificateChainFile /etc/ssl/....intermediate.crt ++ #SSLCertificateKeyFile /etc/ssl/....key + + #Alias /static /usr/lib/pythonX.Y/site-packages/pagure/static/ + #Alias /releases /var/www/releases +@@ -97,7 +97,7 @@ + # + # + +- # ++ # + #Options +Indexes + # + +diff -rup pagure/files/pagure.cfg.sample pagure.cfg-defs/files/pagure.cfg.sample +--- pagure/files/pagure.cfg.sample 2020-05-08 21:32:56.679172082 -0400 ++++ pagure.cfg-defs/files/pagure.cfg.sample 2020-05-08 22:03:36.961622933 -0400 +@@ -72,25 +72,33 @@ DOC_APP_URL = 'http://docs.localhost.loc + + ### The URL to use to clone git repositories. + GIT_URL_SSH = 'ssh://git@localhost.localdomain/' +-GIT_URL_GIT = 'git://localhost.localdomain/' ++GIT_URL_GIT = 'http://localhost.localdomain/' ++ ++ ++### Folder containing the pagure user SSH authorized keys ++SSH_FOLDER = os.path.join( ++ '/srv', ++ 'gitolite', ++ '.ssh' ++) ### Folder containing to the git repos GIT_FOLDER = os.path.join( @@ -42,7 +93,7 @@ diff -rup pagure-5.0/files/pagure.cfg.sample pagure-5.0.cfg-defs/files/pagure.cf 'remotes' ) -@@ -92,21 +92,23 @@ VIRUS_SCAN_ATTACHMENTS = False +@@ -100,21 +108,23 @@ VIRUS_SCAN_ATTACHMENTS = False ### Configuration file for gitolite GITOLITE_CONFIG = os.path.join( @@ -70,61 +121,78 @@ diff -rup pagure-5.0/files/pagure.cfg.sample pagure-5.0.cfg-defs/files/pagure.cf ### Path to the gitolite.rc file GL_RC = None -diff -rup pagure-5.0/files/pagure.conf pagure-5.0.cfg-defs/files/pagure.conf ---- pagure-5.0/files/pagure.conf 2018-08-23 15:08:03.000000000 -0400 -+++ pagure-5.0.cfg-defs/files/pagure.conf 2018-09-24 17:29:01.928780964 -0400 -@@ -29,9 +29,9 @@ - ## Use secure TLSv1.1 and TLSv1.2 ciphers - #Header always add Strict-Transport-Security "max-age=15768000; includeSubDomains; preload" +Only in pagure.cfg-defs/files: pagure.cfg.sample.orig +diff -rup pagure/files/pagure_docs_web.service pagure.cfg-defs/files/pagure_docs_web.service +--- pagure/files/pagure_docs_web.service 2020-05-08 21:33:38.862595014 -0400 ++++ pagure.cfg-defs/files/pagure_docs_web.service 2020-05-08 21:41:42.996448966 -0400 +@@ -5,7 +5,7 @@ Documentation=https://pagure.io/pagure -- #SSLCertificateFile /etc/pki/tls/....crt -- #SSLCertificateChainFile /etc/pki/tls/....intermediate.crt -- #SSLCertificateKeyFile /etc/pki/tls/....key -+ #SSLCertificateFile /etc/ssl/....crt -+ #SSLCertificateChainFile /etc/ssl/....intermediate.crt -+ #SSLCertificateKeyFile /etc/ssl/....key - #Alias /static /usr/lib/pythonX.Y/site-packages/pagure/static/ + [Service] +-ExecStart=/usr/bin/gunicorn --workers 4 --env PAGURE_CONFIG=/etc/pagure/pagure.cfg --access-logfile /var/log/pagure/access_docs_web.log --error-logfile /var/log/pagure/error_docs_web.log --bind unix:/tmp/pagure_docs_web.sock pagure.docs_server:APP ++ExecStart=/usr/bin/gunicorn --workers 4 --env PAGURE_CONFIG=/etc/pagure/pagure.cfg --access-logfile /var/log/pagure/access_docs_web.log --error-logfile /var/log/pagure/error_docs_web.log --bind unix:/srv/gitolite/.pagure_docs_web.sock pagure.docs_server:APP + Type=simple + User=git + Group=git +diff -rup pagure/files/pagure-nginx.conf pagure.cfg-defs/files/pagure-nginx.conf +--- pagure/files/pagure-nginx.conf 2020-05-08 21:33:38.860594994 -0400 ++++ pagure.cfg-defs/files/pagure-nginx.conf 2020-05-08 21:43:48.199704257 -0400 +@@ -12,15 +12,15 @@ + #access_log /var/log/nginx/pagure_docs.access.log; + #error_log /var/log/nginx/pagure_docs.error.log; -@@ -60,24 +60,24 @@ - ## Use secure TLSv1.1 and TLSv1.2 ciphers - #Header always add Strict-Transport-Security "max-age=15768000; includeSubDomains; preload" +- #ssl_certificate /etc/pki/tls/....crt +- #ssl_certificate_key /etc/pki/tls/....key ++ #ssl_certificate /etc/ssl/....crt ++ #ssl_certificate_key /etc/ssl/....key -- #SSLCertificateFile /etc/pki/tls/....crt -- #SSLCertificateChainFile /etc/pki/tls/....intermediate.crt -- #SSLCertificateKeyFile /etc/pki/tls/....key -+ #SSLCertificateFile /etc/ssl/....crt -+ #SSLCertificateChainFile /etc/ssl/....intermediate.crt -+ #SSLCertificateKeyFile /etc/ssl/....key + #location @pagure_docs { + #proxy_set_header Host $http_host; + #proxy_set_header X-Real-IP $remote_addr; + #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + #proxy_set_header X-Forwarded-Proto $scheme; +- #proxy_pass http://unix:/tmp/pagure_docs_web.sock; ++ #proxy_pass http://unix:/srv/gitolite/.pagure_docs_web.sock; + #} - #Alias /static /usr/lib/pythonX.Y/site-packages/pagure/static/ -- #Alias /releases /var/www/releases -+ #Alias /releases /srv/www/pagure-releases + #location / { +@@ -48,15 +48,15 @@ + #access_log /var/log/nginx/pagure.access.log; + #error_log /var/log/nginx/pagure.error.log; - ## Section used to support cloning git repo over http (https in this case) -- #SetEnv GIT_PROJECT_ROOT /path/to/git/repositories -+ #SetEnv GIT_PROJECT_ROOT /srv/gitolite/repositories +- #ssl_certificate /etc/pki/tls/....crt +- #ssl_certificate_key /etc/pki/tls/....key ++ #ssl_certificate /etc/ssl/....crt ++ #ssl_certificate_key /etc/ssl/....key -- #AliasMatch ^/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /path/to/git/repositories/$1 -- #AliasMatch ^/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /path/to/git/repositories/$1 -+ #AliasMatch ^/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /srv/gitolite/repositories/$1 -+ #AliasMatch ^/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /srv/gitolite/repositories/$1 - #ScriptAliasMatch \ - #"(?x)^/(.*/(HEAD | \ - #info/refs | \ - #objects/info/[^/]+ | \ - #git-(upload|receive)-pack))$" \ -- #/usr/libexec/git-core/git-http-backend/$1 -+ #/usr/lib/git/git-http-backend/$1 + #location @pagure { + #proxy_set_header Host $http_host; + #proxy_set_header X-Real-IP $remote_addr; + #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + #proxy_set_header X-Forwarded-Proto $scheme; +- #proxy_pass http://unix:/tmp/pagure_web.sock; ++ #proxy_pass http://unix:/srv/gitolite/.pagure_web.sock; + #} - # - #WSGIProcessGroup pagure -@@ -106,7 +106,7 @@ - # - # + #location / { +@@ -68,7 +68,7 @@ + #} -- # -+ # - #Options +Indexes - # + #location /releases { +- #alias /var/www/releases/; ++ #alias /srv/www/pagure-releases/; + #autoindex on; + #} +diff -rup pagure/files/pagure_web.service pagure.cfg-defs/files/pagure_web.service +--- pagure/files/pagure_web.service 2020-05-08 21:33:38.862595014 -0400 ++++ pagure.cfg-defs/files/pagure_web.service 2020-05-08 21:41:26.941287994 -0400 +@@ -5,7 +5,7 @@ Documentation=https://pagure.io/pagure + + + [Service] +-ExecStart=/usr/bin/gunicorn --workers 4 --env PAGURE_CONFIG=/etc/pagure/pagure.cfg --access-logfile /var/log/pagure/access_web.log --error-logfile /var/log/pagure/error_web.log --bind unix:/tmp/pagure_web.sock "pagure.flask_app:create_app()" ++ExecStart=/usr/bin/gunicorn --workers 4 --env PAGURE_CONFIG=/etc/pagure/pagure.cfg --access-logfile /var/log/pagure/access_web.log --error-logfile /var/log/pagure/error_web.log --bind unix:/srv/gitolite/.pagure_web.sock "pagure.flask_app:create_app()" + Type=simple + User=git + Group=git diff --git a/pagure-5.10.0.tar.gz b/pagure-5.10.0.tar.gz new file mode 100644 index 0000000..75c4f2f --- /dev/null +++ b/pagure-5.10.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a2b60e85e35f19a4260aa049aa7508059604de40a07acc1bdb7a421e882542c +size 21610760 diff --git a/pagure-5.9.1.tar.gz b/pagure-5.9.1.tar.gz deleted file mode 100644 index 1d5f0dc..0000000 --- a/pagure-5.9.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ad4938975b202eee30098d112b250309d2690194099bc59f3f6d9d7069b78d3c -size 21751943 diff --git a/pagure-README.SUSE b/pagure-README.SUSE index 16613d5..1941a3c 100644 --- a/pagure-README.SUSE +++ b/pagure-README.SUSE @@ -7,6 +7,8 @@ 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 @@ -17,10 +19,6 @@ chown git:git /srv/www/pagure-releases mkdir -p /srv/www/run -setfacl -m user:wwwrun:rx --default /srv/gitolite -setfacl -Rdm user:wwwrun:rx /srv/gitolite -setfacl -Rm user:wwwrun:rx /srv/gitolite - 1. Install and set up a database Option A: PostgreSQL @@ -84,13 +82,54 @@ 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 -6. Edit /etc/apache2/vhosts.d/pagure.conf to set up web settings as appropriate. +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 @@ -102,8 +141,8 @@ firewall-cmd --runtime-to-permanent 8. Enable and start pagure services -systemctl enable --now pagure_worker pagure_gitolite_worker pagure_api_key_expire_mail.timer pagure_mirror_project_in.timer +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 apache2, or restart if it's already running +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/ diff --git a/pagure.changes b/pagure.changes index df5158c..3c86072 100644 --- a/pagure.changes +++ b/pagure.changes @@ -1,3 +1,46 @@ +------------------------------------------------------------------- +Fri May 15 01:05:30 UTC 2020 - Neal Gompa + +- Update to 5.10.0 + + 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 + ------------------------------------------------------------------- Sat Apr 4 16:03:40 UTC 2020 - Neal Gompa diff --git a/pagure.spec b/pagure.spec index 3763e4a..2dee813 100644 --- a/pagure.spec +++ b/pagure.spec @@ -23,7 +23,7 @@ Name: pagure -Version: 5.9.1 +Version: 5.10.0 Release: 0 Summary: A git-centered forge Group: Development/Tools/Version Control @@ -42,9 +42,6 @@ Source10: pagure-README.SUSE # Backports from upstream -# Not yet upstreamable patches -## Allow Pagure to use SQLAlchemy >= 1.3.0 -Patch0501: 0501-Revert-Add-a-upper-limit-to-sqlalchemy.patch # SUSE-specific fixes ## Change the defaults in the example config to match packaging @@ -54,6 +51,7 @@ BuildArch: noarch BuildRequires: apache2 +BuildRequires: nginx BuildRequires: fdupes BuildRequires: systemd-rpm-macros BuildRequires: python3-devel @@ -114,8 +112,6 @@ Requires: python3-WTForms Requires: python3-munch Requires: python3-redis -Requires: apache2-mod_wsgi-python3 - # Required for celery Requires: python3-pytz @@ -130,6 +126,11 @@ Recommends: (python3-psycopg2 if postgresql-server) # If using MariaDB/MySQL, the correct driver should be installed Recommends: (python3-PyMySQL if mysql-server) +# If using Apache web server, the correct configuration should be installed +Recommends: (%{name}-web-apache-httpd if apache2) + +# If using Nginx web server, the correct configuration should be installed +Recommends: (%{name}-web-nginx if nginx) # The default theme is required Requires: %{name}-theme-default @@ -156,6 +157,28 @@ For steps on how to set up the system after installing this package, please read %{_docdir}/%{name}/README.SUSE. +%package web-apache-httpd +Summary: Apache HTTPD configuration for Pagure +Requires: %{name} = %{version}-%{release} +Requires: apache2-mod_wsgi-python3 +# Apache config moved out to its own subpackage +Obsoletes: %{name} < 5.10 +Conflicts: %{name} < 5.10 +%description web-apache-httpd +This package provides the configuration files for deploying +a Pagure server using the Apache HTTPD server. + + +%package web-nginx +Summary: Nginx configuration for Pagure +Requires: %{name} = %{version}-%{release} +Requires: nginx +Requires: python3-gunicorn +%description web-nginx +This package provides the configuration files for deploying +a Pagure server using the Nginx web server. + + %package theme-upstream Summary: Base theme for the Pagure web interface Requires: %{name} = %{version}-%{release} @@ -309,7 +332,11 @@ install -pm 0644 %{SOURCE10} README.SUSE # Install apache configuration file mkdir -p %{buildroot}/%{_sysconfdir}/apache2/vhosts.d -install -p -m 644 files/pagure.conf %{buildroot}/%{_sysconfdir}/apache2/vhosts.d/pagure.conf +install -p -m 644 files/pagure-apache-httpd.conf %{buildroot}/%{_sysconfdir}/apache2/vhosts.d/pagure.conf + +# Install nginx configuration file +mkdir -p %{buildroot}/%{_sysconfdir}/nginx/vhosts.d/ +install -p -m 644 files/pagure-nginx.conf %{buildroot}/%{_sysconfdir}/nginx/vhosts.d/pagure.conf # Install configuration file mkdir -p %{buildroot}/%{_sysconfdir}/pagure @@ -340,11 +367,25 @@ install -p -m 644 files/alembic.ini %{buildroot}/%{_sysconfdir}/pagure/alembic.i # Install the alembic revisions cp -r alembic %{buildroot}/%{_datadir}/pagure +# Install the systemd file for the web frontend +mkdir -p %{buildroot}/%{_unitdir} +install -p -m 644 files/pagure_web.service \ + %{buildroot}/%{_unitdir}/pagure_web.service + +# Install the systemd file for the docs web frontend +mkdir -p %{buildroot}/%{_unitdir} +install -p -m 644 files/pagure_docs_web.service \ + %{buildroot}/%{_unitdir}/pagure_docs_web.service + # Install the systemd file for the worker mkdir -p %{buildroot}/%{_unitdir} install -p -m 644 files/pagure_worker.service \ %{buildroot}/%{_unitdir}/pagure_worker.service +# Install the systemd file for the authorized_keys worker +install -p -m 644 files/pagure_authorized_keys_worker.service \ + %{buildroot}/%{_unitdir}/pagure_authorized_keys_worker.service + # Install the systemd file for the gitolite worker install -p -m 644 files/pagure_gitolite_worker.service \ %{buildroot}/%{_unitdir}/pagure_gitolite_worker.service @@ -418,8 +459,10 @@ sed -e "s|#!/usr/bin/env python|#!%{__python3}|" -i \ # Switch interpreter for systemd units to correct Python interpreter sed -e "s|/usr/bin/python|%{__python3}|g" -i %{buildroot}/%{_unitdir}/*.service -# Change to correct static file path for apache httpd -sed -e "s/pythonX.Y/python%{python3_version}/g" -i %{buildroot}/%{_sysconfdir}/apache2/vhosts.d/pagure.conf +# Change to correct static file path for apache httpd and nginx +sed -e "s/pythonX.Y/python%{python3_version}/g" -i \ + %{buildroot}/%{_sysconfdir}/apache2/vhosts.d/pagure.conf \ + %{buildroot}/%{_sysconfdir}/nginx/vhosts.d/pagure.conf # Make symlinks for default theme packages mv %{buildroot}/%{python3_sitelib}/pagure/themes/default %{buildroot}/%{python3_sitelib}/pagure/themes/upstream @@ -430,6 +473,15 @@ ln -sr %{buildroot}/%{python3_sitelib}/pagure/themes/chameleon %{buildroot}/%{py %fdupes %{buildroot}/%{python3_sitelib} %fdupes doc/ +# Make log directory and files +mkdir -p %{buildroot}/%{_localstatedir}/log/pagure +logfiles="web docs_web" + +for logfile in $logfiles; do + touch %{buildroot}/%{_localstatedir}/log/pagure/access_${logfile}.log + touch %{buildroot}/%{_localstatedir}/log/pagure/error_${logfile}.log +done + # Regenerate clobbered symlinks (Cf. https://pagure.io/pagure/issue/3782) runnerhooks="post-receive pre-receive" @@ -440,7 +492,7 @@ done # Make the rcFOO symlinks for systemd services mkdir -p %{buildroot}/%{_sbindir} -paguresvcs="api_key_expire_mail ci ev gitolite_worker loadjson logcom milter mirror webhook worker mirror_project_in" +paguresvcs="api_key_expire_mail ci ev authorized_keys_worker gitolite_worker loadjson logcom milter mirror webhook worker mirror_project_in" for paguresvc in $paguresvcs; do ln -sf %{_sbindir}/service %{buildroot}/%{_sbindir}/rcpagure_$paguresvc done @@ -451,6 +503,7 @@ mkdir -p %{buildroot}/srv/gitolite/pseudo mkdir -p %{buildroot}/srv/gitolite/repositories/{,docs,forks,requests,tickets} mkdir -p %{buildroot}/srv/gitolite/remotes mkdir -p %{buildroot}/srv/gitolite/.gitolite/{conf,keydir,logs} +mkdir -p %{buildroot}/srv/gitolite/.ssh # Add empty gitolite config file touch %{buildroot}/srv/gitolite/.gitolite/conf/gitolite.conf @@ -465,16 +518,15 @@ install -p -m 644 files/gitolite3.rc %{buildroot}/srv/gitolite/.gitolite.rc echo "Create wsgi rundir if it doesn't exist..." mkdir -p /srv/www/run || : -echo "Setting up facls..." -setfacl -m user:wwwrun:rx --default /srv/gitolite || : -setfacl -Rdm user:wwwrun:rx /srv/gitolite || : -setfacl -Rm user:wwwrun:rx /srv/gitolite || : - echo "See %{_docdir}/%{name}/README.SUSE to continue" %systemd_post pagure_worker.service +%systemd_post pagure_authorized_keys_worker.service %systemd_post pagure_gitolite_worker.service %systemd_post pagure_api_key_expire_mail.timer %systemd_post pagure_mirror_project_in.timer +%post web-nginx +%systemd_post pagure_web.service +%systemd_post pagure_docs_web.service %post milters %tmpfiles_create %{_tmpfilesdir}/%{name}-milter.conf %systemd_post pagure_milter.service @@ -493,9 +545,13 @@ echo "See %{_docdir}/%{name}/README.SUSE to continue" %preun %systemd_preun pagure_worker.service +%systemd_preun pagure_authorized_keys_worker.service %systemd_preun pagure_gitolite_worker.service %systemd_preun pagure_api_key_expire_mail.timer %systemd_preun pagure_mirror_project_in.timer +%preun web-nginx +%systemd_preun pagure_web.service +%systemd_preun pagure_docs_web.service %preun milters %systemd_preun pagure_milter.service %preun ev @@ -513,9 +569,13 @@ echo "See %{_docdir}/%{name}/README.SUSE to continue" %postun %systemd_postun_with_restart pagure_worker.service +%systemd_postun_with_restart pagure_authorized_keys_worker.service %systemd_postun_with_restart pagure_gitolite_worker.service %systemd_postun pagure_api_key_expire_mail.timer %systemd_postun pagure_mirror_project_in.timer +%postun web-nginx +%systemd_postun_with_restart pagure_web.service +%systemd_postun_with_restart pagure_docs_web.service %postun milters %systemd_postun_with_restart pagure_milter.service %postun ev @@ -533,14 +593,12 @@ echo "See %{_docdir}/%{name}/README.SUSE to continue" %files -%doc README.SUSE README.rst UPGRADING.rst doc/ files/gitolite3.rc files/pagure.conf files/pagure.cfg.sample +%doc README.SUSE README.rst UPGRADING.rst doc/ files/gitolite3.rc files/pagure.cfg.sample %license LICENSE -%config(noreplace) %{_sysconfdir}/apache2/vhosts.d/pagure.conf %config(noreplace) %{_sysconfdir}/pagure/pagure.cfg %config(noreplace) %{_sysconfdir}/pagure/alembic.ini %dir %{_sysconfdir}/pagure/ %dir %{_datadir}/pagure/ -%config(noreplace) %{_datadir}/pagure/*.wsgi %{_datadir}/pagure/*.py* %exclude %{_datadir}/pagure/comment_email_milter.py* %{_datadir}/pagure/alembic/ @@ -555,6 +613,7 @@ echo "See %{_docdir}/%{name}/README.SUSE to continue" %{python3_sitelib}/pagure*.egg-info %{_bindir}/pagure-admin %{_unitdir}/pagure_worker.service +%{_unitdir}/pagure_authorized_keys_worker.service %{_unitdir}/pagure_gitolite_worker.service %{_unitdir}/pagure_api_key_expire_mail.service %{_unitdir}/pagure_api_key_expire_mail.timer @@ -562,6 +621,7 @@ echo "See %{_docdir}/%{name}/README.SUSE to continue" %{_unitdir}/pagure_mirror_project_in.timer %{_sbindir}/rcpagure_api_key_expire_mail %{_sbindir}/rcpagure_worker +%{_sbindir}/rcpagure_authorized_keys_worker %{_sbindir}/rcpagure_gitolite_worker %{_sbindir}/rcpagure_mirror_project_in # Pagure data content @@ -569,11 +629,29 @@ echo "See %{_docdir}/%{name}/README.SUSE to continue" %attr(-,git,git) %dir /srv/gitolite/remotes %attr(-,git,git) %dir /srv/gitolite/repositories/{,docs,forks,requests,tickets} %attr(-,git,git) %dir /srv/gitolite/.gitolite/{,conf,keydir,logs} +%attr(700,git,git) %dir /srv/gitolite/.gitolite/.ssh %attr(-,git,git) %config(noreplace) /srv/gitolite/.gitolite/conf/gitolite.conf %attr(-,git,git) %config(noreplace) /srv/gitolite/.gitolite.rc %attr(-,git,git) %dir /srv/www/pagure-releases +%files web-apache-httpd +%license LICENSE +%doc files/pagure-apache-httpd.conf +%config(noreplace) %{_sysconfdir}/apache2/vhosts.d/pagure.conf +%config(noreplace) %{_datadir}/pagure/*.wsgi + + +%files web-nginx +%license LICENSE +%doc files/pagure-nginx.conf +%config(noreplace) %{_sysconfdir}/nginx/vhosts.d/pagure.conf +%{_unitdir}/pagure_web.service +%{_unitdir}/pagure_docs_web.service +%attr(-,git,git) %dir %{_localstatedir}/log/pagure +%ghost %{_localstatedir}/log/pagure/*.log + + %files theme-upstream %license LICENSE %{python3_sitelib}/pagure/themes/upstream/