Skip to content

Commit 38d0450

Browse files
committed
* Replace DATABASE_EXPOSED_PORT by DATABASE_PORT
* Remove access to database outside of container
1 parent 333f3b1 commit 38d0450

File tree

5 files changed

+5
-14
lines changed

5 files changed

+5
-14
lines changed

build/resto/container_root/cont-init.d/15-resto-config.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,6 @@ if [ ! -z "${ADDON_TAG_ITAG_TAGGERS}" ]; then
5454
ADDON_TAG_ITAG_TAGGERS=\'$(echo $ADDON_TAG_ITAG_TAGGERS | sed s/,/\',\'/g)\'
5555
fi
5656

57-
# [IMPORTANT] Set DATABASE_PORT
58-
if [ "${DATABASE_HOST}" == "restodb" ]; then
59-
DATABASE_PORT=5432
60-
else
61-
DATABASE_PORT=${DATABASE_EXPOSED_PORT}
62-
fi
63-
6457
# Awfull trick
6558
eval "cat <<EOF
6659
$(<${CONFIG_TEMPLATE_FILE})

config-dev.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ API_HOST_DESCRIPTION="resto localhost server"
5454
DATABASE_HOST=restodb
5555

5656
### Database port
57-
DATABASE_EXPOSED_PORT=5253
57+
#DATABASE_PORT=5432
5858

5959
### [IMPORTANT] Usually you should only change the DATABASE_USER_PASSWORD value and leave the other values untouched
6060
DATABASE_NAME=resto

config.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ API_HOST_DESCRIPTION="resto localhost server"
5454
DATABASE_HOST=restodb
5555

5656
### Database exposed port
57-
DATABASE_EXPOSED_PORT=5253
57+
#DATABASE_PORT=5432
5858

5959
### [IMPORTANT] Usually you should only change the DATABASE_USER_PASSWORD value and leave the other values untouched
6060
DATABASE_NAME=resto

deploy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ fi
114114

115115
PUBLIC_ENDPOINT=$(grep ^PUBLIC_ENDPOINT= ${ENV_FILE} | awk -F= '{for (i=2; i<=NF; i++) print $i}'| xargs echo -n)
116116
RESTO_EXPOSED_PORT=$(grep ^RESTO_EXPOSED_PORT= ${ENV_FILE} | awk -F= '{for (i=2; i<=NF; i++) print $i}'| xargs echo -n)
117-
DATABASE_EXPOSED_PORT=$(grep ^DATABASE_EXPOSED_PORT= ${ENV_FILE} | awk -F= '{for (i=2; i<=NF; i++) print $i}'| xargs echo -n)
117+
DATABASE_PORT=$(grep ^DATABASE_PORT= ${ENV_FILE} | awk -F= '{for (i=2; i<=NF; i++) print $i}'| xargs echo -n)
118118
DATABASE_HOST=$(grep ^DATABASE_HOST= ${ENV_FILE} | awk -F= '{for (i=2; i<=NF; i++) print $i}'| xargs echo -n)
119119
DATABASE_NAME=$(grep ^DATABASE_NAME= ${ENV_FILE} | awk -F= '{for (i=2; i<=NF; i++) print $i}'| xargs echo -n)
120120
DATABASE_USER_NAME=$(grep ^DATABASE_USER_NAME= ${ENV_FILE} | awk -F= '{for (i=2; i<=NF; i++) print $i}'| xargs echo -n)
@@ -157,15 +157,15 @@ if [[ ${CLEAN} -eq 1 ]]; then
157157
echo -e "[INFO] Cleaning existing resto container and volumes"
158158
COMPOSE_FILE=${COMPOSE_FILE} \
159159
RESTO_EXPOSED_PORT=${RESTO_EXPOSED_PORT} \
160-
DATABASE_EXPOSED_PORT=${DATABASE_EXPOSED_PORT} \
160+
DATABASE_PORT=${DATABASE_PORT} \
161161
ENV_FILE=${ENV_FILE} \
162162
docker compose down -v
163163
fi
164164
fi
165165

166166
COMPOSE_FILE=${COMPOSE_FILE} \
167167
RESTO_EXPOSED_PORT=${RESTO_EXPOSED_PORT} \
168-
DATABASE_EXPOSED_PORT=${DATABASE_EXPOSED_PORT} \
168+
DATABASE_PORT=${DATABASE_PORT} \
169169
DATABASE_HOST=${DATABASE_HOST} \
170170
DATABASE_NAME=${DATABASE_NAME} \
171171
DATABASE_USER_NAME=${DATABASE_USER_NAME} \

docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ services:
4848
- POSTGRES_PASSWORD=${DATABASE_USER_PASSWORD:-resto}
4949
- POSTGRES_USER=${DATABASE_USER_NAME:-resto}
5050
- POSTGRES_DB=${DATABASE_NAME:-resto}
51-
ports:
52-
- ${DATABASE_EXPOSED_PORT:-5253}:5432
5351
healthcheck:
5452
test: ["CMD-SHELL", "pg_isready -U ${DATABASE_USER_NAME:-resto}"]
5553
interval: 1m

0 commit comments

Comments
 (0)