10 Commits

Author SHA1 Message Date
CrazyMax
fd6895097c Dedicated example for Traefik 2019-11-17 07:25:30 +01:00
CrazyMax
171e0c32f1 Allow to set custom PUID/PGID 2019-11-17 07:15:23 +01:00
CrazyMax
fdb28342f3 Update README 2019-11-13 17:10:49 +01:00
CrazyMax
7f5f161300 Update workflows 2019-11-13 17:10:42 +01:00
CrazyMax
bfcb34f6f4 Update README 2019-10-26 20:01:34 +02:00
CrazyMax
89ffc880f9 JetBrains License Server 21137 (#19) 2019-10-24 18:45:50 +02:00
CrazyMax
f6aca1ead3 Update labels workflow 2019-10-24 18:41:57 +02:00
CrazyMax
8f4d76fb7f Final labels 2019-10-20 05:19:03 +02:00
CrazyMax
cf603f0736 Fix Docker labels 2019-10-20 05:18:58 +02:00
CrazyMax
13cec3d9a9 Add ghaction-github-labeler 2019-10-20 01:19:39 +02:00
16 changed files with 297 additions and 113 deletions

2
.github/FUNDING.yml vendored
View File

@@ -1,2 +1,2 @@
patreon: crazymax github: crazy-max
custom: https://www.paypal.me/crazyws custom: https://www.paypal.me/crazyws

69
.github/labels.yml vendored Normal file
View File

@@ -0,0 +1,69 @@
## https://github.com/crazy-max/ghaction-github-labeler
- # bot
name: ":robot: bot"
color: "69cde9"
description: ""
- # bug
name: ":bug: bug"
color: "b60205"
description: ""
- # documentation
name: ":memo: documentation"
color: "c5def5"
description: ""
- # duplicate
name: ":busts_in_silhouette: duplicate"
color: "cccccc"
description: ""
- # enhancement
name: ":sparkles: enhancement"
color: "0054ca"
description: ""
- # feature request
name: ":bulb: feature request"
color: "0e8a16"
description: ""
- # feedback
name: ":mega: feedback"
color: "03a9f4"
description: ""
- # future maybe
name: ":rocket: future maybe"
color: "fef2c0"
description: ""
- # good first issue
name: ":hatching_chick: good first issue"
color: "7057ff"
description: ""
- # help wanted
name: ":pray: help wanted"
color: "4caf50"
description: ""
- # hold
name: ":hand: hold"
color: "24292f"
description: ""
- # invalid
name: ":no_entry_sign: invalid"
color: "e6e6e6"
description: ""
- # maybe bug
name: ":interrobang: maybe bug"
color: "ff5722"
description: ""
- # needs more info
name: ":thinking: needs more info"
color: "795548"
description: ""
- # question
name: ":question: question"
color: "3f51b5"
description: ""
- # upstream
name: ":eyes: upstream"
color: "fbca04"
description: ""
- # wontfix
name: ":coffin: wontfix"
color: "ffffff"
description: ""

View File

@@ -1,11 +1,13 @@
name: build name: build
on: on:
pull_request:
branches: 'master'
push: push:
branches: 'master' branches: 'master'
tags: '*' tags: '*'
paths:
- '.github/workflows/build.yml'
- 'Dockerfile'
- 'entrypoint.sh'
jobs: jobs:
build: build:
@@ -41,9 +43,9 @@ jobs:
run: | run: |
docker buildx build --platform ${{ steps.prepare.outputs.docker_platforms }} \ docker buildx build --platform ${{ steps.prepare.outputs.docker_platforms }} \
--output "type=image,push=false" \ --output "type=image,push=false" \
--label "org.label-schema.build-date=${{ steps.prepare.outputs.build_date }}" \ --build-arg "BUILD_DATE=${{ steps.prepare.outputs.build_date }}" \
--label "org.label-schema.version=${{ steps.prepare.outputs.version }}" \ --build-arg "VCS_REF=${GITHUB_SHA::8}" \
--label "org.label-schema.vcs-ref=${GITHUB_SHA::8}" \ --build-arg "VERSION=${{ steps.prepare.outputs.version }}" \
--tag "${{ steps.prepare.outputs.docker_image }}:latest" \ --tag "${{ steps.prepare.outputs.docker_image }}:latest" \
--tag "${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}" \ --tag "${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}" \
--file Dockerfile . --file Dockerfile .
@@ -60,9 +62,9 @@ jobs:
run: | run: |
docker buildx build --platform ${{ steps.prepare.outputs.docker_platforms }} \ docker buildx build --platform ${{ steps.prepare.outputs.docker_platforms }} \
--output "type=image,push=true" \ --output "type=image,push=true" \
--label "org.label-schema.build-date=${{ steps.prepare.outputs.build_date }}" \ --build-arg "BUILD_DATE=${{ steps.prepare.outputs.build_date }}" \
--label "org.label-schema.version=${{ steps.prepare.outputs.version }}" \ --build-arg "VCS_REF=${GITHUB_SHA::8}" \
--label "org.label-schema.vcs-ref=${GITHUB_SHA::8}" \ --build-arg "VERSION=${{ steps.prepare.outputs.version }}" \
--tag "${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}" \ --tag "${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}" \
--tag "${{ steps.prepare.outputs.docker_image }}:latest" \ --tag "${{ steps.prepare.outputs.docker_image }}:latest" \
--file Dockerfile . --file Dockerfile .

25
.github/workflows/labels.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
name: labels
on:
push:
branches:
- 'master'
paths:
- '.github/labels.yml'
- '.github/workflows/labels.yml'
jobs:
labeler:
runs-on: ubuntu-latest
steps:
-
# https://github.com/actions/checkout
name: Checkout
uses: actions/checkout@v1
-
# https://github.com/crazy-max/ghaction-github-labeler
name: Run Labeler
if: success()
uses: crazy-max/ghaction-github-labeler@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -3,8 +3,16 @@ name: test
on: on:
pull_request: pull_request:
branches: master branches: master
paths:
- '.github/workflows/test.yml'
- 'Dockerfile'
- 'entrypoint.sh'
push: push:
branches: master branches: master
paths:
- '.github/workflows/test.yml'
- 'Dockerfile'
- 'entrypoint.sh'
jobs: jobs:
test: test:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 956 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 956 B

View File

@@ -1,5 +1,13 @@
# Changelog # Changelog
## 21137-RC2 (2019/11/17)
* Allow to set custom `PUID`/`PGID`
## 21137-RC1 (2019/10/24)
* JetBrains License Server 21137
## 20308-RC4 (2019/10/10) ## 20308-RC4 (2019/10/10)
* Optimize layers * Optimize layers

View File

@@ -1,22 +1,46 @@
# syntax=docker/dockerfile:experimental # syntax=docker/dockerfile:experimental
FROM --platform=${TARGETPLATFORM:-linux/amd64} adoptopenjdk:12-jre-hotspot FROM --platform=${TARGETPLATFORM:-linux/amd64} adoptopenjdk:12-jre-hotspot as suexec
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
ARG TARGETPLATFORM ARG TARGETPLATFORM
ARG BUILDPLATFORM ARG BUILDPLATFORM
RUN printf "I am running on ${BUILDPLATFORM:-linux/amd64}, building for ${TARGETPLATFORM:-linux/amd64}\n$(uname -a)\n" RUN printf "I am running on ${BUILDPLATFORM:-linux/amd64}, building for ${TARGETPLATFORM:-linux/amd64}\n$(uname -a)\n"
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gcc \
libc-dev \
&& curl -o /usr/local/bin/su-exec.c https://raw.githubusercontent.com/ncopa/su-exec/master/su-exec.c \
&& gcc -Wall /usr/local/bin/su-exec.c -o/usr/local/bin/su-exec \
&& chown root:root /usr/local/bin/su-exec \
&& chmod 0755 /usr/local/bin/su-exec
FROM --platform=${TARGETPLATFORM:-linux/amd64} adoptopenjdk:12-jre-hotspot
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
LABEL maintainer="CrazyMax" \ LABEL maintainer="CrazyMax" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="jetbrains-license-server" \ org.label-schema.name="jetbrains-license-server" \
org.label-schema.description="JetBrains License Server" \ org.label-schema.description="JetBrains License Server" \
org.label-schema.version=$VERSION \
org.label-schema.url="https://github.com/crazy-max/docker-jetbrains-license-server" \ org.label-schema.url="https://github.com/crazy-max/docker-jetbrains-license-server" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/crazy-max/docker-jetbrains-license-server" \ org.label-schema.vcs-url="https://github.com/crazy-max/docker-jetbrains-license-server" \
org.label-schema.vendor="CrazyMax" \ org.label-schema.vendor="CrazyMax" \
org.label-schema.schema-version="1.0" org.label-schema.schema-version="1.0"
ENV JLS_PATH="/opt/jetbrains-license-server" \ ENV JLS_PATH="/opt/jetbrains-license-server" \
JLS_VERSION="20308" \ JLS_VERSION="21137" \
JLS_SHA256="15cd436d41b1af8e273b8f8b037d654a9e9d9ca8a5f188e08426ca1024ba143a" \ JLS_SHA256="05241f0d41644ecc7679a879c829e57d423e151b997b45c5e986d498d6fe2f21" \
TZ="UTC" TZ="UTC" \
PUID="1000" \
PGID="1000"
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y \ && apt-get install -y \
@@ -31,17 +55,16 @@ RUN apt-get update \
&& rm -f "/tmp/jls.zip" \ && rm -f "/tmp/jls.zip" \
&& chmod a+x "$JLS_PATH/bin/license-server.sh" \ && chmod a+x "$JLS_PATH/bin/license-server.sh" \
&& ln -sf "$JLS_PATH/bin/license-server.sh" "/usr/local/bin/license-server" \ && ln -sf "$JLS_PATH/bin/license-server.sh" "/usr/local/bin/license-server" \
&& groupadd -f -g 1000 jls \ && groupadd -f -g ${PGID} jls \
&& useradd -o -s /bin/bash -d /data -u 1000 -g 1000 -m jls \ && useradd -o -s /bin/bash -d /data -u ${PUID} -g jls -m jls \
&& chown -R jls. /data "$JLS_PATH" \ && chown -R jls. /data "$JLS_PATH" \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY --from=suexec /usr/local/bin/su-exec /usr/local/bin/su-exec
COPY entrypoint.sh /entrypoint.sh COPY entrypoint.sh /entrypoint.sh
RUN chmod a+x /entrypoint.sh RUN chmod a+x /entrypoint.sh
USER jls
EXPOSE 8000 EXPOSE 8000
WORKDIR /data WORKDIR /data
VOLUME [ "/data" ] VOLUME [ "/data" ]

View File

@@ -6,7 +6,7 @@
<a href="https://hub.docker.com/r/crazymax/jetbrains-license-server/"><img src="https://img.shields.io/docker/stars/crazymax/jetbrains-license-server.svg?style=flat-square" alt="Docker Stars"></a> <a href="https://hub.docker.com/r/crazymax/jetbrains-license-server/"><img src="https://img.shields.io/docker/stars/crazymax/jetbrains-license-server.svg?style=flat-square" alt="Docker Stars"></a>
<a href="https://hub.docker.com/r/crazymax/jetbrains-license-server/"><img src="https://img.shields.io/docker/pulls/crazymax/jetbrains-license-server.svg?style=flat-square" alt="Docker Pulls"></a> <a href="https://hub.docker.com/r/crazymax/jetbrains-license-server/"><img src="https://img.shields.io/docker/pulls/crazymax/jetbrains-license-server.svg?style=flat-square" alt="Docker Pulls"></a>
<a href="https://www.codacy.com/app/crazy-max/docker-jetbrains-license-server"><img src="https://img.shields.io/codacy/grade/eb420bc3e6ed49ff97cc261602228efa.svg?style=flat-square" alt="Code Quality"></a> <a href="https://www.codacy.com/app/crazy-max/docker-jetbrains-license-server"><img src="https://img.shields.io/codacy/grade/eb420bc3e6ed49ff97cc261602228efa.svg?style=flat-square" alt="Code Quality"></a>
<br /><a href="https://www.patreon.com/crazymax"><img src="https://img.shields.io/badge/donate-patreon-f96854.svg?logo=patreon&style=flat-square" alt="Support me on Patreon"></a> <br /><a href="https://github.com/sponsors/crazy-max"><img src="https://img.shields.io/badge/sponsor-crazy--max-181717.svg?logo=github&style=flat-square" alt="Become a sponsor"></a>
<a href="https://www.paypal.me/crazyws"><img src="https://img.shields.io/badge/donate-paypal-00457c.svg?logo=paypal&style=flat-square" alt="Donate Paypal"></a> <a href="https://www.paypal.me/crazyws"><img src="https://img.shields.io/badge/donate-paypal-00457c.svg?logo=paypal&style=flat-square" alt="Donate Paypal"></a>
</p> </p>
@@ -19,9 +19,11 @@ If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other
## Features ## Features
* Run as non-root user
* Multi-platform image
* License server completely customizable via environment variables * License server completely customizable via environment variables
* Registration data and configuration in a single directory * Registration data and configuration in a single directory
* [Traefik](https://github.com/containous/traefik-library-image) as reverse proxy and creation/renewal of Let's Encrypt certificates * [Traefik](https://github.com/containous/traefik-library-image) as reverse proxy and creation/renewal of Let's Encrypt certificates (see [this template](examples/traefik))
## Docker ## Docker
@@ -43,6 +45,8 @@ Image: crazymax/jetbrains-license-server:latest
### Environment variables ### Environment variables
* `TZ`: The timezone assigned to the container (default `UTC`) * `TZ`: The timezone assigned to the container (default `UTC`)
* `PUID`: Process UID (default `1000`)
* `PGID`: Process GID (default `1000`)
* `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_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 `/`) * `JLS_CONTEXT`: [Context path](https://www.jetbrains.com/help/license_server/setting_host_and_port.html#d1010e63) used by the license server (default `/`)
* `JLS_ACCESS_CONFIG`: JSON file to configure [user restrictions](https://www.jetbrains.com/help/license_server/configuring_user_restrictions.html) (default `/data/access-config.json`) * `JLS_ACCESS_CONFIG`: JSON file to configure [user restrictions](https://www.jetbrains.com/help/license_server/configuring_user_restrictions.html) (default `/data/access-config.json`)
@@ -59,7 +63,7 @@ Image: crazymax/jetbrains-license-server:latest
* `/data`: Contains [registration data](https://www.jetbrains.com/help/license_server/migrate.html) and configuration * `/data`: Contains [registration data](https://www.jetbrains.com/help/license_server/migrate.html) and configuration
> :warning: Note that the volume should be owned by uid `1000` and gid `1000`. If you don't give the volume correct permissions, the container may not start. > :warning: Note that the volumes should be owned by the user/group with the specified `PUID` and `PGID`. If you don't give the volume correct permissions, the container may not start.
### Ports ### Ports
@@ -72,8 +76,6 @@ Image: crazymax/jetbrains-license-server:latest
Docker compose is the recommended way to run this image. Copy the content of folder [examples/compose](examples/compose) in `/var/jls/` on your host for example. Edit the compose and env files with your preferences and run the following commands: Docker compose is the recommended way to run this image. Copy the content of folder [examples/compose](examples/compose) in `/var/jls/` on your host for example. Edit the compose and env files with your preferences and run the following commands:
```bash ```bash
touch acme.json
chmod 600 acme.json
docker-compose up -d docker-compose up -d
docker-compose logs -f docker-compose logs -f
``` ```
@@ -85,14 +87,14 @@ You can also use the following minimal command :
```bash ```bash
$ docker run -d -p 8000:8000 --name jetbrains_license_server \ $ docker run -d -p 8000:8000 --name jetbrains_license_server \
-e TZ="Europe/Paris" \ -e TZ="Europe/Paris" \
-e JLS_VIRTUAL_HOSTS=jetbrains-license-server.example.com \ -e JLS_VIRTUAL_HOSTS=jls.example.com \
-v $(pwd)/data:/data \ -v $(pwd)/data:/data \
crazymax/jetbrains-license-server:latest crazymax/jetbrains-license-server:latest
``` ```
## Update ## Update
Recreate the container whenever i push an update : Recreate the container whenever I push an update:
```bash ```bash
docker-compose pull docker-compose pull
@@ -115,12 +117,9 @@ That's because the license server is running behind a reverse proxy. Please conf
## How can I help ? ## How can I help ?
All kinds of contributions are welcome :raised_hands:!<br /> All kinds of contributions are welcome :raised_hands:! The most basic way to show your support is to star :star2: the project, or to raise issues :speech_balloon: You can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max) :clap: or by making a [Paypal donation](https://www.paypal.me/crazyws) to ensure this journey continues indefinitely! :rocket:
The most basic way to show your support is to star :star2: the project, or to raise issues :speech_balloon:<br />
But we're not gonna lie to each other, I'd rather you buy me a beer or two :beers:!
[![Support me on Patreon](.res/patreon.png)](https://www.patreon.com/crazymax) Thanks again for your support, it is much appreciated! :pray:
[![Paypal Donate](.res/paypal.png)](https://www.paypal.me/crazyws)
## License ## License

View File

@@ -6,13 +6,23 @@ JLS_PORT=8000
JLS_CONTEXT=${JLS_CONTEXT:-/} JLS_CONTEXT=${JLS_CONTEXT:-/}
JLS_ACCESS_CONFIG=${JLS_ACCESS_CONFIG:-/data/access-config.json} JLS_ACCESS_CONFIG=${JLS_ACCESS_CONFIG:-/data/access-config.json}
if [ -n "${PGID}" ] && [ "${PGID}" != "$(id -g jls)" ]; then
echo "Switching to PGID ${PGID}..."
sed -i -e "s/^jls:\([^:]*\):[0-9]*/jls:\1:${PGID}/" /etc/group
sed -i -e "s/^jls:\([^:]*\):\([0-9]*\):[0-9]*/jls:\1:\2:${PGID}/" /etc/passwd
fi
if [ -n "${PUID}" ] && [ "${PUID}" != "$(id -u jls)" ]; then
echo "Switching to PUID ${PUID}..."
sed -i -e "s/^jls:\([^:]*\):[0-9]*:\([0-9]*\)/jls:\1:${PUID}:\2/" /etc/passwd
fi
# Init # Init
echo "Initializing files and folders..." echo "Initializing files and folders..."
touch "/data/access-config.json" su-exec jls:jls touch "/data/access-config.json"
# https://www.jetbrains.com/help/license_server/setting_host_and_port.html # https://www.jetbrains.com/help/license_server/setting_host_and_port.html
echo "Configuring Jetbrains License Server..." echo "Configuring Jetbrains License Server..."
license-server configure --listen ${JLS_LISTEN_ADDRESS} --port ${JLS_PORT} --context ${JLS_CONTEXT} su-exec jls:jls 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 # https://www.jetbrains.com/help/license_server/setting_host_and_port.html
if [ ! -z "$JLS_VIRTUAL_HOSTS" ] ; then if [ ! -z "$JLS_VIRTUAL_HOSTS" ] ; then
@@ -20,45 +30,48 @@ if [ ! -z "$JLS_VIRTUAL_HOSTS" ] ; then
for JLS_VIRTUAL_HOST in $(echo ${JLS_VIRTUAL_HOSTS} | tr "," "\n"); do for JLS_VIRTUAL_HOST in $(echo ${JLS_VIRTUAL_HOSTS} | tr "," "\n"); do
echo "-> ${JLS_VIRTUAL_HOST}" echo "-> ${JLS_VIRTUAL_HOST}"
done done
license-server configure --jetty.virtualHosts.names=${JLS_VIRTUAL_HOSTS} su-exec jls:jls license-server configure --jetty.virtualHosts.names=${JLS_VIRTUAL_HOSTS}
fi fi
# https://www.jetbrains.com/help/license_server/configuring_user_restrictions.html # https://www.jetbrains.com/help/license_server/configuring_user_restrictions.html
if [ -s "$JLS_ACCESS_CONFIG" ]; then if [ -s "$JLS_ACCESS_CONFIG" ]; then
echo "Enabling user restrictions access from $JLS_ACCESS_CONFIG..." echo "Enabling user restrictions access from $JLS_ACCESS_CONFIG..."
license-server configure --access.config=file:${JLS_ACCESS_CONFIG} su-exec jls:jls license-server configure --access.config=file:${JLS_ACCESS_CONFIG}
fi fi
# https://www.jetbrains.com/help/license_server/detailed_server_usage_statistics.html # https://www.jetbrains.com/help/license_server/detailed_server_usage_statistics.html
if [ ! -z "$JLS_SMTP_SERVER" -a ! -z "$JLS_STATS_RECIPIENTS" ] ; then if [ ! -z "$JLS_SMTP_SERVER" -a ! -z "$JLS_STATS_RECIPIENTS" ] ; then
JLS_SMTP_PORT=${JLS_SMTP_PORT:-25} JLS_SMTP_PORT=${JLS_SMTP_PORT:-25}
echo "Enabling User Reporting via SMTP at $JLS_SMTP_SERVER:$JLS_SMTP_PORT..." echo "Enabling User Reporting via SMTP at $JLS_SMTP_SERVER:$JLS_SMTP_PORT..."
license-server configure --smtp.server ${JLS_SMTP_SERVER} --smtp.server.port ${JLS_SMTP_PORT} su-exec jls:jls license-server configure --smtp.server ${JLS_SMTP_SERVER} --smtp.server.port ${JLS_SMTP_PORT}
if [ ! -z "$JLS_SMTP_USERNAME" -a ! -z "$JLS_SMTP_PASSWORD" ] ; then if [ ! -z "$JLS_SMTP_USERNAME" -a ! -z "$JLS_SMTP_PASSWORD" ] ; then
echo "Using SMTP username $JLS_SMTP_USERNAME with password..." echo "Using SMTP username $JLS_SMTP_USERNAME with password..."
license-server configure --smtp.server.username ${JLS_SMTP_USERNAME} su-exec jls:jls license-server configure --smtp.server.username ${JLS_SMTP_USERNAME}
license-server configure --smtp.server.password ${JLS_SMTP_PASSWORD} su-exec jls:jls license-server configure --smtp.server.password ${JLS_SMTP_PASSWORD}
fi fi
if [ ! -z "$JLS_STATS_FROM" ] ; then if [ ! -z "$JLS_STATS_FROM" ] ; then
echo "Setting stats sender to $JLS_STATS_FROM..." echo "Setting stats sender to $JLS_STATS_FROM..."
license-server configure --stats.from ${JLS_STATS_FROM} su-exec jls:jls license-server configure --stats.from ${JLS_STATS_FROM}
fi fi
if [ "$JLS_REPORT_OUT_OF_LICENSE" -gt 0 ]; then if [ "$JLS_REPORT_OUT_OF_LICENSE" -gt 0 ]; then
echo "Setting report out of licence to $JLS_REPORT_OUT_OF_LICENSE%..." 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} su-exec jls:jls license-server configure --reporting.out.of.license.threshold ${JLS_REPORT_OUT_OF_LICENSE}
fi fi
echo "Stats recipients: $JLS_STATS_RECIPIENTS..." echo "Stats recipients: $JLS_STATS_RECIPIENTS..."
license-server configure --stats.recipients ${JLS_STATS_RECIPIENTS} su-exec jls:jls license-server configure --stats.recipients ${JLS_STATS_RECIPIENTS}
fi fi
# https://www.jetbrains.com/help/license_server/detailed_server_usage_statistics.html # https://www.jetbrains.com/help/license_server/detailed_server_usage_statistics.html
if [ ! -z "$JLS_STATS_TOKEN" ] ; then if [ ! -z "$JLS_STATS_TOKEN" ] ; then
echo "Enabling stats via API at /$JLS_STATS_TOKEN..." echo "Enabling stats via API at /$JLS_STATS_TOKEN..."
license-server configure --reporting.token ${JLS_STATS_TOKEN} su-exec jls:jls license-server configure --reporting.token ${JLS_STATS_TOKEN}
fi fi
exec "$@" echo "Fixing perms..."
chown -R jls:jls /data "$JLS_PATH"
exec su-exec jls:jls "$@"

View File

@@ -1,63 +1,18 @@
version: "3.2" version: "3.2"
services: services:
traefik: jls:
image: traefik:1.7-alpine
container_name: traefik
command:
- "--logLevel=INFO"
- "--defaultentrypoints=http,https"
- "--entryPoints=Name:http Address::80 Redirect.EntryPoint:https"
- "--entryPoints=Name:https Address::443 TLS"
- "--docker"
- "--docker.exposedbydefault=false"
- "--docker.domain=example.com"
- "--acme=false"
- "--acme.acmelogging=true"
- "--acme.email=webmaster@example.com"
- "--acme.storage=acme.json"
- "--acme.entryPoint=https"
- "--acme.onhostrule=true"
- "--acme.httpchallenge=true"
- "--acme.httpchallenge.entrypoint=http"
ports:
- target: 80
published: 80
protocol: tcp
- target: 443
published: 443
protocol: tcp
volumes:
- "./acme.json:/acme.json"
- "/var/run/docker.sock:/var/run/docker.sock"
restart: always
app:
image: crazymax/jetbrains-license-server:latest image: crazymax/jetbrains-license-server:latest
container_name: jetbrains_license_server container_name: jls
depends_on: ports:
- traefik - target: 8000
published: 8000
protocol: tcp
volumes: volumes:
- "jetbrains-license-server:/data" - "jls:/data"
labels: env_file:
- "traefik.enable=true" - "./jls.env"
- "traefik.backend=jetbrains-license-server"
- "traefik.port=8000"
- "traefik.frontend.rule=Host:jetbrains-license-server.example.com,an-other-host.example.com"
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"
- "JLS_SMTP_PASSWORD="
- "JLS_STATS_FROM=jetbrains@example.com"
- "JLS_STATS_TOKEN=0123456789ABCDEF"
restart: always restart: always
volumes: volumes:
jetbrains-license-server: jls:

12
examples/compose/jls.env Normal file
View File

@@ -0,0 +1,12 @@
TZ=Europe/Paris
JLS_VIRTUAL_HOSTS=127.0.0.1,jls.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
JLS_SMTP_PASSWORD=
JLS_STATS_FROM=jetbrains@example.com
JLS_STATS_TOKEN=0123456789ABCDEF

View File

@@ -0,0 +1,8 @@
## Usage
```bash
touch acme.json
chmod 600 acme.json
docker-compose up -d
docker-compose logs -f
```

View File

@@ -0,0 +1,50 @@
version: "3.2"
services:
traefik:
image: traefik:1.7-alpine
container_name: traefik
command:
- "--logLevel=INFO"
- "--defaultentrypoints=http,https"
- "--entryPoints=Name:http Address::80 Redirect.EntryPoint:https"
- "--entryPoints=Name:https Address::443 TLS"
- "--docker"
- "--docker.exposedbydefault=false"
- "--docker.domain=example.com"
- "--acme=false"
- "--acme.acmelogging=true"
- "--acme.email=webmaster@example.com"
- "--acme.storage=acme.json"
- "--acme.entryPoint=https"
- "--acme.onhostrule=true"
- "--acme.httpchallenge=true"
- "--acme.httpchallenge.entrypoint=http"
ports:
- target: 80
published: 80
protocol: tcp
- target: 443
published: 443
protocol: tcp
volumes:
- "./acme.json:/acme.json"
- "/var/run/docker.sock:/var/run/docker.sock"
restart: always
jls:
image: crazymax/jetbrains-license-server:latest
container_name: jls
volumes:
- "jls:/data"
labels:
- "traefik.enable=true"
- "traefik.backend=jls"
- "traefik.port=8000"
- "traefik.frontend.rule=Host:jls.example.com,an-other-host.example.com"
env_file:
- "./jls.env"
restart: always
volumes:
jls:

12
examples/traefik/jls.env Normal file
View File

@@ -0,0 +1,12 @@
TZ=Europe/Paris
JLS_VIRTUAL_HOSTS=jls.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
JLS_SMTP_PASSWORD=
JLS_STATS_FROM=jetbrains@example.com
JLS_STATS_TOKEN=0123456789ABCDEF