├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── access-config.json ├── docker-compose.yml └── docker-launcher.sh /.gitignore: -------------------------------------------------------------------------------- 1 | data/* 2 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM tomcat:8.5 2 | MAINTAINER Peter Fry "https://github.com/racerpeter" 3 | 4 | ENV BASE_DIR=/usr/local/tomcat/license-server 5 | 6 | # The query string param means nothing to the jetbrains server, and is only used to bump the build number in the dockerfile 7 | RUN /usr/bin/curl -o installer.zip https://download-cf.jetbrains.com/lcsrv/license-server-installer.zip?version=17955 && \ 8 | mkdir $BASE_DIR && \ 9 | unzip -d $BASE_DIR installer.zip && \ 10 | rm -f installer.zip 11 | 12 | COPY docker-launcher.sh /usr/bin/docker-launcher.sh 13 | RUN chmod +x /usr/bin/docker-launcher.sh 14 | 15 | EXPOSE 8080 16 | 17 | CMD ["/usr/bin/docker-launcher.sh"] 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Peter Fry 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # jetbrains-license-server 2 | A dockerized JetBrains License Server (current version is build 17955, released Sept 28, 2018), based on tomcat:8.5. Available on Docker Hub at [racerpeter/jetbrains-license-server](https://hub.docker.com/r/racerpeter/jetbrains-license-server/). 3 | 4 | ## Getting Started 5 | Getting started with jetbrains-license-server is easy: 6 | 7 | 1. Configure the license server using the environment variables below 8 | 2. Run `docker-compose up` 9 | 3. Navigate to your license server (default: `http://localhost:8080`) 10 | 4. You should be prompted to log in to your JetBrains account to configure the license server. *Your license server data will be stored in the mounted data directory so that the license server configuration is persisted across restarts.* 11 | 12 | ### Environment Variable Options 13 | - `LICENSE_SERVER_HOST` The hostname at which this license server will be available. This setting is required when [exposing the license server from behind a reverse proxy](https://www.jetbrains.com/help/license_server/configuring_secure_connection.html) (optional, disabled by default) 14 | - `LICENSE_SERVER_SMTP_SERVER` SMTP server to use for sending [stats emails](https://www.jetbrains.com/help/license_server/detailed_server_usage_statistics.html) (optional, stats emails disabled by default) 15 | - `LICENSE_SERVER_SMTP_PORT` Defaults to 25 16 | - `LICENSE_SERVER_SMTP_USERNAME` Optional, auth is disabled by default 17 | - `LICENSE_SERVER_SMTP_PASSWORD` Required if LICENSE_SERVER_SMTP_USERNAME is provided 18 | - `LICENSE_SERVER_STATS_FROM` From address for stats emails 19 | - `LICENSE_SERVER_STATS_RECIPIENTS` Recipient address(es) for stats emails (comma delimited) 20 | - `LICENSE_SERVER_STATS_TOKEN` Enables an auth token for the [stats API](https://www.jetbrains.com/help/license_server/detailed_server_usage_statistics.html) at /reportApi (method: POST) 21 | - `LICENSE_SERVER_USER_RESTRICTIONS` Enables user restrictions loaded from `$LICENSE_SERVER_USER_RESTRICTIONS` (/root/access-config.json by default, which is mounted from the Docker host when using docker-compose.yml, otherwise it must be copied into the container. *Note: only configured when the file is non-empty.*) 22 | 23 | ### Requirements: 24 | - Docker 25 | - docker-compose 26 | -------------------------------------------------------------------------------- /access-config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/racerpeter/jetbrains-license-server/c26a33de4e0e710535a2feb8fd05b8b7dab0afea/access-config.json -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | license_server: 4 | image: racerpeter/jetbrains-license-server 5 | ports: 6 | - "8080:8080" 7 | environment: 8 | - LICENSE_SERVER_HOST=licenses.example.com 9 | - LICENSE_SERVER_SMTP_SERVER=smtp.example.com 10 | - LICENSE_SERVER_SMTP_PORT=465 11 | - LICENSE_SERVER_SMTP_USERNAME=license_server 12 | - LICENSE_SERVER_SMTP_PASSWORD=password 13 | - LICENSE_SERVER_STATS_FROM=licenses@example.com 14 | - LICENSE_SERVER_STATS_RECIPIENTS=management@mavenlink.com 15 | - LICENSE_SERVER_STATS_TOKEN=SECRET 16 | volumes: 17 | - ./data:/root/.jb-license-server 18 | - ./access-config.json:/root/access-config.json 19 | -------------------------------------------------------------------------------- /docker-launcher.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Configuring license server..." 4 | $BASE_DIR/bin/license-server.sh configure --port 8080 5 | 6 | if [ "z$LICENSE_SERVER_HOST" != "z" ]; then 7 | echo "Using hostname $LICENSE_SERVER_HOST..." 8 | $BASE_DIR/bin/license-server.sh configure --host $LICENSE_SERVER_HOST --jetty.virtualHosts.names=$LICENSE_SERVER_HOST 9 | fi 10 | 11 | if [ "z$LICENSE_SERVER_SMTP_SERVER" != "z" ]; then 12 | if [ "z$LICENSE_SERVER_STATS_RECIPIENTS" != "z" ]; then 13 | smtp_port=${LICENSE_SERVER_SMTP_PORT:-25} 14 | echo "Enabling Stats via SMTP at $LICENSE_SERVER_SMTP_SERVER:$smtp_port..." 15 | $BASE_DIR/bin/license-server.sh configure --smtp.server $LICENSE_SERVER_SMTP_SERVER --smtp.server.port $smtp_port 16 | 17 | echo "Stats recipient(s): $LICENSE_SERVER_STATS_RECIPIENTS..." 18 | $BASE_DIR/bin/license-server.sh configure --stats.recipients $LICENSE_SERVER_STATS_RECIPIENTS 19 | 20 | if [ "z$LICENSE_SERVER_SMTP_USERNAME" != "z" ]; then 21 | if [ "z$LICENSE_SERVER_SMTP_PASSWORD" != "z" ]; then 22 | echo "Using SMTP username $LICENSE_SERVER_SMTP_USERNAME with password..." 23 | $BASE_DIR/bin/license-server.sh configure --smtp.server.username $LICENSE_SERVER_SMTP_USERNAME 24 | $BASE_DIR/bin/license-server.sh configure --smtp.server.password $LICENSE_SERVER_SMTP_PASSWORD 25 | fi 26 | fi 27 | 28 | if [ "z$LICENSE_SERVER_STATS_FROM" != "z" ]; then 29 | echo "Using hostname $LICENSE_SERVER_STATS_FROM..." 30 | $BASE_DIR/bin/license-server.sh configure --stats.from $LICENSE_SERVER_STATS_FROM 31 | fi 32 | fi 33 | fi 34 | 35 | license_restrictions=${LICENSE_SERVER_USER_RESTRICTIONS-/root/access-config.json} 36 | if [ -s $license_restrictions ]; then 37 | echo "Enabling user restrictions loaded from $license_restrictions..." 38 | $BASE_DIR/bin/license-server.sh configure --access.config=file:$license_restrictions 39 | fi 40 | 41 | if [ "z$LICENSE_SERVER_STATS_TOKEN" != "z" ]; then 42 | echo "Enabling stats via API at /$LICENSE_SERVER_STATS_TOKEN..." 43 | $BASE_DIR/bin/license-server.sh configure --reporting.token $LICENSE_SERVER_STATS_TOKEN 44 | fi 45 | 46 | echo "Starting license server..." 47 | $BASE_DIR/bin/license-server.sh start 48 | 49 | sleep infinity 50 | 51 | echo "Stopping license server..." 52 | $BASE_DIR/bin/license-server.sh stop 53 | 54 | echo "exited $0" 55 | --------------------------------------------------------------------------------