-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connect to multiple School Server easily #679
base: master
Are you sure you want to change the base?
Connect to multiple School Server easily #679
Conversation
Better known_host handling has been added. Please check 9307267 |
Multiple commits squashed into one. |
def _get_history_for_serial(serial_number): | ||
identifier_path = os.path.join(env.get_profile_path(), 'identifiers') | ||
if not os.path.exists(identifier_path): | ||
os.mkdir(identifier_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These three lines are duplicate of code in _store_identifiers
, please refactor.
Several typos in commit message, please spell check. |
Issue: As mentioned in the bug [1]. It is difficult to connect a Sugar device to multiple XS servers because the user is required to perform few manual steps to clear a previous registration. Also, new registration is performed even when a laptop tries to connect to an XS server, where it has already registered previously. This caused the original backup-url and back-up path to change on the server causing inefficiency. Solution: The solution involves a few automated checks and tasks that are performed to overwrite new registration details, store previous registration details and restore the details is an old server is connected. All GConf variables used by ds-backup are also updated with the server and registration details. The identity of the server is added to known_hosts file on successful registration to avoid ssh verification errors. Server: I tried it on XSCE School Server release-6.0 on a CentOS7 machine. No server side modification was done to archive it apart from enabling 'Services for XO Laptops such as Registration, Backup, and Activity Server' in 'Configure' section of schoolserver admin. (http://schoolserver/admin/) I used webpage available at schoolserver:5000 provided by xs-authserver, where the list of registered laptops are present. Here is a related feature page for details of this enhancement [2]. A link to the starting of a discussion thread about this feature. [3]. [1] https://bugs.sugarlabs.org/ticket/362 [2] https://wiki.sugarlabs.org/go/Features/Multi_XS-server_registration [3] http://lists.sugarlabs.org/archive/sugar-devel/2016-April/051800.html
@quozl Thanks for the in depth review and guidance. I have refactored the code and removed typos in commit message. |
No worries, glad to be of help. I've not reviewed your latest. Best of luck. |
Please review |
raise RegisterError(_('The server could not complete the request.')) | ||
|
||
settings.set_string('jabber-server', data['jabberserver']) | ||
response = urllib2.urlopen(db_url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use libsoup for opening urls. Libsoup properly intergrates with the gobject mainloop; so that the ui is still responsive while we wait on the network.
Lib soup has documentation, but you can probs just copy some code from my reddit client; https://github.com/samdroid-apps/something-for-reddit/blob/master/src/api.py#L182
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@samdroid-apps Please review
Replaced urllib2 by libsoup. Shall I squash the commits to one? |
I don't have means to test this. Can someone review it again? (@samdroid-apps @quozl) |
I don't either. I'm also not sure if the school server has the capacity to interact with Sugar. Perhaps @iiab has some way to test. They do have the pre-requisites listed, found in code search; Next step on this pull request is to resolve the conflicts by rebasing the patch. |
This issue should be closed as not a problem. A lot of design and
implementation effort has already been expended on a non-issue.
The original issue was raised by someone who apparently did not know how
to deal with the known-host issue encountered by developers and system
administrators who need to access more than one server with the same
host name. The solution on an XO is trivial:
#remove known hosts
sudo rm -rf /home/olpc/.ssh/known_hosts
This problem is totally unrelated to Sugar.
What would be helpful is to eliminate the registration button
completely. Have Sugar register every time it connects to a server (as
has been done by OLE Nepal for over a decade). If that registration
fails, no harm is done. If the laptop is not registered, it won't be
able to back up the Journal. If registered the data will not be updated
but will ordinarily be valid.
Tony
…On 1/11/19 6:05 AM, Rahul Bothra wrote:
I don't have means to test this. Can someone review it again?
***@***.*** <https://github.com/samdroid-apps> @quozl
<https://github.com/quozl>)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#679 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAULkiM4P3ovxe79h0i8jXSd4INk3muYks5vCA2OgaJpZM4IIyGr>.
|
Thanks Tony. Was the change to Sugar by OLE Nepal distributed generally to end users? If so, please point us at the source code? |
Hi, James
I don't believe it was submitted to SugarLabs specifically. It is part
of a number of changes which were made to fit the needs there - such as
using Firefox as the browser, operating Firefox in full-screen mode, and
so on. However, essentially the only change needed is to execute the
registration button function as part of the connect procedure. The
server-side code simply repeats the registration process on its side
causing no change if the information supplied is the same.
I am sure the OLE Nepal folks will be happy to explain the change.
Tony
…On 1/11/19 10:21 AM, James Cameron wrote:
Thanks Tony. Was the change to Sugar by OLE Nepal distributed
generally to end users? If so, please point us at the source code?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#679 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAULkj1Gx-sBi8rWU9OKpBx09eetk-yUks5vCEmJgaJpZM4IIyGr>.
|
Issue: As mentioned in the bug [1].
It is difficult to connect a Sugar device to multiple school servers because
the user is required to perform few manual steps to clear a previous
registration. Also, new registration is performed even when a laptop
tries to connect to an school server, where it has already registered
previously. This caused the original backup-url and back-up path to
change on the server causing inefficiency.
Solution: The solution involves a few automated checks and tasks that
are performed to overwrite new registration details, store previous
registration details and restore the details is an old server is connected.
UI: Just the 'Register' and 'Register again' button are replaced with
a single 'Connect to server' button on the FavouriteView desktop. It was
done to provide a non confusing simple and constant button to the user, as
his/her final motive is to get Sugar settings configured with the server
regardless of the fact that it is registering, registering again or
simply restoring settings of previous registration. Also it will mark
the change in the background functionality.
Server: I tried it on XSCE School Server release-6.0 on a CentOS7 machine.
No server side modification was done to achive it apart from enabling
'Services for XO Laptops such as Registration, Backup, and Activity Server'
in 'Configure' section of schoolserver admin. (http://schoolserver/admin/)
I used webpage available at schoolserver:5000 prvided by xs-authserver,
where the list of registered laptops are present.
Here is a related feature page for details of this enhancement [2].
A link to the starting of a discussion thread about this feature. [3].
[1] https://bugs.sugarlabs.org/ticket/362
[2] https://wiki.sugarlabs.org/go/Features/Multi_XS-server_registration
[3] https://wiki.sugarlabs.org/go/Features/Multiple_schoolserver_registration