19 Commits

Author SHA1 Message Date
ElevenNotes
ad35b06dc0 dispatch failed 2025-02-10 11:10:13 +01:00
ElevenNotes
efccd9cdb3 downstream auto build 2025-02-10 11:05:42 +01:00
ElevenNotes
5c6e416ce4 current activation screenshot 2025-02-10 10:47:44 +01:00
ElevenNotes
48a5ba320c bump python to always latest 2025-02-10 10:43:05 +01:00
ElevenNotes
78d0173da0 bump python to 3.12.9-r0 2025-02-10 10:41:40 +01:00
ElevenNotes
c157fc1094 switch to branch next on upstream py-kms 2025-02-10 10:39:20 +01:00
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
13 changed files with 95 additions and 1099 deletions

View File

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

View File

@@ -2,12 +2,19 @@ name: create and publish docker image
on:
workflow_dispatch:
inputs:
release:
description: 'create release or not'
required: false
default: true
type: 'boolean'
push:
tags:
- 'v*'
env:
DOCKER_USERNAME: 11notes
RELEASE: true
jobs:
build-and-push-image:
@@ -36,19 +43,27 @@ jobs:
export LOCAL_SEMVER_MAJOR=$(awk -F. '{ print $1 }' <<< ${json_version})
export LOCAL_SEMVER_MINOR=$(awk -F. '{ print $2 }' <<< ${json_version})
export LOCAL_SEMVER_PATCH=$(awk -F. '{ print $3 }' <<< ${json_version})
export LOCAL_TAGS="${json_image}:latest"
export LOCAL_TAGS="${json_image}:${LOCAL_SHA}"
if [ ! -z ${LOCAL_SEMVER_MAJOR} ]; then LOCAL_TAGS="${LOCAL_TAGS},${json_image}:${LOCAL_SEMVER_MAJOR}"; fi
if [ ! -z ${LOCAL_SEMVER_MINOR} ]; then LOCAL_TAGS="${LOCAL_TAGS},${json_image}:${LOCAL_SEMVER_MAJOR}.${LOCAL_SEMVER_MINOR}"; fi
if [ ! -z ${LOCAL_SEMVER_PATCH} ]; then LOCAL_TAGS="${LOCAL_TAGS},${json_image}:${LOCAL_SEMVER_MAJOR}.${LOCAL_SEMVER_MINOR}.${LOCAL_SEMVER_PATCH}"; fi
if echo "${LOCAL_TAGS}" | grep -q "${json_stable}" ; then LOCAL_TAGS="${LOCAL_TAGS},${json_image}:stable"; fi
if echo "${LOCAL_TAGS}" | grep -q "${json_latest}" ; then LOCAL_TAGS="${LOCAL_TAGS},${json_image}:latest"; fi
if [ ! -z ${json_tags} ]; then SPECIAL_LOCAL_TAGS=$(echo ${json_tags} | sed 's/,/ /g'); for LOCAL_TAG in ${json_tags}; do LOCAL_TAGS="${LOCAL_TAGS},${json_image}:${LOCAL_TAG}"; done; fi
LOCAL_TAGS="${LOCAL_TAGS},${json_image}:${LOCAL_SHA}"
echo "IMAGE_TAGS=${LOCAL_TAGS}" >> $GITHUB_ENV
: # if for whatever reason UID/GID must be changed at build time
echo "IMAGE_UID=${json_uid:-1000}" >> $GITHUB_ENV
echo "IMAGE_GID=${json_gid:-1000}" >> $GITHUB_ENV
: # echo inputs
echo "${{ toJSON(github.event.inputs) }}"
- name: github / disable release
if: ${{ inputs.release != null && inputs.release == false }}
run: |
echo "RELEASE=false" >> $GITHUB_ENV
- name: docker / login to hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
@@ -88,6 +103,10 @@ jobs:
image: ${{ env.json_image }}:grype
severity-cutoff: high
- name: grype / report / print
if: success() || failure()
run: cat ${{ steps.scan.outputs.sarif }}
- name: grype / delete tag
if: success() || failure()
run: |
@@ -102,9 +121,6 @@ jobs:
with:
sarif_file: ${{ steps.scan.outputs.sarif }}
- name: grype / report / print
run: cat ${{ steps.scan.outputs.sarif }}
- name: docker / build & push
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d
with:
@@ -128,9 +144,11 @@ jobs:
${{ env.IMAGE_TAGS }}
- name: github / create release notes
if: ${{ env.RELEASE == 'true' && hashFiles('RELEASE.md') != '' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create ${{ github.ref_name }} -F RELEASE.md
run: |
gh release create ${{ github.ref_name }} -F RELEASE.md
- name: github / update description and set repo defaults
run: |
@@ -157,4 +175,10 @@ jobs:
destination_container_repo: ${{ env.json_image }}
provider: dockerhub
short_description: ${{ env.json_description }}
readme_file: 'README.md'
readme_file: 'README.md'
- name: github / dispatch workflow
if: ${{ env.json_dispatch_workflow != null }}
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc
with:
workflow: ${{ env.json_dispatch_workflow }}

16
.github/workflows/gui.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
name: build kms gui
on:
workflow_dispatch:
jobs:
cron:
runs-on: ubuntu-latest
steps:
- name: auto build and update downstream image
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc
with:
workflow: docker.yml
repo: 11notes/docker-kms-gui
token: "${{ secrets.REPOSITORY_TOKEN }}"
inputs: '{ "release": false }'

11
.json
View File

@@ -2,9 +2,14 @@
"image":"11notes/kms",
"description":"Activate any version of Windows and Office, forever",
"name":"kms",
"version":"646f476",
"version":"465f4d1",
"root":"/kms",
"stable":"646f476",
"parent":"11notes/alpine:stable"
"stable":"465f4d1",
"latest":"465f4d1",
"parent":"11notes/alpine:stable",
"dispatch":{
"workflow":"gui.yml"
}
}

View File

@@ -1,11 +1,12 @@
![Banner](https://github.com/11notes/defaults/blob/main/static/img/banner.png?raw=true)
# 🏔️ kms on Alpine
[<img src="https://img.shields.io/badge/github-source-blue?logo=github&color=040308">](https://github.com/11notes/docker-kms)![size](https://img.shields.io/docker/image-size/11notes/kms/646f476?color=0eb305)![version](https://img.shields.io/docker/v/11notes/kms/646f476?color=eb7a09)![pulls](https://img.shields.io/docker/pulls/11notes/kms?color=2b75d6)[<img src="https://img.shields.io/github/issues/11notes/docker-kms?color=7842f5">](https://github.com/11notes/docker-kms/issues)
[<img src="https://img.shields.io/badge/github-source-blue?logo=github&color=040308">](https://github.com/11notes/docker-kms)![size](https://img.shields.io/docker/image-size/11notes/kms/465f4d1?color=0eb305)![version](https://img.shields.io/docker/v/11notes/kms/465f4d1?color=eb7a09)![pulls](https://img.shields.io/docker/pulls/11notes/kms?color=2b75d6)[<img src="https://img.shields.io/github/issues/11notes/docker-kms?color=7842f5">](https://github.com/11notes/docker-kms/issues)
**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 📖
**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.
@@ -40,7 +41,7 @@ Works with:
name: "kms"
services:
kms:
image: "11notes/kms:646f476"
image: "11notes/kms:465f4d1"
container_name: "kms"
environment:
TZ: "Europe/Zurich"
@@ -48,7 +49,7 @@ services:
- "var:/kms/var"
ports:
- "1688:1688/tcp"
restart: always
restart: "always"
kms-gui:
image: "11notes/kms-gui:latest"
container_name: "kms-gui"
@@ -58,7 +59,7 @@ services:
- "var:/kms/var"
ports:
- "8080:8080/tcp"
restart: always
restart: "always"
volumes:
var:
```
@@ -93,11 +94,11 @@ slmgr /ato
| Parameter | Value | Default |
| --- | --- | --- |
| `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_PORT` | any port > 1024 | 1688 |
| `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_RENEWALINTERVAL` | re-activation after N minutes | 259200 (180 days) |
| `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)
* [alpine](https://alpinelinux.org)
# TIPS 📌
* Use a reverse proxy like Traefik, Nginx, HAproxy to terminate TLS with a valid certificate
* Use Lets Encrypt certificates to protect your SSL endpoints
# GENERAL TIPS 📌
* Use a reverse proxy like Traefik, Nginx, HAproxy to terminate TLS and to protect your 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)
# 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
* switch to new github workflow and build process
* downstream auto build

View File

@@ -1,29 +1,15 @@
# :: Util
FROM alpine AS util
FROM 11notes/util AS util
ARG NO_CACHE
RUN set -ex; \
apk --no-cache --update add \
git; \
git clone https://github.com/11notes/docker-util.git;
# :: Build / redis
FROM python:3.12-alpine AS build
ARG TARGETARCH
# :: Build / py-kms
FROM alpine/git AS build
ARG APP_VERSION
USER root
RUN set -ex; \
apk --update --no-cache add \
git; \
mkdir -p /opt/py-kms; \
git clone https://github.com/Py-KMS-Organization/py-kms.git; \
cd /py-kms/py-kms; \
git clone https://github.com/Py-KMS-Organization/py-kms.git -b next; \
cd /git/py-kms; \
git checkout ${APP_VERSION}; \
cp -R /py-kms/py-kms/* /opt/py-kms;
cp -R /git/py-kms/docker/docker-py3-kms-minimal/requirements.txt /git/py-kms/py-kms/requirements.txt; \
cp -R /git/py-kms/docker/docker-py3-kms/requirements.txt /git/py-kms/py-kms/requirements.gui.txt;
# :: Header
FROM 11notes/alpine:stable
@@ -46,12 +32,12 @@
ENV KMS_LOCALE=1033
ENV KMS_CLIENTCOUNT=26
ENV KMS_ACTIVATIONINTERVAL=120
ENV KMS_RENEWALINTERVAL=10080
ENV KMS_RENEWALINTERVAL=259200
ENV KMS_LOGLEVEL="INFO"
# :: multi-stage
COPY --from=util /docker-util/src/ /usr/local/bin
COPY --from=build /opt/py-kms/ /opt/py-kms
COPY --from=util /usr/local/bin/ /usr/local/bin
COPY --from=build /git/py-kms/py-kms/ /opt/py-kms
# :: Run
USER root
@@ -59,17 +45,14 @@
# :: install application
RUN set -ex; \
apk --no-cache --update add \
python3=3.12.8-r1; \
python3; \
apk --no-cache --update --virtual .build add \
py3-pip;
RUN set -ex; \
mkdir -p ${APP_ROOT}/var; \
touch /var/log/kms.log; \
ln -sf /dev/stdout /var/log/kms.log; \
pip3 install --no-cache-dir --break-system-packages \
tzlocal \
pytz; \
pip3 install --no-cache-dir -r /opt/py-kms/requirements.txt --break-system-packages; \
pip3 install --no-cache-dir pytz --break-system-packages; \
apk del --no-network .build;
# :: copy filesystem changes and set correct permissions
@@ -77,7 +60,8 @@
RUN set -ex; \
chmod +x -R /usr/local/bin; \
chown -R 1000:1000 \
${APP_ROOT};
${APP_ROOT} \
/opt/py-kms;
# :: Volumes
VOLUME ["${APP_ROOT}/var"]

View File

@@ -1,7 +1,7 @@
name: "kms"
services:
kms:
image: "11notes/kms:646f476"
image: "11notes/kms:465f4d1"
container_name: "kms"
environment:
TZ: "Europe/Zurich"
@@ -9,7 +9,7 @@ services:
- "var:/kms/var"
ports:
- "1688:1688/tcp"
restart: always
restart: "always"
kms-gui:
image: "11notes/kms-gui:latest"
container_name: "kms-gui"
@@ -19,6 +19,6 @@ services:
- "var:/kms/var"
ports:
- "8080:8080/tcp"
restart: always
restart: "always"
volumes:
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: 39 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,11 @@
#!/bin/ash
if [ -z "${1}" ]; then
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 \
@@ -12,7 +18,7 @@
-s /kms/var/kms.db \
-w RANDOM \
-V ${KMS_LOGLEVEL} \
-F /var/log/kms.log \
-F STDOUT \
-y
eleven log start

BIN
slmgr.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB