Skip to content

Commit 7754585

Browse files
committed
add KMS_GUI_STYLE
1 parent 2bbc9e2 commit 7754585

File tree

4 files changed

+40
-3
lines changed

4 files changed

+40
-3
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ volumes:
5454
| --- | --- | --- |
5555
| `TZ` | [Time Zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) | |
5656
| `DEBUG` | Will activate debug option for container image and app (if available) | |
57+
| `KMS_GUI_STYLE` | switch the UI style of the webinterface (py-kms, custom-icon) | custom-icon |
5758

5859
# SOURCE 💾
5960
* [11notes/kms-gui](https://github.com/11notes/docker-kms-gui)
@@ -63,6 +64,7 @@ volumes:
6364

6465
# BUILT WITH 🧰
6566
* [py-kms](https://github.com/Py-KMS-Organization/py-kms)
67+
* [CustomIcon/pykms-frontend](https://github.com/CustomIcon/pykms-frontend)
6668
* [alpine](https://alpinelinux.org)
6769

6870
# GENERAL TIPS 📌

RELEASE.md

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

arch.dockerfile

+22-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ ARG APP_VERSION=stable
22
ARG APP_VERSION_PREFIX=""
33
ARG APP_VERSION_SUFFIX=""
44

5+
# :: Build / templates
6+
FROM alpine/git AS templates
7+
RUN set -ex; \
8+
git clone https://github.com/CustomIcon/pykms-frontend.git; \
9+
cd /git/pykms-frontend; \
10+
git reset --hard 9e789a5;
11+
512
# :: Header
613
FROM 11notes/kms:${APP_VERSION_PREFIX}${APP_VERSION}${APP_VERSION_SUFFIX}
714

@@ -20,6 +27,8 @@ ARG APP_VERSION_SUFFIX=""
2027
ENV APP_VERSION=${APP_VERSION}
2128
ENV APP_ROOT=${APP_ROOT}
2229

30+
ENV KMS_GUI_STYLE="custom-icon"
31+
2332
ENV PYKMS_SQLITE_DB_PATH=/kms/var/kms.db
2433
ENV PYKMS_LICENSE_PATH=/opt/py-kms/LICENSE
2534
ENV PYKMS_VERSION_PATH=/opt/py-kms/VERSION
@@ -46,8 +55,19 @@ ARG APP_VERSION_SUFFIX=""
4655
pip3 install --no-cache-dir -r /opt/py-kms/requirements.gui.txt --break-system-packages; \
4756
apk del --no-network .build;
4857

49-
# :: copy filesystem changes and set correct permissions
50-
COPY ./rootfs /
58+
# :: copy filesystem changes
59+
COPY ./rootfs /
60+
61+
# :: add multi template option
62+
RUN set -ex; \
63+
mkdir -p ${APP_ROOT}/.default/templates/py-kms; \
64+
mkdir -p ${APP_ROOT}/.default/templates/custom-icon; \
65+
cp -R /opt/py-kms/templates/* ${APP_ROOT}/.default/templates/py-kms; \
66+
rm -rf /opt/py-kms/templates;
67+
68+
COPY --from=templates /git/pykms-frontend/templates/ ${APP_ROOT}/.default/templates/custom-icon
69+
70+
# :: set correct permissions
5171
RUN set -ex; \
5272
chmod +x -R /usr/local/bin; \
5373
chown -R ${APP_UID}:${APP_GID} \

rootfs/usr/local/bin/entrypoint.sh

+14
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66
eleven log debug "setting kms-gui log level to DEBUG"
77
fi
88

9+
# apply correct style
10+
rm -rf /opt/py-kms/templates
11+
TEMPLATE_DIR=${APP_ROOT}/.default/templates
12+
case ${KMS_GUI_STYLE} in
13+
py-kms)
14+
ln -s ${TEMPLATE_DIR}/py-kms /opt/py-kms/templates
15+
eleven log info "using ${KMS_GUI_STYLE} GUI style"
16+
;;
17+
*)
18+
ln -s ${TEMPLATE_DIR}/custom-icon /opt/py-kms/templates
19+
eleven log info "using default GUI style"
20+
;;
21+
esac
22+
923
cd /opt/py-kms
1024
set -- "gunicorn" \
1125
--log-level ${LOG_LEVEL} \

0 commit comments

Comments
 (0)