Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1244ac4ad0 | ||
|
|
64300ede74 | ||
|
|
517b60f925 | ||
|
|
0440053fa9 | ||
|
|
a19877c376 | ||
|
|
442bad00a3 | ||
|
|
45a1cc0557 |
5
.dockerignore
Normal file
5
.dockerignore
Normal file
@@ -0,0 +1,5 @@
|
||||
/.dev
|
||||
|
||||
# Jetbrains
|
||||
/.idea
|
||||
/*.iml
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,6 +1,5 @@
|
||||
/.dev
|
||||
|
||||
# Jetbrains
|
||||
/.idea
|
||||
/*.iml
|
||||
|
||||
# App
|
||||
/.dev
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
## 15802-RC2 (2018/02/16)
|
||||
|
||||
* Add `JLS_CONTEXT` and `JLS_REPORT_OUT_OF_LICENSE` env vars
|
||||
* Timezone was not setted
|
||||
* No need of Nginx and Supervisor
|
||||
* Error while saving stats
|
||||
* Remove build dependencies
|
||||
|
||||
## 15802-RC1 (2018/02/01)
|
||||
|
||||
* Initial version based on JetBrains License Server 15802
|
||||
|
||||
24
Dockerfile
24
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 \
|
||||
ca-certificates curl libressl nginx supervisor tzdata zip \
|
||||
RUN apk --update --no-cache add tzdata \
|
||||
&& rm -rf /var/cache/apk/* /tmp/*
|
||||
|
||||
ENV JLS_PATH="/opt/jetbrains-license-server" \
|
||||
@@ -24,21 +23,22 @@ ENV JLS_PATH="/opt/jetbrains-license-server" \
|
||||
JLS_SHA256="e0030be1fd06e2db19576363a388d8b84e7b33c9d48c54f0cfcdc032ddd96181"
|
||||
|
||||
ADD entrypoint.sh /entrypoint.sh
|
||||
ADD assets /
|
||||
|
||||
RUN mkdir -p "$JLS_PATH" "/data/registration" "/run/nginx" \
|
||||
&& curl -L "https://download.jetbrains.com/lcsrv/license-server-installer.zip" -o "/tmp/lsi.zip" \
|
||||
&& echo "$JLS_SHA256 /tmp/lsi.zip" | sha256sum -c - | grep OK \
|
||||
&& unzip "/tmp/lsi.zip" -d "$JLS_PATH" \
|
||||
&& rm -f "/tmp/lsi.zip" \
|
||||
RUN apk --update --no-cache add -t build-dependencies \
|
||||
curl zip \
|
||||
&& mkdir -p "$JLS_PATH" \
|
||||
&& curl -L "https://download.jetbrains.com/lcsrv/license-server-installer.zip" -o "/tmp/jls.zip" \
|
||||
&& echo "$JLS_SHA256 /tmp/jls.zip" | sha256sum -c - | grep OK \
|
||||
&& unzip "/tmp/jls.zip" -d "$JLS_PATH" \
|
||||
&& rm -f "/tmp/jls.zip" \
|
||||
&& chmod a+x "$JLS_PATH/bin/license-server.sh" \
|
||||
&& ln -sf "$JLS_PATH/bin/license-server.sh" "/usr/local/bin/license-server" \
|
||||
&& ln -sf "/data/registration" "/root/.jb-license-server" \
|
||||
&& touch "/data/access-config.json" \
|
||||
&& chmod a+x /entrypoint.sh
|
||||
&& chmod a+x /entrypoint.sh \
|
||||
&& apk del build-dependencies \
|
||||
&& rm -rf /var/cache/apk/* /tmp/*
|
||||
|
||||
EXPOSE 80
|
||||
VOLUME [ "/data" ]
|
||||
|
||||
ENTRYPOINT [ "/entrypoint.sh" ]
|
||||
CMD [ "/usr/bin/supervisord", "-c", "/etc/supervisord.conf" ]
|
||||
CMD [ "/usr/local/bin/license-server", "run" ]
|
||||
|
||||
@@ -19,7 +19,6 @@ If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other
|
||||
|
||||
### Included
|
||||
|
||||
* Nginx reverse proxy
|
||||
* License server completely customizable via environment variables
|
||||
* Registration data and configuration in a single directory
|
||||
|
||||
@@ -33,9 +32,11 @@ If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other
|
||||
### Environment variables
|
||||
|
||||
* `TZ` : The timezone assigned to the container (default to `UTC`)
|
||||
* `JLS_VIRTUAL_HOSTS` : [Virtual hosts](https://www.jetbrains.com/help/license_server/setting_host_and_port.html#d1010e63) where license server will be available (required ; comma delimited for several hosts)
|
||||
* `JLS_VIRTUAL_HOSTS` : [Virtual hosts](https://www.jetbrains.com/help/license_server/setting_host_and_port.html#d1010e63) where license server will be available (comma delimited for several hosts)
|
||||
* `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)
|
||||
@@ -49,7 +50,7 @@ If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other
|
||||
|
||||
### Ports
|
||||
|
||||
* `80` : HTTP port
|
||||
* `80` : Jetbrains License Server HTTP port
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -91,7 +92,7 @@ If you've got the following message :
|
||||
Passed value of header "Host" is not allowed. Please contact your license server administrator.
|
||||
```
|
||||
|
||||
That's because the license server is running behind the Nginx reverse proxy. Please configure virtual hosts using the `JLS_VIRTUAL_HOSTS` variable.
|
||||
That's because the license server is running behind a reverse proxy. Please configure virtual hosts using the `JLS_VIRTUAL_HOSTS` variable.
|
||||
|
||||
## How can i help ?
|
||||
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
daemon off;
|
||||
user nginx;
|
||||
error_log stderr error;
|
||||
|
||||
events {
|
||||
worker_connections 2048;
|
||||
use epoll;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
aio threads;
|
||||
sendfile on;
|
||||
keepalive_timeout 15;
|
||||
keepalive_disable msie6;
|
||||
keepalive_requests 100;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
server_tokens off;
|
||||
gzip off;
|
||||
|
||||
# https://www.jetbrains.com/help/license_server/configuring_secure_connection.html
|
||||
server {
|
||||
listen 80;
|
||||
location / {
|
||||
proxy_set_header X-Forwarded-Host $http_host;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_pass http://127.0.0.1:8080/;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
pidfile=/var/run/supervisord.pid
|
||||
|
||||
[supervisorctl]
|
||||
serverurl=unix:///var/run/supervisor.sock
|
||||
|
||||
[unix_http_server]
|
||||
file=/var/run/supervisor.sock
|
||||
|
||||
[rpcinterface:supervisor]
|
||||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||
|
||||
[program:license-server]
|
||||
priority=1
|
||||
command=/usr/local/bin/license-server run
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
redirect_stderr=true
|
||||
|
||||
[program:nginx]
|
||||
command=/usr/sbin/nginx
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
redirect_stderr=true
|
||||
@@ -39,8 +39,10 @@ services:
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
- JLS_VIRTUAL_HOSTS=jetbrains-license-server.example.com,an-other-host.example.com
|
||||
- JLS_CONTEXT=/
|
||||
- JLS_ACCESS_CONFIG=/data/access-config.json
|
||||
- JLS_STATS_RECIPIENTS=webmaster@example.com,an-other-address@example.com
|
||||
- JLS_REPORT_OUT_OF_LICENSE=90
|
||||
- JLS_SMTP_SERVER=smtp.example.com
|
||||
- JLS_SMTP_PORT=25
|
||||
- JLS_SMTP_USERNAME=smtp@example.com
|
||||
|
||||
@@ -1,13 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
TZ=${TZ:-"UTC"}
|
||||
JLS_PATH="/opt/jetbrains-license-server"
|
||||
JLS_LISTEN_ADDRESS="127.0.0.1"
|
||||
JLS_PORT=8080
|
||||
JLS_LISTEN_ADDRESS="0.0.0.0"
|
||||
JLS_PORT=80
|
||||
JLS_CONTEXT=${JLS_CONTEXT:-"/"}
|
||||
JLS_ACCESS_CONFIG=${JLS_ACCESS_CONFIG:-"/data/access-config.json"}
|
||||
|
||||
# Timezone
|
||||
echo "Setting timezone to ${TZ}..."
|
||||
ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime
|
||||
echo ${TZ} > /etc/timezone
|
||||
|
||||
# Init
|
||||
echo "Initializing files and folders..."
|
||||
mkdir -p /data/registration
|
||||
ln -sf "/data/registration" "/root/.jb-license-server"
|
||||
touch "/data/access-config.json"
|
||||
|
||||
# https://www.jetbrains.com/help/license_server/setting_host_and_port.html
|
||||
echo "Configuring Jetbrains License Server..."
|
||||
license-server configure --listen ${JLS_LISTEN_ADDRESS} --port ${JLS_PORT}
|
||||
license-server configure --listen ${JLS_LISTEN_ADDRESS} --port ${JLS_PORT} --context ${JLS_CONTEXT}
|
||||
|
||||
# https://www.jetbrains.com/help/license_server/setting_host_and_port.html
|
||||
if [ ! -z "$JLS_VIRTUAL_HOSTS" ] ; then
|
||||
@@ -41,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
|
||||
|
||||
Reference in New Issue
Block a user