cryptolens_configurationstring
environment variable with the configuration string from this page.
To sum up, you can start the server in two ways:
cryptolens_configurationstring
to the configuration string.config.json
file (not recommended).ConfigurationFromCryptolens
variable in Program.cs
, which can be created on this page. In other words, there is no need to provide any arguments when calling the license server or use an external configuration file.
The license server can be compiled on most operating systems and the process is as follows:
ConfigurationFromCryptolens
variable in Program.cs
.LicenseServerCore.sln
file:
LicenseServer.exe
as an administrator (you can download it here). The default port is 8080 but this can be changed. One way of doing it is to run CMD as an administrator and then type the command below:
Please make sure to check that this port is open so that other computers in the network can access it (shown below).
dotnet
before launching the server. Everything else is the same. Based on our tests, no sudo access is needed to run the license server on Linux.
wf.msc
LicenseServerUrl
, which can be used to provide the URL of the license server.
v1.*
and v2.*
. If you only need the request forwarding feature, v.1.*
version will suffice. If you want to use the extra features listed below, you can use v2.*
version instead.
Key.Activate
, which helps to reduce the number of requests sent to Cryptolens. This is useful especially if your clients would have temporary internet connectivity issues. To enable license caching, you need to specify how long the license server should store each license. Note: if your application uses the signatureExpirationInterval
parameter in HasValidSignature
, the lifetime of the cache on the license server needs to be either equal to signatureExpirationInterval
or less. Otherwise, your client application will throw an error.
As an example, to launch the server that caches licenses for 10 days, it can be started as follows:
.skm
extension) is in the Downloads folder, it can be loaded as follows (or use this configuration string):
ConfigurationFromCryptolens
variable in Program.cs
. In newer versions, you can choose to place the configuration string in an environment variable (cryptolens_configurationstring
) or by supplying it as a command line argument (-config).Key.Activate
needs to be called the same way as the in the Unity example: https://help.cryptolens.io/getting-started/unityActivate
and GetKey
requests.Floating=true
, similar to the way it would have been done when calling Cryptolens’ Web API:
licensefiles
folder needs to have the data objects that will be incremented or decremented. Otherwise, the license server will throw an error.config.json
in the same folder as the server. The structure of the configuration file is shown below:
ActivationFiles
can either reference a specific file or a folder. If it references a folder, all files with the .skm
extension will be loaded.
ConfigurationFromCryptolens
variable and build the License Server yourself.cryptolens_configurationstring
with the configuration string from above.ConfigurationFromCryptolens
in Program.cs is not null or empty.ConfigurationFromCryptolens
to any string value and then rely on the environment variables. Alternatively, you can create a configuration string at https://app.cryptolens.io/extensions/licenseserver and then set “path to config file” to USE_ENVIRONMENT_VARIABLES
.
Cryptolens uses the following environment variables:
Name | Description |
---|---|
cryptolens_offlinemode | Specifies if the license server should contact the central server (if set to false) or rely on the cached version if such exists (if set to true). When set to true, the license server will at first try the cache before attempting to contact the license server. |
cryptolens_port | The port to use. |
cryptolens_activationfilefolder | The path to the folder with activation files. Please set it to an absolute path when running the license server as a service. |
cryptolens_cachelength | The amount of days until a new license file should be obtained. |
cryptolens_pathtoconfigfile | The path to the configuration file. This can be useful if you anticipate that your clients might need to change certain properties more often, and then it may be easier to change the file rather than restarting the machine (which is often required for the environment variables to take effect). For now, you can set the port and the folder to the activation files. If you plan to run the server as a service, please set this to absolute path. |
cryptolens_cachefolder | Path to the cache folder. If you plan to run the server as a service, please set this to absolute path. |
cryptolens_configurationstring | An optional parameter that you can use to provide the configuration string that would normally need to be added in the code. The license server will always check for this environment variable at start and it will have priority over command line arguments. |