From 0440053fa92e50eaad78c6db198b4a511db6ca9e Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 16 Feb 2018 02:02:48 +0100 Subject: [PATCH] Add `JLS_REPORT_OUT_OF_LICENSE` env var No need of Supervisor --- CHANGELOG.md | 6 +++--- Dockerfile | 6 ++---- README.md | 1 + entrypoint.sh | 7 ++++++- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59d043b..ae9a5e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,10 @@ # Changelog -## 15802-RC2 (2018/02/15) +## 15802-RC2 (2018/02/16) -* Add `JLS_CONTEXT` env var +* Add `JLS_CONTEXT` and `JLS_REPORT_OUT_OF_LICENSE` env vars * Timezone was not setted -* No need of Nginx +* No need of Nginx and Supervisor * Error while saving stats ## 15802-RC1 (2018/02/01) diff --git a/Dockerfile b/Dockerfile index c2aa4c7..ee72646 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,8 +15,7 @@ LABEL org.label-schema.build-date=$BUILD_DATE \ org.label-schema.vendor="CrazyMax" \ org.label-schema.schema-version="1.0" -RUN apk --update --no-cache add \ - curl supervisor tzdata zip \ +RUN apk --update --no-cache add curl tzdata zip \ && rm -rf /var/cache/apk/* /tmp/* ENV JLS_PATH="/opt/jetbrains-license-server" \ @@ -24,7 +23,6 @@ ENV JLS_PATH="/opt/jetbrains-license-server" \ JLS_SHA256="e0030be1fd06e2db19576363a388d8b84e7b33c9d48c54f0cfcdc032ddd96181" ADD entrypoint.sh /entrypoint.sh -ADD assets / RUN mkdir -p "$JLS_PATH" \ && curl -L "https://download.jetbrains.com/lcsrv/license-server-installer.zip" -o "/tmp/lsi.zip" \ @@ -39,4 +37,4 @@ EXPOSE 80 VOLUME [ "/data" ] ENTRYPOINT [ "/entrypoint.sh" ] -CMD [ "/usr/bin/supervisord", "-c", "/etc/supervisord.conf" ] +CMD [ "/usr/local/bin/license-server", "run" ] diff --git a/README.md b/README.md index 836f000..b0c5853 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other * `JLS_CONTEXT` : [Context path](https://www.jetbrains.com/help/license_server/setting_host_and_port.html#d1010e63) used by the license server (default to : `/`) * `JLS_ACCESS_CONFIG` : JSON file to configure [user restrictions](https://www.jetbrains.com/help/license_server/configuring_user_restrictions.html) (default to `/data/access-config.json`) * `JLS_STATS_RECIPIENTS` : [Reports recipients](https://www.jetbrains.com/help/license_server/detailed_server_usage_statistics.html#d461e40) email addresses for stats (comma delimited) +* `JLS_REPORT_OUT_OF_LICENSE` : [Warn about lack of licenses](https://www.jetbrains.com/help/license_server/detailed_server_usage_statistics.html#d461e40) every hour following the percentage threshold (default to : `0` = disabled) * `JLS_SMTP_SERVER` : SMTP server host to use for sending [stats](https://www.jetbrains.com/help/license_server/detailed_server_usage_statistics.html) (stats disabled if empty) * `JLS_SMTP_PORT` : SMTP server port (default to `25`) * `JLS_SMTP_USERNAME` : SMTP username (auth disabled if empty) diff --git a/entrypoint.sh b/entrypoint.sh index c5df7aa..2c5aeb3 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -14,7 +14,7 @@ echo ${TZ} > /etc/timezone # Init echo "Initializing files and folders..." -mkdir -p /data/registration /var/log/supervisord +mkdir -p /data/registration ln -sf "/data/registration" "/root/.jb-license-server" touch "/data/access-config.json" @@ -54,6 +54,11 @@ if [ ! -z "$JLS_SMTP_SERVER" -a ! -z "$JLS_STATS_RECIPIENTS" ] ; then license-server configure --stats.from ${JLS_STATS_FROM} fi + if [ "$JLS_REPORT_OUT_OF_LICENSE" -gt 0 ]; then + echo "Setting report out of licence to $JLS_REPORT_OUT_OF_LICENSE%..." + license-server configure --reporting.out.of.license.threshold ${JLS_REPORT_OUT_OF_LICENSE} + fi + echo "Stats recipients: $JLS_STATS_RECIPIENTS..." license-server configure --stats.recipients ${JLS_STATS_RECIPIENTS} fi