Platform Team/Sugar Network/Implementation: Difference between revisions

No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 24: Line 24:
The configuration occurs based on several sources (sorted by applied order):
The configuration occurs based on several sources (sorted by applied order):


* {{Code|/etc/sugar-network.conf}} system-wide configuration file,
* {{Code|/etc/sugar-network.d}} directory with system-wide configuration files,
* {{Code|~/.config/sugar-network/config}} user-wide configuration file.
* Command-line arguments (configuration names equal to command-line arguments),
* Command-line arguments (configuration names equal to command-line arguments),
* {{Code|/etc/sugar-network/config}} system-wide configuration file,
* {{Code|~/.config/sugar-network/config}} user-wide configuration file.


To get the current configuration, call:
To get the current configuration, call:
Line 76: Line 77:
This is a client side application. The reasons to have such client application (instead of direct using of server API) are the following:
This is a client side application. The reasons to have such client application (instead of direct using of server API) are the following:


* Provide access to local Sugar Network data (providing [[Platform_Team/Sugar_Network/API|API]] from the localhost), it is useful if server is not accessible;
* Provide access to local Sugar Network data (providing [[Platform_Team/Sugar_Network/API|API]] from the localhost), e.g., from remote devices;
* Being not connected to a server, users might create postponed changes in Sugar Network content, they will be applied to a server right after getting connected;
* Having locally provided API as a proxy to a server, it is the only way (for now) to be authenticated on the server;
* Having locally provided API as a proxy to a server, it is the only way (for now) to be authenticated on the server;
* Provide features that can't served from a servers, e.g., launching activities;
* Provide features that can't served from a servers, e.g., launching activities;
Line 85: Line 87:
* Command-line arguments (configuration names equal to command-line arguments),
* Command-line arguments (configuration names equal to command-line arguments),
* {{Code|/etc/sweets.conf}} system-wide configuration file,
* {{Code|/etc/sweets.conf}} system-wide configuration file,
* {{Code|/etc/sweets.d}} directory with system-wide configuration files,
* {{Code|~/.config/sweets/config}} user-wide configuration file,
* {{Code|~/.config/sweets/config}} user-wide configuration file,
* {{Code|~/.sugar/''current-profile''/sweets.conf}} configuration specific to a Sugar profile.
* {{Code|~/.sugar/''current-profile''/sweets.conf}} configuration specific to a Sugar profile, this configuration file is being created by Sugar Integration code in Sugar and better to avoid setting these options directly.


To get the current configuration, call:
To get the current configuration, call:
Line 121: Line 124:
== Usage ==
== Usage ==


Assume we have two hosts, ''Node'' and ''Client'' (it might be the same real host though). ''Node'' host will be a Sugar Network server. The ''Client'' side will run Sugar Network integrated Sugar session to connect to the ''Node''. [[Sweets_Distribution#Add_repository|Attach]] ''Factory'' [[Sweets Distribution]] repository on both hosts.
Depending on use-case, follow one of existing [[Deployment_Platform#Deployment_scenarios|usage scenarios]].
 
On the ''Node'' side:
 
* Install {{Code|sugar-network}} package;
* Populate the {{Code|/etc/sugar-network/config}} configuration file with the following content:
 
[node]
host = 0.0.0.0
port = 8000
 
* Run node server using the {{Code|sugar-network-node start}} command;
 
On the ''Client'' side:
 
* Install {{Code|sweets-desktop}} package;
 
* Point ''Client'' to the newly launched ''Node'' (you all time can use one of [[Platform_Team/Sugar_Network/API#API_servers|public servers]]) in the {{Code|/etc/sweets.conf}} configuration file:
 
[client]
api-url = http://''NODE-HOST-HERE'':8000
 
* Choose ''Sweets Distribution'' desktop session, or, run Sugar in a window using the {{Code|sweets-sugar-emulator}} command;
 
* [[Platform_Team/Sweets_Distribution/Factory/Features#Sugar_Network_integration|Enable]] Sugar Network integration in the Sugar Shell;
 
* Open [[Platform_Team/Sugar_Network/Web_UI|Web UI]] by pressing ''F8'' key;
 
* Find [[Sugar_Network/Contributor_Hub|Contributor Hub]] in the Web UI and launch it.
 
Note that newly installed ''Node'' will be empty, the process of populating it with public data will be implemented in upcoming release.


== Sources ==
== Sources ==