Skip to content

Commit d75622d

Browse files
authored
Merge pull request #266 from dsgnr/fix_custom_index
Fix web container where volume mounts are used
2 parents 130da13 + af0dd1e commit d75622d

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [3.1.2] - 2024-11-18
6+
- Fixes a regression caused by [#258](https://github.com/dsgnr/portchecker.io/pull/258)
7+
where the web container would fail to start if the index was overwritten by a custom volume mount.
8+
59
## [3.1.1] - 2024-11-18
610
- Fixes incorrect environment variable defaults in README
711
- Adds threading to `query_ipv4` method. Uses default worker value (CPU count).

backend/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tool.poetry]
22
package-mode = false
33
name = "portchecker.io"
4-
version = "3.1.1"
4+
version = "3.1.2"
55
description = """portchecker.io is an open-source API for checking port \
66
availability on specified hostnames or IP addresses. \
77
Ideal for developers and network admins, it helps troubleshoot network \

frontend/entrypoint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ set -e
44
# `DEFAULT_PORT` is set by Webpack at container build time if the environment variable is provided.
55
# If this variable is not set at that time (like for production images), we must modify the rendered HTML on container up.
66
if [ -n "$DEFAULT_PORT" ]; then
7-
sed -i -E "s/(<input[^>]*id=\"port\"[^>]*value=\")[^\"]*\"/\\1${DEFAULT_PORT}\"/" /usr/share/nginx/html/index.html
8-
echo "Updated DEFAULT_PORT value to $DEFAULT_PORT."
7+
if sed -i -E "s/(<input[^>]*id=\"port\"[^>]*value=\")[^\"]*\"/\\1${DEFAULT_PORT}\"/" /usr/share/nginx/html/index.html; then
8+
echo "Updated DEFAULT_PORT value to $DEFAULT_PORT."
9+
else
10+
echo "An error occurred when attempting to set the DEFAULT_PORT value."
11+
fi
912
else
1013
echo "DEFAULT_PORT is not set. No changes made."
1114
fi

0 commit comments

Comments
 (0)