mirror of
https://github.com/11notes/docker-kms-gui.git
synced 2025-10-24 08:33:50 +00:00
Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7754585854 | ||
|
|
2bbc9e2653 | ||
|
|
a955ccb9b1 | ||
|
|
3822e0e370 | ||
|
|
c06ececada | ||
|
|
c8b7e470e4 | ||
|
|
eea805e13a | ||
|
|
6909b2fc29 | ||
|
|
caa7a8a1e6 | ||
|
|
dcfb8ba91e | ||
|
|
129c21344c | ||
|
|
303774a72c | ||
|
|
23892c6d0b | ||
|
|
58f22ed34c | ||
|
|
63d616adfd | ||
|
|
b6f69b4860 | ||
|
|
ed3ea34868 | ||
|
|
11cf777dbd | ||
|
|
70680a384b | ||
|
|
4b3005630d | ||
|
|
6bd0fcdd8a | ||
|
|
14fd52cc83 | ||
|
|
58e32a5d1a |
@@ -1,5 +1,5 @@
|
||||
.git*
|
||||
*.md
|
||||
LICENSE
|
||||
img/
|
||||
maintain/
|
||||
project*
|
||||
3
.gitattributes
vendored
3
.gitattributes
vendored
@@ -1,2 +1 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
* text=auto
|
||||
161
.github/workflows/docker.yml
vendored
161
.github/workflows/docker.yml
vendored
@@ -1,17 +1,36 @@
|
||||
name: create and publish docker image
|
||||
name: docker
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
inputs:
|
||||
release:
|
||||
description: 'set WORKFLOW_GITHUB_RELEASE'
|
||||
required: false
|
||||
default: 'false'
|
||||
|
||||
env:
|
||||
DOCKER_USERNAME: 11notes
|
||||
image:
|
||||
description: 'set IMAGE'
|
||||
required: false
|
||||
|
||||
uid:
|
||||
description: 'set IMAGE_UID'
|
||||
required: false
|
||||
|
||||
gid:
|
||||
description: 'set IMAGE_GID'
|
||||
required: false
|
||||
|
||||
semverprefix:
|
||||
description: 'prefix for semver tags'
|
||||
required: false
|
||||
|
||||
semversuffix:
|
||||
description: 'suffix for semver tags'
|
||||
required: false
|
||||
|
||||
jobs:
|
||||
build-and-push-image:
|
||||
runs-on: ubuntu-latest
|
||||
docker:
|
||||
runs-on: ubuntu-22.04
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
@@ -21,6 +40,14 @@ jobs:
|
||||
- name: init / checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
|
||||
- name: init / inputs to env
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
run: |
|
||||
cat << 'EOF' > .inputs
|
||||
${{ toJSON(github.event.inputs) }}
|
||||
EOF
|
||||
for KEY in $(cat .inputs | jq --raw-output 'keys[]' | tr '\n' ' '); do echo "input_$(echo ${KEY} | tr '[:upper:]' '[:lower:]')=$(cat .inputs | jq --raw-output '.'${KEY}'')" >> $GITHUB_ENV; done
|
||||
|
||||
- name: init / .json to env
|
||||
uses: rgarcia-phi/json-to-variables@9835d537368468c4e4de5254dc3efeadda183793
|
||||
with:
|
||||
@@ -28,31 +55,49 @@ jobs:
|
||||
|
||||
- name: init / setup environment
|
||||
run: |
|
||||
: # set default arch if not set
|
||||
: # set image
|
||||
LOCAL_IMAGE=${json_image}
|
||||
if [ ! -z ${input_image} ]; then LOCAL_IMAGE=${input_image}; fi
|
||||
echo "IMAGE=${LOCAL_IMAGE}" >> $GITHUB_ENV
|
||||
|
||||
: # set defaults
|
||||
echo "IMAGE_ARCH=${json_arch:-linux/amd64,linux/arm64}" >> $GITHUB_ENV
|
||||
echo "WORKFLOW_GRYPE_SEVERITY_CUTOFF=${json_grype_severity:-high}" >> $GITHUB_ENV;
|
||||
echo "WORKFLOW_GITHUB_RELEASE=${input_release:-true}" >> $GITHUB_ENV;
|
||||
|
||||
: # create tags for semver, stable and other shenanigans
|
||||
export LOCAL_SHA=$(git rev-parse --short HEAD)
|
||||
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"
|
||||
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 [ ! -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}"
|
||||
LOCAL_SHA=$(git rev-parse --short HEAD)
|
||||
LOCAL_SEMVER_MAJOR=$(awk -F. '{ print $1 }' <<< ${json_semver_version})
|
||||
LOCAL_SEMVER_MINOR=$(awk -F. '{ print $2 }' <<< ${json_semver_version})
|
||||
LOCAL_SEMVER_PATCH=$(awk -F. '{ print $3 }' <<< ${json_semver_version})
|
||||
LOCAL_SEMVER_PREFIX=""
|
||||
LOCAL_SEMVER_SUFFIX=""
|
||||
LOCAL_SEMVER_RC=""
|
||||
LOCAL_TAGS="${LOCAL_IMAGE}:${LOCAL_SHA}"
|
||||
if [ ! -z ${input_semverprefix} ]; then LOCAL_SEMVER_PREFIX="${input_semverprefix}-"; fi
|
||||
if [ ! -z ${input_semversuffix} ]; then LOCAL_SEMVER_SUFFIX="-${input_semversuffix}"; fi
|
||||
if [ ! -z ${json_semver_rc} ]; then LOCAL_SEMVER_RC="-${json_semver_rc}"; fi
|
||||
if [ ! -z ${LOCAL_SEMVER_MAJOR} ]; then LOCAL_TAGS="${LOCAL_TAGS},${LOCAL_IMAGE}:${LOCAL_SEMVER_PREFIX}${LOCAL_SEMVER_MAJOR}${LOCAL_SEMVER_SUFFIX}"; fi
|
||||
if [ ! -z ${LOCAL_SEMVER_MINOR} ]; then LOCAL_TAGS="${LOCAL_TAGS},${LOCAL_IMAGE}:${LOCAL_SEMVER_PREFIX}${LOCAL_SEMVER_MAJOR}.${LOCAL_SEMVER_MINOR}${LOCAL_SEMVER_SUFFIX}"; fi
|
||||
if [ ! -z ${LOCAL_SEMVER_PATCH} ]; then LOCAL_TAGS="${LOCAL_TAGS},${LOCAL_IMAGE}:${LOCAL_SEMVER_PREFIX}${LOCAL_SEMVER_MAJOR}.${LOCAL_SEMVER_MINOR}.${LOCAL_SEMVER_PATCH}${LOCAL_SEMVER_SUFFIX}"; fi
|
||||
if echo "${LOCAL_TAGS}" | grep -q "${json_semver_stable}" ; then LOCAL_TAGS="${LOCAL_TAGS},${LOCAL_IMAGE}:${LOCAL_SEMVER_PREFIX}stable${LOCAL_SEMVER_SUFFIX}"; fi
|
||||
if echo "${LOCAL_TAGS}" | grep -q "${json_semver_latest}" ; then LOCAL_TAGS="${LOCAL_TAGS},${LOCAL_IMAGE}:${LOCAL_SEMVER_PREFIX}latest${LOCAL_SEMVER_SUFFIX}"; fi
|
||||
if [ ! -z ${json_semver_tags} ]; then SPECIAL_LOCAL_TAGS=$(echo ${json_semver_tags} | sed 's/,/ /g'); for LOCAL_TAG in ${json_semver_tags}; do LOCAL_TAGS="${LOCAL_TAGS},${LOCAL_IMAGE}:${LOCAL_SEMVER_PREFIX}${LOCAL_TAG}${LOCAL_SEMVER_SUFFIX}"; done; fi
|
||||
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
|
||||
if [ ! -z ${input_uid} ]; then echo "IMAGE_UID=${input_uid}" >> $GITHUB_ENV; else echo "IMAGE_UID=${json_uid:-1000}" >> $GITHUB_ENV; fi
|
||||
if [ ! -z ${input_gid} ]; then echo "IMAGE_GID=${input_gid}" >> $GITHUB_ENV; else echo "IMAGE_GID=${json_gid:-1000}" >> $GITHUB_ENV; fi
|
||||
|
||||
: # set rc, prefix or suffix globally
|
||||
echo "IMAGE_SEMVER_PREFIX=${LOCAL_SEMVER_PREFIX}" >> $GITHUB_ENV
|
||||
echo "IMAGE_SEMVER_SUFFIX=${LOCAL_SEMVER_SUFFIX}" >> $GITHUB_ENV
|
||||
echo "IMAGE_VERSION_RC=${LOCAL_SEMVER_RC}" >> $GITHUB_ENV
|
||||
|
||||
- name: docker / login to hub
|
||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
|
||||
with:
|
||||
username: ${{ env.DOCKER_USERNAME }}
|
||||
username: 11notes
|
||||
password: ${{ secrets.DOCKER_TOKEN }}
|
||||
|
||||
- name: docker / setup qemu
|
||||
@@ -61,48 +106,63 @@ jobs:
|
||||
- name: docker / setup buildx
|
||||
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5
|
||||
|
||||
- name: grype / build & push
|
||||
- name: grype / build & push & tag
|
||||
id: grype-tag
|
||||
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d
|
||||
with:
|
||||
context: .
|
||||
file: arch.dockerfile
|
||||
push: true
|
||||
platforms: ${{ env.IMAGE_ARCH }}
|
||||
cache-from: type=registry,ref=${{ env.json_image }}:buildcache
|
||||
cache-to: type=registry,ref=${{ env.json_image }}:buildcache,mode=max,compression=zstd,force-compression=true
|
||||
cache-from: type=registry,ref=${{ env.IMAGE }}:${{ env.IMAGE_SEMVER_PREFIX }}buildcache${{ env.IMAGE_SEMVER_SUFFIX }}
|
||||
cache-to: type=registry,ref=${{ env.IMAGE }}:${{ env.IMAGE_SEMVER_PREFIX }}buildcache${{ env.IMAGE_SEMVER_SUFFIX }},mode=max,compression=zstd,force-compression=true
|
||||
build-args: |
|
||||
APP_IMAGE=${{ env.json_image }}
|
||||
APP_IMAGE=${{ env.IMAGE }}
|
||||
APP_NAME=${{ env.json_name }}
|
||||
APP_VERSION=${{ env.json_version }}
|
||||
APP_VERSION=${{ env.json_semver_version }}
|
||||
APP_ROOT=${{ env.json_root }}
|
||||
APP_UID=${{ env.IMAGE_UID }}
|
||||
APP_GID=${{ env.IMAGE_GID }}
|
||||
APP_VERSION_PREFIX=${{ env.IMAGE_SEMVER_PREFIX }}
|
||||
APP_VERSION_SUFFIX=${{ env.IMAGE_SEMVER_SUFFIX }}
|
||||
APP_VERSION_RC=${{ env.IMAGE_VERSION_RC }}
|
||||
APP_NO_CACHE=$(date +%s)
|
||||
tags: |
|
||||
${{ env.json_image }}:grype
|
||||
${{ env.IMAGE }}:${{ env.IMAGE_SEMVER_PREFIX }}grype${{ env.IMAGE_SEMVER_SUFFIX }}
|
||||
|
||||
- name: grype / scan
|
||||
id: scan
|
||||
id: grype-scan
|
||||
uses: anchore/scan-action@abae793926ec39a78ab18002bc7fc45bbbd94342
|
||||
with:
|
||||
image: ${{ env.json_image }}:grype
|
||||
severity-cutoff: high
|
||||
image: ${{ env.IMAGE }}:${{ env.IMAGE_SEMVER_PREFIX }}grype${{ env.IMAGE_SEMVER_SUFFIX }}
|
||||
severity-cutoff: ${{ env.WORKFLOW_GRYPE_SEVERITY_CUTOFF }}
|
||||
by-cve: true
|
||||
output-format: 'sarif'
|
||||
output-file: ${{ runner.temp }}/_github_home/grype.sarif
|
||||
|
||||
- name: grype / report / sarif to markdown
|
||||
id: sarif-to-md
|
||||
if: success() || failure()
|
||||
continue-on-error: true
|
||||
uses: 11notes/action-sarif-to-markdown@bc689850bd33a1037ea1d0a609ab4ea14b3c4396
|
||||
with:
|
||||
sarif_file: grype.sarif
|
||||
|
||||
- name: grype / delete tag
|
||||
if: success() || failure()
|
||||
if: steps.grype-tag.outcome == 'success'
|
||||
run: |
|
||||
curl --request DELETE \
|
||||
--url https://hub.docker.com/v2/repositories/${{ env.json_image }}/tags/grype/ \
|
||||
--url https://hub.docker.com/v2/repositories/${{ env.IMAGE }}/tags/${{ env.IMAGE_SEMVER_PREFIX }}grype${{ env.IMAGE_SEMVER_SUFFIX }}/ \
|
||||
--header 'authorization: jwt ${{ secrets.DOCKER_TOKEN }}' \
|
||||
--header 'content-type: application/json' \
|
||||
--fail
|
||||
|
||||
- name: grype / report / upload
|
||||
if: steps.grype-scan.outcome == 'success'
|
||||
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169
|
||||
with:
|
||||
sarif_file: ${{ steps.scan.outputs.sarif }}
|
||||
|
||||
- name: grype / report / print
|
||||
run: cat ${{ steps.scan.outputs.sarif }}
|
||||
sarif_file: ${{ steps.grype-scan.outputs.sarif }}
|
||||
category: grype
|
||||
|
||||
- name: docker / build & push
|
||||
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d
|
||||
@@ -113,22 +173,28 @@ jobs:
|
||||
sbom: true
|
||||
provenance: mode=max
|
||||
platforms: ${{ env.IMAGE_ARCH }}
|
||||
cache-from: type=registry,ref=${{ env.json_image }}:buildcache
|
||||
cache-to: type=registry,ref=${{ env.json_image }}:buildcache,mode=max,compression=zstd,force-compression=true
|
||||
cache-from: type=registry,ref=${{ env.IMAGE }}:${{ env.IMAGE_SEMVER_PREFIX }}buildcache${{ env.IMAGE_SEMVER_SUFFIX }}
|
||||
cache-to: type=registry,ref=${{ env.IMAGE }}:${{ env.IMAGE_SEMVER_PREFIX }}buildcache${{ env.IMAGE_SEMVER_SUFFIX }},mode=max,compression=zstd,force-compression=true
|
||||
build-args: |
|
||||
APP_IMAGE=${{ env.json_image }}
|
||||
APP_IMAGE=${{ env.IMAGE }}
|
||||
APP_NAME=${{ env.json_name }}
|
||||
APP_VERSION=${{ env.json_version }}
|
||||
APP_VERSION=${{ env.json_semver_version }}
|
||||
APP_ROOT=${{ env.json_root }}
|
||||
APP_UID=${{ env.IMAGE_UID }}
|
||||
APP_GID=${{ env.IMAGE_GID }}
|
||||
APP_VERSION_PREFIX=${{ env.IMAGE_SEMVER_PREFIX }}
|
||||
APP_VERSION_SUFFIX=${{ env.IMAGE_SEMVER_SUFFIX }}
|
||||
APP_VERSION_RC=${{ env.IMAGE_VERSION_RC }}
|
||||
APP_NO_CACHE=$(date +%s)
|
||||
tags: |
|
||||
${{ env.IMAGE_TAGS }}
|
||||
|
||||
- name: github / create release notes
|
||||
if: env.WORKFLOW_GITHUB_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: |
|
||||
@@ -137,7 +203,7 @@ jobs:
|
||||
--header 'authorization: Bearer ${{ secrets.REPOSITORY_TOKEN }}' \
|
||||
--header 'content-type: application/json' \
|
||||
--data '{
|
||||
"description":"${{ env.json_description }}",
|
||||
"description":"${{ env.json_readme_description }}",
|
||||
"homepage":"",
|
||||
"has_issues":true,
|
||||
"has_discussions":true,
|
||||
@@ -147,12 +213,13 @@ jobs:
|
||||
--fail
|
||||
|
||||
- name: docker / push README.md to docker hub
|
||||
if: hashFiles('README.md') != ''
|
||||
uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8
|
||||
env:
|
||||
DOCKER_USER: ${{ env.DOCKER_USERNAME }}
|
||||
DOCKER_USER: 11notes
|
||||
DOCKER_PASS: ${{ secrets.DOCKER_TOKEN }}
|
||||
with:
|
||||
destination_container_repo: ${{ env.json_image }}
|
||||
destination_container_repo: ${{ env.IMAGE }}
|
||||
provider: dockerhub
|
||||
short_description: ${{ env.json_description }}
|
||||
short_description: ${{ env.json_readme_description }}
|
||||
readme_file: 'README.md'
|
||||
25
.github/workflows/tags.yml
vendored
Normal file
25
.github/workflows/tags.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
name: tags
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: build docker image
|
||||
uses: the-actions-org/workflow-dispatch@3133c5d135c7dbe4be4f9793872b6ef331b53bc7
|
||||
with:
|
||||
workflow: docker.yml
|
||||
token: "${{ secrets.REPOSITORY_TOKEN }}"
|
||||
inputs: '{ "release":"true" }'
|
||||
|
||||
docker-unraid:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: build docker image for unraid community
|
||||
uses: the-actions-org/workflow-dispatch@3133c5d135c7dbe4be4f9793872b6ef331b53bc7
|
||||
with:
|
||||
workflow: docker.yml
|
||||
token: "${{ secrets.REPOSITORY_TOKEN }}"
|
||||
inputs: '{ "release":"false", "uid":"99", "gid":"100", "semversuffix":"unraid" }'
|
||||
16
.json
16
.json
@@ -1,10 +1,18 @@
|
||||
{
|
||||
"image":"11notes/kms-gui",
|
||||
"description":"Activate any version of Windows and Office, forever",
|
||||
"name":"kms-gui",
|
||||
"version":"646f476",
|
||||
"root":"/kms",
|
||||
|
||||
"stable":"646f476",
|
||||
"parent":"11notes/alpine:stable"
|
||||
"semver":{
|
||||
"version":"465f4d1",
|
||||
"stable":"465f4d1",
|
||||
"latest":"465f4d1"
|
||||
},
|
||||
|
||||
"readme":{
|
||||
"description":"Activate any version of Windows and Office, forever",
|
||||
"parent":{
|
||||
"image":"11notes/kms:465f4d1"
|
||||
}
|
||||
}
|
||||
}
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal 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.
|
||||
36
README.md
36
README.md
@@ -1,11 +1,22 @@
|
||||

