License Server based on license3j
10K+
Container image for the License Server application based on license3j project.
Currently designed to work with FastSpring requests only.
docker run --rm -p 8090:8090 \
-e FASTSPRING_FULFILLMENT_USERNAME=fastspring \
-e FASTSPRING_FULFILLMENT_PASSWORD=changeme \
-e FASTSPRING_FULFILLMENT_PRIVATEKEY=fastspring_hashkey \
-e FASTSPRING_WEBHOOK_SECRET=fastspring_hmac \
-v /etc/license3j-server/secrets/license3j-signkey.txt:/run/secrets/license3j-signkey.txt:ro \
savignano/license3j-server:latest
Health endpoint:
http://localhost:8090/health
Image defaults from docker/context/license3j-server/config/ are baked into
/opt/license3j-server/config-defaults in the container.
At startup, missing files are copied into /opt/license3j-server/config:
cp -an /opt/license3j-server/config-defaults/. /opt/license3j-server/config/
So you can mount a config directory and keep your overrides while still getting new default files:
docker run --rm -p 8090:8090 \
-v /etc/license3j-server/config:/opt/license3j-server/config \
savignano/license3j-server:latest
| Variable | Default | Description |
|---|---|---|
SERVER_PORT | 8090 | HTTP server port |
SIGNKEY_FILE | (required) | Path to license3j signing key |
LICENSE_EXPIRY_DAYS | 365 | Default license expiry in days to be used when ca_expiryDays is not set |
FASTSPRING_FULFILLMENT_PRIVATEKEY | (required) | FastSpring security_request_hash private key from Remote Server Request Configuration |
FASTSPRING_FULFILLMENT_USERNAME | (required) | Basic Auth username for fulfillment endpoint |
FASTSPRING_FULFILLMENT_PASSWORD | (required) | Basic Auth password for fulfillment endpoint |
FASTSPRING_WEBHOOK_SECRET | (required) | FastSpring webhook HMAC secret from Webhook Configuration |
MAIL_ENABLED | false | Set to true to enable webhook email sending |
MAIL_SMTP_HOST | localhost | SMTP server host |
MAIL_SMTP_PORT | 587 | SMTP server port |
MAIL_SMTP_STARTTLS | true | Enable STARTTLS |
MAIL_SMTP_USERNAME | (required if mail enabled) | SMTP username |
MAIL_SMTP_PASSWORD | (required if mail enabled) | SMTP password |
MAIL_FROM | (required if mail enabled) | Sender address |
WELCOME_TEMPLATE_FILE | /opt/license3j-server/config/welcome-email.vm | Filesystem path to welcome email template. Falls back to classpath default if not found |
CHARGE_COMPLETED_TEMPLATE_FILE | /opt/license3j-server/config/charge-completed-email.vm | Filesystem path to renewal email template. Falls back to classpath default if not found |
Which webhook events trigger an email is configured in application.yml under licenseserver.webhook.event-handlers. Each handler has:
| Setting | Description |
|---|---|
event-type | FastSpring webhook event type to handle (e.g. subscription.activated) |
subject-template | Email subject line (Velocity syntax, has access to $data) |
template-name | Classpath template name in templates/{name}.vm |
template-file | Optional filesystem path override for the template (env var, e.g. ${WELCOME_TEMPLATE_FILE:}) |
recipient-path | Dot-notation path to recipient email in webhook data (default: account.contact.email) |
enabled | Set to false to disable this handler without removing it (default: true) |
Default configuration handles two events:
subscription.activated — sends a welcome email (template: welcome-email.vm)subscription.charge.completed — sends a renewal email with the license key (template: charge-completed-email.vm)All other webhook events are logged and skipped.
To customize event handlers (add/remove webhook events), mount a custom application.yml next to the JAR:
docker run ... \
-v /path/to/my-application.yml:/opt/license3j-server/app/application.yml:ro \
savignano/license3j-server:latest
Your file only needs to contain the properties you want to override — everything else falls back to defaults.
Note:
event-handlersis a list, so defining it in your custom file replaces the whole thing. Copy the defaults below and extend from there.
licenseserver:
webhook:
event-handlers:
- event-type: subscription.activated
subject-template: "Welcome to $!{data.display}"
template-name: welcome-email
template-file: ${WELCOME_TEMPLATE_FILE:}
recipient-path: account.contact.email
- event-type: subscription.charge.completed
subject-template: "Your $!{data.subscription.display} license renewal"
template-name: charge-completed-email
template-file: ${CHARGE_COMPLETED_TEMPLATE_FILE:}
recipient-path: account.contact.email
Both subject-template and the body template (.vm file) are rendered with Apache Velocity. The following variables are available:
| Variable | Type | Description |
|---|---|---|
$data | Map | The full webhook event data payload as a nested Map. Access any field via dot notation |
$eventType | String | The webhook event type (e.g. subscription.activated) |
Common $data paths (exact fields depend on event type):
| Path | Description |
|---|---|
$data.account.contact.email | Customer email |
$data.account.contact.first | Customer first name |
$data.account.contact.last | Customer last name |
$data.display | Product display name (subscription.activated) |
$data.initialOrderReference | Order reference (subscription.activated) |
$data.subscription | Subscription ID string (subscription.activated) |
$data.order.reference | Order reference (subscription.charge.completed) |
$data.subscription.display | Product display name (subscription.charge.completed) |
$data.order.items | List of order items with fulfillments (subscription.charge.completed) |
Use $!data.field (with !) to render an empty string instead of literal $data.field when the value is null.
Content type
Image
Digest
sha256:5e095110c…
Size
115.2 MB
Last updated
about 1 hour ago
docker pull savignano/license3j-server:nightly