add KMS_GUI_STYLE

This commit is contained in:
ElevenNotes
2025-02-17 10:57:55 +01:00
parent 2bbc9e2653
commit 7754585854
4 changed files with 40 additions and 3 deletions

View File

@@ -54,6 +54,7 @@ volumes:
| --- | --- | --- | | --- | --- | --- |
| `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` | Will activate debug option for container image and app (if available) | | | `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 💾 # SOURCE 💾
* [11notes/kms-gui](https://github.com/11notes/docker-kms-gui) * [11notes/kms-gui](https://github.com/11notes/docker-kms-gui)
@@ -63,6 +64,7 @@ volumes:
# BUILT WITH 🧰 # BUILT WITH 🧰
* [py-kms](https://github.com/Py-KMS-Organization/py-kms) * [py-kms](https://github.com/Py-KMS-Organization/py-kms)
* [CustomIcon/pykms-frontend](https://github.com/CustomIcon/pykms-frontend)
* [alpine](https://alpinelinux.org) * [alpine](https://alpinelinux.org)
# GENERAL TIPS 📌 # GENERAL TIPS 📌

View File

@@ -1,2 +1,3 @@
### 🪄 Features ### 🪄 Features
* new .json format * new KMS_GUI_STYLE variable to switch the style of the UI
* added custom GUI of @CustomIcon as default (thanks!)

View File

@@ -2,6 +2,13 @@ ARG APP_VERSION=stable
ARG APP_VERSION_PREFIX="" ARG APP_VERSION_PREFIX=""
ARG APP_VERSION_SUFFIX="" ARG APP_VERSION_SUFFIX=""
# :: Build / templates
FROM alpine/git AS templates
RUN set -ex; \
git clone https://github.com/CustomIcon/pykms-frontend.git; \
cd /git/pykms-frontend; \
git reset --hard 9e789a5;
# :: Header # :: Header
FROM 11notes/kms:${APP_VERSION_PREFIX}${APP_VERSION}${APP_VERSION_SUFFIX} FROM 11notes/kms:${APP_VERSION_PREFIX}${APP_VERSION}${APP_VERSION_SUFFIX}
@@ -20,6 +27,8 @@ ARG APP_VERSION_SUFFIX=""
ENV APP_VERSION=${APP_VERSION} ENV APP_VERSION=${APP_VERSION}
ENV APP_ROOT=${APP_ROOT} ENV APP_ROOT=${APP_ROOT}
ENV KMS_GUI_STYLE="custom-icon"
ENV PYKMS_SQLITE_DB_PATH=/kms/var/kms.db ENV PYKMS_SQLITE_DB_PATH=/kms/var/kms.db
ENV PYKMS_LICENSE_PATH=/opt/py-kms/LICENSE ENV PYKMS_LICENSE_PATH=/opt/py-kms/LICENSE
ENV PYKMS_VERSION_PATH=/opt/py-kms/VERSION ENV PYKMS_VERSION_PATH=/opt/py-kms/VERSION
@@ -46,8 +55,19 @@ ARG APP_VERSION_SUFFIX=""
pip3 install --no-cache-dir -r /opt/py-kms/requirements.gui.txt --break-system-packages; \ pip3 install --no-cache-dir -r /opt/py-kms/requirements.gui.txt --break-system-packages; \
apk del --no-network .build; apk del --no-network .build;
# :: copy filesystem changes and set correct permissions # :: copy filesystem changes
COPY ./rootfs / 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; \ RUN set -ex; \
chmod +x -R /usr/local/bin; \ chmod +x -R /usr/local/bin; \
chown -R ${APP_UID}:${APP_GID} \ chown -R ${APP_UID}:${APP_GID} \

View File

@@ -6,6 +6,20 @@
eleven log debug "setting kms-gui log level to DEBUG" eleven log debug "setting kms-gui log level to DEBUG"
fi 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 cd /opt/py-kms
set -- "gunicorn" \ set -- "gunicorn" \
--log-level ${LOG_LEVEL} \ --log-level ${LOG_LEVEL} \