Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
141
Merge Requests
141
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
5080a7d3
Commit
5080a7d3
authored
May 17, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to configure location ACLs.
parent
f2dd3054
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
7 deletions
+23
-7
slapos/recipe/erp5/src/slapos/recipe/erp5/__init__.py
slapos/recipe/erp5/src/slapos/recipe/erp5/__init__.py
+18
-7
slapos/recipe/erp5/src/slapos/recipe/erp5/template/apache.location-snippet.conf.in
...apos/recipe/erp5/template/apache.location-snippet.conf.in
+5
-0
No files found.
slapos/recipe/erp5/src/slapos/recipe/erp5/__init__.py
View file @
5080a7d3
...
...
@@ -696,12 +696,18 @@ class Recipe(BaseSlapRecipe):
apache_conf
[
'pid_file'
]
+
' SIGUSR1'
)
return
apache_conf
def
_writeApacheConfiguration
(
self
,
prefix
,
apache_conf
,
backend
):
def
_writeApacheConfiguration
(
self
,
prefix
,
apache_conf
,
backend
,
location_access_mapping
=
None
):
if
location_access_mapping
is
None
:
location_access_mapping
=
{}
rewrite_rule_template
=
\
"RewriteRule (.*) http://%(backend)s$1 [L,P]"
path_template
=
pkg_resources
.
resource_string
(
__name__
,
'template/apache.zope.conf.path.in'
)
if
location_access_mapping
is
None
:
path
=
path_template
%
dict
(
path
=
'/'
)
else
:
path
=
''
d
=
dict
(
path
=
path
,
backend
=
backend
,
...
...
@@ -714,12 +720,17 @@ class Recipe(BaseSlapRecipe):
path_enable
=
path
,
rewrite_rule
=
rewrite_rule
))
return
self
.
createConfigurationFile
(
prefix
+
'.conf'
,
pkg_resources
.
resource_string
(
__name__
,
'template/apache.zope.conf.in'
)
%
apache_conf
)
apache_conf_string
=
pkg_resources
.
resource_string
(
__name__
,
'template/apache.zope.conf.in'
)
%
apache_conf
location_template
=
pkg_resources
.
resource_string
(
__name__
,
'template/apache.location-snippet.conf.in'
)
for
location
,
allow_string
in
location_access_mapping
.
iteritems
():
apache_conf_string
+=
'
\
n
'
+
location_template
%
dict
(
location
=
location
,
allow_string
=
allow_string
)
+
'
\
n
'
return
self
.
createConfigurationFile
(
prefix
+
'.conf'
,
apache_conf_string
)
def
installLoginApache
(
self
,
ip
,
port
,
backend
,
key
,
certificate
,
suffix
=
''
):
suffix
=
''
,
location_access_mapping
=
None
):
ssl_template
=
"""SSLEngine on
SSLCertificateFile %(login_certificate)s
SSLCertificateKeyFile %(login_key)s
...
...
@@ -732,7 +743,7 @@ SSLRandomSeed connect builtin
apache_conf
[
'ssl_snippet'
]
=
ssl_template
%
dict
(
login_certificate
=
certificate
,
login_key
=
key
)
apache_config_file
=
self
.
_writeApacheConfiguration
(
'login_apache'
+
suffix
,
apache_conf
,
backend
)
apache_conf
,
backend
,
location_access_mapping
)
self
.
path_list
.
append
(
apache_config_file
)
self
.
path_list
.
extend
(
zc
.
buildout
.
easy_install
.
scripts
([(
'login_apache'
+
suffix
,
...
...
slapos/recipe/erp5/src/slapos/recipe/erp5/template/apache.location-snippet.conf.in
0 → 100644
View file @
5080a7d3
<Location %(location)s>
Order Deny,Allow
Deny from all
Allow from %(allow_string)s
</Location>
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