6 Commits

Author SHA1 Message Date
ElevenNotes
58f22ed34c add DEBUG option 2025-02-07 10:49:24 +01:00
ElevenNotes
63d616adfd chown /opt/py-kms 2025-02-07 10:28:35 +01:00
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
9 changed files with 115 additions and 1088 deletions

View File

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

2
.json
View File

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

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
* add DEBUG option via enivornment variable DEBUG

View File

@@ -1,31 +1,7 @@
# :: Util
FROM alpine/git AS util
ARG NO_CACHE
RUN set -ex; \
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,31 +17,28 @@
ENV APP_ROOT=${APP_ROOT}
ENV PYKMS_SQLITE_DB_PATH=/kms/var/kms.db
ENV PYKMS_LICENSE_PATH=/opt/py-kms-gui/LICENSE
ENV PYKMS_VERSION_PATH=/opt/py-kms-gui/VERSION
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 /git/docker-util/src/ /usr/local/bin
COPY --from=build /opt/py-kms-gui/ /opt/py-kms-gui
COPY ./LICENSE /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; \
cd /opt/py-kms; \
echo "${APP_VERSION}" > VERSION; \
echo "master" >> VERSION; \
pip3 install --no-cache-dir -r /opt/py-kms-gui/requirements.txt --break-system-packages; \
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
@@ -73,10 +46,8 @@
RUN set -ex; \
chmod +x -R /usr/local/bin; \
chown -R 1000:1000 \
${APP_ROOT};
# :: Volumes
VOLUME ["${APP_ROOT}/var"]
${APP_ROOT} \
/opt/py-kms;
# :: Monitor
HEALTHCHECK --interval=5s --timeout=2s CMD curl -X GET -kILs --fail http://localhost:${PORT}/livez || exit 1

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

File diff suppressed because it is too large Load Diff

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,16 @@
#!/bin/ash
if [ -z "${1}" ]; then
cd /opt/py-kms-gui
if [ ! -z "${DEBUG}" ]; then
LOG_LEVEL="DEBUG"
eleven log debug "setting kms-gui log level to DEBUG"
fi
cd /opt/py-kms
set -- "gunicorn" \
--log-level INFO \
--log-level ${LOG_LEVEL} \
pykms_WebUI:app
eleven log start
fi