User:Gareth Ellison/Supergrid

From Second Life Wiki
Jump to navigation Jump to search

I was asked by someone to post the specs of the supergrid to the wiki.

The supergrid is the term I use to describe the set of services I have running at litesim.com (if it is inappropriate to mention competitors to LL here, please feel free to edit out) to enable centralised login.

Basic components

Here's a brief overview of the current system as running today

metaverse.xml

This file is a listing of all known grids in a kind of local cache. It specifies as an LLSD map a listing of domains and grids under those domains together with information on what protocol each grid uses and the default region and co-ordinates with relevant URLs to different services:


<llsd>
 <map>
  <key>domains</key>
  <map>
   <key>secondlife.com</key>
    <map>
     <key>grids</key>
     <map>
     <key>agni</key>
      <map>
       <key>protocol</key>
       <string>unknown</string>
       <key>loginpage</key>
       <string>http://secondlife.com/app/login</string>
       <key>loginuri</key>
       <string>https://login.agni.lindenlab.com/cgi-bin/login.cgi</string>
       <key>desc</key>
       <string>The Second Life(TM) main grid</string>
      </map>
     <key>aditi</key>
      <map>
       <key>protocol</key>
       <string>unknown</string>
       <key>loginpage</key>
       <string>http://secondlife.com/app/login/beta</string>
       <key>loginuri</key>
       <string>https://login.aditi.lindenlab.com/cgi-bin/login.cgi</string>
       <key>desc</key>
       <string>The Second Life(TM) beta grid</string>
      </map>
     </map>
     <key>defgrid</key>
     <string>agni</string>
    </map>
    <key>osgrid.org</key>
     <map>
      <key>grids</key>
       <map>
        <key>OSGrid</key>
         <map>
          <key>protocol</key>
          <string>OGS</string>
          <key>loginuri</key>
          <string>http://www.osgrid.org:8002/</string>
          <key>defregion</key>
          <array>
           <string>Wright Plaza</string>
           <real>128.0</real>
           <real>128.0</real>
           <real>30.0</real>
          </array>
          <key>desc</key>
          <string>The first and oldest grid running on FLOSS code</string>
         </map>
        </map>
        <key>defgrid</key>
        <string>OSGrid</string>
       </map>
       <key>litesim.com</key>
       <map>
        <key>supergrid</key>
         <map>
          <key>loginpage</key>
          <string>https://www.litesim.com/loginscreen</string>
          <key>loginuri</key>
          <string>https://www.litesim.com/viewer_login</string>
          <key>desc</key>
          <string>The original and best super grid</string>
         </map>
         <key>grids</key>
          <map>
           <key>fantasyislands</key>
           <map>
            <key>session_trackers</key>
            <string>http://fantasyislands.grids.litesim.com:8000/session_trackers</string>
            <key>account_sync</key>
	    <string>http://fantasyislands.grids.litesim.com:8000/sync_ogs</string>
            <key>protocol</key>
            <string>OGS</string>
            <key>desc</key>
            <string>A Litesim Ltd customer</string>
            <key>defregion</key>
	    <array>
             <string>FantasyHQ</string>
             <real>128.0</real>
             <real>128.0</real>
             <real>30.0</real>
            </array>
            <key>loginuri</key>
	    <string>http://fantasyislands.ogs-openuser.litesim.com:8002</string>
           </map>
           <key>lsmainland</key>
	    <map>
             <key>session_trackers</key>
             <string>http://71.6.154.182:8000/session_trackers</string>
             <key>account_sync</key>
             <string>http://71.6.154.182:8000/sync_ogs</string>
             <key>protocol</key>
             <string>OGS</string>
             <key>desc</key>
             <string>The litesim.com mainland</string>
             <key>defregion</key>
             <array>
              <string>Litesim welcome</string>
              <real>128.0</real>
              <real>128.0</real>
              <real>30.0</real>
             </array>
             <key>loginuri</key>
             <string>http://lsmainland.ogs-openuser.litesim.com:8002</string>
            </map>
            <key>lsdevraw</key>
	    <map>
             <key>protocol</key>
             <string>raw</string>
             <key>desc</key>
	     <string>Litesim development grid, RAW protocol, i.e you provide a UDP endpoint as the region name</string>
            </map>
</map>
<key>defgrid</key>
<string>lsmainland</string>
</map>
</map>
</map>
</llsd>

Should a domain not occur in this listing, it is intended that the login server or other client will instead retrieve www.domain.com/metaverse.xml and attempt to obtain the same data. In the current implementation, domain.com is authorative only for grids hosted at domain.com, and www.example.com/metaverse.xml may contain grids under domain.com only for the purposes of caching. Clients connect to a grid via a non-authorative metaverse.xml at their own risk.

node controller daemon

Somewhat misnamed due to its origins as a remote admin daemon for administering cluster nodes, this daemon has now taken on the role of sync'ing accounts between the supergrid and trusting remote subgrids. Should a user try to login via the supergrid to a remote subgrid which does not trust it, the supergrid may still contact the node controller if one exists to request session updates by posting to the relevant URL.

The purpose in the current system of the node controller is to accept account syncronisations and to route session updates. It acts like a bridge currently between the supergrid and the open grid services installation or other protocols and source code in python is available here - https://www.litesim.com/svn/node_control - please note that this code may also be mixed up with general maintenance scripts.

supergrid login server

The login server is integrated presently as a web.py module on the website and handles parsing login requests to locate the right subgrid. At startup the webserver loads the known grids out of a MySQL database and creates the LLSD representation for metaverse.xml. It then caches these details in memory and enables users to login with the URL scheme described in the next section. Should an untrusted or untrusting grid be requested it acts as a passive proxy, only relaying the XML-RPC login as-is and manipulating only the user agent string in the request. At the present time I am awaiting consent from LL's lawyers to begin testing more direct manipulation of the login request and the creation of ghost avatars etc to enable cross-grid TPs and IMs (by maintaining presence on SL with a bot that can act as a relay).

URL scheme

The URL scheme has been chosen to be very simple to use and expand, quite simply:

RegionName@domain.tld:gridname

For example, my home location is one of:

baikal@secondlife.com:agni or home@secondlife.com:agni or last@secondlife.com:agni or Litesim Welcome@litesim.com:lsmainland or home@litesim.com:lsmainland

This URL is entered into the start location on the standard viewer and eliminates the need for a seperate grid selection dropdown box and thus enables use of the standard viewer unchanged.

The rest

More specs and code to come!