aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md190
1 files changed, 91 insertions, 99 deletions
diff --git a/README.md b/README.md
index c00bbd7..704015f 100644
--- a/README.md
+++ b/README.md
@@ -1,102 +1,94 @@
// Copyright (C) 2022 The Qt Company Ltd.
//
-Qt Licenser daemon
-
-- Tested in Ubuntu 16.04, Mint 20.3, Macbook Pro M1 (Mac from console only, not as a daemon)
-- This README does not include Windows version, because it's not supported yet
-
-Prerequisites:
- cmake, curl, build-essentials
-
-To build, run the build script: (from project root)
-
- ./build.sh
-
-
----------- Install it as a service: ----------
-
-cd to deploy/ directory (created by build.sh):
- cd deploy
-
-At this point, you might want to edit the licd.ini file, where most important is the License Server address to be able to connect to it. If you do this later, you need to edit /opt/licd.ini as root. See licd.ini in deploy directory.
-
-Run installation script as root:
- sudo ./installer.sh
-
-(will now start automatically after reboot, too)
-
-To get MOC wrapper working, too, please note: Installation script does not know your Qt installation location (Something like /home/user/Qt/6.3.1/gcc_64/libexec/). That's why you need to set MOC wrapper working by doing:
- 1. cd [your Qt framework install dir]
- 2. mv moc orig_moc <--- Note: has to be exactly 'orig_moc'
- 3. ln -s /opt/licd/mocwrapper moc
- 4. Try it by building any Qt-enabled app wit any IDE or from command line
-
-In case youre using Qt5, you need to enable legacy support for its qmake licensing system by replacing licheck binary with the provided one:
- (Still in the Qt installation location):
- 1. cp licheck licheck.bak <--- This is just to back up the original, you can name it freely
- 2. ln -s /opt/licd/licheck licheck
-
-
-Check if the service running:
- sudo systemctl status licd
-
-To stop it:
- sudo systemctl stop licd
-
-to disable it:
- sudo systemctl disable licd
-
-To view logs:
- journalctl -u licd -n 100
- (Displays last 100 lines. If -n is not given, it will show all the logs)
-
-To run manually (easier to see what happens while testing, as logs will print out directly in the console):
- - sudo systemctl stop licd <--- Don't forget to stop all other licd instances as well
- - cd <project root>/deploy
- - OR:
- - cd /opt/licd <-- Settings will always be taken from /opt/licd/licd.ini
- - sudo ./licd <--- 'sudo' because licd needs to have write access to its directory
-
-To stop it (manually):
- killall licd <-- Not that this does not work if running as a system service
-
-To completely uninstall, run 'uninstaller.sh' from deploy directory (as root, of course)
- In addition, you need to remove symlinks from Qt installation dir and restore original binaries there:
- - cd <your Qt installation dir>
- - mv orig_moc moc
- - mv licheck.bak licheck <-- or whatever you named your backup
-
-
----------- Test it: ----------
-
-Start License server on some Windows machine
-
-- If you didn't edit settings after building: Check the ip address of Win box, then copy it to the line stating 'server_addr' in the settings file (licd.ini). This will be user as the default site license server address. After installation, it must be edited (as root) in /opt/licd/licd.ini
-
-Note that user settings file is not there yet. If you want, you can create it now by running MOC from your Qt installation dir:
- - <your Qt installation dir>/moc <--- Use the absolute path here!!!
-MOC saves the settings file in <your home dir>/.local/share/Qt/qtlicenseservice.ini and advises you to review/edit it with any text editor.
-
-After getting those settings edited, you can try to compile any Qt-enabled app, and it should go through. If you did't start MOC "manually" in the previous step thus the settings file is missing, MOC will give you the similar response now, asking you to review and edit the settings. Build again when done with it.
-
-- To test long term licenses, say:
- qtlongterm <add/remove> -u <username> -i <license id> -d <daemon address> [-l <license server address>]
- - And note thet the license server address (-l) is optional
- - For example, adding a longterm reservation:
- qtlongterm add -u sami -i 12345678 -d localhost:60000
- - To release it, use 'remove intead of 'add'
- - To get help:
- qtlongterm --help
-
-- Test MOC and plugin interfaces without actually using MOC or Qt Creator (plugin):
-
-Open telnet (you may need to install it first: sudo apt install telnet)
- telnet localhost 60000 (in linux)
-
-After connecting, issue a command like:
- license -u foobar -a QtCreator -v 6.3 -i 123456
- Where: -u = username, -a = app in use, -v app version and -i Qt license ID
- Optionally, you can also give -l switch followed by license server address, like: -l 10.0.10.234:8080
-
-Reply is then info txt about having/not having a valid license, or "Bad request" for malformed message.
+Qt Licenser daemon for Windows and Linux
+
+Daemon is a gateway between Qt License Server and Qt developer tools (i.e. Qt Creator and Qt Design Studio).
+It also keeps users developing Qt apps without Qt tools under valid license by wrapping the MOC (Meta Object Compiler)
+into new one which requests license like other tools so.
+
+Daemon talks to the server via HTTP, with data moving back and worth in JSON format usin HTTP POST method. Clients request for their licenses by connectiong to daemons's TCP/IP server, using plain text.
+
+For installation/running, see each system's respective INSTALL_xxx.txt files.
+
+---------- The user settings file ---------
+
+The settings file 'qtlicenseservice.ini' is created automatically in user's Qt home folder which usually is in:
+Linux: <your home dir>/.local/share/Qt/qtlicenseservice.ini
+Windows: <your home dir>\AppData\Roaming\Qt\qtlicenseservice.ini
+
+To create it from scratch, run either mocwrapper or qtlicensetool once (qtlicensetool needs some parameter - you can use -S). You'll be informed about the creation and location of the settings file. The defaults most probably are not correct, so edit it to meet your configuration. The most critical settings are:
+ - license_id Your license id, you definitely must edit this
+ - licd_addr Address to the machine where License Service (daemon) is running. In many cases, localhost is correct.
+ - licd_port Daemon port - default is 60000. Check from daemon settings file or ask the admin
+
+ # MOC-wrapper/moc
+From now on, moc will take the [default] section in use if there's no installation-specific section available. New section names will be determined by current Qt framework installation path. Thats why its mandatory to call moc with absolute path on the second run - easisest way to do that is to just start building some Qt app, as the build procedure always calls moc with absolute path.
+You'll be informed about the creation of the new section under which the defaults are copied at this point. In case you have multiple instances/versions of the Qt framework, you'll have invividual sections for each of them.
+
+ # qtlicensetool
+qtlicensetool ALWAYS reads its settings from the [default] section, no matter where it's being run from.
+
+
+---------- Setup and Usage ----------
+
+At first, start Qt License Server on some Windows machine
+
+- If you didn't edit daemon settings after building: Check the ip address from Win box where the License Server is running, then copy it to the line stating 'server_addr' in the settings file (licd.ini). This will be user as the default site license server address. After installation, it must be edited:
+ Linux: (as root) in /opt/licd/licd.ini
+ Widows (as admin) in C:\Program Files/licd/licd.ini
+Start the daemon, as described in respective Linux/Windows INSTALL file.
+
+- You also can 'manually' start licd in no-daemon mode (as normal CLI app):
+ - First make sure daemon is not running
+ - from the command line, cd to the directory where daemon is installed, then give a command:
+ > ./licd --nodaemon (Linux/Mac)
+ > licd.exe --nodaemon (Windows)
+ - You now can see immediately what happens in there. Stop like any other app with Ctrl-C
+ - Note that where ever you start licd, it will always read settings from installation folder.
+ # MOC-wrapper
+ If the setup is made correct (moc binary changed to the link pointing to mocwrapper), MOC license checks should happen in backround without any user actions, each time a build is being done.
+
+ You can ask mocwrapper version with:
+ > ./mocwrapper --version (mocwrapper.exe in Windows)
+
+# qtlicensetool
+ Old 'qtlongterm' has now been replaced bu a new, more generic tool to handle more Qt licensing-related checks and actions. I'ts still a CLI tool, and has a format:
+ qtlicensetool <Action> [params]
+ Where 'Action' is:
+ -h or --help : Prints out the tool's help text
+ -v or --version : Prints out qtlicensetool version
+ -S or --serverversion : Prints out License Server version
+ -D or --daemonversion : Prints out the License Service (daemon) version
+ -L or --longterm : Longterm reservation (add or remove)
+ For longterm usage ('-L' or '--longterm'), you must tell which operation to do:
+ add|remove <--- Either one needs to be there
+ Optionat parameters which override [default| section settings:
+ -d = Full license daemon address and port separated by ':'
+ -u = Your Qt license username
+ -i = Your Qt license ID number (must be an int)
+ -l = License server address and port separated by ':'
+ Example:
+ > qtlicensetool --longterm add : Make a long-term license reservation
+ > qtlicensetool -L add -i 462412 : Same as above, but using different license ID
+ > qtlicensetool --daemonversion : Prints out a daemon version number
+
+# To test MOC and plugin interfaces without actually using MOC or Qt Creator (plugin):
+ Use any TCP/IP-enabled app to connect to localhost's port 60000 (or whichever is stated in licd.ini). For example, with telnet:
+ telnet localhost 60000
+
+ After connecting, issue a command like:
+ license -u foobar -a QtCreator -v 6.3 -i 123456
+ Where: -u = username, -a = app in use, -v app version and -i Qt license ID
+ Optionally, you can also give -l switch followed by license server address, like: -l 10.0.10.234:8080
+
+ Reply is then info txt about having/not having a valid license, or "Bad request" for malformed message.
+
+---------- Version info ----------
+
+From each component included, you can ask their version using --version switch as follows:
+ [app name] --version <--- [app name].exe in Windows, of course
+ - where [app name] can be one of: 'licd', 'qtlicensetool', 'moc' (or 'mocwrapper')
+ - Note! By default, 'licd' and 'mocwrapper' are not in $PATH by default, so you must call them with their absolute path.
+ In Windows case, you can add "C:\Program Files\licd\" in environment PATH to ease up calling 'qtlongterm'
+In Linux, the binaries are in /opt/licd after installation, and "C:\Program Files\licd\" in Windows.