24 Commits

Author SHA1 Message Date
ElevenNotes
b48eeb675e drop KMS_ENHANCED_PRIVACY_ID 2025-02-07 11:43:16 +01:00
ElevenNotes
18c70eb586 drop KMS_ENHANCED_PRIVACY_ID 2025-02-07 11:31:02 +01:00
ElevenNotes
b1ff4dc249 drop KMS_ENHANCED_PRIVACY_ID 2025-02-07 11:30:22 +01:00
ElevenNotes
39c409583f add KMS_ENHANCED_PRIVACY_ID 2025-02-07 11:14:17 +01:00
ElevenNotes
7b2d310a77 add KMS_ENHANCED_PRIVACY_ID 2025-02-07 11:13:54 +01:00
ElevenNotes
33a59cfaa8 add DEBUG option 2025-02-07 10:45:31 +01:00
ElevenNotes
fdfa93cda8 add GUI example 2025-02-07 10:33:43 +01:00
ElevenNotes
8a2410c6dd chown /opt/py-kms 2025-02-07 10:29:05 +01:00
ElevenNotes
976e5908d6 add pytz 2025-02-07 09:36:56 +01:00
ElevenNotes
bbc70f4e85 add img 2025-02-07 09:31:08 +01:00
ElevenNotes
5e99a47212 prepare base layer for GUI image 2025-02-07 09:02:56 +01:00
ElevenNotes
2bc18274b2 legacy 2025-02-07 09:02:02 +01:00
ElevenNotes
496ef93b83 prepare baseline for KMS gui layer 2025-02-07 09:01:34 +01:00
ElevenNotes
abf8bacdb1 add custom KmsDataBase.xml 2025-02-07 08:11:09 +01:00
ElevenNotes
6896f7af81 tzlocal 2025-02-07 07:36:53 +01:00
ElevenNotes
08eb107dbe tzlocal 2025-02-07 07:33:37 +01:00
ElevenNotes
12d475a9bf tzlocal 2025-02-07 07:33:09 +01:00
ElevenNotes
63923d266c tzlocal error 2025-02-07 07:30:37 +01:00
ElevenNotes
57a7806590 add no-cache 2025-02-07 07:20:47 +01:00
ElevenNotes
fdb14fa9a8 tzdata error fix 2025-02-07 07:05:15 +01:00
ElevenNotes
1e7ec66f87 drop -d 2025-02-06 15:44:33 +01:00
ElevenNotes
f69b4b2667 added -d option for dual stack 2025-02-06 15:40:41 +01:00
ElevenNotes
5f3c446be5 add tzlocal 2025-02-06 15:26:11 +01:00
ElevenNotes
a5c9b72fa9 add tzlocal pytz pysqlite3 2025-02-06 15:23:45 +01:00
12 changed files with 1111 additions and 45 deletions

View File

@@ -1,5 +1,6 @@
.git* .git*
*.md *.md
LICENSE LICENSE
img/
maintain/ maintain/
project* project*

View File

