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
Nicolas Wavrant
slapos
Commits
466e239f
Commit
466e239f
authored
May 04, 2012
by
Thomas Lechauve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fetch new vifib and put it in docroot of nginx
parent
7b4d9ecc
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
264 additions
and
110 deletions
+264
-110
component/nginx/buildout.cfg
component/nginx/buildout.cfg
+1
-0
setup.py
setup.py
+1
-0
slapos/recipe/html5as/__init__.py
slapos/recipe/html5as/__init__.py
+38
-31
slapos/recipe/html5as/template/mime_types.in
slapos/recipe/html5as/template/mime_types.in
+78
-0
slapos/recipe/html5as/template/nginx_conf.in
slapos/recipe/html5as/template/nginx_conf.in
+32
-0
slapos/recipe/html5as/template/nginx_run.in
slapos/recipe/html5as/template/nginx_run.in
+14
-0
slapos/recipe/html5as/templates/nginx_conf.in
slapos/recipe/html5as/templates/nginx_conf.in
+0
-51
slapos/recipe/html5as/templates/nginx_index.in
slapos/recipe/html5as/templates/nginx_index.in
+0
-21
slapos/recipe/html5as/templates/nginx_run.in
slapos/recipe/html5as/templates/nginx_run.in
+0
-5
software/html5as/instance.cfg
software/html5as/instance.cfg
+12
-0
software/html5as/instance_html5as.cfg
software/html5as/instance_html5as.cfg
+60
-0
software/html5as/software.cfg
software/html5as/software.cfg
+27
-1
stack/slapos.cfg
stack/slapos.cfg
+1
-1
No files found.
component/nginx/buildout.cfg
View file @
466e239f
...
...
@@ -9,6 +9,7 @@ parts = nginx
recipe = hexagonit.recipe.cmmi
url = http://nginx.org/download/nginx-1.0.14.tar.gz
configure-options=
--with-ipv6
--with-ld-opt="-L ${pcre:location}/lib -Wl,-rpath=${pcre:location}/lib -Wl,-rpath=${zlib:location}/lib"
--with-cc-opt="-I ${pcre:location}/include"
setup.py
View file @
466e239f
...
...
@@ -61,6 +61,7 @@ setup(name=name,
'nbdserver = slapos.recipe.nbdserver:Recipe'
,
'generic.onetimeupload = slapos.recipe.generic_onetimeupload:Recipe'
,
'helloworld = slapos.recipe.helloworld:Recipe'
,
'html5as = slapos.recipe.html5as:Recipe'
,
'generic.cloudooo = slapos.recipe.generic_cloudooo:Recipe'
,
'fontconfig = slapos.recipe.fontconfig:Recipe'
,
'java = slapos.recipe.java:Recipe'
,
...
...
slapos/recipe/html5as/__init__.py
View file @
466e239f
...
...
@@ -16,7 +16,7 @@
#
# 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
# 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
...
...
@@ -34,35 +34,42 @@ class Recipe(GenericBaseRecipe):
nginx instance configuration.
"""
def
__init__
(
self
,
buildout
,
name
,
options
):
return
GenericBaseRecipe
.
__init__
(
self
,
buildout
,
name
,
options
)
def
install
(
self
):
config
=
dict
(
nb_workers
=
self
.
options
[
"nb_workers"
]
path_pid
=
self
.
options
[
"path_pid"
]
path_log
=
self
.
options
[
"path_log"
]
path_access_log
=
self
.
options
[
"path_access_log"
]
root
=
self
.
options
[
"root"
]
ip
=
self
.
options
[
"ip"
]
port
=
self
.
options
[
"port"
]
path_shell
=
self
.
options
[
"path_shell"
]
config_file
=
self
.
options
[
"config_file"
]
path
=
self
.
options
[
"path"
]
)
# Configs
nginx_conf_file
=
self
.
createFile
(
self
.
options
[
'config_file'
],
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'nginx_conf.in'
,
config
))
)
# Index default
nginx_index_file
=
self
.
createFile
(
'/'
.
join
([
root
,
"index.html"
),
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'nginx_index.in'
,
config
))
)
# Runners
runner_path
=
self
.
createExecutable
(
self
.
options
[
'path'
],
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'nginx_run.in'
),
config
))
config
=
dict
(
nb_workers
=
self
.
options
[
"nb_workers"
],
path_pid
=
self
.
options
[
"path_pid"
],
path_log
=
self
.
options
[
"path_log"
],
tmp
=
self
.
options
[
"tmp"
],
path_access_log
=
self
.
options
[
"path_access_log"
],
path_error_log
=
self
.
options
[
"path_error_log"
],
root
=
self
.
options
[
"root"
],
ip
=
self
.
options
[
"ip"
],
port
=
self
.
options
[
"port"
],
path_shell
=
self
.
options
[
"path_shell"
],
config_file
=
self
.
options
[
"config_file"
],
path
=
self
.
options
[
"path"
],
nginx_path
=
self
.
options
[
"nginx_path"
],
mime_path
=
self
.
options
[
"mime_path"
],
default_index
=
self
.
options
[
"default_index"
]
)
# Configs
nginx_conf_file
=
self
.
createFile
(
self
.
options
[
'config_file'
],
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'nginx_conf.in'
),
config
)
)
nginx_mime_types
=
self
.
createFile
(
self
.
options
[
'mime_path'
],
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'mime_types.in'
),
config
)
)
# Runners
runner_path
=
self
.
createExecutable
(
self
.
options
[
'path'
],
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'nginx_run.in'
),
config
))
return
[
runner_path
]
return
[
runner_path
,
nginx_conf_file
]
slapos/recipe/html5as/template/mime_types.in
0 → 100644
View file @
466e239f
types {
text/html html htm shtml;
text/css css;
text/xml xml rss;
image/gif gif;
image/jpeg jpeg jpg;
application/x-javascript js;
application/atom+xml atom;
text/mathml mml;
text/plain txt;
text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml;
text/x-component htc;
image/png png;
image/tiff tif tiff;
image/vnd.wap.wbmp wbmp;
image/x-icon ico;
image/x-jng jng;
image/x-ms-bmp bmp;
image/svg+xml svg svgz;
application/java-archive jar war ear;
application/mac-binhex40 hqx;
application/msword doc;
application/pdf pdf;
application/postscript ps eps ai;
application/rtf rtf;
application/vnd.ms-excel xls;
application/vnd.ms-powerpoint ppt;
application/vnd.wap.wmlc wmlc;
application/vnd.google-earth.kml+xml kml;
application/vnd.google-earth.kmz kmz;
application/x-7z-compressed 7z;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp;
application/x-makeself run;
application/x-perl pl pm;
application/x-pilot prc pdb;
application/x-rar-compressed rar;
application/x-redhat-package-manager rpm;
application/x-sea sea;
application/x-shockwave-flash swf;
application/x-stuffit sit;
application/x-tcl tcl tk;
application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi;
application/xhtml+xml xhtml;
application/zip zip;
application/octet-stream bin exe dll;
application/octet-stream deb;
application/octet-stream dmg;
application/octet-stream eot;
application/octet-stream iso img;
application/octet-stream msi msp msm;
application/ogg ogx;
audio/midi mid midi kar;
audio/mpeg mpga mpega mp2 mp3 m4a;
audio/ogg oga ogg spx;
audio/x-realaudio ra;
audio/webm weba;
video/3gpp 3gpp 3gp;
video/mp4 mp4;
video/mpeg mpeg mpg mpe;
video/ogg ogv;
video/quicktime mov;
video/webm webm;
video/x-flv flv;
video/x-mng mng;
video/x-ms-asf asx asf;
video/x-ms-wmv wmv;
video/x-msvideo avi;
}
slapos/recipe/html5as/template/nginx_conf.in
0 → 100644
View file @
466e239f
worker_processes %(nb_workers)s;
user nouser nogroup;
pid %(path_pid)s;
error_log %(path_error_log)s;
events {
worker_connections 1024;
accept_mutex off;
}
http {
include mime.types;
default_type application/octet-stream;
access_log %(path_access_log)s combined;
index index.html;
server {
listen [::]:%(port)s;
server_name _;
keepalive_timeout 5;
client_body_temp_path %(tmp)s/client_body_temp;
proxy_temp_path %(tmp)s/proxy_temp;
fastcgi_temp_path %(tmp)s/fastcgi_temp;
uwsgi_temp_path %(tmp)s/uwsgi_temp;
scgi_temp_path %(tmp)s/scgi_temp;
# path for static files
root %(root)s;
}
}
slapos/recipe/html5as/template/nginx_run.in
0 → 100644
View file @
466e239f
#!%(path_shell)s
# BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically
git clone http://git.erp5.org/repos/slapos.core.git --branch slapjs
cd slapos.core
git config core.sparsecheckout true
echo jQuery/vifib/ > .git/info/sparse-checkout
git read-tree -m -u slapjs
mv jQuery/vifib/* %(root)s
cd ..
rm -r slapos.core
exec %(nginx_path)s -c %(config_file)s
slapos/recipe/html5as/templates/nginx_conf.in
deleted
100644 → 0
View file @
7b4d9ecc
worker_processes %{nb_workers};
user nobody nogroup;
pid %{path_pid}/nginx.pid;
error_log %{path_log}/nginx.error.log;
events {
worker_connections 1024;
accept_mutex off;
}
http {
include mime.types;
default_type application/octet-stream;
access_log %{path_access_log}/nginx.access.log combined;
sendfile on;
server {
listen 80 default;
client_max_body_size 4G;
server_name _;
keepalive_timeout 5;
# path for static files
root %{root};
location / {
# checks for static file, if not found proxy to app
proxy_pass http://%{ip}:%{port}/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location @proxy_to_app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://app_server;
}
error_page 500 502 503 504 /500.html;
location = /500.html {
root %{root};
}
}
}
slapos/recipe/html5as/templates/nginx_index.in
deleted
100644 → 0
View file @
7b4d9ecc
<!doctype html>
<html>
<head></head>
<body>
<center>
<h2>
Nginx instance:
</h2>
<ul>
<li>
workers: %{nb_workers}
</li>
<li>
pid file : %{path_pid}
</li>
<li>
log file : %{path_log}
</li>
<li>
access log file : %{path_access_log}
</li>
<li>
root : %{root}
</li>
<li>
ip : %{ip}
</li>
<li>
port : %{port}
</li>
<li>
shell : %{path_shell}
</li>
<li>
config file : %{config_file}
</li>
<li>
server bin : %{path}
</li>
</ul>
</center>
</body>
</html>
\ No newline at end of file
slapos/recipe/html5as/templates/nginx_run.in
deleted
100644 → 0
View file @
7b4d9ecc
#!%(path_shell)s
# BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically
exec %(path)s -c %(config_file)s
software/html5as/instance.cfg
0 → 100644
View file @
466e239f
[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_html5as:output}
software/html5as/instance_html5as.cfg
0 → 100644
View file @
466e239f
[buildout]
parts =
html5as
publish-connection-information
# partition tree
# /
# |- etc/
# | |- nginx.conf
# | |- run/
# | |- nginx (binary)
# |- var/
# | |- run/
# | | |- nginx.pid
# | |- log/
# | | |- nginx.log
# | | |- nginx.access.log
# |- srv/
# | |- html5as/ (doc root)
# | | |- index.html
# | |- backup/
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
[basedirectory]
recipe = slapos.cookbook:mkdirectory
services = $${rootdirectory:etc}/run
log = $${rootdirectory:var}/log
run = $${rootdirectory:var}/run
backup = $${rootdirectory:srv}/backup
data = $${rootdirectory:srv}/html5as
[html5as]
recipe = slapos.cookbook:html5as
nb_workers = 2
path_pid = $${basedirectory:run}/nginx.pid
path_log = $${basedirectory:log}/nginx.log
path_access_log = $${basedirectory:log}/nginx.access.log
path_error_log = $${basedirectory:log}/nginx.error.log
root = $${basedirectory:data}
default_index = $${basedirectory:data}/index.html
ip = $${slap-network-information:global-ipv6}
port = 8080
path_shell = ${dash:location}/bin/dash
nginx_path = ${nginx:location}/sbin/nginx
config_file = $${rootdirectory:etc}/nginx.conf
mime_path = $${rootdirectory:etc}/mime.types
path = $${basedirectory:services}/nginx
tmp = $${buildout:directory}/tmp
[publish-connection-information]
recipe = slapos.cookbook:publish
server_url = http://[$${html5as:ip}]:$${html5as:port}
software/html5as/software.cfg
View file @
466e239f
[buildout]
versions = versions
extensions = buildout-versions
extends =
../../stack/slapos.cfg
../../component/nginx/buildout.cfg
../../component/dash/buildout.cfg
develop = /opt/slapdev
parts =
template
dash
nginx
eggs
instance_html5as
[html5as]
[eggs]
recipe = z3c.recipe.scripts
eggs = slapos.cookbook
[template]
# Default template for the instance.
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
output = ${buildout:directory}/template.cfg
#md5sum = 196670999d6b015f48483d2ae6f15fbd
mode = 0644
[instance_html5as]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance_html5as.cfg
output = ${buildout:directory}/template_html5as.cfg
#md5sum = 4e0a5c24ded8f0e9afa78c2f37377278
mode = 0644
[versions]
zc.buildout = 1.6.0-dev-SlapOS-005
stack/slapos.cfg
View file @
466e239f
...
...
@@ -25,7 +25,7 @@ allow-hosts +=
*.nexedi.org
*.python.org
*.sourceforge.net
alastairs-place.net
#
alastairs-place.net
dist.repoze.org
effbot.org
github.com
...
...
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