Example #1
0
def setupAuthentication():
    """
    Set up :mod:`authentication` ready for the server.

    This should only be run after config setup is complete as one of the
    imported modules provides config defaults.

    """

    import authentication
    from getpass import getpass

    password = getpass("Please give a passkey for accessing the interface (Blank for none): ")
    if password:
        authentication.addUser(pb.app_user, password)
    else:
        authentication.clear()
Example #2
0
show_break()

# Pre-Server Launch Setup

import authentication

if new_config:
# Ask only if we're looking at a new file
    from getpass import getpass

    password = getpass("Please give a passkey for accessing the interface (Blank for none): ")
    if password:
        authentication.addUser(pb.app_user, password)
    else:
        authentication.clear()

    show_break()

# Start server

import myserver

myserver.getServer().setup()

print "Now you can log on to the server with the following credentials:"
print ""
print "Location: http://localhost:" + str(config.getSettings("server")["port"])
if authentication.active():
    print "User: "******"Password: <You should know>"