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
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
Ivan Tyagov
slapos
Commits
0c513667
Commit
0c513667
authored
Jun 08, 2011
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement initial draft of install front end method.
parent
d4083b76
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
13 deletions
+52
-13
slapos/recipe/apache/__init__.py
slapos/recipe/apache/__init__.py
+52
-13
No files found.
slapos/recipe/apache/__init__.py
View file @
0c513667
...
@@ -53,14 +53,13 @@ class Recipe(BaseSlapRecipe):
...
@@ -53,14 +53,13 @@ class Recipe(BaseSlapRecipe):
self
.
path_list
.
append
(
self
.
killpidfromfile
)
self
.
path_list
.
append
(
self
.
killpidfromfile
)
ca_conf
=
self
.
installCertificateAuthority
()
ca_conf
=
self
.
installCertificateAuthority
()
key
,
certificate
=
self
.
requestCertificate
(
'Login Based Access'
)
key
,
certificate
=
self
.
requestCertificate
(
'Apache Front end'
)
apache_conf
=
dict
(
apache_login
=
self
.
installBackendApache
(
ip
=
self
.
getGlobalIPv6Address
(),
site_url
=
self
.
installFrontendApache
(
ip
=
self
.
getGlobalIPv6Address
(),
port
=
13000
,
backend
=
zope_access
,
key
=
key
,
certificate
=
certificate
))
port
=
8080
,
key
=
key
,
certificate
=
certificate
)
self
.
linkBinary
()
self
.
linkBinary
()
self
.
setConnectionDict
(
dict
(
self
.
setConnectionDict
(
dict
(
site_url
=
site_url
,
))
site_url
=
apache_conf
[
'apache_login'
],
))
return
self
.
path_list
return
self
.
path_list
def
installLogrotate
(
self
):
def
installLogrotate
(
self
):
...
@@ -177,7 +176,7 @@ class Recipe(BaseSlapRecipe):
...
@@ -177,7 +176,7 @@ class Recipe(BaseSlapRecipe):
__name__
,
'template/openssl.cnf.ca.in'
)
%
config
)
__name__
,
'template/openssl.cnf.ca.in'
)
%
config
)
self
.
path_list
.
extend
(
zc
.
buildout
.
easy_install
.
scripts
([
self
.
path_list
.
extend
(
zc
.
buildout
.
easy_install
.
scripts
([
(
'certificate_authority'
,
(
'certificate_authority'
,
__name__
+
'
.certificate_authority'
,
'runCertificateAuthority'
)],
'slapos.recipe.erp5
.certificate_authority'
,
'runCertificateAuthority'
)],
self
.
ws
,
sys
.
executable
,
self
.
wrapper_directory
,
arguments
=
[
dict
(
self
.
ws
,
sys
.
executable
,
self
.
wrapper_directory
,
arguments
=
[
dict
(
openssl_configuration
=
openssl_configuration
,
openssl_configuration
=
openssl_configuration
,
openssl_binary
=
self
.
options
[
'openssl_binary'
],
openssl_binary
=
self
.
options
[
'openssl_binary'
],
...
@@ -186,6 +185,7 @@ class Recipe(BaseSlapRecipe):
...
@@ -186,6 +185,7 @@ class Recipe(BaseSlapRecipe):
crl
=
os
.
path
.
join
(
self
.
ca_crl
),
crl
=
os
.
path
.
join
(
self
.
ca_crl
),
request_dir
=
self
.
ca_request_dir
request_dir
=
self
.
ca_request_dir
)]))
)]))
# configure backup
# configure backup
backup_cron
=
os
.
path
.
join
(
self
.
cron_d
,
'ca_rdiff_backup'
)
backup_cron
=
os
.
path
.
join
(
self
.
cron_d
,
'ca_rdiff_backup'
)
open
(
backup_cron
,
'w'
).
write
(
open
(
backup_cron
,
'w'
).
write
(
...
@@ -219,8 +219,47 @@ class Recipe(BaseSlapRecipe):
...
@@ -219,8 +219,47 @@ class Recipe(BaseSlapRecipe):
apache_conf
[
'pid_file'
]
+
' SIGUSR1'
)
apache_conf
[
'pid_file'
]
+
' SIGUSR1'
)
return
apache_conf
return
apache_conf
def
installFrontendApache
(
self
,
ip
,
port
,
name
,
frontend_path
,
backend_url
,
def
installFrontendApache
(
self
,
ip
,
port
,
key
,
certificate
,
backend_path
,
key
,
certificate
,
access_control_string
=
None
):
name
=
"slapos"
,
access_control_string
=
None
):
"""
ident
=
'frontend_'
+
name
"""
frontend_path
=
self
.
createDataDirectory
(
'apacheshared'
)
pass
apache_conf
=
self
.
_getApacheConfigurationDict
(
ident
,
ip
,
port
)
apache_conf
[
'server_name'
]
=
name
apache_conf
[
'ssl_snippet'
]
=
pkg_resources
.
resource_string
(
__name__
,
'template/apache.ssl-snippet.conf.in'
)
%
dict
(
login_certificate
=
certificate
,
login_key
=
key
)
path
=
pkg_resources
.
resource_string
(
__name__
,
'template/apache.zope.conf.path-protected.in'
)
%
dict
(
path
=
'/'
,
access_control_string
=
'none'
)
if
access_control_string
is
None
:
path_template
=
pkg_resources
.
resource_string
(
__name__
,
'template/apache.zope.conf.path.in'
)
path
+=
path_template
%
dict
(
path
=
frontend_path
)
else
:
path_template
=
pkg_resources
.
resource_string
(
__name__
,
'template/apache.zope.conf.path-protected.in'
)
path
+=
path_template
%
dict
(
path
=
frontend_path
,
access_control_string
=
access_control_string
)
rewrite_rule
=
"### Write rule not defined yet."
apache_conf
.
update
(
**
dict
(
path_enable
=
path
,
rewrite_rule
=
rewrite_rule
))
apache_conf_string
=
pkg_resources
.
resource_string
(
__name__
,
'template/apache.zope.conf.in'
)
%
apache_conf
apache_config_file
=
self
.
createConfigurationFile
(
ident
+
'.conf'
,
apache_conf_string
)
self
.
path_list
.
append
(
apache_config_file
)
self
.
path_list
.
extend
(
zc
.
buildout
.
easy_install
.
scripts
([(
ident
,
'slapos.recipe.erp5.apache'
,
'runApache'
)],
self
.
ws
,
sys
.
executable
,
self
.
wrapper_directory
,
arguments
=
[
dict
(
required_path_list
=
[
key
,
certificate
],
binary
=
self
.
options
[
'httpd_binary'
],
config
=
apache_config_file
)
]))
return
"https://[%s]:%s/"
%
(
ip
,
port
)
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