Gabriele Contini
2020-02-01 025c09a83b575871c4efbac3ecf080c472951bdd
Deploy documentation to gh-pages branch (#74)

* add doxygen
4个文件已修改
17个文件已添加
884 ■■■■■ 已修改文件
.travis.yml 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CMakeLists.txt 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
doc/Backoffice.md 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
doc/Basic-concepts.md 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
doc/Build-the-library-windows.md 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
doc/Build-the-library.md 157 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
doc/Dependencies.md 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
doc/Development-And-Usage-Workflow.md 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
doc/Development-Environment-Setup.md 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
doc/DoxygenLayout.xml 205 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
doc/Hardware-identifiers.md 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
doc/Home.md 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
doc/Integration.md 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
doc/Issue-licenses.md 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
doc/License-retrieval.md 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
doc/QA.md 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
doc/features.md 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
doc/pc-id-selection.png 补丁 | 查看 | 原始文档 | blame | 历史
doc/structure.dox 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
include/licensecc/datatypes.h 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
include/licensecc/licensecc.h 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.travis.yml
@@ -1,7 +1,12 @@
language: cpp
services: docker
matrix:
stages:
   - name: test
   - name: documentation
     if: branch = develop
jobs:
   include:
   - os: linux
     dist: bionic
@@ -180,7 +185,38 @@
     script: 
         - travis_wait 20 cmake --build . --target install --config Release
         - ctest -C Release
   - os: linux
     dist: bionic
     stage: documentation
     name: "Deploy documentation"
     addons:
         apt:
           packages:
             - cmake
             - libssl-dev
             - zlib1g-dev
             - libboost-dev
             - libboost-test-dev
             - libboost-filesystem-dev
             - libboost-iostreams-dev
             - libboost-program-options-dev
             - libboost-system-dev
             - libboost-thread-dev
             - libboost-date-time-dev
             - doxygen
             - graphviz
     script:
        - make docs
     deploy:
        provider: pages
        skip_cleanup: true
        github_token: $GITHUB_TOKEN
        keep_history: false
        verbose: true
        target_branch: "gh-pages"
        local_dir: "build/html"
        on:
            branch: develop
env:
    - CTEST_OUTPUT_ON_FAILURE=1      
before_script:
CMakeLists.txt
@@ -142,7 +142,6 @@
endif()
SET( Boost_USE_STATIC_LIBS ON )
find_package(Boost COMPONENTS unit_test_framework system filesystem)
#if boost is found enable tests
IF(Boost_FOUND)
    INCLUDE(CTest)
@@ -155,6 +154,18 @@
    message(WARNING "Boost not found, disabling tests")
ENDIF(Boost_FOUND)
find_package(Doxygen COMPONENTS dot)
IF(Doxygen_FOUND)
    message(STATUS "Doxygen found, generating docs.")
    SET(DOXYGEN_EXCLUDE_PATTERNS "*/library/ini/*")
    SET(DOXYGEN_DISABLE_INDEX YES)
    SET(DOXYGEN_GENERATE_TREEVIEW YES)
    SET(DOXYGEN_LAYOUT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/doc/DoxygenLayout.xml")
    doxygen_add_docs(docs doc src include/licensecc COMMENT "doxygen docs")
ELSE(Doxygen_FOUND)
    message(STATUS "Doxygen not found, not generating docs.")
ENDIF(Doxygen_FOUND)
install(DIRECTORY ${LCC_INCLUDE_DIR} DESTINATION include/${PROJECT_NAME})
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION include)
install(FILES src/cmake/licensecc-config.cmake DESTINATION ${main_lib_dest})
@@ -163,3 +174,4 @@
write_basic_package_version_file(${CMAKE_BINARY_DIR}/licensecc-config-version.cmake COMPATIBILITY SameMajorVersion)
install(FILES ${CMAKE_BINARY_DIR}/licensecc-config-version.cmake DESTINATION ${main_lib_dest})
doc/Backoffice.md
New file
@@ -0,0 +1,46 @@
# Backoffice (Draft) (Use Cases)
Not implemented yet.
## Domain
**Software Provider**
* PK ProviderId
* Email (UNIQUE)
* Password
* LicenseGenerator?? (UNIQUE)
* Library headers and compiled files (zip).
**Product**
* PK ProductId + (FK) ProviderId
**Software User**
* PK UserId + (FK) ProviderId
* Email (UNIQUE)
**License**
* PK LicenceId (AUTO)
* FK ProductId + UserId
* StartDate
* EndDate (NULL)
* HostId (NULL)
## Use Cases
**Software Provider Sign Up**
 \<\<inlcude\>\>
 * Generate Keys
 * Compile (provider specific) license generator and libraries bundle.
**Software Provider Sign In**
**Create New License**
Alternative scenario :
create new User, create new Product
**List Licences**
**(Renew License)**
**(Email Expiring Licenses)**
doc/Basic-concepts.md
New file
@@ -0,0 +1,12 @@
#Basic concepts and terminology
##Project
A project corresponds to one application where the licensing system need to be integrated.
Each project has its own private key and its own folder where `licensecc` is compiled.
Currently we support only one project per (build) machine. This is especially true in Windows, where the private key has the same name for all the projects.
##Features
Features let licensed application to selectively enable or disable functions in the application, features are part of the original license, they do not have hardware identifications, they only have validity date.
#Customizing the build
doc/Build-the-library-windows.md
New file
@@ -0,0 +1,47 @@
@ingroup  group_02
This page describes how to build the library. It's a good starting point if you just downloaded it and you want to start explore.
Under windows both MSVC compiler and MinGW are supported
## MSVC (2015~2019) - prerequisites
Pre-compiled [versions of boost](https://sourceforge.net/projects/boost/files/boost-binaries/) for windows are available at SourceForge.
For MSVC 2019: recommended cmake => 3.15.2 (the version 3.14 embedded in visual studio is not working with boost 1.71), [boost 1.71 msvc-14.2](https://dl.bintray.com/boostorg/release/1.71.0/binaries/boost_1_71_0-msvc-14.2-64.exe)
### Download:
This project has a submodule (the license generator). Remember to add the option `--recursive` to clone it.
```console
git clone --recursive https://github.com/open-license-manager/open-license-manager.git
```
~~Initialize command line tools:~~
```
~~ "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 ~~
```
Configure the library:
```
cmake .. -G "Visual Studio 16 2019" -A x64 -DBOOST_ROOT="C:\local\boost"  //(or where boost was installed)
```
### Supported cmake definitions/options
Below a list of some useful cmake configurations
|Definition name|Description|
|---------------|-----------|
|-DSTATIC_RUNTIME=1        |link statically to the standard and runtime support libraries (compiler flag /MT)|
|-DCMAKE_BUILD_TYPE=Release|link to the release version of the boost libraries|
|-DCMAKE_INSTALL_PREFIX=C:\.. | folder where to install libraries and headers |
|-DBOOST_ROOT=C:\.. | folder where boost is installed. If cmake is reporting boost not found consider updating cmake. |
Compile and test (command line)
```
cmake --build . --target install --config Release
ctest -C Release
```
doc/Build-the-library.md
New file
@@ -0,0 +1,157 @@
@ingroup  group_01
# Linux
## Install prerequisites
Below the prerequisites for compiling open-license-manager. For developing it we use Eclipse. Recent CDT works smoothly with CMake. Remember to install the Ninja package as build system and Cmake Gui for a good eclipse integration.
### Ubuntu
Supported Ubuntu distributions are 18.04 (Bionic Beaver) and 16.04 (Xenial) though it should be possible to build on any recent Ubuntu version.
Install prerequisites:
```console
sudo apt-get install cmake valgrind libssl-dev zlib1g-dev libboost-test-dev libboost-filesystem-dev \
     libboost-iostreams-dev libboost-program-options-dev libboost-system-dev libboost-thread-dev \
     libboost-date-time-dev build-essential
```
For development with eclipse:
```console
sudo apt-get install cmake-gui ninja-build
```
### CentOS 7
CentOS 7 ships with gcc 4.8 that isn't working for a bug on regular expression. It's necessary to update to gcc 4.9 or later.
Install prerequisites:
```console
yum -y update && yum -y install wget boost boost-devel boost-static openssl openssl-devel glibc-static centos-release-scl-rh
yum -y install devtoolset-7-toolchain devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-valgrind-devel
scl enable devtoolset-7 bash
export CC=/opt/rh/devtoolset-7/root/usr/bin/gcc
export CXX=/opt/rh/devtoolset-7/root/usr/bin/g++
```
Centos 7 ships with CMake 2.8.11 that's not supported anymore. You need to compile and install a newer (>3.6) version of CMake.
```console
wget https://cmake.org/files/v3.11/cmake-3.11.0.tar.gz
tar zxvf cmake-3.11.0.tar.gz
cd cmake-3.11.0
./bootstrap
make
sudo make install
cmake --version #(check it's 3.11.0)
```
If you don't want to install all these prerequisites you can also build the library in a docker container. Check for the corresponding section in the `.travis.yml` file at the base of the project.
### CentOS 8
Install prerequisites:
```console
yum -y update && yum -y groupinstall 'Development Tools'
yum -y install wget cmake boost boost-devel openssl-devel zlib-devel
dnf -y --enablerepo=PowerTools install boost-static
```
CentOS 8 doesn't ship with a static version of openssl. It is necessary to compile it from sources.
```console
wget https://github.com/openssl/openssl/archive/OpenSSL_1_1_1d.tar.gz
tar xzf OpenSSL_1_1_1d.tar.gz && cd openssl-OpenSSL_1_1_1d
./config && make -j 8
sudo make install
```
### Other linux
Open License Manager should compile on any recent (2019) linux distribution. Being CentOS 7 the older distribution we keep compatibilty with.
Minimum prerequisites
*   gcc => 4.9, cmake => 3.6
*   zlib, openssl => 1.0.2
*   Boost => 1.53 (If you want to compile your own boost version remember to use the flag `runtime-link=static`)
Optional prerequisites:
*   Dbus (if you want to enable dbus generated identifiers)
*   Doxygen
## Download and compile
### Download:
This project has a submodule (the license generator). Remember to add the option `--recursive` to clone it.
```console
git clone --recursive https://github.com/open-license-manager/open-license-manager.git
```
### Configure:
```console
cd open-license-manager/build
cmake .. -DCMAKE_INSTALL_PREFIX=../install
```
### Compile and test:
```console
make
make install
```
```console
make test
ctest -T memcheck
```
### cmake useful flags
|Definition name           |Description|
|--------------------------|-----------|
|LCC_PROJECT_NAME=<str>  | This correspond to the name of the project you're generating licenses for. The flag is optional, if you don't specify it the build system will create a project named `DEFAULT` for you |
|LCC_LOCATION=<path>     | In case you download the license generator separately this is the folder where it was installed or where his lcc-config.cmake can be found |
|CMAKE_BUILD_TYPE=Release| generate a release version of the library (should be used as default)|
|CMAKE_INSTALL_PREFIX    | folder where to install compiled libraries and headers. (default: /usr/local)               |
|BOOST_ROOT              | Folder where boost was installed (optional: if you installed boost using system package manager this should not be necessary) |
|OPENSSL_ROOT            | Folder where OpenSSL was installed (optional: if you installed openssl as system package this should not be necessary) |
## Cross compile on Linux for Windows
Tested on host: Ubuntu 18.04
### Prerequisites
```console
sudo apt-get install cmake valgrind binutils-mingw-w64 mingw-w64 mingw-w64-tools \
    mingw-w64-x86-64-dev libz-mingw-w64-dev wine-stable wine-binfmt p7zip-full
```
Download and compile boost:
```console
export CUR_PATH=$(pwd)
wget -c https://dl.bintray.com/boostorg/release/1.71.0/source/boost_1_71_0.tar.bz2
tar xjf boost_1_71_0.tar.bz2
rm boost_1_71_0.tar.bz2
cd boost_1_71_0
sudo ln -s /usr/bin/x86_64-w64-mingw32-g++ /usr/local/bin/g++-mingw
./bootstrap.sh
./b2 toolset=gcc-mingw target-os=windows address-model=64 --with-date_time --with-test --with-filesystem --with-program_options --with-regex --with-serialization --with-system runtime-link=static --prefix=./dist release install
```
Install OpenSSL:
```console
wget --no-check-certificate https://bintray.com/vszakats/generic/download_file?file_path=openssl-1.0.2h-win64-mingw.7z -O openssl.7z
7z x openssl.7z
rm openssl.7z
```
Configure and compile:
```
cmake -DCMAKE_TOOLCHAIN_FILE=../modules/toolchain-ubuntu-mingw64.cmake -DOPENSSL_ROOT_DIR=$CUR_PATH/openssl-OpenSSL_1_1_1d/dist -DCMAKE_FIND_DEBUG_MODE=ON -DOPENSSL_USE_STATIC_LIBS=ON -DBOOST_ROOT=$CUR_PATH/boost_1_71_0/dist  ..
```
doc/Dependencies.md
New file
@@ -0,0 +1,38 @@
This page describes the dependencies of open-license-manager and the supported build environments.
Dependencies varies with the environment, if you're building the library for the first time we suggest you download or set up one of the supported environments to be sure not to incur in dependency/compiler errors (you can use virtual machines , docker or lxc/lxd technologies).
The library is composed by two modules: a license generator `lcc` executable, that also works as a project configuration tool, and the open-license-manager C++ library itself `licensecc` (the part you have to integrate in your application).
## Open-license-manager library `licensecc` dependencies
These are the dependencies of the library you have to link to your code. We try to keep them at a minimum. N.B. boost is always optional and it's never linked to your application.
| Operating System               | Openssl    | Zlib                        | Boost<sup>2</sup>   |
|--------------------------------|:----------:|:---------------------------:|:-------------------:|
| Ubuntu 18.04     | :heavy_check_mark: v1.1.1| :question: optional         | optional(test) 1.65 |
| Ubuntu 16.04     | :heavy_check_mark: v1.0.2| :question: req.by openssl   | optional(test)      |
| Centos 7         | :heavy_check_mark: v1.0.2| :question: req.by openssl   | otpional(test) 1.53 |
| Centos 8         | :heavy_check_mark: compile from source 1.1.1d     |    | otpional(test) 1.61 |
| Ubuntu 18.04-cross compile for Windows|recommended 1.0.2h<sup>1</sup>|    | optional(test) 1.71 |
| Windows MSVC 2017| optional<sup>1</sup>     |                             | optional(test) 1.71 |
| Windows MinGW    | optional<sup>1</sup>     |                             | optional(test) 1.71 |
## License generator executable `lcc` dependencies
| Operating System               | Openssl      | Zlib                       | Boost<sup>3</sup>       |
|--------------------------------|:------------:|:--------------------------:|:-----------------------:|
| Ubuntu 18.04        |:heavy_check_mark: v1.1.1|:question: if req.by openssl|:heavy_check_mark: 1.65  |
| Ubuntu 16.04        |:heavy_check_mark: v1.0.2|:question: if req.by openssl|:heavy_check_mark:       |
| Centos 7            |:heavy_check_mark: v1.0.2|:question: if req.by openssl| :heavy_check_mark: 1.53 |
| Centos 8            | :heavy_check_mark: compile from source 1.1.1d|       | :heavy_check_mark: 1.61 |
| Ubuntu 18.04-cross compile for Win|:heavy_check_mark:|                     | :heavy_check_mark: 1.71 |
| Windows MSVC 2017/2019| otpional<sup>1</sup>|                              | :heavy_check_mark: 1.71 |
| Windows MinGW         | optional<sup>1</sup>|                              | :heavy_check_mark: 1.71 |
Notes:
<sup>1</sup> If you plan to run the windows executable under Linux with wine it is necessary to use OpenSSL.
<sup>2</sup> Boost components required to run tests `unit_test_framework`,`system`,`filesystem`
<sup>3</sup> Boost is mandadory dependency of lcc executable. Components: `unit_test_framework`,`system`,`filesystem`
doc/Development-And-Usage-Workflow.md
New file
@@ -0,0 +1,35 @@
Below a description of the planned development and usage process. Comments and progress are reported on [issue #42](https://github.com/open-license-manager/open-license-manager/issues/42)
![dev-build-process](https://user-images.githubusercontent.com/1121667/64474031-e5afff80-d1a0-11e9-9819-f3b7e4e2126d.png)
## Build release
Open License Manager developers build a new release merging code to the master branch. Implementing [GitFlow](https://nvie.com/posts/a-successful-git-branching-model) this should happen only when a new release is ready to be deployed.
Travis CI builds the release for the supported environments and deploys it to GitHub release system.
### Binary release contents
Binary release contains:
 * open-license-manager executable (merge of the actual `license_generator` executable and `bootstrap`).
 * source code of the unconfigured library.
 * source code of (part of) the tests.
### Test (1)
Contextually to the previous step Travis CI carries out all the tests.
A special attention is about how carry out functional tests.
In this phase the library is configured, compiled (only for the tests sake), linked with a mock executable and tested together with the license generator.
## Initialize library
In this phase the signing keys are generated by open-license-manager executable (`olm`), and optionally the source code of the library may be modified or obfuscated.
### Test (2)
## Integrate into the product
The source code of the library can and should be manually altered to prevent hackers to find a single cracking mechanism for all the products that integrate the library.
## deliver the product to the client
Compiled product is delivered to the client.
 * If we want to link the execution to a specific hardware we need to send the product to the client without a license (or a demo executable, with the sole intent to generate the machine identifier).
 * If we just want to send a demo product with an expiry date we prepare a license without the machine identifier.
# Build process
From the process described above, (strange to say) the license generator (`olm`) configures itself as a build
dependency of the licensing library, thus it needs to be built first.
doc/Development-Environment-Setup.md
New file
@@ -0,0 +1,36 @@
This guide is just an help in case you haven't decided your development environment or your development environment match ours.
We don't have any specific dependency on development tools, you can choose the one you prefer. Though if you want to contribute
you're required to  format the code using `clang-format` before you submit the pull request.
We use Eclipse CDT to develop the software under Linux (Ubuntu) and Visual Studio under windows.
First of all download the source code and compile it from command line as described in [build the library](build-the-library)
## Eclipse
Eclipse CDT has recently improved the support for Cmake projects, be sure to install the latest CDT version from the
marketplace, with cmake support. Remember to install `ninja` build system for integration with cmake.
Select New > C++ project > "Empty or existing cmake project" (then point it to the location where you downloaded
the source code).
If you want to submit contributions you must install plugins that are able to use clang-format to format the code,
or manually format the code before you submit. We suggest [CppStyle](http://www.cppstyle.com/) (available also from marketplace)
It is also necessary to install clang-format and cpplint.py (from google).
### Ubuntu setup
```
sudo curl -L "https://github.com/google/styleguide/blob/gh-pages/cpplint/cpplint.py" -o /usr/bin/cpplint.py
sudo chmod a+x /usr/local/bin/cpplint.py
sudo apt-get install clang-format ninja-build
```
Go to Window > Preferences > C++ > CppStyle and configure the path for `cpplint.py` you just downloaded.
Go to Project > Properties > C++ General > Formatter and select CppStyle as code formatter.
We also suggest to install a pre-commit hook that helps keeping the code well formatted.
```
./scripts/git-pre-commit-hook install
```
doc/DoxygenLayout.xml
New file
@@ -0,0 +1,205 @@
<doxygenlayout version="1.0">
    <!-- Generated by doxygen 1.8.13 -->
    <!-- Navigation index tabs for HTML output -->
    <navindex>
        <tab type="mainpage" visible="yes" title="" />
        <tab type="modules" visible="yes" title="" intro="" />
        <tab type="examples" visible="yes" title="" intro="" />
        <tab type="pages" visible="no" title="" intro="" />
        <tab type="usergroup" title="Usage">
            <tab type="user" url="http://www.google.com" title="Google" />
            <tab type="user" url="@ref mypage" title="My Page" />
        </tab>
        <tab type="usergroup" title="Development">
            <tab type="user" url="http://www.google.com" title="Google" />
            <tab type="user" url="@ref api" title="module api" />
        </tab>
        <tab type="usergroup" title="Internals">
            <tab type="namespaces" visible="yes" title="">
                <tab type="namespacelist" visible="yes" title="" intro="" />
                <tab type="namespacemembers" visible="yes" title="" intro="" />
            </tab>
            <tab type="classes" visible="yes" title="">
                <tab type="classlist" visible="yes" title="" intro="" />
                <tab type="classindex" visible="$ALPHABETICAL_INDEX" title="" />
                <tab type="hierarchy" visible="yes" title="" intro="" />
                <tab type="classmembers" visible="yes" title="" intro="" />
            </tab>
            <tab type="files" visible="yes" title="">
                <tab type="filelist" visible="yes" title="" intro="" />
                <tab type="globals" visible="yes" title="" intro="" />
            </tab>
        </tab>
    </navindex>
    <!-- Layout definition for a class page -->
    <class>
        <briefdescription visible="yes" />
        <includes visible="$SHOW_INCLUDE_FILES" />
        <inheritancegraph visible="$CLASS_GRAPH" />
        <collaborationgraph visible="$COLLABORATION_GRAPH" />
        <memberdecl>
            <nestedclasses visible="yes" title="" />
            <publictypes title="" />
            <services title="" />
            <interfaces title="" />
            <publicslots title="" />
            <signals title="" />
            <publicmethods title="" />
            <publicstaticmethods title="" />
            <publicattributes title="" />
            <publicstaticattributes title="" />
            <protectedtypes title="" />
            <protectedslots title="" />
            <protectedmethods title="" />
            <protectedstaticmethods title="" />
            <protectedattributes title="" />
            <protectedstaticattributes title="" />
            <packagetypes title="" />
            <packagemethods title="" />
            <packagestaticmethods title="" />
            <packageattributes title="" />
            <packagestaticattributes title="" />
            <properties title="" />
            <events title="" />
            <privatetypes title="" />
            <privateslots title="" />
            <privatemethods title="" />
            <privatestaticmethods title="" />
            <privateattributes title="" />
            <privatestaticattributes title="" />
            <friends title="" />
            <related title="" subtitle="" />
            <membergroups visible="yes" />
        </memberdecl>
        <detaileddescription title="" />
        <memberdef>
            <inlineclasses title="" />
            <typedefs title="" />
            <enums title="" />
            <services title="" />
            <interfaces title="" />
            <constructors title="" />
            <functions title="" />
            <related title="" />
            <variables title="" />
            <properties title="" />
            <events title="" />
        </memberdef>
        <allmemberslink visible="yes" />
        <usedfiles visible="$SHOW_USED_FILES" />
        <authorsection visible="yes" />
    </class>
    <!-- Layout definition for a namespace page -->
    <namespace>
        <briefdescription visible="yes" />
        <memberdecl>
            <nestednamespaces visible="yes" title="" />
            <constantgroups visible="yes" title="" />
            <classes visible="yes" title="" />
            <typedefs title="" />
            <enums title="" />
            <functions title="" />
            <variables title="" />
            <membergroups visible="yes" />
        </memberdecl>
        <detaileddescription title="" />
        <memberdef>
            <inlineclasses title="" />
            <typedefs title="" />
            <enums title="" />
            <functions title="" />
            <variables title="" />
        </memberdef>
        <authorsection visible="yes" />
    </namespace>
    <!-- Layout definition for a file page -->
    <file>
        <briefdescription visible="yes" />
        <includes visible="$SHOW_INCLUDE_FILES" />
        <includegraph visible="$INCLUDE_GRAPH" />
        <includedbygraph visible="$INCLUDED_BY_GRAPH" />
        <sourcelink visible="yes" />
        <memberdecl>
            <classes visible="yes" title="" />
            <namespaces visible="yes" title="" />
            <constantgroups visible="yes" title="" />
            <defines title="" />
            <typedefs title="" />
            <enums title="" />
            <functions title="" />
            <variables title="" />
            <membergroups visible="yes" />
        </memberdecl>
        <detaileddescription title="" />
        <memberdef>
            <inlineclasses title="" />
            <defines title="" />
            <typedefs title="" />
            <enums title="" />
            <functions title="" />
            <variables title="" />
        </memberdef>
        <authorsection />
    </file>
    <!-- Layout definition for a group page -->
    <group>
        <briefdescription visible="yes" />
        <groupgraph visible="$GROUP_GRAPHS" />
        <memberdecl>
            <nestedgroups visible="yes" title="" />
            <dirs visible="yes" title="" />
            <files visible="yes" title="" />
            <namespaces visible="yes" title="" />
            <classes visible="yes" title="" />
            <defines title="" />
            <typedefs title="" />
            <enums title="" />
            <enumvalues title="" />
            <functions title="" />
            <variables title="" />
            <signals title="" />
            <publicslots title="" />
            <protectedslots title="" />
            <privateslots title="" />
            <events title="" />
            <properties title="" />
            <friends title="" />
            <membergroups visible="yes" />
        </memberdecl>
        <detaileddescription title="" />
        <memberdef>
            <pagedocs />
            <inlineclasses title="" />
            <defines title="" />
            <typedefs title="" />
            <enums title="" />
            <enumvalues title="" />
            <functions title="" />
            <variables title="" />
            <signals title="" />
            <publicslots title="" />
            <protectedslots title="" />
            <privateslots title="" />
            <events title="" />
            <properties title="" />
            <friends title="" />
        </memberdef>
        <authorsection visible="yes" />
    </group>
    <!-- Layout definition for a directory page -->
    <directory>
        <briefdescription visible="yes" />
        <directorygraph visible="yes" />
        <memberdecl>
            <dirs visible="yes" />
            <files visible="yes" />
        </memberdecl>
        <detaileddescription title="" />
    </directory>
</doxygenlayout>
doc/Hardware-identifiers.md
New file
@@ -0,0 +1,25 @@
## Use cases
Linking the execution of a software to a. With the recent coming of virtualized environments the installation of software directly on the machine has been less and less.
OpenLicenseManager guess the environment where the user is trying to launch the software, and reports it to the software publisher when he is generating a license in a way that he can decide how to limit the usage on per license basis.
### Executing in a physical hardware
This is straightforward case. If the software is executing on a physical hardware it is possible to identify the hardware by various parameters (cpu type/memory/disk label/mac address)
### Execution in a virtual machine
Generating a pc identifier on a virtual machine doesn't make much sense, since the vm can be copied as a whole elsewhere
and there are few ways to detect this without using an external license server.
*   Usually when the machine is copied the MAC address is changed. But sometimes it changes on its own. Software publishers may want to use this as a last resort to prevent the vm for being cloned. It has to be verified case by case.
*   Software editors may want to prevent people from extracting the software from the VM. They can use an hidden registry key or a specific file in a location outside the installation directory to verify the software is distributed in the original VM. Or they can link the execution to a specific kind of virtualization (this is supported by OpenLicenseManager).
### Executing in a container
Depending on how containers are used having hardware identifiers may make sense or no sense at all. For instance if containers are used
to avoid to pollute the external distribution it makes perfect sense to have an hardware identifier, if users are running dockers in a kubernetes cluster it makes no sense at all.
## Identifier Generation
Below the identifier generation workflow.
If the licensed software specify the parameter
If the licensed software uses `STRATEGY_DEFAULT` and the strategy generates an unstable identifier it is possible to ask the user to set t
doc/Home.md
New file
@@ -0,0 +1 @@
Welcome to the open-license-manager wiki!
doc/Integration.md
New file
@@ -0,0 +1,33 @@
This short guide explain how to integrate `open-license-manager` in your application.
Working examples are provided in the [examples](https://github.com/open-license-manager/examples) project.
## Public api
The file containing the public api is `include/licensecc/licensecc.h`. Functions in there are considered stable.
### Print a pc identifier
```CPP
bool identify_pc(IDENTIFICATION_STRATEGY pc_id_method, char* identifier_out, size_t bufSize);
```
### Verify a license
```CPP
/**
 * This method is used to request the use of one license for a product.
 * In case of local license it's used to check if the product is licensed.
 *
 * @return LICENSE_OK(0) if successful. Other values if there are errors.
 * @param productName[in]
 *             a vendor defined string containing the name of the product we want to request.
 * @param licenseLocation[in] otpional, can be NULL.
 *                     licenseLocation, either the name of the file
 *                                 or the name of the environment variable should be !='\0'
 * @param license[out] optional, can be NULL, if set it will return extra informations about the license.
 */
EVENT_TYPE acquire_license(const CallerInformations* callerInformation, const LicenseLocation* licenseLocation,
                           LicenseInfo* license_out);
```
doc/Issue-licenses.md
New file
@@ -0,0 +1,42 @@
The easiest way to issue licenses is to enter the project library and create the following project structure:
The projects folder can be anyware. We created one in `open-license-manager/projects` for your convenience (and for testing purposes). A default project<sup>1</sup> named `DEFAULT` has been created for you when you configured the project with cmake.
You can re-configure the project with the `LCC_PROJECT_NAME` cmake variable to create a new project.
```
projects
└── DEFAULT       #(your project name)
    ├── include
    │   └── licensecc
    │       └── DEFAULT
    │           ├── licensecc_properties.h
    │           └── public_key.h
    ├── licenses
    │   └── test.lic
    └── private_key.rsa
```
Let's suppose the `lcc` executable is in your path. If not you should find it in your build tree, or wherever you installed the library.
The lines below will create a perpetual unlimited license for your software:
```
cd projects/DEFAULT #(or whatever your project name is)
lcc license issue -o licenses/{license-file-name}.lic
```
A good way to start exploring available options is the command:
`lcc license issue --help`
| Parameter        | Description                                                                                  |
|------------------|----------------------------------------------------------------------------------------------|
|base64,b          | the license is encoded for inclusion in environment variables                                |
|valid-from        | Specify the start of the validity for this license. Format YYYYMMDD. If not specified defaults to today. |
|valid-to          | The expire date for this license. Format YYYYMMDD. If not specified the license won't expire |
|client-signature  | The signature of the pc that requires the license. It should be in the format XXXX-XXXX-XXXX-XXXX. If not specified the license won't be linked to a specific pc. |
|output-file-name  | License output file path.                                                                    |
|extra-data        | Application specific data. They'll be returned when calling the `acquire_license` method   |
Note:
<sup>1</sup> a project is a container for the customizations of open-license-manager. In special way its keys and build parameters. The name should reflect the name of the software you want to add a license to. The project name appears in the license file.
doc/License-retrieval.md
New file
@@ -0,0 +1,9 @@
# License retrieval
Open License Manager, when integrated into a licensed software can automatically find its license file (or multiple license files) based on:
 * An environment variable:
     * Placing the full path of the license file in the environment variable `LICENSE_LOCATION` the library will look for it. Multiple license files can be separated by ';'
     * Placing the full license content in the environment `LICENSE_DATA` will let the library load it.
 * Placing the license in the same folder of the licensed executable will make the software find its own license. The filename must be the same of the executable, the extension `.lic`. eg. if you're licensing `my_awesome_software.exe` the license file must be in the same folder and must be called `my_awesome_software.lic`.
 * The calling application can specify the location (or the complete license data) using `LicenseLocation` structure.
 * Implementing and registering the interface `LicenseLocator` software authors can easily define their own strategy.
doc/QA.md
New file
@@ -0,0 +1,20 @@
## Development
Development related questions.
### Why do i have to build from source? Can you release a pre-compiled version of the library?
No we can't release pre-compiled binaries of the library.
In the early phases of the build the library is customized: among other things a private and public key pair is generated and the public key is included into the compiled code, in a way that every project gets its own signature keys. See [Development and Usage](development-and-usage-workflow)
## Project status
### Project general context (is the project still maintained?)
This project started as a week-end project in 2014, donated and almost forgotten. This doesn't necessarily meant bad. It was "functional". Thanks to the effort of some people that are using it, and to the help of many of you it has been kept up to date (2019). Recently there has been a long waited enhancement regarding license management procedures.
### Is it production ready?
Let's be honest. It's still in a very alhpa ![experimental](http://badges.github.io/stability-badges/dist/experimental.svg) stage. This means it's usable with some effort. Some companies are actively using it in production to issue demo licenses and few production licenses. If you plan to use it in a scenario where you need to issue hundreds of licenses plan some maintaining effort.
### Challenges ?
The most challenging aspect is the number of environment/libraries we must work with. We've recently set up automated tests on Travis CI to help contributors to verify their code automatically in conditions they've not thought about.
### Open License Manager and "the community"
Open License Manager has a very strange relationship with "the community", its aim is to protect proprietary software from copy and unintended usage. But out there, there are people that think that all the software should be licensed as AGPL... Thus StackOverflow and its fellow sites turned out to be not a collaborative place to talk about software protection. Remember to choose your questions carefully. :speak_no_evil:
doc/features.md
New file
@@ -0,0 +1,90 @@
# General features:
| Feature                              | Implementation status |
|--------------------------------------|:---------------------:|
| Trial license with expiry date       | :heavy_check_mark:    |
| Link software to "physical" hardware | :heavy_check_mark:    |
| Virtual machine detection            | In progress           |
| Easy license retrieval               | :heavy_check_mark:    |
| Manage licenses                      | Planned               |
| Easy Customizable limits             | Planned               |
| Java/C# bindings                     | Planned               |
| Floating/network licenses            | Planned               |
## Issue a "demo" license with only expiry date.
Software editors often want to release a trial license that is not linked to a specified machine, but just limit the usage in time or to some other feature (number of cpu, process memory).
See [execution limits](Implemented/Planned execution limits) section.
## Licenses linked to "physical" hardware id
Link the software to a physical hardware (a pc). In this scenario the software editor wants his software to be executed on a specific piece of hardware. We suppose the operating system is installed "bare to metal" and we're able to calculate an identifier of that hardware. This isn't always true for virtualized environments for which alternative strategies must be planned [eg. floating licenses (not yet implemented)]. See the section on [hardware identifiers](hardware-identifiers) for a detailed discussion of the use cases.
Depending on the situation there are are different kinds of hardware id that can be used. See [execution limits](Implemented/Planned execution limits) section.
## Virtual machine detection
Detect if the software is running in a virtualized environment and (optionally) forbid the execution. This is useful if software editors want to prevent the execution in virtual machines (lxc/dockers...) and be able to compute a meaningful hardware id.
Another use case is the software is to be used only in a specific class of virtualized environments. For instance it was initially packaged as a docker image, the software editor don't want it to be "extracted" and placed elsewhere.
## License retrieval
Open License Manager, when integrated into a licensed software will find its license file based on many different strategies.
It can handle multiple licenses at the same time. See the wiki page about [license retrieval](license-retrieval) for details.
## Licensed software features (partially implemented)
A licensed software may be composed by many features (functions) each one activable independently. Licensing system tells the licensed software which features are enabled, and which features are disabled.
## License Management (planned)
It is necessary to keep track of the licenses that have been issued, of the clients, and their pc identifier.
A web application is planned that will provide integration with payment systems to allow licensed software customers to buy licenses.
## Customizable execution limits (planned)
It should be easy to add and implement your own "execution limit": that is require/forbid some feature in the application execution environment.
## Java/C# bindings (planned)
The application should support bindings to java language. The library has to be compiled as a .dll for use with JNI or C# integration layer. This is especially challenging on the api side.
Since the api is public, and the library is packaged as a separate .dll/.so everybody can compile a version of it always returning LICENSE_OK easily defeating the license schema.
## Floating licenses (planned)
Limit the execution of the licensed software to a certain number of instances per license.
This can be done in multiple ways:
    * without a central server, using broadcast or scanning the local network to find peers.
    * with a central server installed in the client's network.
    * with a central server on internet.
Status of this implementation is tracked in [issue #4](https://github.com/open-license-manager/open-license-manager/issues/4)
# Implemented/Planned execution limits
Open License Manager can limit execution of licensed software based on some criteria, called "execution limits".
Depending on the execution environment some criteria may not be applicable:
| | Windows BareToMetal | Linux BareToMetal | Linux container (lxc/docker) |Virtual Machine |
|----------------|:------------------:|:------------------:|:------------------:|:------------------:|
| date           | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| disk label     | :heavy_check_mark: | :heavy_check_mark: | :x:<sup>1</sup>    | :heavy_check_mark: |
| disk id        | :heavy_check_mark: | :heavy_check_mark: | :x:<sup>1</sup>    | :heavy_check_mark: |
| ip address     | :heavy_check_mark: | :heavy_check_mark: | :interrobang:      | :heavy_check_mark: |
| mac address    | :heavy_check_mark: | :heavy_check_mark: | :interrobang:      | :heavy_check_mark: |
| cpu number     | Planned            | Planned            | Planned            | Planned            |
| process memory | Planned            | Planned            | Planned            | Planned            |
| machine memory | Planned            | Planned            | Planned            | Planned            |
| virtualization type | Planned       | Planned            | Planned            | Planned            |
| concurrent execution | Planned | Planned | Planned | Planned |
| licensed sw version | Planned       | Planned            | Planned            | Planned            |
## Date
This is the most common limit set on a license, allow the software to expire after the defined date.
## Disk label/Disk id
It is possible to limit the execution to a computer that has a certain disk connected.
This kind of limitation doesn't make sense in linux containerized environments.
## Cpu Number/Machine memory
Allow to restrict the execution only to a machine with the specified amount of cpu or memory or less. This is useful in virtualized environments, to create a licensed software demo version with limited performaces or with limited scalability.
Status of this implementation is tracked in [issue #4](https://github.com/open-license-manager/open-license-manager/issues/4)
## Virtualization type
Allow the execution of the licensed software only on some type of hardware or virtualized environment eg. only bare to metal, only in virtual machine, only in docker.
## Licensed software version
A licensed software may declare a version (eg 1.0.0). A license may span multiple releases of the software e.g. allow version 1.1.1 but not 2.0.0.
#
doc/pc-id-selection.png
doc/structure.dox
New file
@@ -0,0 +1,22 @@
/*! \page A simple manual
Some general info.
This manual is divided in the following sections:
- \subpage intro
- \subpage advanced "Advanced usage"
*/
//-----------------------------------------------------------
/*! \page intro Introduction
This page introduces the user to the topic.
Now you can proceed to the \ref advanced "advanced section".
*/
//-----------------------------------------------------------
/*! \page advanced Advanced Usage
This page is for advanced users.
Make sure you have first read \ref intro "the introduction".
*/
include/licensecc/datatypes.h
@@ -1,3 +1,6 @@
/** \addtogroup api
 * @{
 */
#ifndef DATATYPES_H_
#define DATATYPES_H_
@@ -137,3 +140,6 @@
#endif
#endif
/**
 * @}
 */
include/licensecc/licensecc.h
@@ -1,3 +1,6 @@
/** \addtogroup api
 * @{
 */
#ifndef LICENSEPP_H_
#define LICENSEPP_H_
@@ -55,3 +58,6 @@
#endif
#endif
/**
 * @}
 */