open-license-manager / licensecc

Software licensing, copy protection in C++. It has few dependencies and it's cross-platform.
http://open-license-manager.github.io/licensecc/
BSD 3-Clause "New" or "Revised" License
947 stars 300 forks source link

Using a licencse file on client CI #122

Open BotellaA opened 3 years ago

BotellaA commented 3 years ago

I would like to know if there is a way to provide a license file to a client, so he could use it on a third party CI, like Github Actions.

We could generate a license without any PC information but this unrestricted license file should not be given to a client.... Do you see a way to lock or control the usage on a third party CI?

Thanks for your help

gcontini commented 3 years ago

Hi Arnaud, The original idea was to detect the virtualization environment the CI use and some VM parameters: eg, your demo application can only run on Google Cloud with less than XX of ram and less than X cpu. That's the best i can think of. Another idea could be a timer: your application can only run for xx minutes (time of the tests) then it stops...

The VM detection code is already there, but i couldn't complete the verification part, and seems my plan to work on it are to be further postponed. A first plain implementation shouldn't be that difficult: add the parameters into the license generator and verify against them in the library... BR Gabriele

BotellaA commented 3 years ago

Thanks for the reply. What is missing for the verifcation part? The specifications for each CI?

gcontini commented 3 years ago

Hi Arnaud, The class ExecutionEnvironment has already an enum to return wihch cloud provider you are executing in. The license generator should be able to generate a license limiting to a cloud provider (eg.add one line into the license file like: cloud-provider=GCP ) in LicenseVerifier::verify_limits read the line above (it's in the m_limits map in FullLicenseInfo) and if present validate it with the current value from ExecutionEnvironment