Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Carlos Ramos Carreño
erp5
Commits
6974d9d6
Commit
6974d9d6
authored
Sep 21, 2012
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create the superuser, set his password, provide a php.ini
parent
9d7b44e4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
2 deletions
+36
-2
slapos/recipe/postgres/__init__.py
slapos/recipe/postgres/__init__.py
+13
-1
software/maarch/php.ini.in
software/maarch/php.ini.in
+18
-0
software/maarch/software.cfg
software/maarch/software.cfg
+4
-0
stack/lapp/instance-postgres.cfg.in
stack/lapp/instance-postgres.cfg.in
+1
-1
No files found.
slapos/recipe/postgres/__init__.py
View file @
6974d9d6
...
...
@@ -25,6 +25,7 @@
#
##############################################################################
import
md5
import
os
import
sys
import
subprocess
...
...
@@ -74,6 +75,7 @@ class Recipe(GenericBaseRecipe):
pgdata
=
self
.
options
[
'pgdata-directory'
]
with
open
(
os
.
path
.
join
(
pgdata
,
'postgresql.conf'
),
'wb'
)
as
cfg
:
# XXX TODO listen_addresses
cfg
.
write
(
textwrap
.
dedent
(
"""
\
logging_collector = on
log_rotation_size = 50MB
...
...
@@ -118,7 +120,17 @@ class Recipe(GenericBaseRecipe):
'-D'
,
pgdata
,
'postgres'
,
],
stdin
=
subprocess
.
PIPE
)
p
.
communicate
(
'CREATE DATABASE %s
\
n
'
%
self
.
options
[
'dbname'
])
password
=
'insecure'
enc_password
=
md5
.
md5
(
password
).
hexdigest
()
# to execute multiple commands, all newlines (but the last) must be preceded by backslash.
# see http://www.postgresql.org/docs/9.1/static/app-postgres.html
sql
=
'
\
n
'
.
join
([
'CREATE DATABASE %s
\
\
\
n
'
%
self
.
options
[
'dbname'
],
"CREATE USER '%s' PASSWORD '%s' SUPERUSER'
\
n
"
%
(
self
.
options
[
'user'
],
enc_password
),
])
p
.
communicate
(
sql
)
except
subprocess
.
CalledProcessError
:
raise
UserError
(
'Could not create database %s'
%
pgdata
)
...
...
software/maarch/php.ini.in
0 → 100644
View file @
6974d9d6
[PHP]
engine = On
safe_mode = Off
expose_php = Off
error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED
display_errors = On
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
session.save_path = "%(tmp_directory)s"
session.auto_start = 0
date.timezone = Europe/Paris
file_uploads = On
upload_max_filesize = 8M
post_max_size = 8M
magic_quotes_gpc=Off
software/maarch/software.cfg
View file @
6974d9d6
...
...
@@ -41,3 +41,7 @@ install_cmd =
${apache-php-postgres:location}/bin/pear install maarch/CLITools-0.3.1
${apache-php-postgres:location}/bin/pear install MIME_Type
[apache-php-postgres]
php-ini-dir = ${buildout:directory}
stack/lapp/instance-postgres.cfg.in
View file @
6974d9d6
...
...
@@ -43,7 +43,7 @@ recipe = slapos.cookbook:postgres
# Options
ipv6_host = $${instance-parameters:ipv6}
user =
user
user =
postgres
port = 5432
dbname = db
# pgdata_directory is created by initdb, and should not exist beforehand.
...
...
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