Skip to content

Commit a36bfd1

Browse files
authored
v1.0.1 (#2)
Major updates * Using latest base images * Upgrade password hash to sha256 and using createuser instead of sql command Minor updates * Using new bf-esh executable Documentation updates * Fixing versions on readme * Fixing backup refs in readme * Update workflow build status shield
1 parent d636a0e commit a36bfd1

File tree

10 files changed

+23
-22
lines changed

10 files changed

+23
-22
lines changed

12/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM bfren/alpine-s6:alpine3.12-2.2.19
1+
FROM bfren/alpine-s6:alpine3.12-2.2.20
22

33
ENV \
44
# set to "1" to compress backup sql files

13/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM bfren/alpine-s6:alpine3.14-2.2.19
1+
FROM bfren/alpine-s6:alpine3.14-2.2.20
22

33
ENV \
44
# set to "1" to compress backup sql files

14/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM bfren/alpine-s6:alpineedge-2.2.19
1+
FROM bfren/alpine-s6:alpineedge-2.2.20
22

33
ENV \
44
# set to "1" to compress backup sql files

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Docker PostgreSQL
22

33
![GitHub release (latest by date)](https://img.shields.io/github/v/release/bfren/docker-postgresql) ![Docker Pulls](https://img.shields.io/docker/pulls/bfren/postgresql?label=pulls) ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/bfren/postgresql/latest?label=size)<br/>
4-
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/bfren/docker-postgresql/dev?label=build)
4+
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/bfren/docker-postgresql/dev-13?label=build)
55

66
[Docker Repository](https://hub.docker.com/r/bfren/postgresql) - [bfren ecosystem](https://github.com/bfren/docker)
77

8-
[PostgreSQL](https://www.postgresql.org/) comes pre-installed (12, 12, or 14) with automatic backups built-in.
8+
[PostgreSQL](https://www.postgresql.org/) comes pre-installed (12, 13, or 14) with automatic backups built-in.
99

1010
## Contents
1111

@@ -20,7 +20,7 @@
2020

2121
Backups for every database are stored:
2222

23-
* in the `/var/lib/postgresql/backup` volume
23+
* in the `/backup` volume
2424
* in subfolders by date and time (yyMMddhhmm)
2525
* every eight hours
2626

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.0
1+
1.0.1

overlay/etc/bf/templates/pg_hba.conf.esh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,12 @@
8888
local all all trust
8989
# IPv4 local connections:
9090
host all all 127.0.0.1/32 trust
91+
# IPv6 local connections:
92+
host all all ::1/128 trust
9193
# Allow replication connections from localhost, by a user with the
9294
# replication privilege.
9395
local replication all trust
9496
host replication all 127.0.0.1/32 trust
97+
host replication all ::1/128 trust
9598
# Allow network access by authentication
96-
host all all 0.0.0.0/0 md5
99+
host all all 0.0.0.0/0 scram-sha-256

overlay/etc/bf/templates/postgres.conf.esh renamed to overlay/etc/bf/templates/postgresql.conf.esh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ unix_socket_directories = '/run/postgresql,/tmp' # comma-separated list of direc
8989
# - Authentication -
9090

9191
#authentication_timeout = 1min # 1s-600s
92-
#password_encryption = md5 # md5 or scram-sha-256
92+
password_encryption = scram-sha-256 # md5 or scram-sha-256
9393
#db_user_namespace = off
9494

9595
# GSSAPI using Kerberos
@@ -548,7 +548,6 @@ min_wal_size = 80MB
548548
# %q = stop here in non-session
549549
# processes
550550
# %% = '%'
551-
# e.g. '<%u%%%d> '
552551
#log_lock_waits = off # log lock waits >= deadlock_timeout
553552
#log_parameter_max_length = -1 # when logging statements, limit logged
554553
# bind-parameter values to N bytes;

overlay/etc/cont-init.d/12-postgresql-init

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ start () {
1414
bf-debug "Running db-init."
1515
s6-setuidgid postgres initdb -D "${POSTGRESQL_DATA}"
1616

17+
# regenerate configuration
18+
bf-debug "Regenerating configuration files."
19+
s6-setuidgid postgres ${POSTGRESQL_LIB}/config
20+
1721
# start server
1822
bf-echo "Starting PostgreSQL for initialisation."
1923
s6-setuidgid postgres pg_ctl start -D "${POSTGRESQL_DATA}"
@@ -65,16 +69,11 @@ if [ ! -f ${POSTGRESQL_DATA}/PG_VERSION ] ; then
6569
s6-setuidgid postgres ${POSTGRESQL_LIB}/init
6670
stop
6771

68-
else
69-
70-
# be friendly..
71-
bf-debug "Server ready."
72-
7372
fi
7473

7574

7675
#======================================================================================================================
77-
# Regenerate configuration.
76+
# Be friendly.
7877
#======================================================================================================================
7978

80-
s6-setuidgid postgres ${POSTGRESQL_LIB}/config
79+
bf-debug "Server ready."

overlay/usr/lib/bf/postgresql/config

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export BF_E=`basename ${0}`
99
#======================================================================================================================
1010

1111
bf-echo "Writing PostgreSQL config..."
12-
esh -o ${POSTGRESQL_DATA}/pg_hba.conf \
13-
${BF_TEMPLATES}/pg_hba.conf.esh
14-
esh -o ${POSTGRESQL_DATA}/postgres.conf \
15-
${BF_TEMPLATES}/postgres.conf.esh
12+
bf-esh ${BF_TEMPLATES}/pg_hba.conf.esh \
13+
${POSTGRESQL_DATA}/pg_hba.conf
14+
bf-esh ${BF_TEMPLATES}/postgresql.conf.esh \
15+
${POSTGRESQL_DATA}/postgresql.conf
1616
bf-done

overlay/usr/lib/bf/postgresql/init

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export BF_E=`basename ${0}`
1818

1919
# create specified role
2020
bf-debug "Creating role ${POSTGRESQL_USERNAME}..."
21-
psql -c "CREATE ROLE ${POSTGRESQL_USERNAME} WITH SUPERUSER LOGIN ENCRYPTED PASSWORD '${POSTGRESQL_PASSWORD}';"
21+
echo -e "${POSTGRESQL_PASSWORD}\n${POSTGRESQL_PASSWORD}" | createuser --superuser --pwprompt ${POSTGRESQL_USERNAME}
2222

2323
# create database(s)
2424
bf-debug "Creating..."

0 commit comments

Comments
 (0)