From ea711f8736433c0d11709f3ff7fa02d34f9c0a16 Mon Sep 17 00:00:00 2001 From: Tristan <39345534+MichelBaie@users.noreply.github.com> Date: Sun, 19 Sep 2021 14:35:14 +0200 Subject: [PATCH 01/16] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e73504e..484d8f9 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ This version of _py-kms_ is for itself a fork of the original implementation by - Windows 8 - Windows 8.1 - Windows 10 ( 1511 / 1607 / 1703 / 1709 / 1803 / 1809 ) - - Windows 10 ( 1903 / 1909 / 20H1 ) + - Windows 10 ( 1903 / 1909 / 20H1, 20H2, 21H1 ) - Windows Server 2008 - Windows Server 2008 R2 - Windows Server 2012 From f93ea7f7a5f029cccd0b0aeb63a38b4bbdb2d41d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=A6=E5=8A=9B=E6=80=95=E6=8E=A7?= Date: Sat, 9 Oct 2021 09:08:22 +0800 Subject: [PATCH 02/16] Update Keys.md Add Windows 11 keys --- docs/Keys.md | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/Keys.md b/docs/Keys.md index 30afc99..5a4de0b 100644 --- a/docs/Keys.md +++ b/docs/Keys.md @@ -39,37 +39,37 @@ sometimes even reject it by itself (often due too many uses - in that case try t | Windows Server 2016 Cloud Storage | `QN4C6-GBJD2-FB422-GHWJK-GJG2R` | | Windows Server 2016 Azure Core | `VP34G-4NPPG-79JTQ-864T4-R3MQX`
`WNCYY-GFBH2-M4WTT-XQ2FP-PG2K9` | -### Windows 10 +### Windows 10 & Windows 11 | Product | GVLK | | --- | --- | -| Windows 10 Professional Workstation | `NRG8B-VKK3Q-CXVCJ-9G2XF-6Q84J` | -| Windows 10 Professional Workstation N | `9FNHH-K3HBT-3W4TD-6383H-6XYWF` | -| Windows 10 Enterprise G | `YYVX9-NTFWV-6MDM3-9PT4T-4M68B` | -| Windows 10 Enterprise G N | `44RPN-FTY23-9VTTB-MP9BX-T84FV` | +| Windows 10/11 Professional Workstation | `NRG8B-VKK3Q-CXVCJ-9G2XF-6Q84J` | +| Windows 10/11 Professional Workstation N | `9FNHH-K3HBT-3W4TD-6383H-6XYWF` | +| Windows 10/11 Enterprise G | `YYVX9-NTFWV-6MDM3-9PT4T-4M68B` | +| Windows 10/11 Enterprise G N | `44RPN-FTY23-9VTTB-MP9BX-T84FV` | | Windows 10 Enterprise LTSC 2019 | `M7XTQ-FN8P6-TTKYV-9D4CC-J462D` | | Windows 10 Enterprise LTSC 2019 N | `92NFX-8DJQP-P6BBQ-THF9C-7CG2H` | -| Windows 10 Remote Server | `7NBT4-WGBQX-MP4H7-QXFF8-YP3KX` | -| Windows 10 Enterprise for Remote Sessions | `CPWHC-NT2C7-VYW78-DHDB2-PG3GK` | +| Windows 10/11 Remote Server | `7NBT4-WGBQX-MP4H7-QXFF8-YP3KX` | +| Windows 10/11 Enterprise for Remote Sessions | `CPWHC-NT2C7-VYW78-DHDB2-PG3GK` | | Windows 10 S (Lean) | `NBTWJ-3DR69-3C4V8-C26MC-GQ9M6` | -| Windows 10 Professional | `W269N-WFGWX-YVC9B-4J6C9-T83GX` | -| Windows 10 Professional N | `MH37W-N47XK-V7XM9-C7227-GCQG9`
`HMNWJ-V69R6-B2CDC-8P7VT-2373K` | -| Windows 10 Professional Education | `6TP4R-GNPTD-KYYHQ-7B7DP-J447Y` | -| Windows 10 Professional Education N | `YVWGF-BXNMC-HTQYQ-CPQ99-66QFC` | -| Windows 10 Education | `NW6C2-QMPVW-D7KKK-3GKT6-VCFB2`
`F48BJ-8NX82-MRVY9-PF8BW-HMHY2` | -| Windows 10 Education N | `2WH4N-8QGBV-H22JP-CT43Q-MDWWJ`
`PPWGW-8NW9C-J77Q9-8WHB9-QV64W` | -| Windows 10 Enterprise | `NPPR9-FWDCX-D2C8J-H872K-2YT43`
`96YNV-9X4RP-2YYKB-RMQH4-6Q72D`
`TN6CM-KCVXP-VVP8X-YVCF7-R9BDH`
`3PMKQ-YNVGT-HFJGG-2F4FQ-9D6T7` | -| Windows 10 Enterprise N | `DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4`
`WGGHN-J84D6-QYCPR-T7PJ7-X766F` | -| Windows 10 Enterprise S | `H76BG-QBNM7-73XY9-V6W2T-684BJ` | -| Windows 10 Enterprise S N | `X4R4B-NV6WD-PKTVK-F98BH-4C2J8` | +| Windows 10/11 Professional | `W269N-WFGWX-YVC9B-4J6C9-T83GX` | +| Windows 10/11 Professional N | `MH37W-N47XK-V7XM9-C7227-GCQG9`
`HMNWJ-V69R6-B2CDC-8P7VT-2373K` | +| Windows 10/11 Professional Education | `6TP4R-GNPTD-KYYHQ-7B7DP-J447Y` | +| Windows 10/11 Professional Education N | `YVWGF-BXNMC-HTQYQ-CPQ99-66QFC` | +| Windows 10/11 Education | `NW6C2-QMPVW-D7KKK-3GKT6-VCFB2`
`F48BJ-8NX82-MRVY9-PF8BW-HMHY2` | +| Windows 10/11 Education N | `2WH4N-8QGBV-H22JP-CT43Q-MDWWJ`
`PPWGW-8NW9C-J77Q9-8WHB9-QV64W` | +| Windows 10/11 Enterprise | `NPPR9-FWDCX-D2C8J-H872K-2YT43`
`96YNV-9X4RP-2YYKB-RMQH4-6Q72D`
`TN6CM-KCVXP-VVP8X-YVCF7-R9BDH`
`3PMKQ-YNVGT-HFJGG-2F4FQ-9D6T7` | +| Windows 10/11 Enterprise N | `DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4`
`WGGHN-J84D6-QYCPR-T7PJ7-X766F` | +| Windows 10/11 Enterprise S | `H76BG-QBNM7-73XY9-V6W2T-684BJ` | +| Windows 10/11 Enterprise S N | `X4R4B-NV6WD-PKTVK-F98BH-4C2J8` | | Windows 10 Enterprise 2015 LTSB | `WNMTR-4C88C-JK8YV-HQ7T2-76DF9` | | Windows 10 Enterprise 2015 LTSB N | `2F77B-TNFGY-69QQF-B8YKP-D69TJ`
`RW7WN-FMT44-KRGBK-G44WK-QV7YK` | | Windows 10 Enterprise 2016 LTSB | `DCPHK-NFMTC-H88MJ-PFHPY-QJ4BJ` | | Windows 10 Enterprise 2016 LTSB N | `QFFDN-GRT3P-VKWWX-X7T3R-8B639` | -| Windows 10 Home
Windows 10 Core | `TX9XD-98N7V-6WMQ6-BX7FG-H8Q99`
`33QT6-RCNYF-DXB4F-DGP7B-7MHX9` | -| Windows 10 Home N
Windows 10 Core N | `3KHY7-WNT83-DGQKR-F7HPR-844BM`
`CP4KF-NG6TC-9K6QF-P6GTT-H8RBM` | -| Windows 10 Home Single Language
Windows 10 Core Single Language | `7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH`
`9HGRW-NH2CQ-XQHJD-YCRWB-6VJV7`
`4NX46-6DHCG-MR3PH-9FMCX-3RQ3G` | -| Windows 10 Home Country Specific
Windows 10 Core Country Specific | `PVMJN-6DFY6-9CCP6-7BKTT-D3WVR`
`JN9HR-MH7K4-DBPDD-TFTXF-Q9MMF` | +| Windows 10/11 Home
Windows 10/11 Core | `TX9XD-98N7V-6WMQ6-BX7FG-H8Q99`
`33QT6-RCNYF-DXB4F-DGP7B-7MHX9` | +| Windows 10/11 Home N
Windows 10/11 Core N | `3KHY7-WNT83-DGQKR-F7HPR-844BM`
`CP4KF-NG6TC-9K6QF-P6GTT-H8RBM` | +| Windows 10/11 Home Single Language
Windows 10 Core Single Language | `7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH`
`9HGRW-NH2CQ-XQHJD-YCRWB-6VJV7`
`4NX46-6DHCG-MR3PH-9FMCX-3RQ3G` | +| Windows 10/11 Home Country Specific
Windows 10 Core Country Specific | `PVMJN-6DFY6-9CCP6-7BKTT-D3WVR`
`JN9HR-MH7K4-DBPDD-TFTXF-Q9MMF` | ### Windows Server 2012 R2 From 5de292e12a9090a716001ddf2e0f9bad5941ca94 Mon Sep 17 00:00:00 2001 From: Matthew Beckett Date: Thu, 7 Oct 2021 20:04:49 +0100 Subject: [PATCH 03/16] Remove validation of LOGFILE extension --- py-kms/pykms_Misc.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/py-kms/pykms_Misc.py b/py-kms/pykms_Misc.py index 5769fc9..f948d44 100644 --- a/py-kms/pykms_Misc.py +++ b/py-kms/pykms_Misc.py @@ -227,7 +227,7 @@ def logger_create(log_obj, config, mode = 'a'): log_obj.setLevel(config['loglevel']) #------------------------------------------------------------------------------------------------------------------------------------------------------------ -def check_dir(path, where, log_obj = None, argument = '-F/--logfile', typefile = '.log'): +def check_dir(path, where, log_obj = None, argument = '-F/--logfile'): filename = os.path.basename(path) pathname = os.path.dirname(path) extension = os.path.splitext(filename)[1] @@ -243,9 +243,6 @@ def check_dir(path, where, log_obj = None, argument = '-F/--logfile', typefile = pathname = filename pretty_printer(log_obj = log_obj, where = where, to_exit = True, put_text = msg_dir %(argument, pathname)) - elif not extension.lower() == typefile: - pretty_printer(log_obj = log_obj, where = where, to_exit = True, - put_text = msg_fil %(argument, typefile, extension)) def check_logfile(optionlog, defaultlog, where): if not isinstance(optionlog, list): From 4a7376f17b0306c74b7180b16a08803dac1c522f Mon Sep 17 00:00:00 2001 From: Simon Beginn Date: Wed, 13 Oct 2021 12:54:22 +0200 Subject: [PATCH 04/16] Fix pytz and time localization --- docker/docker-py3-kms-minimal/Dockerfile | 2 +- docker/docker-py3-kms/Dockerfile | 2 +- docker/docker-py3-kms/start.sh | 0 docs/Getting Started.md | 2 +- py-kms/pykms_Base.py | 9 +++++++-- 5 files changed, 10 insertions(+), 5 deletions(-) mode change 100644 => 100755 docker/docker-py3-kms/start.sh diff --git a/docker/docker-py3-kms-minimal/Dockerfile b/docker/docker-py3-kms-minimal/Dockerfile index 2fd9768..98eb5ce 100644 --- a/docker/docker-py3-kms-minimal/Dockerfile +++ b/docker/docker-py3-kms-minimal/Dockerfile @@ -26,7 +26,7 @@ RUN apk add --no-cache --update \ sqlite-libs \ py3-pip \ build-base python3-dev && \ - pip3 install peewee tzlocal && \ + pip3 install peewee tzlocal pytz && \ apk del git build-base python3-dev WORKDIR /home/py-kms diff --git a/docker/docker-py3-kms/Dockerfile b/docker/docker-py3-kms/Dockerfile index e98a808..bbe06c7 100644 --- a/docker/docker-py3-kms/Dockerfile +++ b/docker/docker-py3-kms/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache --update \ git clone https://github.com/coleifer/sqlite-web.git /tmp/sqlite_web && \ mv /tmp/sqlite_web/sqlite_web /home/ && \ rm -rf /tmp/sqlite_web && \ - pip3 install peewee tzlocal pysqlite3 && \ + pip3 install peewee tzlocal pytz pysqlite3 && \ chmod a+x /usr/bin/start.sh && \ apk del git build-base python3-dev diff --git a/docker/docker-py3-kms/start.sh b/docker/docker-py3-kms/start.sh old mode 100644 new mode 100755 diff --git a/docs/Getting Started.md b/docs/Getting Started.md index 122e6ae..ce1c633 100644 --- a/docs/Getting Started.md +++ b/docs/Getting Started.md @@ -15,7 +15,7 @@ If you wish to get _py-kms_ just up and running without installing any dependenc Docker also solves problems regarding the explicit IPv4 and IPv6 usage (it just supports both). The following command will download, "install" and start _py-kms_ and also keep it alive after any service disruption. ```bash -docker run -d --name py-kms --restart always -p 1688:1688 pykmsorg/py-kms +docker run -d --name py-kms --restart always -p 1688:1688 -v /etc/localtime:/etc/localtime:ro pykmsorg/py-kms ``` If you just want to use the image and don't want to build them yourself, you can always use the official image at the [Docker Hub](https://hub.docker.com/r/pykmsorg/py-kms) (`pykmsorg/py-kms`). To ensure that you are using always the latest version you should check something like [watchtower](https://github.com/containrrr/watchtower) out ! diff --git a/py-kms/pykms_Base.py b/py-kms/pykms_Base.py index 6397b4a..dd55f31 100644 --- a/py-kms/pykms_Base.py +++ b/py-kms/pykms_Base.py @@ -119,11 +119,11 @@ class kmsBase: # Localize the request time, if module "tzlocal" is available. try: + from datetime import datetime from tzlocal import get_localzone from pytz.exceptions import UnknownTimeZoneError try: - tz = get_localzone() - local_dt = tz.localize(requestDatetime) + local_dt = datetime.fromisoformat(str(requestDatetime)).astimezone(get_localzone()) except UnknownTimeZoneError: pretty_printer(log_obj = loggersrv.warning, put_text = "{reverse}{yellow}{bold}Unknown time zone ! Request time not localized.{end}") @@ -132,6 +132,11 @@ class kmsBase: pretty_printer(log_obj = loggersrv.warning, put_text = "{reverse}{yellow}{bold}Module 'tzlocal' not available ! Request time not localized.{end}") local_dt = requestDatetime + except Exception as e: + # Just in case something else goes wrong + loggersrv.warning('Okay, something went horribly wrong while localizing the request time (proceeding anyways): ' + str(e)) + local_dt = requestDatetime + pass # Activation threshold. # https://docs.microsoft.com/en-us/windows/deployment/volume-activation/activate-windows-10-clients-vamt From 3fe2b45f72208e7b15f055a7d375826f219ca67d Mon Sep 17 00:00:00 2001 From: Simon Beginn Date: Wed, 13 Oct 2021 12:55:16 +0200 Subject: [PATCH 05/16] Extended error message --- py-kms/pykms_Base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-kms/pykms_Base.py b/py-kms/pykms_Base.py index dd55f31..1f38ba9 100644 --- a/py-kms/pykms_Base.py +++ b/py-kms/pykms_Base.py @@ -130,7 +130,7 @@ class kmsBase: local_dt = requestDatetime except ImportError: pretty_printer(log_obj = loggersrv.warning, - put_text = "{reverse}{yellow}{bold}Module 'tzlocal' not available ! Request time not localized.{end}") + put_text = "{reverse}{yellow}{bold}Module 'tzlocal' or 'pytz' not available ! Request time not localized.{end}") local_dt = requestDatetime except Exception as e: # Just in case something else goes wrong From 3806c032142f1f086e6da1715a8c67648771d38d Mon Sep 17 00:00:00 2001 From: Simon Beginn Date: Wed, 13 Oct 2021 21:59:46 +0200 Subject: [PATCH 06/16] Fix broken check_dir() call from 5de292e12a9090a716001ddf2e0f9bad5941ca94 --- py-kms/pykms_Server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-kms/pykms_Server.py b/py-kms/pykms_Server.py index 301661b..60c74a5 100755 --- a/py-kms/pykms_Server.py +++ b/py-kms/pykms_Server.py @@ -447,7 +447,7 @@ def server_check(): # Check sqlite. if srv_config['sqlite']: if isinstance(srv_config['sqlite'], str): - check_dir(srv_config['sqlite'], 'srv', log_obj = loggersrv.error, argument = '-s/--sqlite', typefile = '.db') + check_dir(srv_config['sqlite'], 'srv', log_obj = loggersrv.error, argument = '-s/--sqlite') elif srv_config['sqlite'] is True: srv_config['sqlite'] = srv_options['sql']['file'] From cb8a95e6d63f0f2559a4eaf775c25d36d3bf0ea7 Mon Sep 17 00:00:00 2001 From: Simon Beginn Date: Thu, 14 Oct 2021 11:45:17 +0200 Subject: [PATCH 07/16] Fir for undefnied time zones --- docker/docker-py3-kms-minimal/Dockerfile | 6 +++++- docker/docker-py3-kms/Dockerfile | 10 +++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docker/docker-py3-kms-minimal/Dockerfile b/docker/docker-py3-kms-minimal/Dockerfile index 98eb5ce..738c054 100644 --- a/docker/docker-py3-kms-minimal/Dockerfile +++ b/docker/docker-py3-kms-minimal/Dockerfile @@ -11,7 +11,7 @@ ENV ACTIVATION_INTERVAL 120 ENV RENEWAL_INTERVAL 10080 ENV HWID "RANDOM" ENV LOGLEVEL INFO -ENV LOGFILE /var/log/pykms_logserver.log +ENV LOGFILE /dev/stdout ENV LOGSIZE "" COPY ./py-kms /home/py-kms @@ -25,10 +25,14 @@ RUN apk add --no-cache --update \ python3-tkinter \ sqlite-libs \ py3-pip \ + tzdata \ build-base python3-dev && \ pip3 install peewee tzlocal pytz && \ apk del git build-base python3-dev +# Fix undefined timezone, in case the user did not mount the /etc/localtime +RUN cp /usr/share/zoneinfo/UTC /etc/localtime + WORKDIR /home/py-kms EXPOSE ${PORT}/tcp diff --git a/docker/docker-py3-kms/Dockerfile b/docker/docker-py3-kms/Dockerfile index bbe06c7..38a6a61 100644 --- a/docker/docker-py3-kms/Dockerfile +++ b/docker/docker-py3-kms/Dockerfile @@ -8,9 +8,9 @@ ENV CLIENT_COUNT 26 ENV ACTIVATION_INTERVAL 120 ENV RENEWAL_INTERVAL 10080 ENV SQLITE false -ENV HWID "364F463A8863D35F" -ENV LOGLEVEL ERROR -ENV LOGFILE /var/log/pykms_logserver.log +ENV HWID "RANDOM" +ENV LOGLEVEL INFO +ENV LOGFILE /dev/stdout ENV LOGSIZE "" COPY docker/docker-py3-kms/start.sh /usr/bin/start.sh @@ -25,6 +25,7 @@ RUN apk add --no-cache --update \ python3-tkinter \ sqlite-libs \ py3-pip \ + tzdata \ build-base python3-dev && \ git clone https://github.com/coleifer/sqlite-web.git /tmp/sqlite_web && \ mv /tmp/sqlite_web/sqlite_web /home/ && \ @@ -33,6 +34,9 @@ RUN apk add --no-cache --update \ chmod a+x /usr/bin/start.sh && \ apk del git build-base python3-dev +# Fix undefined timezone, in case the user did not mount the /etc/localtime +RUN cp /usr/share/zoneinfo/UTC /etc/localtime + WORKDIR /home/py-kms EXPOSE ${PORT}/tcp From 0630b226111dda3ab9f7c738e5701b81d147346e Mon Sep 17 00:00:00 2001 From: Simon Beginn Date: Thu, 14 Oct 2021 13:13:15 +0200 Subject: [PATCH 08/16] Switch to whole new entrypoint system --- docker/docker-py3-kms-minimal/Dockerfile | 26 ++++++------ docker/docker-py3-kms/Dockerfile | 35 +++++++++------- docker/docker-py3-kms/build-py3-kms.sh | 1 - docker/docker-py3-kms/run-py3-kms.sh | 16 ------- docker/docker-py3-kms/start.sh | 50 ---------------------- docker/entrypoint.py | 53 ++++++++++++++++++++++++ docs/Getting Started.md | 9 ++-- 7 files changed, 92 insertions(+), 98 deletions(-) delete mode 100755 docker/docker-py3-kms/build-py3-kms.sh delete mode 100755 docker/docker-py3-kms/run-py3-kms.sh delete mode 100755 docker/docker-py3-kms/start.sh create mode 100755 docker/entrypoint.py diff --git a/docker/docker-py3-kms-minimal/Dockerfile b/docker/docker-py3-kms-minimal/Dockerfile index 738c054..2c9107d 100644 --- a/docker/docker-py3-kms-minimal/Dockerfile +++ b/docker/docker-py3-kms-minimal/Dockerfile @@ -2,17 +2,17 @@ FROM alpine:3.12 -ENV IP 0.0.0.0 -ENV PORT 1688 -ENV EPID "" -ENV LCID 1033 -ENV CLIENT_COUNT 26 -ENV ACTIVATION_INTERVAL 120 -ENV RENEWAL_INTERVAL 10080 -ENV HWID "RANDOM" -ENV LOGLEVEL INFO -ENV LOGFILE /dev/stdout -ENV LOGSIZE "" +ENV IP 0.0.0.0 +ENV PORT 1688 +ENV EPID "" +ENV LCID 1033 +ENV CLIENT_COUNT 26 +ENV ACTIVATION_INTERVAL 120 +ENV RENEWAL_INTERVAL 10080 +ENV HWID RANDOM +ENV LOGLEVEL INFO +ENV LOGFILE /dev/stdout +ENV LOGSIZE "" COPY ./py-kms /home/py-kms @@ -37,4 +37,6 @@ WORKDIR /home/py-kms EXPOSE ${PORT}/tcp -ENTRYPOINT /usr/bin/python3 pykms_Server.py ${IP} ${PORT} -l ${LCID} -c ${CLIENT_COUNT} -a ${ACTIVATION_INTERVAL} -r ${RENEWAL_INTERVAL} -w ${HWID} -V ${LOGLEVEL} -F ${LOGFILE} +COPY docker/entrypoint.py /usr/bin/entrypoint.py +RUN chmod a+x /usr/bin/entrypoint.py +ENTRYPOINT ['/usr/bin/python3', '/usr/bin/entrypoint.py'] diff --git a/docker/docker-py3-kms/Dockerfile b/docker/docker-py3-kms/Dockerfile index 38a6a61..e5fd87c 100644 --- a/docker/docker-py3-kms/Dockerfile +++ b/docker/docker-py3-kms/Dockerfile @@ -1,19 +1,19 @@ FROM alpine:3.12 -ENV IP 0.0.0.0 -ENV PORT 1688 -ENV EPID "" -ENV LCID 1033 -ENV CLIENT_COUNT 26 -ENV ACTIVATION_INTERVAL 120 -ENV RENEWAL_INTERVAL 10080 -ENV SQLITE false -ENV HWID "RANDOM" -ENV LOGLEVEL INFO -ENV LOGFILE /dev/stdout -ENV LOGSIZE "" +ENV IP 0.0.0.0 +ENV PORT 1688 +ENV EPID "" +ENV LCID 1033 +ENV CLIENT_COUNT 26 +ENV ACTIVATION_INTERVAL 120 +ENV RENEWAL_INTERVAL 10080 +ENV SQLITE true +ENV SQLITE_PORT 8080 +ENV HWID RANDOM +ENV LOGLEVEL INFO +ENV LOGFILE /dev/stdout +ENV LOGSIZE "" -COPY docker/docker-py3-kms/start.sh /usr/bin/start.sh COPY ./py-kms /home/py-kms RUN apk add --no-cache --update \ @@ -28,10 +28,12 @@ RUN apk add --no-cache --update \ tzdata \ build-base python3-dev && \ git clone https://github.com/coleifer/sqlite-web.git /tmp/sqlite_web && \ + cd /tmp/sqlite_web && \ + git checkout 2e7c85da3d37f80074ed3ae39b5851069b4f301c && \ + cd / && \ mv /tmp/sqlite_web/sqlite_web /home/ && \ rm -rf /tmp/sqlite_web && \ pip3 install peewee tzlocal pytz pysqlite3 && \ - chmod a+x /usr/bin/start.sh && \ apk del git build-base python3-dev # Fix undefined timezone, in case the user did not mount the /etc/localtime @@ -39,6 +41,9 @@ RUN cp /usr/share/zoneinfo/UTC /etc/localtime WORKDIR /home/py-kms +EXPOSE ${SQLITE_PORT}/tcp EXPOSE ${PORT}/tcp -ENTRYPOINT ["/usr/bin/start.sh"] +COPY docker/entrypoint.py /usr/bin/entrypoint.py +RUN chmod a+x /usr/bin/entrypoint.py +ENTRYPOINT ['/usr/bin/python3', '/usr/bin/entrypoint.py'] diff --git a/docker/docker-py3-kms/build-py3-kms.sh b/docker/docker-py3-kms/build-py3-kms.sh deleted file mode 100755 index 71e6145..0000000 --- a/docker/docker-py3-kms/build-py3-kms.sh +++ /dev/null @@ -1 +0,0 @@ -docker build -t pykms/pykms:py3-kms ../../ --file ./Dockerfile diff --git a/docker/docker-py3-kms/run-py3-kms.sh b/docker/docker-py3-kms/run-py3-kms.sh deleted file mode 100755 index b8d5f4c..0000000 --- a/docker/docker-py3-kms/run-py3-kms.sh +++ /dev/null @@ -1,16 +0,0 @@ -docker stop py3-kms -docker rm py3-kms -docker run -d --name py3-kms \ - -t \ - -p 8080:8080 \ - -p 1688:1688 \ - -e IP=0.0.0.0 \ - -e PORT=1688 \ - -e SQLITE=true \ - -e HWID=RANDOM \ - -e LOGLEVEL=INFO \ - -e LOGFILE=/var/log/pykms_logserver.log \ - -e LOGSIZE=2 \ - -v /etc/localtime:/etc/localtime:ro \ - -v /var/log:/var/log:rw \ - --restart unless-stopped pykms/pykms:py3-kms diff --git a/docker/docker-py3-kms/start.sh b/docker/docker-py3-kms/start.sh deleted file mode 100755 index f6b1e01..0000000 --- a/docker/docker-py3-kms/start.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -cd /home/py-kms -if [ "$SQLITE" == false ]; -then - if [ "$EPID" == "" ]; - then - if [ "$LOGSIZE" == "" ]; - then - /usr/bin/python3 pykms_Server.py ${IP} ${PORT} -l ${LCID} -c ${CLIENT_COUNT} -a ${ACTIVATION_INTERVAL} -r ${RENEWAL_INTERVAL} -w ${HWID} -V ${LOGLEVEL} -F ${LOGFILE} - else - /usr/bin/python3 pykms_Server.py ${IP} ${PORT} -l ${LCID} -c ${CLIENT_COUNT} -a ${ACTIVATION_INTERVAL} -r ${RENEWAL_INTERVAL} -w ${HWID} -V ${LOGLEVEL} -F ${LOGFILE} -S ${LOGSIZE} - fi - else - if [ "$LOGSIZE" == "" ]; - then - /usr/bin/python3 pykms_Server.py ${IP} ${PORT} -e ${EPID} -l ${LCID} -c ${CLIENT_COUNT} -a ${ACTIVATION_INTERVAL} -r ${RENEWAL_INTERVAL} -w ${HWID} -V ${LOGLEVEL} -F ${LOGFILE} - else - /usr/bin/python3 pykms_Server.py ${IP} ${PORT} -e ${EPID} -l ${LCID} -c ${CLIENT_COUNT} -a ${ACTIVATION_INTERVAL} -r ${RENEWAL_INTERVAL} -w ${HWID} -V ${LOGLEVEL} -F ${LOGFILE} -S ${LOGSIZE} - fi - fi -else - if [ "$EPID" == "" ]; - then - if [ "$LOGSIZE" == "" ]; - then - /bin/bash -c "/usr/bin/python3 pykms_Server.py ${IP} ${PORT} -l ${LCID} -c ${CLIENT_COUNT} -a ${ACTIVATION_INTERVAL} -r ${RENEWAL_INTERVAL} -s ${PWD}/pykms_database.db -w ${HWID} -V ${LOGLEVEL} -F ${LOGFILE} &" - sleep 5 - /usr/bin/python3 pykms_Client.py ${IP} ${PORT} -m Windows10 & - /usr/bin/python3 /home/sqlite_web/sqlite_web.py -H ${IP} -x ${PWD}/pykms_database.db --read-only - else - /bin/bash -c "/usr/bin/python3 pykms_Server.py ${IP} ${PORT} -l ${LCID} -c ${CLIENT_COUNT} -a ${ACTIVATION_INTERVAL} -r ${RENEWAL_INTERVAL} -s ${PWD}/pykms_database.db -w ${HWID} -V ${LOGLEVEL} -F ${LOGFILE} -S ${LOGSIZE} &" - sleep 5 - /usr/bin/python3 pykms_Client.py ${IP} ${PORT} -m Windows10 & - /usr/bin/python3 /home/sqlite_web/sqlite_web.py -H ${IP} -x ${PWD}/pykms_database.db --read-only - fi - else - if [ "$LOGSIZE" == "" ]; - then - /bin/bash -c "/usr/bin/python3 pykms_Server.py ${IP} ${PORT} -e ${EPID} -l ${LCID} -c ${CLIENT_COUNT} -a ${ACTIVATION_INTERVAL} -r ${RENEWAL_INTERVAL} -s ${PWD}/pykms_database.db -w ${HWID} -V ${LOGLEVEL} -F ${LOGFILE} &" - sleep 5 - /usr/bin/python3 pykms_Client.py ${IP} ${PORT} -m Windows10 & - /usr/bin/python3 /home/sqlite_web/sqlite_web.py -H ${IP} -x ${PWD}/pykms_database.db --read-only - else - /bin/sh -c "/usr/bin/python3 pykms_Server.py ${IP} ${PORT} -e ${EPID} -l ${LCID} -c ${CLIENT_COUNT} -a ${ACTIVATION_INTERVAL} -r ${RENEWAL_INTERVAL} -s ${PWD}/pykms_database.db -w ${HWID} -V ${LOGLEVEL} -F ${LOGFILE} -S ${LOGSIZE} &" - sleep 5 - /usr/bin/python3 pykms_Client.py ${IP} ${PORT} -m Windows10 & - /usr/bin/python3 /home/sqlite_web/sqlite_web.py -H ${IP} -x ${PWD}/pykms_database.db --read-only - fi - fi -fi diff --git a/docker/entrypoint.py b/docker/entrypoint.py new file mode 100755 index 0000000..9fe4fe3 --- /dev/null +++ b/docker/entrypoint.py @@ -0,0 +1,53 @@ +#!/usr/bin/python3 + +# This replaces the old start.sh and ensures all arguments are bound correctly from the environment variables... + +import os +import time +import subprocess + +argumentVariableMapping = { + '-l': 'LCID', + '-c': 'CLIENT_COUNT', + '-a': 'ACTIVATION_INTERVAL', + '-r': 'RENEWAL_INTERVAL', + '-w': 'HWID', + '-V': 'LOGLEVEL', + '-F': 'LOGFILE', + '-S': 'LOGSIZE', + '-e': 'EPID' +} + +# Build the command to execute +command = ['/usr/bin/python3', 'pykms_Server.py', os.environ.get('IP'), os.environ.get('PORT')] +for (arg, env) in argumentVariableMapping.items(): + if env in os.environ and os.environ.get(env) != '': + command.append(arg) + command.append(os.environ.get(env)) + +enableSQLITE = os.environ.get('SQLITE').lower() == 'true' +os.makedirs('db', exist_ok=True) +dbPath = os.path.join(os.environ.get('PWD'), 'db', 'pykms_database.db') +if enableSQLITE: + command.append('-s') + command.append(dbPath) + +pykmsProcess = subprocess.Popen(command) + +# In case SQLITE is defined: Start the web interface +if enableSQLITE: + time.sleep(5) # The server may take a while to start + if not os.path.isfile(dbPath): + # Start a dummy activation to ensure the database file is created + subprocess.run(['/usr/bin/python3', 'pykms_Client.py', os.environ.get('IP'), os.environ.get('PORT'), '-m', 'Windows10', '-n', 'DummyClient', '-c', 'ae3a27d1-b73a-4734-9878-70c949815218']) + sqliteProcess = subprocess.Popen(['/usr/bin/python3', '/home/sqlite_web/sqlite_web.py', '-H', os.environ.get('IP'), '--read-only', '-x', dbPath, '-p', os.environ.get('SQLITE_PORT')]) + +try: + pykmsProcess.wait() +except: + # In case of any error - just shut down + pass + +if enableSQLITE: + sqliteProcess.terminate() + pykmsProcess.terminate() diff --git a/docs/Getting Started.md b/docs/Getting Started.md index ce1c633..45e9b29 100644 --- a/docs/Getting Started.md +++ b/docs/Getting Started.md @@ -37,25 +37,26 @@ _Please note that any architecture other than the classic `amd64` is slightly bi #### Docker Compose You can use `docker-compose` instead of building and running the Dockerfile, so you do not need to respecify your settings again and again. The following Docker Compose file will deploy the `latest` image with the log into your local directory. +Make sure to take a look into the `entrypoint.py` script to see all supported variable mappings! ```yaml version: '3' services: kms: - image: pykmsorg/py-kms:latest + image: pykmsorg/py-kms:python3 ports: - 1688:1688 + - 8080:8080 environment: - IP=0.0.0.0 - SQLITE=true - HWID=RANDOM - LOGLEVEL=INFO - - LOGSIZE=2 - - LOGFILE=/var/log/pykms_logserver.log + - LOGFILE=/dev/stdout restart: always volumes: + - ./db:/home/py-kms/db - /etc/localtime:/etc/localtime:ro - - ./logs:/var/log:rw ``` #### Parameters From fba768bd512397f09be69aa408bfc6efb3a72954 Mon Sep 17 00:00:00 2001 From: Simon Beginn Date: Thu, 14 Oct 2021 13:17:51 +0200 Subject: [PATCH 09/16] Extended docs for SQLITE stuff --- docs/Getting Started.md | 9 +-------- docs/Usage.md | 4 ++++ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/docs/Getting Started.md b/docs/Getting Started.md index 45e9b29..96553f2 100644 --- a/docs/Getting Started.md +++ b/docs/Getting Started.md @@ -60,20 +60,13 @@ services: ``` #### Parameters -Below is a fully expanded run command, detailing all the different supported environment variables to set. For further reference see the [start parameters](Usage.html#docker-environment) for the docker environment. +Below is a little bit more extended run command, detailing all the different supported environment variables to set. For further reference see the [start parameters](Usage.html#docker-environment) for the docker environment. ```bash docker run -it -d --name py3-kms \ -p 8080:8080 \ -p 1688:1688 \ - -e IP=0.0.0.0 \ - -e PORT=1688 \ -e SQLITE=true \ - -e HWID=RANDOM \ - -e LOGLEVEL=INFO \ - -e LOGSIZE=2 \ - -e LOGFILE=/var/log/pykms_logserver.log \ -v /etc/localtime:/etc/localtime:ro \ - -v ./logs:/var/log:rw \ --restart unless-stopped pykmsorg/py-kms:[TAG] ``` You can omit the `-e SQLITE=...` and `-p 8080:8080` option if you plan to use the `minimal` or `latest` image, which does not include the respective module support. diff --git a/docs/Usage.md b/docs/Usage.md index 7e27ba9..a0ab9d4 100644 --- a/docs/Usage.md +++ b/docs/Usage.md @@ -230,6 +230,10 @@ ENV RENEWAL_INTERVAL 10080 # Use this flag to store request information from unique clients in an SQLite database. ENV SQLITE false +# TCP-port +# The network port to listen with the web interface on. The default is "8080". +ENV SQLITE_PORT 8080 + # hwid # Use this flag to specify a HWID. # The HWID must be an 16-character string of hex characters. From b2b9cb137e485c24fd2755cbf9613ddb2d20c341 Mon Sep 17 00:00:00 2001 From: TheSpad Date: Thu, 14 Oct 2021 18:37:45 +0100 Subject: [PATCH 10/16] Fix entrypoint --- docker/entrypoint.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/entrypoint.py b/docker/entrypoint.py index 9fe4fe3..c394bf5 100755 --- a/docker/entrypoint.py +++ b/docker/entrypoint.py @@ -27,7 +27,8 @@ for (arg, env) in argumentVariableMapping.items(): enableSQLITE = os.environ.get('SQLITE').lower() == 'true' os.makedirs('db', exist_ok=True) -dbPath = os.path.join(os.environ.get('PWD'), 'db', 'pykms_database.db') +dbPath = os.path.join('/home/py-kms', 'db', 'pykms_database.db') +print(dbPath) if enableSQLITE: command.append('-s') command.append(dbPath) From 8c1d23fe3809084c12cde71564b04a5de4bfcb8c Mon Sep 17 00:00:00 2001 From: TheSpad Date: Thu, 14 Oct 2021 18:38:19 +0100 Subject: [PATCH 11/16] Fix entrypoint --- docker/docker-py3-kms-minimal/Dockerfile | 2 +- docker/docker-py3-kms/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/docker-py3-kms-minimal/Dockerfile b/docker/docker-py3-kms-minimal/Dockerfile index 2c9107d..25a28af 100644 --- a/docker/docker-py3-kms-minimal/Dockerfile +++ b/docker/docker-py3-kms-minimal/Dockerfile @@ -39,4 +39,4 @@ EXPOSE ${PORT}/tcp COPY docker/entrypoint.py /usr/bin/entrypoint.py RUN chmod a+x /usr/bin/entrypoint.py -ENTRYPOINT ['/usr/bin/python3', '/usr/bin/entrypoint.py'] +ENTRYPOINT ["/usr/bin/python3", "/usr/bin/entrypoint.py"] diff --git a/docker/docker-py3-kms/Dockerfile b/docker/docker-py3-kms/Dockerfile index e5fd87c..c2ee203 100644 --- a/docker/docker-py3-kms/Dockerfile +++ b/docker/docker-py3-kms/Dockerfile @@ -46,4 +46,4 @@ EXPOSE ${PORT}/tcp COPY docker/entrypoint.py /usr/bin/entrypoint.py RUN chmod a+x /usr/bin/entrypoint.py -ENTRYPOINT ['/usr/bin/python3', '/usr/bin/entrypoint.py'] +ENTRYPOINT ["/usr/bin/python3", "/usr/bin/entrypoint.py"] From 74850b8b63aba3f831d6170d460657f597300690 Mon Sep 17 00:00:00 2001 From: simonmicro Date: Fri, 15 Oct 2021 01:31:34 +0200 Subject: [PATCH 12/16] Corrected path back to current work directory and formatted log message --- docker/entrypoint.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/entrypoint.py b/docker/entrypoint.py index c394bf5..becba95 100755 --- a/docker/entrypoint.py +++ b/docker/entrypoint.py @@ -27,9 +27,9 @@ for (arg, env) in argumentVariableMapping.items(): enableSQLITE = os.environ.get('SQLITE').lower() == 'true' os.makedirs('db', exist_ok=True) -dbPath = os.path.join('/home/py-kms', 'db', 'pykms_database.db') -print(dbPath) +dbPath = os.path.join('db', 'pykms_database.db') if enableSQLITE: + print('Storing database file to ' + dbPath) command.append('-s') command.append(dbPath) From b00e743eaf4e46075c615950aeb29379b1970411 Mon Sep 17 00:00:00 2001 From: Simon Beginn Date: Sun, 17 Oct 2021 11:56:28 +0200 Subject: [PATCH 13/16] Fixed broken SQLite entrypoint (https://github.com/Py-KMS-Organization/py-kms/issues/14) --- docker/entrypoint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/entrypoint.py b/docker/entrypoint.py index becba95..ea30ede 100755 --- a/docker/entrypoint.py +++ b/docker/entrypoint.py @@ -25,7 +25,7 @@ for (arg, env) in argumentVariableMapping.items(): command.append(arg) command.append(os.environ.get(env)) -enableSQLITE = os.environ.get('SQLITE').lower() == 'true' +enableSQLITE = os.environ.get('SQLITE') != None and os.environ.get('SQLITE').lower() == 'true' os.makedirs('db', exist_ok=True) dbPath = os.path.join('db', 'pykms_database.db') if enableSQLITE: From 4ee742d671ae853f600b90425c97b2080ff17b80 Mon Sep 17 00:00:00 2001 From: Simon Beginn Date: Thu, 21 Oct 2021 13:14:44 +0200 Subject: [PATCH 14/16] Fix for missing environment variables --- docker/entrypoint.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docker/entrypoint.py b/docker/entrypoint.py index ea30ede..399d091 100755 --- a/docker/entrypoint.py +++ b/docker/entrypoint.py @@ -19,17 +19,19 @@ argumentVariableMapping = { } # Build the command to execute -command = ['/usr/bin/python3', 'pykms_Server.py', os.environ.get('IP'), os.environ.get('PORT')] +listenIP = os.environ.get('IP', '0.0.0.0') +listenPort = os.environ.get('PORT', '1688') +command = ['/usr/bin/python3', 'pykms_Server.py', listenIP, listenPort] for (arg, env) in argumentVariableMapping.items(): if env in os.environ and os.environ.get(env) != '': command.append(arg) command.append(os.environ.get(env)) -enableSQLITE = os.environ.get('SQLITE') != None and os.environ.get('SQLITE').lower() == 'true' -os.makedirs('db', exist_ok=True) -dbPath = os.path.join('db', 'pykms_database.db') +enableSQLITE = os.environ.get('SQLITE', 'false').lower() == 'true' if enableSQLITE: print('Storing database file to ' + dbPath) + dbPath = os.path.join('db', 'pykms_database.db') + os.makedirs('db', exist_ok=True) command.append('-s') command.append(dbPath) @@ -40,8 +42,8 @@ if enableSQLITE: time.sleep(5) # The server may take a while to start if not os.path.isfile(dbPath): # Start a dummy activation to ensure the database file is created - subprocess.run(['/usr/bin/python3', 'pykms_Client.py', os.environ.get('IP'), os.environ.get('PORT'), '-m', 'Windows10', '-n', 'DummyClient', '-c', 'ae3a27d1-b73a-4734-9878-70c949815218']) - sqliteProcess = subprocess.Popen(['/usr/bin/python3', '/home/sqlite_web/sqlite_web.py', '-H', os.environ.get('IP'), '--read-only', '-x', dbPath, '-p', os.environ.get('SQLITE_PORT')]) + subprocess.run(['/usr/bin/python3', 'pykms_Client.py', listenIP, listenPort, '-m', 'Windows10', '-n', 'DummyClient', '-c', 'ae3a27d1-b73a-4734-9878-70c949815218']) + sqliteProcess = subprocess.Popen(['/usr/bin/python3', '/home/sqlite_web/sqlite_web.py', '-H', listenIP, '--read-only', '-x', dbPath, '-p', os.environ.get('SQLITE_PORT', 8080)]) try: pykmsProcess.wait() From eb42224bf1ec25c9b9905bcd4ce4ab23d3130a12 Mon Sep 17 00:00:00 2001 From: Simon Beginn Date: Thu, 21 Oct 2021 13:22:03 +0200 Subject: [PATCH 15/16] Block SQLITE in case sqlite-web files are missing --- docker/entrypoint.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docker/entrypoint.py b/docker/entrypoint.py index 399d091..5d2f982 100755 --- a/docker/entrypoint.py +++ b/docker/entrypoint.py @@ -17,6 +17,7 @@ argumentVariableMapping = { '-S': 'LOGSIZE', '-e': 'EPID' } +sqliteWebPath = '/home/sqlite_web/sqlite_web.py' # Build the command to execute listenIP = os.environ.get('IP', '0.0.0.0') @@ -27,7 +28,7 @@ for (arg, env) in argumentVariableMapping.items(): command.append(arg) command.append(os.environ.get(env)) -enableSQLITE = os.environ.get('SQLITE', 'false').lower() == 'true' +enableSQLITE = os.path.isfile(sqliteWebPath) and os.environ.get('SQLITE', 'false').lower() == 'true' if enableSQLITE: print('Storing database file to ' + dbPath) dbPath = os.path.join('db', 'pykms_database.db') @@ -43,7 +44,7 @@ if enableSQLITE: if not os.path.isfile(dbPath): # Start a dummy activation to ensure the database file is created subprocess.run(['/usr/bin/python3', 'pykms_Client.py', listenIP, listenPort, '-m', 'Windows10', '-n', 'DummyClient', '-c', 'ae3a27d1-b73a-4734-9878-70c949815218']) - sqliteProcess = subprocess.Popen(['/usr/bin/python3', '/home/sqlite_web/sqlite_web.py', '-H', listenIP, '--read-only', '-x', dbPath, '-p', os.environ.get('SQLITE_PORT', 8080)]) + sqliteProcess = subprocess.Popen(['/usr/bin/python3', sqliteWebPath, '-H', listenIP, '--read-only', '-x', dbPath, '-p', os.environ.get('SQLITE_PORT', 8080)]) try: pykmsProcess.wait() From 5df548760479f5c20e5c64fef8830986bf6887f1 Mon Sep 17 00:00:00 2001 From: Simon Beginn Date: Thu, 21 Oct 2021 13:26:34 +0200 Subject: [PATCH 16/16] Switch from pulls-limited Docker Hub to Github Container Registry --- README.md | 2 +- docs/Getting Started.md | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 484d8f9..76e90b6 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ The wiki has been completly reworked and is now available on [readthedocs.com](h ## Quick start - To start the server, execute `python3 pykms_Server.py [IPADDRESS] [PORT]`, the default _IPADDRESS_ is `0.0.0.0` ( all interfaces ) and the default _PORT_ is `1688`. Note that both the address and port are optional. It's allowed to use IPv4 and IPv6 addresses. If you have a IPv6-capable dual-stack OS, a dual-stack socket is created when using a IPv6 address. -- To start the server automatically using Docker, execute `docker run -d --name py-kms --restart always -p 1688:1688 pykmsorg/py-kms`. +- To start the server automatically using Docker, execute `docker run -d --name py-kms --restart always -p 1688:1688 ghcr.io/py-kms-organization/py-kms`. - To show the help pages type: `python3 pykms_Server.py -h` and `python3 pykms_Client.py -h`. - For launching _py-kms_ GUI make the file `pykms_Server.py` executable with `chmod +x /path/to/folder/py-kms/pykms_Server.py`, then simply run `pykms_Server.py` by double-clicking. diff --git a/docs/Getting Started.md b/docs/Getting Started.md index 96553f2..7aa157c 100644 --- a/docs/Getting Started.md +++ b/docs/Getting Started.md @@ -15,10 +15,10 @@ If you wish to get _py-kms_ just up and running without installing any dependenc Docker also solves problems regarding the explicit IPv4 and IPv6 usage (it just supports both). The following command will download, "install" and start _py-kms_ and also keep it alive after any service disruption. ```bash -docker run -d --name py-kms --restart always -p 1688:1688 -v /etc/localtime:/etc/localtime:ro pykmsorg/py-kms +docker run -d --name py-kms --restart always -p 1688:1688 -v /etc/localtime:/etc/localtime:ro ghcr.io/py-kms-organization/py-kms ``` -If you just want to use the image and don't want to build them yourself, you can always use the official image at the [Docker Hub](https://hub.docker.com/r/pykmsorg/py-kms) (`pykmsorg/py-kms`). To ensure that you are using always the -latest version you should check something like [watchtower](https://github.com/containrrr/watchtower) out ! +If you just want to use the image and don't want to build them yourself, you can always use the official image at the [Docker Hub](https://hub.docker.com/r/pykmsorg/py-kms) (`pykmsorg/py-kms`) or [GitHub Container Registry](https://github.com/Py-KMS-Organization/py-kms/pkgs/container/py-kms) (`ghcr.io/py-kms-organization/py-kms`). To ensure that you are using always the +latest version you should check something like [watchtower](https://github.com/containrrr/watchtower) out! #### Tags There are currently three tags of the image available (select one just by appending `:` to the image from above): @@ -43,7 +43,7 @@ version: '3' services: kms: - image: pykmsorg/py-kms:python3 + image: ghcr.io/py-kms-organization/py-kms:python3 ports: - 1688:1688 - 8080:8080 @@ -67,7 +67,7 @@ docker run -it -d --name py3-kms \ -p 1688:1688 \ -e SQLITE=true \ -v /etc/localtime:/etc/localtime:ro \ - --restart unless-stopped pykmsorg/py-kms:[TAG] + --restart unless-stopped ghcr.io/py-kms-organization/py-kms:[TAG] ``` You can omit the `-e SQLITE=...` and `-p 8080:8080` option if you plan to use the `minimal` or `latest` image, which does not include the respective module support.