@@ -77,6 +77,7 @@ jobs:
APP_ROOT=${{ env.json_root }} APP_ROOT=${{ env.json_root }}
APP_UID=${{ env.IMAGE_UID }} APP_UID=${{ env.IMAGE_UID }}
APP_GID=${{ env.IMAGE_GID }} APP_GID=${{ env.IMAGE_GID }}
NO_CACHE=$(date +%s)
tags: | tags: |
${{ env.json_image }}:grype ${{ env.json_image }}:grype
@@ -122,6 +123,7 @@ jobs:
APP_ROOT=${{ env.json_root }} APP_ROOT=${{ env.json_root }}
APP_UID=${{ env.IMAGE_UID }} APP_UID=${{ env.IMAGE_UID }}
APP_GID=${{ env.IMAGE_GID }} APP_GID=${{ env.IMAGE_GID }}
NO_CACHE=$(date +%s)
tags: | tags: |
${{ env.IMAGE_TAGS }} ${{ env.IMAGE_TAGS }}

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 11notes
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -5,7 +5,8 @@
**Activate any version of Windows and Office, forever** **Activate any version of Windows and Office, forever**
![slmgr](https://github.com/11notes/docker-kms/blob/main/slmgr.png?raw=true) ![activation](https://github.com/11notes/docker-kms/blob/master/img/activation.png "Windows Server 2025 Datacenter")
![GUI](https://github.com/11notes/docker-kms/blob/master/img/GUI.png "11notes/kms-gui")
# SYNOPSIS 📖 # SYNOPSIS 📖
**What can I do with this?** This image will run a KMS server you can use to activate any version of Windows and Office, forever. If you need a GUI, simply add [11notes/kms-gui](https://github.com/11notes/docker-kms-gui) to your compose. **What can I do with this?** This image will run a KMS server you can use to activate any version of Windows and Office, forever. If you need a GUI, simply add [11notes/kms-gui](https://github.com/11notes/docker-kms-gui) to your compose.
@@ -48,7 +49,7 @@ services:
- "var:/kms/var" - "var:/kms/var"
ports: ports:
- "1688:1688/tcp" - "1688:1688/tcp"
restart: always restart: "always"
kms-gui: kms-gui:
image: "11notes/kms-gui:latest" image: "11notes/kms-gui:latest"
container_name: "kms-gui" container_name: "kms-gui"
@@ -58,7 +59,7 @@ services:
- "var:/kms/var" - "var:/kms/var"
ports: ports:
- "8080:8080/tcp" - "8080:8080/tcp"
restart: always restart: "always"
volumes: volumes:
var: var:
``` ```
@@ -93,11 +94,11 @@ slmgr /ato
| Parameter | Value | Default | | Parameter | Value | Default |
| --- | --- | --- | | --- | --- | --- |
| `TZ` | [Time Zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) | | | `TZ` | [Time Zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) | |
| `DEBUG` | Show debug messages from image **not** app | | | `DEBUG` | Will activate debug option for container image and app (if available) | |
| `KMS_IP` | localhost or 127.0.0.1 or a dedicated IP | 0.0.0.0 | | `KMS_IP` | localhost or 127.0.0.1 or a dedicated IP | 0.0.0.0 |
| `KMS_PORT` | any port > 1024 | 1688 | | `KMS_PORT` | any port > 1024 | 1688 |
| `KMS_LOCALE` | see Microsoft LICD specification | 1033 (en-US) | | `KMS_LOCALE` | see Microsoft LICD specification | 1033 (en-US) |
| `KMS_CLIENTCOUNT` | client count >= 25 | 25 | | `KMS_CLIENTCOUNT` | client count > 25 | 26 |
| `KMS_ACTIVATIONINTERVAL` | Retry unsuccessful after N minutes | 120 (2 hours) | | `KMS_ACTIVATIONINTERVAL` | Retry unsuccessful after N minutes | 120 (2 hours) |
| `KMS_RENEWALINTERVAL` | re-activation after N minutes | 259200 (180 days) | | `KMS_RENEWALINTERVAL` | re-activation after N minutes | 259200 (180 days) |
| `KMS_LOGLEVEL` | CRITICAL, ERROR, WARNING, INFO, DEBUG, MININFO | INFO | | `KMS_LOGLEVEL` | CRITICAL, ERROR, WARNING, INFO, DEBUG, MININFO | INFO |
@@ -112,10 +113,11 @@ slmgr /ato
* [py-kms](https://github.com/Py-KMS-Organization/py-kms) * [py-kms](https://github.com/Py-KMS-Organization/py-kms)
* [alpine](https://alpinelinux.org) * [alpine](https://alpinelinux.org)
# TIPS 📌 # GENERAL TIPS 📌
* Use a reverse proxy like Traefik, Nginx, HAproxy to terminate TLS with a valid certificate * Use a reverse proxy like Traefik, Nginx, HAproxy to terminate TLS and to protect your endpoints
* Use Lets Encrypt certificates to protect your SSL endpoints * Use Lets Encrypt DNS-01 challenge to obtain valid SSL certificates for your services
* Do not expose this image to WAN! You will get notified from Microsoft via your ISP to terminate the service if you do so
* [Microsoft LICD](https://learn.microsoft.com/en-us/openspecs/office_standards/ms-oe376/6c085406-a698-4e12-9d4d-c3b0ee3dbc4a) * [Microsoft LICD](https://learn.microsoft.com/en-us/openspecs/office_standards/ms-oe376/6c085406-a698-4e12-9d4d-c3b0ee3dbc4a)
# ElevenNotes™ # ElevenNotes™
This image is provided to you at your own risk. Always make backups before updating an image to a different version. Check the [releases](https://github.com/11notes/docker-kms/releases) for breaking changes. If you have any problems with using this image simply raise an [issue](https://github.com/11notes/docker-kms/issues), thanks . You can find all my repositories on [github](https://github.com/11notes?tab=repositories). This image is provided to you at your own risk. Always make backups before updating an image to a different version. Check the [releases](https://github.com/11notes/docker-kms/releases) for breaking changes. If you have any problems with using this image simply raise an [issue](https://github.com/11notes/docker-kms/issues), thanks. You can find all my repositories on [github](https://github.com/11notes?tab=repositories).

View File

@@ -1,2 +1,2 @@
### 🪄 Features ### 🪄 Features
* switch to new github workflow and build process * drop KMS_ENHANCED_PRIVACY_ID

View File

@@ -1,37 +1,22 @@
# :: Util # :: Util
FROM alpine AS util FROM alpine/git AS util
ARG NO_CACHE
RUN set -ex; \ RUN set -ex; \
apk --no-cache --update add \
git; \
git clone https://github.com/11notes/docker-util.git; git clone https://github.com/11notes/docker-util.git;
# :: Build / redis # :: Build / py-kms
FROM python:3.12-alpine AS build FROM alpine/git AS build
ARG TARGETARCH
ARG APP_VERSION ARG APP_VERSION
USER root
RUN set -ex; \ RUN set -ex; \
apk --update --no-cache add \
curl \
wget \
unzip \
build-base \
linux-headers \
make \
cmake \
g++ \
git; \
pip3 install --upgrade pip; \
pip3 install pyinstaller; \
git clone https://github.com/Py-KMS-Organization/py-kms.git; \ git clone https://github.com/Py-KMS-Organization/py-kms.git; \
cd /py-kms/py-kms; \ cd /git/py-kms; \
git checkout ${APP_VERSION}; \ git checkout ${APP_VERSION}; \
pyinstaller --onefile pykms_Server.py; \ cp -R /git/py-kms/docker/docker-py3-kms-minimal/requirements.txt /git/py-kms/py-kms/requirements.txt; \
cp /py-kms/py-kms/dist/pykms_Server /usr/local/bin; cp -R /git/py-kms/docker/docker-py3-kms/requirements.txt /git/py-kms/py-kms/requirements.gui.txt;
# :: Header # :: Header
FROM 11notes/alpine:stable FROM 11notes/alpine:stable
@@ -52,14 +37,14 @@
ENV KMS_IP=0.0.0.0 ENV KMS_IP=0.0.0.0
ENV KMS_PORT=1688 ENV KMS_PORT=1688
ENV KMS_LOCALE=1033 ENV KMS_LOCALE=1033
ENV KMS_CLIENTCOUNT=25 ENV KMS_CLIENTCOUNT=26
ENV KMS_ACTIVATIONINTERVAL=120 ENV KMS_ACTIVATIONINTERVAL=120
ENV KMS_RENEWALINTERVAL=259200 ENV KMS_RENEWALINTERVAL=259200
ENV KMS_LOGLEVEL="INFO" ENV KMS_LOGLEVEL="INFO"
# :: multi-stage # :: multi-stage
COPY --from=util /docker-util/src/ /usr/local/bin COPY --from=util /git/docker-util/src/ /usr/local/bin
COPY --from=build /usr/local/bin/ /usr/local/bin COPY --from=build /git/py-kms/py-kms/ /opt/py-kms
# :: Run # :: Run
USER root USER root
@@ -67,19 +52,23 @@
# :: install application # :: install application
RUN set -ex; \ RUN set -ex; \
apk --no-cache --update add \ apk --no-cache --update add \
python3=3.12.8-r1; python3=3.12.8-r1; \
apk --no-cache --update --virtual .build add \
py3-pip;
RUN set -ex; \ RUN set -ex; \
mkdir -p ${APP_ROOT}/var; \ mkdir -p ${APP_ROOT}/var; \
touch /var/log/kms.log; \ pip3 install --no-cache-dir -r /opt/py-kms/requirements.txt --break-system-packages; \
ln -sf /dev/stdout /var/log/kms.log; pip3 install --no-cache-dir pytz --break-system-packages; \
apk del --no-network .build;
# :: copy filesystem changes and set correct permissions # :: copy filesystem changes and set correct permissions
COPY ./rootfs / COPY ./rootfs /
RUN set -ex; \ RUN set -ex; \
chmod +x -R /usr/local/bin; \ chmod +x -R /usr/local/bin; \
chown -R 1000:1000 \ chown -R 1000:1000 \
${APP_ROOT}; ${APP_ROOT} \
/opt/py-kms;
# :: Volumes # :: Volumes
VOLUME ["${APP_ROOT}/var"] VOLUME ["${APP_ROOT}/var"]

View File

@@ -9,7 +9,7 @@ services:
- "var:/kms/var" - "var:/kms/var"
ports: ports:
- "1688:1688/tcp" - "1688:1688/tcp"
restart: always restart: "always"
kms-gui: kms-gui:
image: "11notes/kms-gui:latest" image: "11notes/kms-gui:latest"
container_name: "kms-gui" container_name: "kms-gui"
@@ -19,6 +19,6 @@ services:
- "var:/kms/var" - "var:/kms/var"
ports: ports:
- "8080:8080/tcp" - "8080:8080/tcp"
restart: always restart: "always"
volumes: volumes:
var: var:

BIN
img/GUI.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
img/activation.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,14 @@
#!/bin/ash #!/bin/ash
if [ -z "${1}" ]; then if [ -z "${1}" ]; then
eleven log start
set -- "pykms_Server" \ if [ ! -z "${DEBUG}" ]; then
KMS_LOGLEVEL="DEBUG"
eleven log debug "setting kms log level to DEBUG"
fi
cd /opt/py-kms
set -- "python3" \
pykms_Server.py \
${KMS_IP} \ ${KMS_IP} \
${KMS_PORT} \ ${KMS_PORT} \
-l ${KMS_LOCALE} \ -l ${KMS_LOCALE} \
@@ -11,8 +18,10 @@
-s /kms/var/kms.db \ -s /kms/var/kms.db \
-w RANDOM \ -w RANDOM \
-V ${KMS_LOGLEVEL} \ -V ${KMS_LOGLEVEL} \
-F /var/log/kms.log \ -F STDOUT \
-y -y
eleven log start
fi fi
exec "$@" exec "$@"

BIN
slmgr.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB