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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
slapos
Commits
20d2c4e5
Commit
20d2c4e5
authored
May 22, 2013
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/trac'
parents
6c87a67e
5d776684
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
1883 additions
and
0 deletions
+1883
-0
component/apache-wsgi/buildout.cfg
component/apache-wsgi/buildout.cfg
+43
-0
component/subversion/buildout.cfg
component/subversion/buildout.cfg
+43
-0
setup.py
setup.py
+1
-0
slapos/recipe/trac.py
slapos/recipe/trac.py
+183
-0
software/trac-svn/instance-mariadb.cfg
software/trac-svn/instance-mariadb.cfg
+224
-0
software/trac-svn/instance-trac.cfg
software/trac-svn/instance-trac.cfg
+494
-0
software/trac-svn/instance.cfg
software/trac-svn/instance.cfg
+12
-0
software/trac-svn/software.cfg
software/trac-svn/software.cfg
+379
-0
software/trac-svn/templates/apache.in
software/trac-svn/templates/apache.in
+132
-0
software/trac-svn/templates/create-svn-repo.sh.in
software/trac-svn/templates/create-svn-repo.sh.in
+26
-0
software/trac-svn/templates/git-http-backend.cgi.in
software/trac-svn/templates/git-http-backend.cgi.in
+6
-0
software/trac-svn/templates/gitweb.cgi.in
software/trac-svn/templates/gitweb.cgi.in
+3
-0
software/trac-svn/templates/gitweb.conf.in
software/trac-svn/templates/gitweb.conf.in
+9
-0
software/trac-svn/templates/post-revprop-change.in
software/trac-svn/templates/post-revprop-change.in
+6
-0
software/trac-svn/templates/trac-git-hook.in
software/trac-svn/templates/trac-git-hook.in
+4
-0
software/trac-svn/templates/trac-svn-hook.in
software/trac-svn/templates/trac-svn-hook.in
+64
-0
software/trac-svn/templates/trac.ini.in
software/trac-svn/templates/trac.ini.in
+237
-0
software/trac-svn/templates/trac.wsgi.in
software/trac-svn/templates/trac.wsgi.in
+17
-0
No files found.
component/apache-wsgi/buildout.cfg
0 → 100644
View file @
20d2c4e5
[buildout]
extends =
../apache/buildout.cfg
../python-2.7/buildout.cfg
../bzip2/buildout.cfg
../gdbm/buildout.cfg
../gettext/buildout.cfg
../libexpat/buildout.cfg
../ncurses/buildout.cfg
../openssl/buildout.cfg
../readline/buildout.cfg
../sqlite3/buildout.cfg
../zlib/buildout.cfg
../file/buildout.cfg
parts =
apache-wsgi
[python2.7]
configure-options =
--enable-shared
--disable-static
--enable-ipv6
--enable-unicode=ucs4
--with-system-expat
--with-threads
environment =
CPPFLAGS=-I${zlib:location}/include -I${readline:location}/include -I${libexpat:location}/include -I${ncurses:location}/include -I${ncurses:location}/include/ncursesw -I${bzip2:location}/include -I${gdbm:location}/include -I${openssl:location}/include -I${sqlite3:location}/include -I${gettext:location}/include
LDFLAGS=-L${zlib:location}/lib -L${readline:location}/lib -L${libexpat:location}/lib -L${ncurses:location}/lib -L${bzip2:location}/lib -L${gdbm:location}/lib -L${openssl:location}/lib -L${sqlite3:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${readline:location}/lib -Wl,-rpath=${libexpat:location}/lib -Wl,-rpath=${ncurses:location}/lib -Wl,-rpath=${bzip2:location}/lib -Wl,-rpath=${gdbm:location}/lib -Wl,-rpath=${openssl:location}/lib -Wl,-rpath=${sqlite3:location}/lib -L${gettext:location}/lib -Wl,-rpath=${gettext:location}/lib -Wl,-rpath=${file:location}/lib
LD_RUN_PATH=${buildout:parts-directory}/${:_buildout_section_name_}/lib
[apache-wsgi]
recipe = hexagonit.recipe.cmmi
url = http://modwsgi.googlecode.com/files/mod_wsgi-3.4.tar.gz
md5sum = f42d69190ea0c337ef259cbe8d94d985
configure-options =
--with-apxs=${apache:location}/bin/apxs
--with-python=${python2.7:location}/bin/python2.7
environment =
CPPFLAGS = -I${python2.7:location}/include/python2.7
LDFLAGS = -L${python2.7:location}/lib
component/subversion/buildout.cfg
View file @
20d2c4e5
...
...
@@ -10,6 +10,7 @@ extends =
../pkgconfig/buildout.cfg
../sqlite3/buildout.cfg
../zlib/buildout.cfg
../swig/buildout.cfg
parts =
subversion
...
...
@@ -59,3 +60,45 @@ environment =
PKG_CONFIG_PATH=${apache:location}/lib/pkgconfig:${sqlite3:location}/lib/pkgconfig:${openssl:location}/lib/pkgconfig:${neon:location}/lib/pkgconfig
CPPFLAGS=-I${libexpat:location}/include -I${libuuid:location}/include
LDFLAGS=-L${libexpat:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${sqlite3:location}/lib -Wl,-rpath=${neon:location}/lib -Wl,-rpath=${apache:location}/lib -L${libuuid:location}/lib -Wl,-rpath=${libuuid:location}/lib
[subversion-1.9]
recipe = hexagonit.recipe.cmmi
url = http://www.apache.org/dist/subversion/subversion-1.7.9.tar.gz
md5sum = dfb083e8bfac88aa28d606168b08e4ff
configure-options =
--disable-static
--with-apr=${apache:location}/bin/apr-1-config
--with-apr-util=${apache:location}/bin/apu-1-config
--with-apxs=${apache:location}/bin/apxs
--with-zlib=${zlib:location}
--with-sqlite=${sqlite3:location}
--with-neon=${neon:location}
--with-swig=${swig:location}/bin/swig
--without-berkeley-db
--without-sasl
--without-apr_memcache
--without-gnome-keyring
--without-kwallet
--without-jdk
--without-jikes
--without-junit
--without-ctypesgen
--without-ruby-sitedir
--without-ruby-test-verbose
--disable-nls
# it seems that parallel build sometimes fails.
make-options =
-j1
make-targets =
install
swig-py
install-swig-py
environment =
PATH=${pkgconfig:location}/bin:${neon:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${apache:location}/lib/pkgconfig:${sqlite3:location}/lib/pkgconfig:${openssl:location}/lib/pkgconfig:${neon:location}/lib/pkgconfig
CPPFLAGS=-I${libexpat:location}/include -I${libuuid:location}/include
LDFLAGS=-L${libexpat:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${sqlite3:location}/lib -Wl,-rpath=${neon:location}/lib -Wl,-rpath=${apache:location}/lib -L${libuuid:location}/lib -Wl,-rpath=${libuuid:location}/lib
setup.py
View file @
20d2c4e5
...
...
@@ -195,6 +195,7 @@ setup(name=name,
'stunnel = slapos.recipe.stunnel:Recipe'
,
'symbolic.link = slapos.recipe.symbolic_link:Recipe'
,
'tidstorage = slapos.recipe.tidstorage:Recipe'
,
'trac = slapos.recipe.trac:Recipe'
,
'urlparse = slapos.recipe._urlparse:Recipe'
,
'uuid = slapos.recipe._uuid:Recipe'
,
'vifib = slapos.recipe.vifib:Recipe'
,
...
...
slapos/recipe/trac.py
0 → 100644
View file @
20d2c4e5
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import
os
import
sys
import
subprocess
import
shutil
import
json
from
slapos.recipe.librecipe
import
GenericBaseRecipe
class
Recipe
(
GenericBaseRecipe
):
def
__init__
(
self
,
buildout
,
name
,
options
):
pythonPath
=
""
for
eggs
in
options
[
'eggs-dirs'
].
splitlines
():
if
eggs
:
for
item
in
os
.
listdir
(
eggs
):
path
=
os
.
path
.
join
(
eggs
,
item
)
pythonPath
=
path
+
":"
+
pythonPath
options
[
'python_path'
]
=
pythonPath
options
[
'wsgi-dir'
]
=
os
.
path
.
join
(
options
[
'site-dir'
].
strip
(),
'apache'
)
options
[
'git-dir'
]
=
os
.
path
.
join
(
options
[
'site-dir'
].
strip
(),
'git'
)
options
[
'svn-dir'
]
=
os
.
path
.
join
(
options
[
'site-dir'
].
strip
(),
'svn'
)
return
GenericBaseRecipe
.
__init__
(
self
,
buildout
,
name
,
options
)
def
install
(
self
):
install_path
=
[]
env
=
os
.
environ
env
[
'LD_LIBRARY_PATH'
]
=
self
.
options
[
'python-lib'
]
project_dir
=
self
.
options
[
'site-dir'
].
strip
()
trac_admin
=
self
.
options
[
'trac-admin'
].
strip
()
admin
=
self
.
options
[
'admin-user'
].
strip
()
passwd
=
self
.
options
[
'admin-password'
].
strip
()
config
=
os
.
path
.
join
(
project_dir
,
'conf/trac.ini'
)
filestat
=
self
.
options
[
'file-status'
].
strip
()
self
.
logger
.
info
(
"Checking if trac project is not installed..."
)
if
os
.
path
.
exists
(
filestat
):
os
.
unlink
(
filestat
)
if
not
os
.
path
.
exists
(
project_dir
):
self
.
logger
.
info
(
"Starting trac project installation at %s"
%
project_dir
)
trac_args
=
[
trac_admin
,
project_dir
,
'initenv'
]
db_string
=
"mysql://%s:%s@%s:%s/%s"
%
(
self
.
options
[
'mysql-username'
].
strip
(),
self
.
options
[
'mysql-password'
].
strip
(),
self
.
options
[
'mysql-host'
].
strip
(),
self
.
options
[
'mysql-port'
].
strip
(),
self
.
options
[
'mysql-database'
].
strip
()
)
process_install
=
subprocess
.
Popen
(
trac_args
,
stdout
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
,
env
=
env
)
process_install
.
stdin
.
write
(
'%s
\
n
%s
\
n
'
%
(
self
.
options
[
'project'
].
strip
(),
db_string
))
result
=
process_install
.
communicate
()[
0
]
process_install
.
stdin
.
close
()
if
process_install
.
returncode
is
None
or
process_install
.
returncode
!=
0
:
if
os
.
path
.
exists
(
project_dir
):
shutil
.
rmtree
(
project_dir
)
self
.
logger
.
error
(
"Failed to initialize Trac.
\
n
The error was: %s"
%
result
)
return
[]
os
.
mkdir
(
self
.
options
[
'git-dir'
])
os
.
mkdir
(
self
.
options
[
'svn-dir'
])
os
.
mkdir
(
self
.
options
[
'wsgi-dir'
])
os
.
unlink
(
config
)
shutil
.
copy
(
self
.
options
[
'trac-ini'
].
strip
(),
config
)
shutil
.
copy
(
self
.
options
[
'trac-wsgi'
].
strip
(),
os
.
path
.
join
(
self
.
options
[
'wsgi-dir'
],
'trac.wsgi'
))
else
:
self
.
logger
.
info
(
"The directory %s already exist, skip project installation"
%
project_dir
)
trac_args
=
[
trac_admin
,
project_dir
,
'upgrade'
]
process_upgrade
=
subprocess
.
Popen
(
trac_args
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
,
env
=
env
)
result
=
process_upgrade
.
communicate
()[
0
]
if
process_upgrade
.
returncode
is
None
or
process_upgrade
.
returncode
!=
0
:
self
.
logger
.
error
(
"Failed to upgrade Trac.
\
n
The error was: %s"
%
result
)
return
[]
#Add All grant to admin user
self
.
logger
.
info
(
"Granting admin rights to the admin user."
)
trac_grant
=
[
trac_admin
,
project_dir
,
"permission add %s TRAC_ADMIN"
%
admin
]
process
=
subprocess
.
Popen
(
trac_grant
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
,
env
=
env
)
result
=
process
.
communicate
()[
0
]
if
process
.
returncode
is
None
or
process
.
returncode
!=
0
:
raise
Exception
(
"Failed to execute Trac-admin.
\
n
The error was: %s"
%
result
)
self
.
logger
.
info
(
"Copying additional plugins into plugins directory"
)
plugins_dir
=
os
.
path
.
join
(
project_dir
,
"plugins"
)
for
item
in
os
.
listdir
(
self
.
options
[
'plugins-egg-dir'
].
strip
()):
source
=
os
.
path
.
join
(
self
.
options
[
'plugins-egg-dir'
].
strip
(),
item
)
destination
=
os
.
path
.
join
(
plugins_dir
,
item
)
if
not
os
.
path
.
exists
(
destination
):
shutil
.
copytree
(
source
,
destination
)
svn_list
=
json
.
loads
(
self
.
options
.
get
(
'svn-project-list'
,
'{}'
))
for
svn_repo
in
svn_list
:
svn_repo_path
=
os
.
path
.
join
(
self
.
options
[
'svn-dir'
],
svn_repo
)
if
not
os
.
path
.
exists
(
svn_repo_path
):
self
.
logger
.
info
(
"Initializing %s SVN repository..."
%
svn_repo
)
svn_args
=
[
self
.
options
[
'svn-repo-script'
],
project_dir
,
svn_repo
,
svn_list
[
svn_repo
]]
process
=
subprocess
.
Popen
(
svn_args
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
result
=
process
.
communicate
()[
0
]
if
process
.
returncode
is
None
or
process
.
returncode
!=
0
:
shutil
.
rmtree
(
svn_repo_path
)
raise
Exception
(
"Failed to create repository.
\
n
The error was: %s"
%
result
)
shutil
.
copy
(
self
.
options
[
'trac-svn-hook'
].
strip
(),
os
.
path
.
join
(
svn_repo_path
,
'hooks/post-commit'
))
shutil
.
copy
(
self
.
options
[
'post-revprop-change'
].
strip
(),
os
.
path
.
join
(
svn_repo_path
,
'hooks/post-revprop-change'
))
self
.
logger
.
info
(
"Finished initializing %s reposiroty"
%
svn_repo
)
repolist
=
json
.
loads
(
self
.
options
.
get
(
'git-project-list'
,
'{}'
))
for
repo
,
desc
in
repolist
.
iteritems
():
absolute_path
=
os
.
path
.
join
(
self
.
options
[
'git-dir'
],
'%s.git'
%
repo
)
if
not
os
.
path
.
exists
(
absolute_path
):
self
.
logger
.
info
(
"Initializing %s GIT repository..."
%
repo
)
subprocess
.
check_call
([
self
.
options
[
'git-binary'
],
'init'
,
'--bare'
,
absolute_path
])
subprocess
.
check_call
([
trac_admin
,
project_dir
,
'repository'
,
'add'
,
repo
,
absolute_path
,
'git'
],
env
=
env
)
subprocess
.
check_call
([
trac_admin
,
project_dir
,
'repository'
,
'resync'
,
repo
],
env
=
env
)
# XXX: Hardcoded path
shutil
.
copy
(
self
.
options
[
'trac-git-hook'
].
strip
(),
os
.
path
.
join
(
absolute_path
,
'hooks/post-commit'
))
description_filename
=
os
.
path
.
join
(
absolute_path
,
'description'
)
with
open
(
description_filename
,
'w'
)
as
description_file
:
description_file
.
write
(
desc
)
user_list
=
json
.
loads
(
self
.
options
.
get
(
'user-list'
,
'{}'
))
fd
=
open
(
os
.
path
.
join
(
project_dir
,
'svnpasswd'
),
'w'
)
fd
.
write
(
"[users]
\
n
%s = %s"
%
(
admin
,
passwd
))
os
.
system
(
"%s -cb %s %s %s"
%
(
self
.
options
[
'htpasswd'
],
self
.
options
[
'passwd-file'
],
admin
,
passwd
)
)
for
user
in
user_list
:
self
.
logger
.
info
(
"Creating or updating user %s ..."
%
user
)
user_args
=
[
self
.
options
[
'htpasswd'
],
'-b'
,
self
.
options
[
'passwd-file'
],
user
,
user_list
[
user
]]
process
=
subprocess
.
Popen
(
user_args
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
result
=
process
.
communicate
()[
0
]
if
process
.
returncode
is
None
or
process
.
returncode
!=
0
:
raise
Exception
(
"Failed to create user %s.
\
n
The error was: %s"
%
(
user
,
result
))
fd
.
write
(
"
\
n
%s = %s"
%
(
user
,
user_list
[
user
]))
fd
.
close
()
open
(
filestat
,
"w"
).
write
(
"done."
)
return
install_path
software/trac-svn/instance-mariadb.cfg
0 → 100644
View file @
20d2c4e5
[buildout]
parts =
urls
mariadb
stunnel
certificate-authority
ca-stunnel
logrotate
logrotate-entry-mariadb
logrotate-entry-stunnel
logrotate-entry-cron
cron
cron-entry-logrotate
slapmonitor
slapreport
gzip-binary = ${gzip:location}/bin/gzip
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc/
var = $${buildout:directory}/var/
srv = $${buildout:directory}/srv/
bin = $${buildout:directory}/bin/
[basedirectory]
recipe = slapos.cookbook:mkdirectory
log = $${rootdirectory:var}/log/
scripts = $${rootdirectory:etc}/run/
services = $${rootdirectory:etc}/service/
run = $${rootdirectory:var}/run/
backup = $${rootdirectory:srv}/backup/
promises = $${rootdirectory:etc}/promise/
[directory]
recipe = slapos.cookbook:mkdirectory
cron-entries = $${rootdirectory:etc}/cron.d/
crontabs = $${rootdirectory:etc}/crontabs/
cronstamps = $${rootdirectory:etc}/cronstamps/
ca-dir = $${rootdirectory:srv}/ssl/
mariadb-data = $${rootdirectory:srv}/mariadb/
logrotate-backup = $${basedirectory:backup}/logrotate/
stunnel-conf = $${rootdirectory:etc}/stunnel/
logrotate-entries = $${rootdirectory:etc}/logrotate.d/
[urls]
recipe = slapos.cookbook:publish
url = mysqls://$${mariadb:user}:$${mariadb:password}@[$${stunnel:remote-host}]:$${stunnel:remote-port}/$${mariadb:database}
[mariadb]
recipe = slapos.cookbook:mysql
# Options
recovering = false
user = trac
port = 3306
password = $${mysql-password:passwd}
ip = $${slap-network-information:local-ipv4}
database = trac
# Paths
wrapper = $${basedirectory:services}/mariadb
update-wrapper = $${basedirectory:scripts}/mariadb_update
logrotate-post = $${rootdirectory:bin}/mariadb_post_logrotate
data-directory = $${directory:mariadb-data}
pid-file = $${basedirectory:run}/mariadb.pid
socket = $${basedirectory:run}/mariadb.sock
error-log = $${basedirectory:log}/mariadb_error.log
conf-file = $${rootdirectory:etc}/mariadb.cnf
promise = $${basedirectory:promises}/mysql
# Binary information
mysql-base-directory = ${mariadb:location}
mysql-binary = ${mariadb:location}/bin/mysql
mysql-install-binary = ${mariadb:location}/scripts/mysql_install_db
mysql-upgrade-binary = ${mariadb:location}/bin/mysql_upgrade
mysqld-binary = ${mariadb:location}/bin/mysqld
[mysql-password]
recipe = slapos.cookbook:generate.password
storage-path = $${rootdirectory:etc}/.passwd
bytes = 4
[slapmonitor]
recipe = slapos.cookbook:slapmonitor
pid-file = $${basedirectory:run}/mariadb.pid
database-path = $${basedirectory:log}/slapmonitor.db
shell-path = ${dash:location}/bin/dash
slapmonitor-path = ${buildout:bin-directory}/slapmonitor
path = $${basedirectory:scripts}/slapmonitor
[slapreport]
recipe = slapos.cookbook:slapreport
pid-file = $${basedirectory:run}/mariadb.pid
consumption-log-path = $${basedirectory:log}/instance_consumption.log
database-path = $${basedirectory:log}/slapmonitor.db
logbox-ip = 87.98.152.12
logbox-port = 5122
logbox-user = admin
logbox-passwd = passer
shell-path = ${dash:location}/bin/dash
slapreport-path = ${buildout:bin-directory}/slapreport
path = $${basedirectory:scripts}/slapreport
[certificate-authority]
recipe = slapos.cookbook:certificate_authority
openssl-binary = ${openssl:location}/bin/openssl
ca-dir = $${directory:ca-dir}
requests-directory = $${cadirectory:requests}
wrapper = $${basedirectory:services}/ca
ca-private = $${cadirectory:private}
ca-certs = $${cadirectory:certs}
ca-newcerts = $${cadirectory:newcerts}
ca-crl = $${cadirectory:crl}
[cadirectory]
recipe = slapos.cookbook:mkdirectory
requests = $${directory:ca-dir}/requests/
private = $${directory:ca-dir}/private/
certs = $${directory:ca-dir}/certs/
newcerts = $${directory:ca-dir}/newcerts/
crl = $${directory:ca-dir}/crl/
[ca-stunnel]
<= certificate-authority
recipe = slapos.cookbook:certificate_authority.request
executable = $${stunnel:wrapper}
wrapper = $${basedirectory:services}/stunnel
key-file = $${stunnel:key-file}
cert-file = $${stunnel:cert-file}
[stunnel]
recipe = slapos.cookbook:stunnel
stunnel-binary = ${stunnel:location}/bin/stunnel
wrapper = $${rootdirectory:bin}/stunnel
log-file = $${basedirectory:log}/stunnel.log
config-file = $${directory:stunnel-conf}/stunnel.conf
key-file = $${directory:stunnel-conf}/stunnel.key
cert-file = $${directory:stunnel-conf}/stunnel.crt
pid-file = $${basedirectory:run}/stunnel.pid
local-host = $${mariadb:ip}
local-port = $${mariadb:port}
remote-host = $${slap-network-information:global-ipv6}
remote-port = 6446
client = false
post-rotate-script = $${rootdirectory:bin}/stunnel_post_rotate
[logrotate]
recipe = slapos.cookbook:logrotate
# Binaries
logrotate-binary = ${logrotate:location}/usr/sbin/logrotate
gzip-binary = $${buildout:gzip-binary}
gunzip-binary = ${gzip:location}/bin/gunzip
# Directories
wrapper = $${rootdirectory:bin}/logrotate
conf = $${rootdirectory:etc}/logrotate.conf
logrotate-entries = $${directory:logrotate-entries}
backup = $${directory:logrotate-backup}
state-file = $${rootdirectory:srv}/logrotate.status
[logrotate-entry-mariadb]
<= logrotate
recipe = slapos.cookbook:logrotate.d
name = mariadb
log = $${mariadb:error-log}
frequency = daily
rotate-num = 30
post = $${mariadb:logrotate-post}
sharedscripts = true
notifempty = true
create = true
[logrotate-entry-stunnel]
<= logrotate
recipe = slapos.cookbook:logrotate.d
name = stunnel
log = $${stunnel:log-file}
frequency = daily
rotate-num = 30
notifempty = true
create = true
post = $${stunnel:post-rotate-script}
[logrotate-entry-cron]
<= logrotate
recipe =slapos.cookbook:logrotate.d
name = crond
log = $${cron-simplelogger:log}
frequency = daily
rotate-num = 30
notifempty = true
create = true
[cron]
recipe = slapos.cookbook:cron
dcrond-binary = ${dcron:location}/sbin/crond
cron-entries = $${directory:cron-entries}
crontabs = $${directory:crontabs}
cronstamps = $${directory:cronstamps}
catcher = $${cron-simplelogger:wrapper}
binary = $${basedirectory:services}/crond
[cron-simplelogger]
recipe = slapos.cookbook:simplelogger
wrapper = $${rootdirectory:bin}/cron_simplelogger
log = $${basedirectory:log}/crond.log
[cron-entry-logrotate]
<= cron
recipe = slapos.cookbook:cron.d
name = logrotate
frequency = 0 0 * * *
command = $${logrotate:wrapper}
[slap-parameter]
#Default value if no ssh parameters specified
logbox-ip =
logbox-port =
logbox-user =
logbox-passwd =
\ No newline at end of file
software/trac-svn/instance-trac.cfg
0 → 100644
View file @
20d2c4e5
This diff is collapsed.
Click to expand it.
software/trac-svn/instance.cfg
0 → 100644
View file @
20d2c4e5
[buildout]
parts =
switch_softwaretype
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[switch_softwaretype]
recipe = slapos.cookbook:softwaretype
default = ${instance-trac:output}
mariadb = ${instance-mariadb:output}
\ No newline at end of file
software/trac-svn/software.cfg
0 → 100644
View file @
20d2c4e5
This diff is collapsed.
Click to expand it.
software/trac-svn/templates/apache.in
0 → 100644
View file @
20d2c4e5
# Apache static configuration
# Automatically generated
# Basic server configuration
PidFile "${:pid_file}"
Listen ${:ip}:${:port}
ServerAdmin someone@email
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
# Log configuration
ErrorLog "${:error_log}"
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" common
CustomLog "${:access_log}" common
ScriptSock "${:cgid-sock}"
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
# Directory protection
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
WSGIScriptAlias / ${:wsgi_location}/trac.wsgi
<Directory ${:wsgi_location}>
WSGIApplicationGroup %{GLOBAL}
AllowOverride All
Require all granted
</Directory>
<Location /login>
AuthType Basic
AuthName "Trac Administrator Access"
AuthUserFile ${:document_root}/.htpasswd
Require valid-user
</Location>
<Location /svn>
ErrorDocument 404 default
DAV svn
SVNParentPath ${:document_root}/svn/
AuthType Basic
AuthName "SVN Repository Access"
AuthUserFile ${:document_root}/.htpasswd
SVNAdvertiseV2Protocol Off
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>
Alias "/static/" "${:gitweb-static-dir}"
<Directory "${:gitweb-static-dir}">
Options FollowSymLinks
Require all granted
</Directory>
# This is Static Accelerated git pull
AliasMatch "^/git/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$" "${:document_root}/git/$1"
AliasMatch "^/git/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$" "${:document_root}/git/$1"
# When it can't be statically delivered, we rely on git-http-backend
ScriptAliasMatch \
"(?x)^/git/(.*/(HEAD | \
info/refs | \
objects/(info/[^/]+ | \
[0-9a-f]{2}/[0-9a-f]{38} | \
pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
git-(upload|receive)-pack))$" \
"${:git-http-backend}/$1"
# Everything else is gitweb interface
ScriptAlias "/git" "${:gitweb-script}"
RewriteEngine On
RewriteCond %{QUERY_STRING} service=git-receive-pack
RewriteRule ^/git/.*/info/refs$ - [E=git_receive_pack:1]
<Location /git>
Order deny,allow
Deny from env=git_receive_pack
AuthType Basic
AuthName "Git Push Access"
AuthBasicProvider file
AuthUserFile ${:document_root}/.htpasswd
Require valid-user
Satisfy any
</Location>
<LocationMatch "^/git/.*/git-receive-pack$">
AuthType Basic
AuthName "Git Push Access"
AuthBasicProvider file
AuthUserFile ${:document_root}/.htpasswd
Require valid-user
SetEnv REMOTE_USER $REDIRECT_REMOTE_USER
</LocationMatch>
# List of modules
LoadModule unixd_module modules/mod_unixd.so
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule version_module modules/mod_version.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule mime_module modules/mod_mime.so
LoadModule cgid_module modules/mod_cgid.so
LoadModule env_module modules/mod_env.so
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule headers_module modules/mod_headers.so
LoadModule dir_module modules/mod_dir.so
LoadModule alias_module modules/mod_alias.so
LoadModule wsgi_module modules/mod_wsgi.so
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
\ No newline at end of file
software/trac-svn/templates/create-svn-repo.sh.in
0 → 100644
View file @
20d2c4e5
#!/bin/sh
export
PATH
=
${
:trac_admin
}
:
${
:svn_bin
}
:
$PATH
export
PYTHONPATH
=
${
:svn_python
}
:
$PYTHONPATH
export
LD_LIBRARY_PATH
=
${
:python_lib
}
:
$LD_LIBRARY_PATH
ENV
=
"
$1
"
REPO
=
"
$2
"
REALM
=
"
$3
"
if
[
-z
"
$ENV
"
-o
-z
"
$REPO
"
]
;
then
echo
"Usage:
$0
ENV REPO"
exit
2
fi
RPATH
=
"
$ENV
/svn/
$REPO
"
PASSWD
=
"
$ENV
/svnpasswd"
svnadmin create
$RPATH
trac-admin
$ENV
repository add
$REPO
$RPATH
svn
trac-admin
$ENV
repository resync
$REPO
echo
"[general]
anon-access = read
auth-access = write
password-db =
$PASSWD
realm =
$REALM
"
>
$RPATH
/conf/svnserve.conf
software/trac-svn/templates/git-http-backend.cgi.in
0 → 100644
View file @
20d2c4e5
#!/bin/sh
## This is a very dirty hack
export
PATH_INFO
=
"
$$
{REDIRECT_URL:-
$PATH_INFO
}"
GIT_PROJECT_ROOT
=
'${:base-directory}'
GIT_HTTP_EXPORT_ALL
=
exec
'${:githttpbackend}'
$@
software/trac-svn/templates/gitweb.cgi.in
0 → 100644
View file @
20d2c4e5
#!/bin/sh
GITWEB_CONFIG
=
'${gitweb-conf:output}'
exec
'${:perl}'
'${:gitweb}'
$@
\ No newline at end of file
software/trac-svn/templates/gitweb.conf.in
0 → 100644
View file @
20d2c4e5
$projectroot = '${:base-directory}';
$site_name = '${slap-parameter:project-name}';
our @git_base_url_list = qw(${:url-list});
# Beautiful URLs
$feature{'pathinfo'}{'default'} = [1];
$feature{'blame'}{'default'} = [1];
software/trac-svn/templates/post-revprop-change.in
0 → 100644
View file @
20d2c4e5
#!/bin/sh
if
[
"
$PROPNAME
"
=
"svn:log"
-o
"
$PROPNAME
"
=
"svn:author"
]
;
then
${
:trac_svn_hook
}
$REPOS
$REV
$USER
$PROPNAME
fi
\ No newline at end of file
software/trac-svn/templates/trac-git-hook.in
0 → 100644
View file @
20d2c4e5
#!/bin/sh
REV
=
$(
${
:git_bin
}
rev-parse HEAD
)
${
:trac_admin
}
${
:trac_env
}
added
"
$1
"
$REV
\ No newline at end of file
software/trac-svn/templates/trac-svn-hook.in
0 → 100644
View file @
20d2c4e5
#!/bin/sh
export
TRAC_ENV
=
${
:trac_env
}
export
PATH
=
${
:trac_admin
}
:
${
:python_bin
}
:
$PATH
export
LD_LIBRARY_PATH
=
${
:python_lib
}
:
$LD_LIBRARY_PATH
export
PYTHONPATH
=
${
:svn_python
}
:
$PYTHONPATH
REPOS
=
"
$1
"
REV
=
"
$2
"
USER
=
"
$3
"
PROPNAME
=
"
$4
"
# -- Foolproofing
if
[
-z
"
$REPOS
"
-o
-z
"
$REV
"
]
;
then
echo
"Usage:
$0
REPOS REV"
exit
2
fi
if
!
python
-V
2>/dev/null
;
then
echo
"python is not in the PATH (
$PATH
), check PATH and LD_LIBRARY_PATH."
exit
2
fi
if
[
-z
"
$TRAC_ENV
"
]
;
then
echo
"TRAC_ENV is not set."
exit
2
fi
# -- Feedback
echo
"----"
if
[
-z
"
$USER
"
-a
-z
"
$PROPNAME
"
]
;
then
EVENT
=
"added"
echo
"Changeset
$REV
was added in
$REPOS
"
else
EVENT
=
"modified"
echo
"Changeset
$REV
was modified by
$USER
in
$REPOS
"
fi
# -- Call "trac-admin ... changeset ... $$REPOS $$REV" for each Trac environment
ifs
=
$IFS
IFS
=
:
if
[
-n
"
$BASH_VERSION
"
]
;
then
# we can use Bash syntax
if
[[
$$
{
BASH_VERSINFO[5]
}
=
*
cygwin
]]
;
then
IFS
=
";"
fi
fi
for
env
in
$TRAC_ENV
;
do
if
[
-r
"
$env
/VERSION"
]
;
then
log
=
$env
/log/svn-hooks-
`
basename
$REPOS
`
.log
nohup
sh
<<
EOF
>>
$log
2>&1 &
echo "Changeset
$REV
$EVENT
"
trac-admin
$env
changeset
$EVENT
$REPOS
$REV
&&
\
echo "OK" || echo "FAILED: see the Trac log"
EOF
else
echo
"
$env
doesn't seem to be a Trac environment, skipping..."
fi
done
IFS
=
$ifs
software/trac-svn/templates/trac.ini.in
0 → 100644
View file @
20d2c4e5
# -*- coding: utf-8 -*-
[attachment]
max_size = 262144
max_zip_size = 2097152
render_unsafe_content = false
[browser]
color_scale = True
downloadable_paths = /trunk, /branches/*, /tags/*
hide_properties = svk:merge
intermediate_color =
intermediate_point =
newest_color = (255, 136, 136)
oldest_color = (136, 136, 255)
oneliner_properties = trac:summary
render_unsafe_content = false
wiki_properties = trac:description
[changeset]
max_diff_bytes = 10000000
max_diff_files = 0
wiki_format_messages = true
[header_logo]
alt = (please configure the [header_logo] section in trac.ini)
height = -1
link =
src = site/your_project_logo.png
width = -1
[git]
cached_repository = false
git_bin = ${:git_bin}
git_fs_encoding = utf-8
persistent_cache = false
projects_base = ${:git_project_base}
projects_list = ${:git_project_list}
projects_url = ${:git_url}
shortrev_len = 7
trac_user_rlookup = false
use_committer_id = true
use_committer_time = true
wikishortrev_len = 40
[svn]
branches = trunk, branches/*
tags = tags/*
[components]
webadmin.* = enabled
tracopt.versioncontrol.svn.* = enabled
tracopt.versioncontrol.git.* = enabled
tracopt.ticket.commit_updater.* = enabled
[inherit]
htdocs_dir =
plugins_dir = ${:trac_plugins}
templates_dir =
[logging]
log_file = trac.log
# log_format = <inherited>
log_level = DEBUG
log_type = none
[milestone]
stats_provider = DefaultTicketGroupStatsProvider
[mimeviewer]
max_preview_size = 262144
mime_map = text/x-dylan:dylan, text/x-idl:ice, text/x-ada:ads:adb
mime_map_patterns = text/plain:README|INSTALL|COPYING.*
pygments_default_style = trac
pygments_modes =
tab_width = 8
treat_as_binary = application/octet-stream, application/pdf, application/postscript, application/msword,application/rtf,
[notification]
admit_domains =
always_notify_owner = false
always_notify_reporter = false
always_notify_updater = true
ambiguous_char_width = single
batch_subject_template = $prefix Batch modify: $tickets_descr
email_sender = SmtpEmailSender
ignore_domains =
mime_encoding = none
sendmail_path = sendmail
smtp_always_bcc =
smtp_always_cc =
smtp_default_domain =
smtp_enabled = false
smtp_from = trac@localhost
smtp_from_author = false
smtp_from_name =
smtp_password =
smtp_port = 25
smtp_replyto = trac@localhost
smtp_server = localhost
smtp_subject_prefix = __default__
smtp_user =
ticket_subject_template = $prefix #$ticket.id: $summary
use_public_cc = false
use_short_addr = false
use_tls = false
[project]
admin = ${:admin_email}
admin_trac_url = .
descr = ${:project_description}
footer = ${:project_footer}
icon = common/trac.ico
name = ${:project_name}
url = ${:project_url}
[query]
default_anonymous_query = status!=closed&cc~=$USER
default_query = status!=closed&owner=$USER
items_per_page = 100
ticketlink_query = ?status=!closed
[report]
items_per_page = 100
items_per_page_rss = 0
[revisionlog]
default_log_limit = 100
graph_colors = ['#cc0', '#0c0', '#0cc', '#00c', '#c0c', '#c00']
[roadmap]
stats_provider = DefaultTicketGroupStatsProvider
[search]
# default_disabled_filters = <inherited>
min_query_length = 3
[sqlite]
# extensions = <inherited>
[ticket]
default_cc =
default_component =
default_description =
default_keywords =
default_milestone =
default_owner = < default >
default_priority = major
default_resolution = fixed
default_severity =
default_summary =
default_type = defect
default_version =
max_comment_size = 262144
max_description_size = 262144
preserve_newlines = default
restrict_owner = false
workflow = ConfigurableTicketWorkflow
[ticket-workflow]
accept = new,assigned,accepted,reopened -> accepted
accept.operations = set_owner_to_self
accept.permissions = TICKET_MODIFY
leave = * -> *
leave.default = 1
leave.operations = leave_status
reassign = new,assigned,accepted,reopened -> assigned
reassign.operations = set_owner
reassign.permissions = TICKET_MODIFY
reopen = closed -> reopened
reopen.operations = del_resolution
reopen.permissions = TICKET_CREATE
resolve = new,assigned,accepted,reopened -> closed
resolve.operations = set_resolution
resolve.permissions = TICKET_MODIFY
[ticket-custom]
project = ${:project_name}
project.label = Project
project.value =
[timeline]
abbreviated_messages = True
changeset_collapse_events = false
changeset_long_messages = false
changeset_show_files = 0
default_daysback = 30
max_daysback = 90
newticket_formatter = oneliner
ticket_show_details = false
[trac]
auth_cookie_lifetime = 0
auth_cookie_path =
authz_file =
authz_module_name =
auto_preview_timeout = 2.0
auto_reload = False
backup_dir = db
base_url = ${:project_url}
check_auth_ip = false
database = mysql://${:mysql_username}:${:mysql_password}@${:mysql_host}:${:mysql_port}/${:mysql_database}
debug_sql = False
default_charset = utf-8
default_dateinfo_format = relative
genshi_cache_size = 128
htdocs_location =
ignore_auth_case = false
jquery_location =
jquery_ui_location =
jquery_ui_theme_location =
mainnav = wiki, timeline, roadmap, browser, tickets, newticket, search
metanav = login, logout, prefs, help, about
mysqldump_path = mysqldump
never_obfuscate_mailto = false
permission_policies = DefaultPermissionPolicy, LegacyAttachmentPolicy
permission_store = DefaultPermissionStore
pg_dump_path = pg_dump
repository_dir =
repository_sync_per_request = (default)
repository_type = svn
resizable_textareas = true
secure_cookies = False
show_email_addresses = false
show_ip_addresses = false
timeout = 20
use_base_url_for_redirect = False
[versioncontrol]
allowed_repository_dir_prefixes =
[wiki]
ignore_missing_pages = false
max_size = 262144
render_unsafe_content = false
safe_schemes = cvs, file, ftp, git, irc, http, https, news, sftp, smb, ssh, svn, svn+ssh
split_page_names = false
software/trac-svn/templates/trac.wsgi.in
0 → 100644
View file @
20d2c4e5
#!${:python_bin}
# -*- coding: utf-8 -*-
import os
def application(environ, start_request):
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