Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SlapOS Develop
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
Eric Zheng
SlapOS Develop
Commits
038c1ea3
Commit
038c1ea3
authored
Aug 04, 2011
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor code to insert all entries in stunnel.conf
parent
7c78875c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
slapos/recipe/apache/__init__.py
slapos/recipe/apache/__init__.py
+14
-9
No files found.
slapos/recipe/apache/__init__.py
View file @
038c1ea3
...
@@ -67,7 +67,7 @@ class Recipe(BaseSlapRecipe):
...
@@ -67,7 +67,7 @@ class Recipe(BaseSlapRecipe):
slave_instance_list
=
self
.
parameter_dict
.
get
(
"slave_instance_list"
,
[])
slave_instance_list
=
self
.
parameter_dict
.
get
(
"slave_instance_list"
,
[])
rewrite_rule_list
=
[]
rewrite_rule_list
=
[]
slave_dict
=
{}
slave_dict
=
{}
s
tunnel_list
=
[]
s
ervice_dict
=
{}
base_url
=
"https://%s:%s/"
%
(
frontend_domain_name
,
frontend_port_number
)
base_url
=
"https://%s:%s/"
%
(
frontend_domain_name
,
frontend_port_number
)
for
slave_instance
in
slave_instance_list
:
for
slave_instance
in
slave_instance_list
:
url
=
slave_instance
.
get
(
"url"
)
url
=
slave_instance
.
get
(
"url"
)
...
@@ -292,7 +292,8 @@ class Recipe(BaseSlapRecipe):
...
@@ -292,7 +292,8 @@ class Recipe(BaseSlapRecipe):
return
varnish_config
return
varnish_config
def
installStunnel
(
self
,
service_dict
,
ca_certificate
,
key
,
ca_crl
,
ca_path
):
def
installStunnel
(
self
,
service_dict
,
certificate
,
key
,
ca_crl
,
ca_path
):
"""Installs stunnel
"""Installs stunnel
service_dict =
service_dict =
{ name: (public_ip, private_ip, public_port, private_port),}
{ name: (public_ip, private_ip, public_port, private_port),}
...
@@ -305,16 +306,20 @@ class Recipe(BaseSlapRecipe):
...
@@ -305,16 +306,20 @@ class Recipe(BaseSlapRecipe):
stunnel_conf
=
dict
(
stunnel_conf
=
dict
(
pid_file
=
pid_file
,
pid_file
=
pid_file
,
log
=
log
,
log
=
log
,
cert
=
c
a_c
ertificate
,
cert
=
certificate
,
key
=
key
,
key
=
key
,
ca_crl
=
ca_crl
,
ca_crl
=
ca_crl
,
ca_path
=
ca_path
,
ca_path
=
ca_path
,
entry_
list
=
''
entry_
str
=
''
)
)
for
service
in
service_dict
:
entry_list
=
[]
# Get template_entry_filename and generate the entry_list
for
name
,
parameter_dict
in
service_dict
.
iteritems
():
pass
parameter_dict
[
"name"
]
=
name
entry_str
=
self
.
substituteTemplate
(
template_entry_filename
,
parameter_dict
)
entry_list
.
append
(
entry_str
)
stunnel_conf
[
"entry_str"
]
=
"
\
n
"
.
join
(
entry_list
)
stunnel_conf_path
=
self
.
createConfigurationFile
(
"stunnel.conf"
,
stunnel_conf_path
=
self
.
createConfigurationFile
(
"stunnel.conf"
,
self
.
substituteTemplate
(
template_filename
,
self
.
substituteTemplate
(
template_filename
,
stunnel_conf
))
stunnel_conf
))
...
@@ -322,7 +327,7 @@ class Recipe(BaseSlapRecipe):
...
@@ -322,7 +327,7 @@ class Recipe(BaseSlapRecipe):
'slapos.recipe.librecipe.execute'
,
'execute_wait'
)],
self
.
ws
,
'slapos.recipe.librecipe.execute'
,
'execute_wait'
)],
self
.
ws
,
sys
.
executable
,
self
.
wrapper_directory
,
arguments
=
[
sys
.
executable
,
self
.
wrapper_directory
,
arguments
=
[
[
self
.
options
[
'stunnel_binary'
].
strip
(),
stunnel_conf_path
],
[
self
.
options
[
'stunnel_binary'
].
strip
(),
stunnel_conf_path
],
[
c
a_c
ertificate
,
key
]]
[
certificate
,
key
]]
)[
0
]
)[
0
]
self
.
path_list
.
append
(
wrapper
)
self
.
path_list
.
append
(
wrapper
)
return
stunnel_conf
return
stunnel_conf
...
...
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