Skip to content

Commit 26563f9

Browse files
authored
Merge pull request #39 from thespad/3.20-again
Use IP env, default to IPv6
2 parents bdef06d + 6387917 commit 26563f9

File tree

3 files changed

+16
-20
lines changed

3 files changed

+16
-20
lines changed

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22

3-
FROM ghcr.io/linuxserver/baseimage-alpine:3.19
3+
FROM ghcr.io/linuxserver/baseimage-alpine:3.20
44

55
# set version label
66
ARG BUILD_DATE
@@ -11,6 +11,7 @@ LABEL maintainer="thespad"
1111
LABEL org.opencontainers.image.source="https://github.com/thespad/docker-py-kms"
1212
LABEL org.opencontainers.image.url="https://github.com/thespad/docker-py-kms"
1313
LABEL org.opencontainers.image.description="A port of node-kms created by cyrozap, which is a port of either the C#, C++, or .NET implementations of KMS Emulator."
14+
LABEL org.opencontainers.image.authors="thespad"
1415

1516
ENV PYTHONIOENCODING=utf-8 \
1617
VIRTUAL_ENV=/pyenv \
@@ -33,7 +34,8 @@ RUN \
3334
setuptools \
3435
wheel && \
3536
pip install -U --no-cache-dir pytz && \
36-
pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.19 -r /home/py-kms/requirements.txt && \
37+
pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.20 -r /home/py-kms/requirements.txt && \
38+
printf "Version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
3739
apk del --purge \
3840
build-dependencies && \
3941
rm -rf \

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
[![GitHub Stars](https://img.shields.io/github/stars/thespad/docker-py-kms.svg?color=26689A&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/thespad/docker-py-kms)
88
[![Docker Stars](https://img.shields.io/docker/stars/thespad/py-kms.svg?color=26689A&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/thespad/py-kms)
99

10-
[![ci](https://img.shields.io/github/actions/workflow/status/thespad/docker-py-kms/call-check-and-release.yml?branch=main&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github&label=Check%20For%20Upstream%20Updates)](https://github.com/thespad/docker-py-kms/actions/workflows/call-check-and-release.yml)
11-
[![ci](https://img.shields.io/github/actions/workflow/status/thespad/docker-py-kms/call-baseimage-update.yml?branch=main&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github&label=Check%20For%20Baseimage%20Updates)](https://github.com/thespad/docker-py-kms/actions/workflows/call-baseimage-update.yml)
12-
[![ci](https://img.shields.io/github/actions/workflow/status/thespad/docker-py-kms/call-build-image.yml?labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github&label=Build%20Image)](https://github.com/thespad/docker-py-kms/actions/workflows/call-build-image.yml)
10+
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/thespad/docker-py-kms/call-check-and-release.yml?branch=main&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github&label=Check%20For%20Upstream%20Updates)](https://github.com/thespad/docker-py-kms/actions/workflows/call-check-and-release.yml)
11+
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/thespad/docker-py-kms/call-baseimage-update.yml?branch=main&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github&label=Check%20For%20Baseimage%20Updates)](https://github.com/thespad/docker-py-kms/actions/workflows/call-baseimage-update.yml)
12+
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/thespad/docker-py-kms/call-build-image.yml?labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github&label=Build%20Image)](https://github.com/thespad/docker-py-kms/actions/workflows/call-build-image.yml)
1313

1414
[py-kms](https://github.com/Py-KMS-Organization/py-kms) is a port of node-kms created by cyrozap, which is a port of either the C#, C++, or .NET implementations of KMS Emulator. The original version was written by CODYQX4 and is derived from the reverse-engineered code of Microsoft's official KMS. This version of py-kms is itself a fork of the original implementation by SystemRage, which was abandoned early 2021.
1515

@@ -42,7 +42,6 @@ Compatible with docker-compose v2 schemas.
4242

4343
```yaml
4444
---
45-
version: "2.1"
4645
services:
4746
py-kms:
4847
image: ghcr.io/thespad/py-kms:latest
@@ -51,9 +50,9 @@ services:
5150
- PUID=1000
5251
- PGID=1000
5352
- TZ=Europe/London
54-
- LEGACY_NET= #optional
53+
- IP=0.0.0.0 #optional
5554
volumes:
56-
- /path/to/appdata/config:/config
55+
- /path/to/py-kms/config:/config
5756
ports:
5857
- 1688:1688
5958
restart: unless-stopped
@@ -66,10 +65,10 @@ docker run -d \
6665
--name=py-kms \
6766
-e PUID=1000 \
6867
-e PGID=1000 \
69-
-e LEGACY_NET= `#optional` \
68+
-e IP=0.0.0.0 `#optional` \
7069
-e TZ=Europe/London \
7170
-p 1688:1688 \
72-
-v /path/to/appdata/config:/config \
71+
-v /path/to/py-kms/config:/config \
7372
--restart unless-stopped \
7473
ghcr.io/thespad/py-kms:latest
7574
```
@@ -84,7 +83,7 @@ Container images are configured using parameters passed at runtime (such as thos
8483
| `-e PUID=1000` | for UserID - see below for explanation |
8584
| `-e PGID=1000` | for GroupID - see below for explanation |
8685
| `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London |
87-
| `-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. |
86+
| `-e IP=` | IP address to bind to. Use `0.0.0.0` for all IPv4 interfaces, use `::` for all IPv6 interfaces, or specify a full address. Note that for compose you must quote the full variable, e.g. `- "IP=0.0.0.0"` or `- "IP=::"`. |
8887
| `-v /config` | Contains all relevant configuration files. |
8988

9089
## User / Group Identifiers
@@ -111,6 +110,7 @@ In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as bel
111110

112111
## Versions
113112

113+
* **26.05.24:** - Rebase to Alpine 3.20.
114114
* **30.12.23:** - Rebase to Alpine 3.19.
115115
* **29.10.23:** - Provide IPv4-only option for legacy hosts.
116116
* **14.05.23:** - Rebase to Alpine 3.18. Drop support for armhf.
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
#!/usr/bin/with-contenv bash
22
# shellcheck shell=bash
33

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
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 "${IP:-0.0.0.0}" "${PORT}" -l "${LCID}" -c "${CLIENT_COUNT}" -a "${ACTIVATION_INTERVAL}" -r "${RENEWAL_INTERVAL}" -w "${HWID}" -V "${LOGLEVEL}" -F "${LOGFILE}"

0 commit comments

Comments
 (0)