Skip to content

Commit 50831fb

Browse files
authored
Merge pull request #33 from thespad/legacy
Provide IPv4-only option for legacy hosts
2 parents 133180e + e45c15b commit 50831fb

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ services:
5252
- PUID=1000
5353
- PGID=1000
5454
- TZ=Europe/London
55+
- LEGACY_NET= #optional
5556
volumes:
5657
- /path/to/appdata/config:/config
5758
ports:
@@ -66,6 +67,7 @@ docker run -d \
6667
--name=py-kms \
6768
-e PUID=1000 \
6869
-e PGID=1000 \
70+
-e LEGACY_NET= `#optional` \
6971
-e TZ=Europe/London \
7072
-p 1688:1688 \
7173
-v /path/to/appdata/config:/config \
@@ -83,6 +85,7 @@ Container images are configured using parameters passed at runtime (such as thos
8385
| `-e PUID=1000` | for UserID - see below for explanation |
8486
| `-e PGID=1000` | for GroupID - see below for explanation |
8587
| `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London |
88+
| `-e LEGACY_NET=` | Set to `true` if you have an ancient host that can't support IPv6 dual stack. This will force py-kms to only bind to the IPv4 interface inside the container. |
8689
| `-v /config` | Contains all relevant configuration files. |
8790

8891
## User / Group Identifiers
@@ -109,6 +112,7 @@ In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as bel
109112

110113
## Versions
111114

115+
* **29.10.23:** - Provide IPv4-only option for legacy hosts.
112116
* **14.05.23:** - Rebase to Alpine 3.18. Drop support for armhf.
113117
* **19.03.23:** - Add `pytz`.
114118
* **09.12.22:** - Rebase to Alpine 3.17.
+9-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/usr/bin/with-contenv bash
22
# shellcheck shell=bash
33

4-
exec \
5-
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost ${PORT}" \
6-
cd /home/py-kms s6-setuidgid abc python3 -u pykms_Server.py "::" "${PORT}" -l "${LCID}" -c "${CLIENT_COUNT}" -a "${ACTIVATION_INTERVAL}" -r "${RENEWAL_INTERVAL}" -w "${HWID}" -V "${LOGLEVEL}" -F "${LOGFILE}"
4+
if [[ ${LEGACY_NET,,} = "true" ]]; then
5+
exec \
6+
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost ${PORT}" \
7+
cd /home/py-kms s6-setuidgid abc python3 -u pykms_Server.py "0.0.0.0" "${PORT}" -l "${LCID}" -c "${CLIENT_COUNT}" -a "${ACTIVATION_INTERVAL}" -r "${RENEWAL_INTERVAL}" -w "${HWID}" -V "${LOGLEVEL}" -F "${LOGFILE}"
8+
else
9+
exec \
10+
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost ${PORT}" \
11+
cd /home/py-kms s6-setuidgid abc python3 -u pykms_Server.py "::" "${PORT}" -l "${LCID}" -c "${CLIENT_COUNT}" -a "${ACTIVATION_INTERVAL}" -r "${RENEWAL_INTERVAL}" -w "${HWID}" -V "${LOGLEVEL}" -F "${LOGFILE}"
12+
fi

0 commit comments

Comments
 (0)