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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kwabena Antwi-Boasiako
slapos
Commits
2c0c1ec2
Commit
2c0c1ec2
authored
Dec 14, 2011
by
Antoine Catton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Save secret_key in order to avoid changing it every buildout run.
parent
4c201202
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
slapos/recipe/apachephp/__init__.py
slapos/recipe/apachephp/__init__.py
+11
-3
No files found.
slapos/recipe/apachephp/__init__.py
View file @
2c0c1ec2
...
@@ -73,9 +73,17 @@ class Recipe(GenericBaseRecipe):
...
@@ -73,9 +73,17 @@ class Recipe(GenericBaseRecipe):
)
)
path_list
.
append
(
wrapper
)
path_list
.
append
(
wrapper
)
secret_key
=
uuencode
(
os
.
urandom
(
45
)).
strip
()
secret_key_filename
=
os
.
path
.
join
(
self
.
buildout
[
'buildout'
][
'directory'
],
# Remove unsafe characters
'.php_secret_key'
)
secret_key
=
secret_key
.
translate
(
None
,
'"
\
'
'
)
if
not
os
.
path
.
exists
(
secret_key_filename
):
secret_key
=
uuencode
(
os
.
urandom
(
45
)).
strip
()
# Remove unsafe characters
secret_key
=
secret_key
.
translate
(
None
,
'"
\
'
'
)
with
open
(
secret_key_filename
,
'w'
)
as
secret_key_file
:
secret_key_file
.
write
(
secret_key
)
else
:
with
open
(
secret_key_filename
,
'r'
)
as
secret_key_file
:
secret_key
=
secret_key_file
.
read
()
application_conf
=
dict
(
mysql_database
=
self
.
options
[
'mysql-database'
],
application_conf
=
dict
(
mysql_database
=
self
.
options
[
'mysql-database'
],
mysql_user
=
self
.
options
[
'mysql-username'
],
mysql_user
=
self
.
options
[
'mysql-username'
],
...
...
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