|
||||
|
||||
# 🏔️ kms-gui on Alpine
|
||||
[<img src="https://img.shields.io/badge/github-source-blue?logo=github&color=040308">](https://github.com/11notes/docker-kms-gui)[<img src="https://img.shields.io/github/issues/11notes/docker-kms-gui?color=7842f5">](https://github.com/11notes/docker-kms-gui/issues)
|
||||
[<img src="https://img.shields.io/badge/github-source-blue?logo=github&color=040308">](https://github.com/11notes/docker-kms-gui)[<img src="https://img.shields.io/github/issues/11notes/docker-kms-gui?color=7842f5">](https://github.com/11notes/docker-kms-gui/issues)
|
||||
|
||||
**Activate any version of Windows and Office, forever**
|
||||
|
||||

|
||||

|
||||
|
||||
# MAIN TAGS 🏷️
|
||||
These are the main tags for the image. There is also a tag for each commit and its shorthand sha256 value.
|
||||
|
||||
* [465f4d1](https://hub.docker.com/r/11notes/kms-gui/tags?name=465f4d1)
|
||||
* [stable](https://hub.docker.com/r/11notes/kms-gui/tags?name=stable)
|
||||
* [latest](https://hub.docker.com/r/11notes/kms-gui/tags?name=latest)
|
||||
* [465f4d1-unraid](https://hub.docker.com/r/11notes/kms-gui/tags?name=465f4d1-unraid)
|
||||
* [stable-unraid](https://hub.docker.com/r/11notes/kms-gui/tags?name=stable-unraid)
|
||||
* [latest-unraid](https://hub.docker.com/r/11notes/kms-gui/tags?name=latest-unraid)
|
||||
|
||||
|
||||
# SYNOPSIS 📖
|
||||
**What can I do with this?** This image will run a web GUI for your [11notes/kms](https://hub.docker.com/r/11notes/kms) server.
|
||||
@@ -15,7 +26,7 @@
|
||||
name: "kms"
|
||||
services:
|
||||
kms:
|
||||
image: "11notes/kms:latest"
|
||||
image: "11notes/kms:stable"
|
||||
container_name: "kms"
|
||||
environment:
|
||||
TZ: Europe/Zurich
|
||||
@@ -25,7 +36,7 @@ services:
|
||||
- "1688:1688/tcp"
|
||||
restart: always
|
||||
kms-gui:
|
||||
image: "11notes/kms-gui:646f476"
|
||||
image: "11notes/kms-gui:465f4d1"
|
||||
container_name: "kms-gui"
|
||||
environment:
|
||||
TZ: Europe/Zurich
|
||||
@@ -42,21 +53,24 @@ volumes:
|
||||
| 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_GUI_STYLE` | switch the UI style of the webinterface (py-kms, custom-icon) | custom-icon |
|
||||
|
||||
# SOURCE 💾
|
||||
* [11notes/kms-gui](https://github.com/11notes/docker-kms-gui)
|
||||
|
||||
# PARENT IMAGE 🏛️
|
||||
* [11notes/alpine:stable](https://hub.docker.com/r/11notes/alpine)
|
||||
* [11notes/kms:465f4d1](https://hub.docker.com/r/11notes/kms)
|
||||
|
||||
# BUILT WITH 🧰
|
||||
* [py-kms](https://github.com/Py-KMS-Organization/py-kms)
|
||||
* [CustomIcon/pykms-frontend](https://github.com/CustomIcon/pykms-frontend)
|
||||
* [alpine](https://alpinelinux.org)
|
||||
|
||||
# TIPS 📌
|
||||
* Use a reverse proxy like Traefik, Nginx, HAproxy to terminate TLS with a valid certificate
|
||||
* Use Let’s 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 Let’s Encrypt DNS-01 challenge to obtain valid SSL certificates for your services
|
||||
|
||||
|
||||
# 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-gui/releases) for breaking changes. If you have any problems with using this image simply raise an [issue](https://github.com/11notes/docker-kms-gui/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-gui/releases) for breaking changes. If you have any problems with using this image simply raise an [issue](https://github.com/11notes/docker-kms-gui/issues), thanks. If you have a question or inputs please create a new [discussion](https://github.com/11notes/docker-kms-gui/discussions) instead of an issue. You can find all my other repositories on [github](https://github.com/11notes?tab=repositories).
|
||||
@@ -1,2 +1,3 @@
|
||||
### 🪄 Features
|
||||
* switch to new github workflow and build process
|
||||
* new KMS_GUI_STYLE variable to switch the style of the UI
|
||||
* added custom GUI of @CustomIcon as default (thanks!)
|
||||
@@ -1,31 +1,16 @@
|
||||
# :: Util
|
||||
FROM alpine AS util
|
||||
ARG APP_VERSION=stable
|
||||
ARG APP_VERSION_PREFIX=""
|
||||
ARG APP_VERSION_SUFFIX=""
|
||||
|
||||
# :: Build / templates
|
||||
FROM alpine/git AS templates
|
||||
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
|
||||
ARG APP_VERSION
|
||||
|
||||
USER root
|
||||
|
||||
RUN set -ex; \
|
||||
apk --update --no-cache add \
|
||||
git; \
|
||||
mkdir -p /opt/py-kms-gui; \
|
||||
git clone https://github.com/Py-KMS-Organization/py-kms.git; \
|
||||
cd /py-kms/py-kms; \
|
||||
git checkout ${APP_VERSION}; \
|
||||
cp -R /py-kms/py-kms/* /opt/py-kms-gui; \
|
||||
cp -R /py-kms/docker/docker-py3-kms/requirements.txt /opt/py-kms-gui;
|
||||
git clone https://github.com/CustomIcon/pykms-frontend.git; \
|
||||
cd /git/pykms-frontend; \
|
||||
git reset --hard 9e789a5;
|
||||
|
||||
# :: Header
|
||||
FROM 11notes/alpine:stable
|
||||
FROM 11notes/kms:${APP_VERSION_PREFIX}${APP_VERSION}${APP_VERSION_SUFFIX}
|
||||
|
||||
# :: arguments
|
||||
ARG TARGETARCH
|
||||
@@ -33,6 +18,8 @@
|
||||
ARG APP_NAME
|
||||
ARG APP_VERSION
|
||||
ARG APP_ROOT
|
||||
ARG APP_UID
|
||||
ARG APP_GID
|
||||
|
||||
# :: environment
|
||||
ENV APP_IMAGE=${APP_IMAGE}
|
||||
@@ -40,41 +27,55 @@
|
||||
ENV APP_VERSION=${APP_VERSION}
|
||||
ENV APP_ROOT=${APP_ROOT}
|
||||
|
||||
ENV KMS_GUI_STYLE="custom-icon"
|
||||
|
||||
ENV PYKMS_SQLITE_DB_PATH=/kms/var/kms.db
|
||||
ENV PYKMS_LICENSE_PATH=/opt/py-kms/LICENSE
|
||||
ENV PYKMS_VERSION_PATH=/opt/py-kms/VERSION
|
||||
ENV PORT=8080
|
||||
ENV LOG_LEVEL=INFO
|
||||
|
||||
# :: multi-stage
|
||||
COPY --from=util /docker-util/src/ /usr/local/bin
|
||||
COPY --from=build /opt/py-kms-gui/ /opt/py-kms-gui
|
||||
COPY ./LICENSE /opt/py-kms
|
||||
|
||||
# :: Run
|
||||
USER root
|
||||
RUN eleven printenv;
|
||||
|
||||
# :: install application
|
||||
RUN set -ex; \
|
||||
apk --no-cache --update add \
|
||||
python3=3.12.8-r1; \
|
||||
apk --no-cache --update --virtual .build add \
|
||||
py3-pip;
|
||||
|
||||
RUN set -ex; \
|
||||
mkdir -p ${APP_ROOT}/var; \
|
||||
cd /opt/py-kms-gui; \
|
||||
pip3 install --no-cache-dir -r /opt/py-kms-gui/requirements.txt --break-system-packages; \
|
||||
cd /opt/py-kms; \
|
||||
echo "${APP_VERSION}" > VERSION; \
|
||||
echo "master" >> VERSION; \
|
||||
pip3 install --no-cache-dir -r /opt/py-kms/requirements.gui.txt --break-system-packages; \
|
||||
apk del --no-network .build;
|
||||
|
||||
# :: copy filesystem changes and set correct permissions
|
||||
COPY ./rootfs /
|
||||
# :: copy filesystem changes
|
||||
COPY ./rootfs /
|
||||
|
||||
# :: add multi template option
|
||||
RUN set -ex; \
|
||||
mkdir -p ${APP_ROOT}/.default/templates/py-kms; \
|
||||
mkdir -p ${APP_ROOT}/.default/templates/custom-icon; \
|
||||
cp -R /opt/py-kms/templates/* ${APP_ROOT}/.default/templates/py-kms; \
|
||||
rm -rf /opt/py-kms/templates;
|
||||
|
||||
COPY --from=templates /git/pykms-frontend/templates/ ${APP_ROOT}/.default/templates/custom-icon
|
||||
|
||||
# :: set correct permissions
|
||||
RUN set -ex; \
|
||||
chmod +x -R /usr/local/bin; \
|
||||
chown -R 1000:1000 \
|
||||
${APP_ROOT};
|
||||
|
||||
# :: Volumes
|
||||
VOLUME ["${APP_ROOT}/var"]
|
||||
chown -R ${APP_UID}:${APP_GID} \
|
||||
${APP_ROOT} \
|
||||
/opt/py-kms;
|
||||
|
||||
# :: Monitor
|
||||
HEALTHCHECK --interval=5s --timeout=2s CMD curl -X GET -kILs --fail http://localhost:${PORT} || exit 1
|
||||
HEALTHCHECK --interval=5s --timeout=2s CMD curl -X GET -kILs --fail http://localhost:${PORT}/livez || exit 1
|
||||
|
||||
# :: Start
|
||||
USER docker
|
||||
@@ -1,7 +1,7 @@
|
||||
name: "kms"
|
||||
services:
|
||||
kms:
|
||||
image: "11notes/kms:latest"
|
||||
image: "11notes/kms:stable"
|
||||
container_name: "kms"
|
||||
environment:
|
||||
TZ: Europe/Zurich
|
||||
@@ -11,7 +11,7 @@ services:
|
||||
- "1688:1688/tcp"
|
||||
restart: always
|
||||
kms-gui:
|
||||
image: "11notes/kms-gui:646f476"
|
||||
image: "11notes/kms-gui:465f4d1"
|
||||
container_name: "kms-gui"
|
||||
environment:
|
||||
TZ: Europe/Zurich
|
||||
|
||||
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
91
rootfs/opt/py-kms/templates/clients.html
Normal file
91
rootfs/opt/py-kms/templates/clients.html
Normal file
@@ -0,0 +1,91 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %}clients{% endblock %}
|
||||
|
||||
{% block style %}
|
||||
th {
|
||||
white-space: nowrap;
|
||||
}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if error %}
|
||||
<article class="message is-danger">
|
||||
<div class="message-header">
|
||||
Whoops! Something went wrong...
|
||||
</div>
|
||||
<div class="message-body">
|
||||
{{ error }}
|
||||
</div>
|
||||
</article>
|
||||
{% else %}
|
||||
<nav class="level">
|
||||
<div class="level-item has-text-centered">
|
||||
<div>
|
||||
<p class="heading">Clients</p>
|
||||
<p class="title">{{ count_clients }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="level-item has-text-centered">
|
||||
<div>
|
||||
<p class="heading">Windows</p>
|
||||
<p class="title">{{ count_clients_windows }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="level-item has-text-centered">
|
||||
<div>
|
||||
<p class="heading">Office</p>
|
||||
<p class="title">{{ count_clients_office }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="level-item has-text-centered">
|
||||
<div>
|
||||
<p class="heading">Products</p>
|
||||
<p class="title"><a href="/products">{{ count_projects }}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<hr>
|
||||
|
||||
{% if clients %}
|
||||
<table class="table is-striped is-hoverable is-fullwidth">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Client ID</th>
|
||||
<th>Machine Name</th>
|
||||
<th>Application ID</th>
|
||||
<th><abbr title="Stock Keeping Unit">SKU</abbr> ID</th>
|
||||
<th>License Status</th>
|
||||
<th>Last Seen</th>
|
||||
<th>KMS <abbr title="Enhanced Privacy ID">EPID</abbr></th>
|
||||
<th>Seen Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for client in clients %}
|
||||
<tr>
|
||||
<th><pre class="clientMachineId">{{ client.clientMachineId }}</pre></th>
|
||||
<td class="machineName">{{ client.machineName }}</td>
|
||||
<td>{{ client.applicationId }}</td>
|
||||
<td>{{ client.skuId }}</td>
|
||||
<td>{{ client.licenseStatus }}</td>
|
||||
<td class="convert_timestamp">{{ client.lastRequestTime }}</td>
|
||||
<td>{{ client.kmsEpid }}</td>
|
||||
<td>{{ client.requestCount }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<article class="message is-warning">
|
||||
<div class="message-header">
|
||||
<p>Whoops?</p>
|
||||
</div>
|
||||
<div class="message-body">
|
||||
This page seems to be empty, because no clients are available. Try to use the server with a compartible client to add it to the database.
|
||||
</div>
|
||||
</article>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -1,10 +1,30 @@
|
||||
#!/bin/ash
|
||||
if [ -z "${1}" ]; then
|
||||
cd /opt/py-kms-gui
|
||||
ls -lah
|
||||
|
||||
if [ ! -z "${DEBUG}" ]; then
|
||||
LOG_LEVEL="DEBUG"
|
||||
eleven log debug "setting kms-gui log level to DEBUG"
|
||||
fi
|
||||
|
||||
# apply correct style
|
||||
rm -rf /opt/py-kms/templates
|
||||
TEMPLATE_DIR=${APP_ROOT}/.default/templates
|
||||
case ${KMS_GUI_STYLE} in
|
||||
py-kms)
|
||||
ln -s ${TEMPLATE_DIR}/py-kms /opt/py-kms/templates
|
||||
eleven log info "using ${KMS_GUI_STYLE} GUI style"
|
||||
;;
|
||||
*)
|
||||
ln -s ${TEMPLATE_DIR}/custom-icon /opt/py-kms/templates
|
||||
eleven log info "using default GUI style"
|
||||
;;
|
||||
esac
|
||||
|
||||
cd /opt/py-kms
|
||||
set -- "gunicorn" \
|
||||
--log-level INFO \
|
||||
--log-level ${LOG_LEVEL} \
|
||||
pykms_WebUI:app
|
||||
|
||||
eleven log start
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user