Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1353862 - Have to alter /usr/share/pagure/pagure.wsgi
Summary: Have to alter /usr/share/pagure/pagure.wsgi
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: pagure
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Pierre-YvesChibon
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-08 09:09 UTC by Miroslav Suchý
Modified: 2016-07-10 08:49 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-10 08:49:04 UTC


Attachments (Terms of Use)

Description Miroslav Suchý 2016-07-08 09:09:59 UTC
Description of problem:
When I want to deploy Pagure using RPM from distribution, then I have to alter
/usr/share/pagure/pagure.wsgi

This is bad as the change is overwritten on next 'dnf upgrade'.
The change needed to run the server should be done only in config and everything in /usr/share/ should be left untouched.

Version-Release number of selected component (if applicable):
pagure-1.0.1-1.fc23.noarch

Comment 1 Pierre-YvesChibon 2016-07-08 09:20:14 UTC
I have always approached the wsgi provided as an example file rather than something functional, but I see the issue.

There are two ways to go about this:
- Mark the two wsgi files as doc then and don't install them in /usr/share but then the apache configuration is pointing to non-existing files
- Keep things as is tag the two wsgi files with ``%config(noreplace)``

Thoughts?

Comment 2 Miroslav Suchý 2016-07-08 09:51:18 UTC
The content

import __main__
__main__.__requires__ = ['SQLAlchemy >= 0.8', 'jinja2 >= 2.4']
import pkg_resources
import os
os.environ['PAGURE_CONFIG'] = '/etc/pagure/pagure.cfg'
os.environ['TEMP'] = '/var/tmp/'
from pagure import APP as application

is perfectly sane for production. I see no reason why not uncomment it and use it. Just keep that part about debug or different path comment for users who want to play with it. But the above should be good start for everybody, which does not need to be altered.

Comment 3 Bruno Wolff III 2016-07-08 13:08:43 UTC
I had noticed this when I was looking at doing a setup using the Fedora package. There are a few defaults in the sample config files that don't match the Fedora install, that would be noce to change. The WSGI case is worse because if you just use the standard file it gets replaced at update. But altogether it makes setting up a play instance harder than it really should be. One other notable case is having the username default to git rather than gitolite3. If we really want to use the simpler git by default we should set that up on the install. But for a default install which is likely to just be used for testing, change the default config and docs to use gitolite3 might be better. I thought there was some stuff about the sample apache confs that also bugged me, but I don't remember right now. I have limited time, so would probably move slowly with any of this.

Comment 4 Pierre-YvesChibon 2016-07-09 08:48:27 UTC
> I see no reason why not uncomment it and use it.

Well, one reason is that I do not want pagure to be "functional" upon install, since it cannot be as the DB needs to be created and all.

So I provide both the apache config file and the wsgi commented out, but maybe the wsgi file could be un-commented indeed.

Comment 5 Pierre-YvesChibon 2016-07-10 08:49:04 UTC
Fix proposed upstream at: https://pagure.io/pagure/pull-request/1115


Note You need to log in before you can comment on or make changes to this bug.