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
Labels
Merge Requests
106
Merge Requests
106
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
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
Show 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):
)
path_list
.
append
(
wrapper
)
secret_key_filename
=
os
.
path
.
join
(
self
.
buildout
[
'buildout'
][
'directory'
],
'.php_secret_key'
)
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'
],
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