Setting up StorGUI - shmolyneaux/SquareJam GitHub Wiki

After completing Getting Started you should have a database structure similar to the following:

Library       (Object)
╚> STOSH      (Object)
╚> storgui    (Object)

Permissions          (Dict)
╚> get_session_info  (List)
╚> login             (List)
╚> getattribute      (List)

Server        (Object)
╚> WebSites   (Object)
  ╚> _0_0_0_0 (Object)
    ╚> index  (Object)
      ╚> html (Method)

Our goal is to get the StorGUI graphic object browser accessible through a web interface.

StorGUI Graphic Object Browser

As you can see above, storgui is contained within the Library object at the root of the database. Within the database we need to create a link from our website to this object. The easiest way to achieve this is to modify the html method to create a link to storgui within the website object.

To do this the html method should read as follows:

def html( self, req ):
  user = self.__connection__.__username__;
  if user == 'root' or ( 'username' in req.form and 'password' in req.form ):
    if user != 'root':
      req.storage.login( req.form['username'], req.form['password'] );
    self.__container__.storgui = req.storage.Library.storgui;
    req.content_type = 'text/plain';
    req.content = "Success!";

  else:
    req.content_type = 'text/html';
    req.content = """
<html>
  <head>
    <title>Login</title>
  </head>
  <body>
    <form method='POST' action'/'>
      Username: <input type='text' name='username' /> <br />
      Password: <input type='password' name='password' /> <br />
      <input type='submit' value='Login' />
    </form>
  </body>
</html>""";

Once this method is saved navigate to https://0.0.0.0:8001 and you should see the following:

Username: Password:

Login Page

After entering the root username and password (password defaults to toor), you should see the following:

Success!

At this point you can navigate to https://0.0.0.0:8001/storgui/storgui to begin using StorGUI.

For a detailed explanation go to Setting Up StorGUI Explanation.

If you reach an error page insure you typed in the correct url then scroll down to the Errors section for more detailed instructions.

Errors

The are several things that can go wrong during this tutorial.

  • Insure that you've completed Getting Started and that the home screen reads Hello World! when you navigate to it.
  • Check the log of SnakeCharmer.py for any errors
  • Double check that the code is functionally identical to what is typed above
⚠️ **GitHub.com Fallback** ⚠️