-
Notifications
You must be signed in to change notification settings - Fork 62
/
build.cfg
235 lines (196 loc) · 8.68 KB
/
build.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
[transcodedaemon]
recipe = collective.transcode.recipe
listen_host = ${site:transcode-host}
listen_port = ${site:transcode-port}
videofolder = ${site:videofolder}
profiles = ${site:transcode-profiles}
secret = ${site:secret}
eggs =
collective.transcode.recipe
collective.transcode.daemon
[zeoserver]
recipe = plone.recipe.zeoserver
zeo-address = ${site:zeo-address}
zeo-var = ${buildout:directory}/var
blob-storage = ${zeoserver:zeo-var}/blobstorage
eggs = ZODB3
plone.app.blob
[paster]
recipe = zc.recipe.egg
dependent-scripts = true
eggs = PasteScript
${uwsgi:eggs}
[uwsgi]
recipe = unweb.recipe.uwsgi
eggs =
${plone:eggs}
PasteDeploy
[zserver-patch]
recipe = collective.recipe.patch
egg = Zope2==2.13.15
patches = ${buildout:directory}/patches/zserver.patch
${buildout:directory}/patches/wsgipublisher.patch
# Patch doesn't apply on newer version, doesn't look safe anyway
[upgrade-patch]
recipe = collective.recipe.patch
egg = plone.app.upgrade==1.2
patches = ${buildout:directory}/patches/upgrade.patch
[navtree-patch]
recipe = collective.recipe.patch
egg = plone.app.layout==2.2.6
patches = ${buildout:directory}/patches/navtree.patch
[ploneftp]
recipe = unweb.recipe.ploneftp
zope_ftp_address = ${site:instance-ftp}
address = ${site:plumiftp-address}
path = /${site:portal-id}/Members/%s/videos
tmp_dir = ${buildout:directory}/var/ploneftp
##############################################################################
# Build nginx & varnish for later configuration
##############################################################################
[lxml]
recipe = z3c.recipe.staticlxml
egg = lxml
build-libxslt = true
build-libxml2 = true
static-build = true
force = false
[ngx_cache_purge]
recipe = hexagonit.recipe.download
url = http://labs.frickle.com/files/ngx_cache_purge-2.1.tar.gz
strip-top-level-dir = true
[ngx_upload_module]
recipe = hexagonit.recipe.download
url = https://github.com/fdintino/nginx-upload-module/archive/master.zip
strip-top-level-dir = true
[nginx-build]
recipe = hexagonit.recipe.cmmi
url = ${downloads:nginx}
configure-options =
--with-http_ssl_module
--with-http_xslt_module
--with-http_stub_status_module
--with-pcre=${pcre-source:location}
--conf-path=${buildout:directory}/templates/nginx/default.conf
--error-log-path=${buildout:directory}/var/log/nginx-error.log
--pid-path=${buildout:directory}/var/nginx.pid
--lock-path=${buildout:directory}/var/nginx.lock
--add-module=${ngx_cache_purge:location}
--add-module=${ngx_upload_module:location}
environment =
CFLAGS=-w
[pcre]
recipe = hexagonit.recipe.cmmi
url = http://exim.mirror.globo.tech/pcre/pcre-8.00.tar.gz
[pcre-source]
recipe = hexagonit.recipe.download
url = http://exim.mirror.globo.tech/pcre/pcre-8.00.tar.gz
strip-top-level-dir = true
[varnish-build]
recipe = hexagonit.recipe.cmmi
url = ${downloads:varnish}
configure-options =
PCRE_CFLAGS=-I${buildout:directory}/parts/pcre/include
PCRE_LIBS="-L${buildout:directory}/parts/pcre/lib -lpcre"
##############################################################################
# Configure front-end web server
##############################################################################
[main-config]
recipe = collective.recipe.template
input = ${buildout:directory}/templates/nginx.conf.template
output = ${buildout:directory}/templates/nginx.conf
##############################################################################
# Configure Varnish cache
##############################################################################
[cache-config]
recipe = collective.recipe.template
input = ${buildout:directory}/templates/cache.conf.template
output = ${buildout:directory}/templates/cache.conf
[cache]
recipe = plone.recipe.varnish
daemon = ${buildout:directory}/parts/varnish-build/sbin/varnishd
mode = foreground
bind = ${site:cache-address}
cache-size = 1G
user = ${site:cache-user}
config = ${buildout:directory}/templates/cache.conf
##############################################################################
# Set up supervisor to run it all
##############################################################################
[supervisor]
recipe = collective.recipe.supervisor
port = ${site:supervisor-host}:${site:supervisor-port}
user = ${site:supervisor-user}
password = ${site:supervisor-pass}
serverurl = http://${site:supervisor-host}:${site:supervisor-port}
programs =
0 zeo ${zeoserver:location}/bin/runzeo true ${site:zeo-user}
10 uwsgi ${buildout:directory}/bin/uwsgi [ --ini-paste ${buildout:directory}/production.ini --ini ${buildout:directory}/parts/uwsgi/uwsgi.txt --paste-logger] true ${site:zope-user}
20 worker ${buildout:directory}/bin/worker [ console ] true ${site:zope-user}
30 transcodedaemon ${buildout:directory}/bin/transcodedaemon [fg] true ${site:transcode-user}
40 ploneftp ${buildout:directory}/bin/ploneftp [fg] true ${site:ftp-user}
50 cache ${buildout:directory}/bin/cache true ${site:cache-user}
60 nginx ${nginx-build:location}/sbin/nginx [-c ${buildout:directory}/templates/nginx.conf]
##############################################################################
# Log rotation
##############################################################################
[logrotate.conf]
recipe = collective.recipe.template
input = ${buildout:directory}/templates/logrotate.conf.template
output = ${buildout:directory}/templates/logrotate.conf
##############################################################################
# Debugging tools - preconfigured python interpreter, omelette
##############################################################################
[zopepy]
recipe = zc.recipe.egg
eggs =
${instance-settings:eggs}
interpreter = zopepy
scripts = zopepy
[omelette]
recipe = collective.recipe.omelette
eggs = ${instance-settings:eggs}
##############################################################################
# Backups - pack - chown
##############################################################################
# [backup]
# recipe = collective.recipe.backup
[backup-daily]
recipe = z3c.recipe.usercrontab
times = 0 0 * * *
command = ${buildout:bin-directory}/bin/backup
[pack-monthly]
recipe = z3c.recipe.usercrontab
times = 0 0 1 * *
command = ${buildout:bin-directory}/bin/zeopack
[chown]
# This recipe is used to set permissions for root mode installs
# For options see http://pypi.python.org/pypi/plone.recipe.command
recipe = plone.recipe.command
command =
echo Setting file permissions - root access required - you may be asked to enter your password
touch ${buildout:directory}/var/log/plone.log ${buildout:directory}/var/log/plone-Z2.log ${buildout:directory}/var/zeoserver.pid ${buildout:directory}/var/log/zeoserver.log ${buildout:directory}/parts/transcodedaemon/transcodedaemon.log
chown ${site:zeo-user} ${buildout:directory}/var/log/zeoserver.log ${buildout:directory}/var/zeoserver.pid
chgrp -R ${site:zeo-user} ${buildout:directory}/var
chown ${site:transcode-user} ${buildout:directory}/transcoded
chmod 770 ${buildout:directory}/var
chmod 775 ${buildout:directory}/var/log
mkdir ${buildout:directory}/var/filestorage ${buildout:directory}/var/blobstorage
mkdir ${buildout:directory}/torrents ${buildout:directory}/torrents_safe
mkdir ~/.python-eggs
chmod o+rwx ~/.python-eggs
chown -R ${site:zope-user} ${buildout:directory}/eggs
chown -R ${site:zope-user} ${buildout:directory}/torrents
chown -R ${site:zope-user} ${buildout:directory}/torrents_safe
chown -R ${site:zeo-user} ${buildout:directory}/var/filestorage
chown -R ${site:zeo-user} ${buildout:directory}/var/blobstorage
chown -R ${site:zope-user} ${buildout:directory}/var/log/plone.log ${buildout:directory}/var/log/plone-Z2.log
chown ${site:transcode-user} ${buildout:directory}/parts/transcodedaemon/transcodedaemon.log ${buildout:directory}/parts/transcodedaemon
if [ -f ${buildout:directory}/ffmpeg/bin/ffmpeg ] ; then ln -s ${buildout:directory}/ffmpeg/bin/ffmpeg ${buildout:directory}/bin/; else ln -s `which ffmpeg` ${buildout:directory}/bin/; fi
if [ -f ${buildout:directory}/ffmpeg/bin/qt-faststart ] ; then ln -s ${buildout:directory}/ffmpeg/bin/qt-faststart ${buildout:directory}/bin/; else ln -s `which qt-faststart` ${buildout:directory}/bin/; fi
if ! [ $TMPDIR ] ; then TMPDIR=/tmp/; fi
mkdir -p $TMPDIR/plumitmp
chown ${site:www-user}:${site:zope-user} $TMPDIR/plumitmp
chmod 770 $TMPDIR/plumitmp
update-command = ${chown:command}
stop-on-error = false