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
iv
slapos
Commits
51498e48
Commit
51498e48
authored
Jun 01, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to use LAMP applications without configuration
parent
b893666f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
19 deletions
+29
-19
slapos/recipe/apachephp/__init__.py
slapos/recipe/apachephp/__init__.py
+21
-19
stack/lamp/buildout.cfg
stack/lamp/buildout.cfg
+8
-0
No files found.
slapos/recipe/apachephp/__init__.py
View file @
51498e48
...
@@ -85,28 +85,30 @@ class Recipe(GenericBaseRecipe):
...
@@ -85,28 +85,30 @@ class Recipe(GenericBaseRecipe):
with
open
(
secret_key_filename
,
'r'
)
as
secret_key_file
:
with
open
(
secret_key_filename
,
'r'
)
as
secret_key_file
:
secret_key
=
secret_key_file
.
read
()
secret_key
=
secret_key_file
.
read
()
application_conf
=
dict
(
mysql_database
=
self
.
options
[
'mysql-database'
],
# Generate application configuration file
mysql_user
=
self
.
options
[
'mysql-username'
],
if
self
.
options
.
get
(
'template'
):
mysql_password
=
self
.
options
[
'mysql-password'
],
application_conf
=
dict
(
mysql_database
=
self
.
options
[
'mysql-database'
],
mysql_host
=
'%s:%s'
%
(
self
.
options
[
'mysql-host'
],
mysql_user
=
self
.
options
[
'mysql-username'
],
self
.
options
[
'mysql-port'
]),
mysql_password
=
self
.
options
[
'mysql-password'
],
secret_key
=
secret_key
,
mysql_host
=
'%s:%s'
%
(
self
.
options
[
'mysql-host'
],
)
self
.
options
[
'mysql-port'
]),
secret_key
=
secret_key
,
)
directory
,
file_
=
os
.
path
.
split
(
self
.
options
[
'configuration'
])
directory
,
file_
=
os
.
path
.
split
(
self
.
options
[
'configuration'
])
path
=
self
.
options
[
'htdocs'
]
path
=
self
.
options
[
'htdocs'
]
if
directory
:
if
directory
:
path
=
os
.
path
.
join
(
path
,
directory
)
path
=
os
.
path
.
join
(
path
,
directory
)
if
not
os
.
path
.
exists
(
path
):
if
not
os
.
path
.
exists
(
path
):
os
.
makedirs
(
path
)
os
.
makedirs
(
path
)
if
not
os
.
path
.
isdir
(
path
):
if
not
os
.
path
.
isdir
(
path
):
raise
OSError
(
"Cannot create %r."
%
path
)
raise
OSError
(
"Cannot create %r."
%
path
)
destination
=
os
.
path
.
join
(
path
,
file_
)
destination
=
os
.
path
.
join
(
path
,
file_
)
config
=
self
.
createFile
(
destination
,
config
=
self
.
createFile
(
destination
,
self
.
substituteTemplate
(
self
.
options
[
'template'
],
application_conf
))
self
.
substituteTemplate
(
self
.
options
[
'template'
],
application_conf
))
path_list
.
append
(
config
)
path_list
.
append
(
config
)
if
os
.
path
.
exists
(
self
.
options
[
'pid-file'
]):
if
os
.
path
.
exists
(
self
.
options
[
'pid-file'
]):
# Reload apache configuration
# Reload apache configuration
...
...
stack/lamp/buildout.cfg
View file @
51498e48
...
@@ -116,6 +116,14 @@ output = ${buildout:directory}/template-pull-backup.cfg
...
@@ -116,6 +116,14 @@ output = ${buildout:directory}/template-pull-backup.cfg
md5sum = 9aab30ba5aa23a37d4b507e7c414be00
md5sum = 9aab30ba5aa23a37d4b507e7c414be00
mode = 0644
mode = 0644
# Dummy parts in case no application configuration file is needed
[application-template]
filename =
location =
[application-configuration]
location =
[eggs]
[eggs]
recipe = zc.recipe.egg
recipe = zc.recipe.egg
eggs =
eggs =
...
...
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