8 Commits

Author SHA1 Message Date
ElevenNotes
b6f69b4860 remove truncation from clients.html 2025-02-07 10:26:29 +01:00
ElevenNotes
ed3ea34868 add img 2025-02-07 09:24:53 +01:00
ElevenNotes
11cf777dbd new base layer 11notes/kms:${APP_VERSION} 2025-02-07 09:17:38 +01:00
ElevenNotes
70680a384b new base layer 11notes/kms:${APP_VERSION} 2025-02-07 09:17:05 +01:00
ElevenNotes
4b3005630d add custom KMS Database xml 2025-02-07 08:33:11 +01:00
ElevenNotes
6bd0fcdd8a add LICENSE 2025-02-07 08:21:02 +01:00
ElevenNotes
14fd52cc83 add LICENSE 2025-02-07 08:12:02 +01:00
ElevenNotes
58e32a5d1a drop ls 2025-02-06 18:27:54 +01:00
10 changed files with 131 additions and 43 deletions

View File

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

View File

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

2
.json
View File

@@ -6,5 +6,5 @@
"root":"/kms",
"stable":"646f476",
"parent":"11notes/alpine:stable"
"parent":"11notes/kms:646f476"
}

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,7 @@
**Activate any version of Windows and Office, forever**
![slmgr](https://github.com/11notes/docker-kms-gui/blob/main/GUI.png?raw=true)
![GUI](https://github.com/11notes/docker-kms-gui/blob/master/img/GUI.png "Web Interface")
# 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.
@@ -48,7 +48,7 @@ volumes:
* [11notes/kms-gui](https://github.com/11notes/docker-kms-gui)
# PARENT IMAGE 🏛️
* [11notes/alpine:stable](https://hub.docker.com/r/11notes/alpine)
* [11notes/kms:646f476](https://hub.docker.com/r/11notes/kms)
# BUILT WITH 🧰
* [py-kms](https://github.com/Py-KMS-Organization/py-kms)

View File

@@ -1,2 +1,2 @@
### 🪄 Features
* switch to new github workflow and build process
* remove truncation from clients.html

View File

@@ -1,31 +1,7 @@
# :: Util
FROM alpine AS util
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;
ARG APP_VERSION=stable
# :: Header
FROM 11notes/alpine:stable
FROM 11notes/kms:${APP_VERSION}
# :: arguments
ARG TARGETARCH
@@ -41,26 +17,27 @@
ENV APP_ROOT=${APP_ROOT}
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
# :: 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
# :: 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
@@ -70,11 +47,8 @@
chown -R 1000:1000 \
${APP_ROOT};
# :: Volumes
VOLUME ["${APP_ROOT}/var"]
# :: 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

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View 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 %}

View File

@@ -1,10 +1,10 @@
#!/bin/ash
if [ -z "${1}" ]; then
cd /opt/py-kms-gui
ls -lah
cd /opt/py-kms
set -- "gunicorn" \
--log-level INFO \
pykms_WebUI:app
eleven log start
fi