linuxserver / docker-bookstack

A Docker container for the BookStack documentation wiki
GNU General Public License v3.0
747 stars 108 forks source link

Fix Alpine 3.15 not support grep -pP; Improve supporting ipv4|[ipv6]|domain:port; #141

Closed thohng closed 1 year ago

thohng commented 1 year ago

Hi Eric Nemchik, I found that grep -qP is not support on Alpine 3.15. Also not work with domain:port or local [::1]:port (sidecar container)

grep: unrecognized option: P
BusyBox v1.34.1 (2022-07-19 20:11:24 UTC) multi-call binary.

Usage: grep [-HhnlLoqvsrRiwFE] [-m N] [-A|B|C N] { PATTERN | -e PATTERN... | -f FILE... } [FILE]...

Search for PATTERN in FILEs (or stdin)

        -H      Add 'filename:' prefix
...

I would improve the detection by 2 conditions:

if echo "$DB_HOST" | grep -qE ':[0-9]+$' && ! echo "$DB_HOST" | grep -qE '^(:{0,2}[a-fA-F0-9]{1,4})+$'; then

This improvement also support

LinuxServer-CI commented 1 year ago

I am a bot, here are the test results for this PR: https://ci-tests.linuxserver.io/lspipepr/bookstack/v22.09.1-pkg-dc94345f-pr-141/index.html https://ci-tests.linuxserver.io/lspipepr/bookstack/v22.09.1-pkg-dc94345f-pr-141/shellcheck-result.xml

thohng commented 1 year ago

I going to merge these changes to my repos after merge PR to my repos