Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos-caddy
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
Guillaume Hervier
slapos-caddy
Commits
f9435cce
Commit
f9435cce
authored
Jun 19, 2014
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
abilian: moved postgres to ipv4
parent
f6cba2aa
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
19 deletions
+14
-19
slapos/recipe/postgres/__init__.py
slapos/recipe/postgres/__init__.py
+7
-5
software/abilian/extranet_spr/instance-postgres.cfg.in
software/abilian/extranet_spr/instance-postgres.cfg.in
+2
-9
software/abilian/extranet_spr/instance.cfg.in
software/abilian/extranet_spr/instance.cfg.in
+1
-1
software/abilian/extranet_spr/software.cfg
software/abilian/extranet_spr/software.cfg
+2
-2
software/postgres/instance.cfg.in
software/postgres/instance.cfg.in
+1
-1
software/postgres/software.cfg
software/postgres/software.cfg
+1
-1
No files found.
slapos/recipe/postgres/__init__.py
View file @
f9435cce
...
...
@@ -70,7 +70,7 @@ class Recipe(GenericBaseRecipe):
"""
def
_options
(
self
,
options
):
options
[
'url'
]
=
'postgresql://%(superuser)s:%(password)s@[%(ipv
6-random
)s]:%(port)s/%(dbname)s'
%
options
options
[
'url'
]
=
'postgresql://%(superuser)s:%(password)s@[%(ipv
4
)s]:%(port)s/%(dbname)s'
%
options
def
install
(
self
):
...
...
@@ -128,13 +128,15 @@ class Recipe(GenericBaseRecipe):
pgdata
=
self
.
options
[
'pgdata-directory'
]
ipv4
=
self
.
options
[
'ipv4'
]
ipv6
=
self
.
options
[
'ipv6'
]
ipv6
=
self
.
options
.
get
(
'ipv6'
,
set
())
postgresql_conf_path
=
os
.
path
.
join
(
pgdata
,
'postgresql.conf'
)
with
open
(
postgresql_conf_path
,
'wb'
)
as
cfg
:
ret
.
append
(
postgresql_conf_path
)
template
=
self
.
options
[
'template-postgresql-conf'
].
lstrip
()
cfg
.
write
(
template
.
format
(
listen_addresses
=
','
.
join
(
ipv4
.
union
(
ipv6
)),
cfg
.
write
(
template
.
format
(
ipv4_listen_addresses
=
','
.
join
(
ipv4
),
ipv6_listen_addresses
=
','
.
join
(
ipv6
),
listen_addresses
=
','
.
join
(
ipv4
.
union
(
ipv6
)),
unix_socket_directory
=
pgdata
))
cfg
.
write
(
'
\
n
'
)
...
...
@@ -143,13 +145,13 @@ class Recipe(GenericBaseRecipe):
ret
.
append
(
pghba_conf_path
)
# see http://www.postgresql.org/docs/9.2/static/auth-pg-hba-conf.html
template_hba_ipv4
=
self
.
options
.
get
(
'template-hba-ipv4'
).
strip
()
template_hba_ipv4
=
self
.
options
.
get
(
'template-hba-ipv4'
,
''
).
strip
()
ipv4_auth
=
''
if
template_hba_ipv4
:
for
ip
in
ipv4
:
ipv4_auth
+=
template_hba_ipv4
.
format
(
ip
=
ip
)
template_hba_ipv6
=
self
.
options
.
get
(
'template-hba-ipv6'
).
strip
()
template_hba_ipv6
=
self
.
options
.
get
(
'template-hba-ipv6'
,
''
).
strip
()
ipv6_auth
=
''
if
template_hba_ipv6
:
for
ip
in
ipv6
:
...
...
software/abilian/extranet_spr/instance-postgres.cfg.in
View file @
f9435cce
...
...
@@ -23,9 +23,7 @@ offline = true
recipe = slapos.cookbook:postgres
# Options
ipv6 = $${instance-parameters:ipv6}
ipv4 = $${instance-parameters:ipv4}
ipv6-random = $${instance-parameters:ipv6-random}
superuser = postgres
password = $${postgres-passwd:passwd}
port = 5432
...
...
@@ -37,7 +35,7 @@ services = $${directories:services}
template-postgresql-conf =
# This configuration file is generated by a SlapOS instance profile. Manual edits will be overwritten.
listen_addresses = '{listen_addresses}'
listen_addresses = '{
ipv4_
listen_addresses}'
port = $${:port}
logging_collector = on
log_rotation_size = 50MB
...
...
@@ -57,16 +55,11 @@ template-pg-hba-conf =
# "local" is for Unix domain socket connections only (check unix_socket_permissions!)
local all all trust
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
{ipv4_auth}
{ipv6_auth}
template-hba-ipv4 =
host all all {ip}/32 md5
template-hba-ipv6 =
host all all {ip}/128 md5
#----------------
...
...
@@ -86,7 +79,7 @@ bytes = 16
[postgres-promise]
recipe = slapos.cookbook:check_port_listening
path = $${directories:promises}/postgres
hostname = $${instance-parameters:ipv
6
-random}
hostname = $${instance-parameters:ipv
4
-random}
port = $${postgres-instance:port}
...
...
software/abilian/extranet_spr/instance.cfg.in
View file @
f9435cce
...
...
@@ -112,7 +112,7 @@ name = Web Frontend
software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
slave = true
config = url
config-url = https://[$${instance-parameters:ipv6-random}]:$${extranet-promise:port}
/
config-url = https://[$${instance-parameters:ipv6-random}]:$${extranet-promise:port}
return = site_url
...
...
software/abilian/extranet_spr/software.cfg
View file @
f9435cce
...
...
@@ -229,14 +229,14 @@ configure-command =
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg.in
output = ${buildout:directory}/instance.cfg
md5sum =
3b6105aa9335141c2d73871bdde80e9d
md5sum =
a865bcd6f894f28c69edf58d4df143ca
mode = 0644
[instance-postgres]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-postgres.cfg.in
output = ${buildout:directory}/instance-postgres.cfg
md5sum =
a8fee23bcada451f94ee70d89c4b94c4
md5sum =
118f5eacb47909aa4fefbd3391cb2077
mode = 0644
[instance-redis]
...
...
software/postgres/instance.cfg.in
View file @
f9435cce
...
...
@@ -43,7 +43,7 @@ bin = ${postgresql:location}/bin
services = $${directories:services}
template-postgresql-conf =
# This configuration file is generated by a SlapOS instance profile. Manual edits will be overwritten.
listen_addresses = '{listen_addresses}'
listen_addresses = '{
ipv4_listen_addresses},{ipv6_
listen_addresses}'
logging_collector = on
log_rotation_size = 50MB
max_connections = 100
...
...
software/postgres/software.cfg
View file @
f9435cce
...
...
@@ -18,7 +18,7 @@ parts =
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg.in
output = ${buildout:directory}/instance.cfg
md5sum =
e78188b903d61de2d2e1e36d1d4bbec8
md5sum =
bfeba61d906ee861804ee8e4c35ad312
mode = 0644
...
...
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