Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ophélie Gagnard
slapos
Commits
c7bafc71
Commit
c7bafc71
authored
May 03, 2013
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update wsgi support in Trac
parent
714c964e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
25 deletions
+31
-25
slapos/recipe/trac.py
slapos/recipe/trac.py
+2
-2
software/trac-svn/instance-trac.cfg
software/trac-svn/instance-trac.cfg
+5
-5
software/trac-svn/software.cfg
software/trac-svn/software.cfg
+7
-7
software/trac-svn/templates/apache.in
software/trac-svn/templates/apache.in
+2
-3
software/trac-svn/templates/trac.wsgi.in
software/trac-svn/templates/trac.wsgi.in
+15
-8
No files found.
slapos/recipe/trac.py
View file @
c7bafc71
...
@@ -84,13 +84,13 @@ class Recipe(GenericBaseRecipe):
...
@@ -84,13 +84,13 @@ class Recipe(GenericBaseRecipe):
shutil
.
rmtree
(
project_dir
)
shutil
.
rmtree
(
project_dir
)
self
.
logger
.
error
(
"Failed to initialize Trac.
\
n
The error was: %s"
%
result
)
self
.
logger
.
error
(
"Failed to initialize Trac.
\
n
The error was: %s"
%
result
)
return
[]
return
[]
os
.
mkdir
(
self
.
options
[
'wsgi-dir'
])
os
.
mkdir
(
self
.
options
[
'git-dir'
])
os
.
mkdir
(
self
.
options
[
'git-dir'
])
os
.
mkdir
(
self
.
options
[
'svn-dir'
])
os
.
mkdir
(
self
.
options
[
'svn-dir'
])
os
.
mkdir
(
self
.
options
[
'wsgi-dir'
])
os
.
unlink
(
config
)
os
.
unlink
(
config
)
shutil
.
copy
(
self
.
options
[
'trac-ini'
].
strip
(),
config
)
shutil
.
copy
(
self
.
options
[
'trac-ini'
].
strip
(),
config
)
shutil
.
copy
(
self
.
options
[
'trac-wsgi'
].
strip
(),
shutil
.
copy
(
self
.
options
[
'trac-wsgi'
].
strip
(),
os
.
path
.
join
(
self
.
options
[
'wsgi-dir'
],
'trac.wsgi'
))
os
.
path
.
join
(
self
.
options
[
'wsgi-dir'
],
'trac.wsgi'
))
else
:
else
:
self
.
logger
.
info
(
"The directory %s already exist, skip project installation"
self
.
logger
.
info
(
"The directory %s already exist, skip project installation"
%
project_dir
)
%
project_dir
)
...
...
software/trac-svn/instance-trac.cfg
View file @
c7bafc71
...
@@ -198,7 +198,7 @@ url = ${template-httpd-conf:location}/${template-httpd-conf:filename}
...
@@ -198,7 +198,7 @@ url = ${template-httpd-conf:location}/${template-httpd-conf:filename}
output = $${rootdirectory:etc}/apache.conf
output = $${rootdirectory:etc}/apache.conf
document_root = $${rootdirectory:srv}/site/
document_root = $${rootdirectory:srv}/site/
wsgi_location = $${
inittrac:wsgi-dir}
wsgi_location = $${
rootdirectory:srv}/site/apache
gitweb-static-dir = ${gitweb:location}/share/gitweb/static/
gitweb-static-dir = ${gitweb:location}/share/gitweb/static/
gitweb-script = $${gitweb-cgi:output}
gitweb-script = $${gitweb-cgi:output}
git-http-backend = $${git-http-backend-cgi:output}
git-http-backend = $${git-http-backend-cgi:output}
...
@@ -238,10 +238,11 @@ mysql_port = $${stunnel:local-port}
...
@@ -238,10 +238,11 @@ mysql_port = $${stunnel:local-port}
[trac-wsgi]
[trac-wsgi]
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${tracWsgi:location}/${tracWsgi:filename}
url = ${tracWsgi:location}/${tracWsgi:filename}
output = $${directory:tracconfig}/trac
-apache
.wsgi
output = $${directory:tracconfig}/trac.wsgi
mode = 0700
mode = 0700
htdocs = $${trac-config:project_dir}
trac_env = $${trac-config:project_dir}
python_bin = ${python2.7:location}/bin/python2.7
[trac-svn-hook-script]
[trac-svn-hook-script]
recipe = slapos.recipe.template
recipe = slapos.recipe.template
...
@@ -284,7 +285,7 @@ svn_python = ${subversion-1.9:location}/lib/svn-python
...
@@ -284,7 +285,7 @@ svn_python = ${subversion-1.9:location}/lib/svn-python
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${template-gitweb-conf:location}/${template-gitweb-conf:filename}
url = ${template-gitweb-conf:location}/${template-gitweb-conf:filename}
output = $${rootdirectory:etc}/gitweb.conf
output = $${rootdirectory:etc}/gitweb.conf
url-list = $${trac-config:project_url}/git git://[$${slap-network-information:global-ipv6}]
url-list = $${trac-config:project_url}/git
http://[$${slap-network-information:global-ipv6}]:8080/git
git://[$${slap-network-information:global-ipv6}]
base-directory = $${trac-config:project_dir}/git
base-directory = $${trac-config:project_dir}/git
[gitweb-cgi]
[gitweb-cgi]
...
@@ -356,7 +357,6 @@ user-list = $${slap-parameter:trac-user-list}
...
@@ -356,7 +357,6 @@ user-list = $${slap-parameter:trac-user-list}
recipe = slapos.cookbook:wrapper
recipe = slapos.cookbook:wrapper
command-line = ${apache:location}/bin/httpd -DFOREGROUND -f "$${httpd-conf:output}"
command-line = ${apache:location}/bin/httpd -DFOREGROUND -f "$${httpd-conf:output}"
environment = PYTHONPATH=${subversion-1.9:location}/lib/svn-python:$${inittrac:python_path}
environment = PYTHONPATH=${subversion-1.9:location}/lib/svn-python:$${inittrac:python_path}
PATH=${python2.7:location}/bin:%(PATH)s
wrapper-path = $${basedirectory:services}/httpd
wrapper-path = $${basedirectory:services}/httpd
wait-for-files = $${inittrac:file-status}
wait-for-files = $${inittrac:file-status}
...
...
software/trac-svn/software.cfg
View file @
c7bafc71
...
@@ -5,10 +5,10 @@ develop =
...
@@ -5,10 +5,10 @@ develop =
# ${trac-plugins-egg:location}/accountmanager
# ${trac-plugins-egg:location}/accountmanager
parts =
parts =
apache-wsgi
slapos-cookbook
slapos-cookbook
gitweb
gitweb
subversion-1.9
subversion-1.9
apache-wsgi
instance-egg
instance-egg
instance
instance
instance-trac
instance-trac
...
@@ -29,8 +29,9 @@ parts =
...
@@ -29,8 +29,9 @@ parts =
extends =
extends =
../../stack/slapos.cfg
../../stack/slapos.cfg
../../component/apache/buildout.cfg
../../component/python-2.7/buildout.cfg
../../component/python-2.7/buildout.cfg
../../component/apache
/buildout.cfg
../../component/apache
-wsgi/buildout.cfg
../../component/logrotate/buildout.cfg
../../component/logrotate/buildout.cfg
../../component/subversion/buildout.cfg
../../component/subversion/buildout.cfg
../../component/gzip/buildout.cfg
../../component/gzip/buildout.cfg
...
@@ -39,7 +40,6 @@ extends =
...
@@ -39,7 +40,6 @@ extends =
../../component/stunnel/buildout.cfg
../../component/stunnel/buildout.cfg
../../component/lxml-python/buildout.cfg
../../component/lxml-python/buildout.cfg
../../component/mysql-python/buildout.cfg
../../component/mysql-python/buildout.cfg
../../component/apache-wsgi/buildout.cfg
../../component/git/buildout.cfg
../../component/git/buildout.cfg
../../component/pwgen/buildout.cfg
../../component/pwgen/buildout.cfg
../../component/shellinabox/buildout.cfg
../../component/shellinabox/buildout.cfg
...
@@ -89,7 +89,7 @@ md5sum = bc6ed91a1862a10af661713aa0691848
...
@@ -89,7 +89,7 @@ md5sum = bc6ed91a1862a10af661713aa0691848
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-trac.cfg
url = ${:_profile_base_location_}/instance-trac.cfg
output = ${buildout:directory}/template-trac.cfg
output = ${buildout:directory}/template-trac.cfg
md5sum =
a29c55056b5ce5a7409b14c54cfc00ad
md5sum =
2ffa830873895fd4a014bf038119ff82
mode = 0644
mode = 0644
[instance-mariadb]
[instance-mariadb]
...
@@ -113,7 +113,7 @@ md5sum = 10286b368b9b6eacae2cdd6caf362759
...
@@ -113,7 +113,7 @@ md5sum = 10286b368b9b6eacae2cdd6caf362759
[tracWsgi]
[tracWsgi]
<= template-download
<= template-download
filename = trac.wsgi.in
filename = trac.wsgi.in
md5sum =
622ca33ed7299409afec43bb79e4c7e9
md5sum =
5226978477d3336f21f0d8684d23a55a
[trac-svn-hook]
[trac-svn-hook]
<= template-download
<= template-download
...
@@ -138,7 +138,7 @@ md5sum = 7ec8822bd5676c3506f079e33ed9f771
...
@@ -138,7 +138,7 @@ md5sum = 7ec8822bd5676c3506f079e33ed9f771
[template-httpd-conf]
[template-httpd-conf]
<= template-download
<= template-download
filename = apache.in
filename = apache.in
md5sum =
be3418e3053ec7f74a3df21830a7edc0
md5sum =
452ff6c77211e312be0227155a83931c
[template-gitweb-cgi]
[template-gitweb-cgi]
<= template-download
<= template-download
...
...
software/trac-svn/templates/apache.in
View file @
c7bafc71
...
@@ -15,6 +15,8 @@ LogLevel warn
...
@@ -15,6 +15,8 @@ LogLevel warn
LogFormat "%h %{REMOTE_USER}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %{REMOTE_USER}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %{REMOTE_USER}i %l %u %t \"%r\" %>s %b" common
LogFormat "%h %{REMOTE_USER}i %l %u %t \"%r\" %>s %b" common
CustomLog "${:access_log}" common
CustomLog "${:access_log}" common
ScriptSock "${:cgid-sock}"
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
# Directory protection
# Directory protection
<Directory />
<Directory />
...
@@ -50,9 +52,6 @@ WSGIScriptAlias / ${:wsgi_location}/trac.wsgi
...
@@ -50,9 +52,6 @@ WSGIScriptAlias / ${:wsgi_location}/trac.wsgi
</LimitExcept>
</LimitExcept>
</Location>
</Location>
ScriptSock "${:cgid-sock}"
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
Alias "/static/" "${:gitweb-static-dir}"
Alias "/static/" "${:gitweb-static-dir}"
<Directory "${:gitweb-static-dir}">
<Directory "${:gitweb-static-dir}">
Options FollowSymLinks
Options FollowSymLinks
...
...
software/trac-svn/templates/trac.wsgi.in
View file @
c7bafc71
import sys
#!${:python_bin}
sys.stdout = sys.stderr
# -*- coding: utf-8 -*-
import os
import os
os.environ['TRAC_ENV'] = '${:htdocs}'
os.environ['PYTHON_EGG_CACHE'] = '${:htdocs}/eggs'
import trac.web.main
application = trac.web.main.dispatch_request
def application(environ, start_request):
\ No newline at end of file
if not 'trac.env_parent_dir' in environ:
environ.setdefault('trac.env_path', '${:trac_env}')
if 'PYTHON_EGG_CACHE' in environ:
os.environ['PYTHON_EGG_CACHE'] = environ['PYTHON_EGG_CACHE']
elif 'trac.env_path' in environ:
os.environ['PYTHON_EGG_CACHE'] = \
os.path.join(environ['trac.env_path'], '.egg-cache')
elif 'trac.env_parent_dir' in environ:
os.environ['PYTHON_EGG_CACHE'] = \
os.path.join(environ['trac.env_parent_dir'], '.egg-cache')
from trac.web.main import dispatch_request
return dispatch_request(environ, start_request)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment