|
|
| (6 intermediate revisions by 2 users not shown) |
| Line 1: |
Line 1: |
| | {{Note/note|This is page is about development version.|If you are looking for information about stable release, follow to [[Platform_Team/sugar-stats/0.1|separate page]].}} |
| | |
| == Summary == | | == Summary == |
|
| |
|
| Line 8: |
Line 10: |
|
| |
|
| More (0.86+) Sugar versions might be added on demand. | | More (0.86+) Sugar versions might be added on demand. |
|
| |
| == Stats server ==
| |
|
| |
| This project also contains a server, which is based on [[Platform_Team/Active_Document|active-document]] and [[Platform_Team/RESTful_Document|restful-document]], and is designed to be a part of the [[Platform_Team/Sugar_Network|Sugar Network]] and [[Platform_Team/Server_Kit/sugar-server|sugar-server]] implementations.
| |
|
| |
| A standalone server might be launched using the {{Code|sugar-stats-server}} command from project sources. The easiest way is using the binary package [http://download.sugarlabs.org/packages/SweetsDistribution:/Factory/ sugar-stats-server] from [[Sweets Distribution]]. The package contains these components:
| |
|
| |
| * {{Code|sugar-stats-server}} command,
| |
| * {{Code|/etc/init.d/sugar-stats-server}} daemon.
| |
|
| |
| For stats transferring from clients, it is useful to use secure, SSL connections. The server configuration needs to be tweaked (and the [[Sugar_Server_Kit/sugar-client#Usage statistics|client]] should use the same certificate):
| |
|
| |
| * {{Code|keyfile}}, path to server's private key,
| |
| * {{Code|certificate}}, path to server's certificate file.
| |
|
| |
| Server will authenticate clients using SSH keys generated on the client side by Sugar Shell. To let the server check client signatures, OpenSSH-5.6+ should be installed on the server side. For versions lower than 5.6, authentication needs to be disabled using the {{Code|trust-users}} parameter.
| |
|
| |
| === Configuration ===
| |
|
| |
| Run the following command to get the current configuration with comments:
| |
|
| |
| sugar-stats-server config
| |
|
| |
| To tweak current configuration, change/create {{Code|/etc/sugar-stats-server.conf}} configuration file.
| |
|
| |
| The following important parameters need to be set before using the server. (When sugar-stats-server is installed from packages, they are initialized to meaningful values.):
| |
|
| |
| * {{Code|stats/stats-root <nowiki>=</nowiki> /var/lib/sugar-network/rrd}}<br>Path to the root directory for placing stats;
| |
| * {{Code|active-document/data-root <nowiki>=</nowiki> /var/lib/sugar-network/users}}<br>Path to the root directory for placing users' metadata;
| |
|
| |
| == Implementation notes ==
| |
|
| |
| * Calculating ''network.school'' stat.
| |
| : Detecting if client host is in school network or not is based on resolving {{Code|am.i.at.school}} hostname.
| |
|
| |
|
| == Getting the code == | | == Getting the code == |
|
| |
|
| * Gitorious [http://git.sugarlabs.org/shell/stats sources] repository. | | * Gitorious [https://web.archive.org/web/20130725065424/git.sugarlabs.org/desktop/stats sources] repository. |
| * Binary [http://download.sugarlabs.org/packages/SweetsDistribution:/Factory/ packages] from [[Sweets Distribution]]. | | * Binary [http://download.sugarlabs.org/packages/SweetsDistribution:/Factory/ packages] from [[Sweets Distribution]]. |
|
| |
|
| In use, the library does not require any building routines, just provide the full path to the {{Code|active_document/}} subdirectory via the {{Code|PYTHONPATH}} environment variable. | | In use, the library does not require any building routines, just provide the full path to the {{Code|active_document/}} subdirectory via the {{Code|PYTHONPATH}} environment variable. |
|
| |
|
| See the [http://git.sugarlabs.org/shell/stats/trees/master/examples examples/] subdirectory in the sources tree for usage examples. | | See the [http://git.sugarlabs.org/desktop/stats/trees/master/examples examples/] subdirectory in the sources tree for usage examples. |
|
| |
|
| ===Library requirements=== | | === Library requirements === |
|
| |
|
| * RRDtool [http://oss.oetiker.ch/rrdtool/prog/rrdpython.en.html python binding]. | | * RRDtool [http://oss.oetiker.ch/rrdtool/prog/rrdpython.en.html python binding]. |
| Line 62: |
Line 30: |
| == Getting involved == | | == Getting involved == |
|
| |
|
| * [http://bugs.sugarlabs.org/newticket?component=sugar-server-kit Report] on bugs. | | * [https://web.archive.org/web/20130720223915/https://bugs.sugarlabs.org/newticket?component=sugar-server-kit Report] on bugs. |
| * Read the [http://git.sugarlabs.org/shell/stats/blobs/master/HACKING HACKING] file to know how to contribute with code. | | * Read the [https://web.archive.org/web/20130728113129/git.sugarlabs.org/server/client/blobs/master/HACKING HACKING] file to know how to contribute with code. |