示例#1
0
    def __init__(self):
        LoggerMixin.configure()
        db.configure()
        Compute.configure()
        APIContainer.configure()

        JBoxAsyncJob.configure()
        JBoxAsyncJob.init(JBoxAsyncJob.MODE_PUB)

        self.application = tornado.web.Application(handlers=[
            (r"^/", APIInfoHandler),
            (r"^/.*/.*", APIHandler)
        ])

        self.application.settings["cookie_secret"] = JBoxCfg.get('sesskey')
        self.application.listen(JBoxCfg.get('api.manager_port'), address=socket.gethostname())
        self.application.listen(JBoxCfg.get('api.manager_port'), address='localhost')

        self.ioloop = ioloop.IOLoop.instance()

        # run container maintainence every 5 minutes
        run_interval = 5 * 60 * 1000
        self.log_info("Container maintenance every " + str(run_interval / (60 * 1000)) + " minutes")
        self.ct = ioloop.PeriodicCallback(JBoxAPI.do_housekeeping, run_interval, self.ioloop)
        self.sigct = ioloop.PeriodicCallback(JBoxAPI.do_signals, 1000, self.ioloop)
示例#2
0
    def __init__(self):
        LoggerMixin.configure()
        db.configure()
        Compute.configure()
        SessContainer.configure()
        VolMgr.configure()

        JBoxAsyncJob.configure()
        JBoxAsyncJob.init(JBoxAsyncJob.MODE_PUB)

        self.application = tornado.web.Application(handlers=[
            (r"/", MainHandler),
            (r"/jboxadmin/", AdminHandler),
            (r"/jboxping/", PingHandler),
            (r"/jboxcors/", CorsHandler)
        ])
        JBPluginHandler.add_plugin_handlers(self.application)
        JBPluginUI.create_include_files()

        # cookie_secret = ''.join(random.choice(string.ascii_uppercase + string.digits) for x in xrange(32))
        # use sesskey as cookie secret to be able to span multiple tornado servers
        self.application.settings["cookie_secret"] = JBoxCfg.get('sesskey')
        self.application.settings["plugin_features"] = JBox.get_pluggedin_features()
        self.application.listen(JBoxCfg.get('interactive.manager_port'), address=socket.gethostname())
        self.application.listen(JBoxCfg.get('interactive.manager_port'), address='localhost')

        self.ioloop = tornado.ioloop.IOLoop.instance()

        # run container maintainence every 5 minutes
        run_interval = 5 * 60 * 1000
        self.log_info("Container maintenance every " + str(run_interval / (60 * 1000)) + " minutes")
        self.ct = tornado.ioloop.PeriodicCallback(JBox.do_housekeeping, run_interval, self.ioloop)
        self.sigct = tornado.ioloop.PeriodicCallback(JBox.do_signals, 1000, self.ioloop)
示例#3
0
    def __init__(self):
        LoggerMixin.configure()
        db.configure()
        Compute.configure()
        APIContainer.configure()

        JBoxAsyncJob.configure()
        JBoxAsyncJob.init(JBoxAsyncJob.MODE_PUB)

        self.application = tornado.web.Application(
            handlers=[(r"^/", APIInfoHandler), (r"^/.*/.*", APIHandler)])

        self.application.settings["cookie_secret"] = JBoxCfg.get('sesskey')
        self.application.listen(JBoxCfg.get('api.manager_port'),
                                address=socket.gethostname())
        self.application.listen(JBoxCfg.get('api.manager_port'),
                                address='localhost')

        self.ioloop = ioloop.IOLoop.instance()

        # run container maintainence every 5 minutes
        run_interval = 5 * 60 * 1000
        self.log_info("Container maintenance every " +
                      str(run_interval / (60 * 1000)) + " minutes")
        self.ct = ioloop.PeriodicCallback(JBoxAPI.do_housekeeping,
                                          run_interval, self.ioloop)
        self.sigct = ioloop.PeriodicCallback(JBoxAPI.do_signals, 1000,
                                             self.ioloop)
示例#4
0
def create_app():
    app = Flask(__name__)

    views.configure(app)

    db.configure(app)

    app.config['SECRET_KEY'] = 'dev'

    return app
示例#5
0
def create_app():
    app = Flask(
        __name__
    )  #templates folder sao html e statics javascript/css etc.. se nao informar nada ele pega o nome padrao

    db.configure(app)

    views.configure(app)

    #admin.configure(app)
    #configurar funçoes
    #contact.configure(app)
    #variaveis
    app.config['SECRET_KEY'] = 'HSUAHSUHAFUUHDHA'
    return app
示例#6
0
def create_app():
    app = Flask(__name__)

    # configurar extensoes
    db.configure(app)

    views.configure(app)

    admin.configure(app)

    contact.configure(app)

    # configurar variaveis
    app.config['SECRET_KEY'] = 'secret'
    return app
示例#7
0
def create_app():
    app = Flask(__name__)

    # configurar extensoes
    db.configure(app)

    views.configure(app)

    contact.configure(app)

    admin.configure(app)

    # configurar variaveis
    app.config['SECRET_KEY'] = 'dhuoel3nbjfop9dh@fmsdkfsml1'

    return app
示例#8
0
def create_app():
    app = Flask(__name__, static_folder="static", template_folder="frontend")

    # Extensions
    db.configure(app)
    views.configure(app)

    admin.configure(app)

    # Blueprint app example
    contact.configure(app)

    # Configurar variaveis
    app.config["SECRET_KEY"] = "skdalksdjsalkjdlkajsdlkajlks"

    return app
def create_app():
    """Function ?."""
    # app = Flask(__name__, template_folder='/template/bar.html', static_folder='/static')
    app = Flask(__name__)

    db.configure(app)

    views.configure(app)
    
    # configurar extensões
    contact.configure(app)

    # Flask Admin
    admin.configure(app)

    # configurar as variáveis
    app.config['SECRET_KEY'] = 'kdjlkhgslskglg'
    return app
示例#10
0
    def __init__(self):
        LoggerMixin.configure()
        db.configure()
        Compute.configure()
        SessContainer.configure()
        APIContainer.configure()
        VolMgr.configure()

        JBoxAsyncJob.configure()
        JBoxAsyncJob.init(JBoxAsyncJob.MODE_SUB)

        self.log_debug("Container manager listening on ports: %s", repr(JBoxCfg.get('container_manager_ports')))
        JBoxd.QUEUE = JBoxAsyncJob.get()

        JBoxd.MAX_ACTIVATIONS_PER_SEC = JBoxCfg.get('user_activation.max_activations_per_sec')
        JBoxd.MAX_AUTO_ACTIVATIONS_PER_RUN = JBoxCfg.get('user_activation.max_activations_per_run')
        JBoxd.ACTIVATION_SUBJECT = JBoxCfg.get('user_activation.mail_subject')
        JBoxd.ACTIVATION_BODY = JBoxCfg.get('user_activation.mail_body')
        JBoxd.ACTIVATION_SENDER = JBoxCfg.get('user_activation.sender')
示例#11
0
    def __init__(self):
        LoggerMixin.configure()
        db.configure()
        Compute.configure()
        SessContainer.configure()
        VolMgr.configure()

        JBoxAsyncJob.configure()
        JBoxAsyncJob.init(JBoxAsyncJob.MODE_PUB)

        self.application = tornado.web.Application(
            handlers=[(r"/", MainHandler), (
                r"/jboxadmin/",
                AdminHandler), (r"/jboxping/",
                                PingHandler), (r"/jboxcors/", CorsHandler)])
        JBPluginHandler.add_plugin_handlers(self.application)
        JBPluginUI.create_include_files()

        # cookie_secret = ''.join(random.choice(string.ascii_uppercase + string.digits) for x in xrange(32))
        # use sesskey as cookie secret to be able to span multiple tornado servers
        self.application.settings["cookie_secret"] = JBoxCfg.get('sesskey')
        self.application.settings[
            "plugin_features"] = JBox.get_pluggedin_features()
        self.application.listen(JBoxCfg.get('interactive.manager_port'),
                                address=socket.gethostname())
        self.application.listen(JBoxCfg.get('interactive.manager_port'),
                                address='localhost')

        self.ioloop = tornado.ioloop.IOLoop.instance()

        # run container maintainence every 5 minutes
        run_interval = 5 * 60 * 1000
        self.log_info("Container maintenance every " +
                      str(run_interval / (60 * 1000)) + " minutes")
        self.ct = tornado.ioloop.PeriodicCallback(JBox.do_housekeeping,
                                                  run_interval, self.ioloop)
        self.sigct = tornado.ioloop.PeriodicCallback(JBox.do_signals, 1000,
                                                     self.ioloop)

        # or configure cacerts
        AsyncHTTPClient.configure(None, defaults=dict(validate_cert=None))
示例#12
0
 def _db(self):
     db.configure(self)
     self.save()
示例#13
0
文件: config.py 项目: Ethcelon/willie
 def _db(self):
     db.configure(self)
     self.save()
示例#14
0
 def _db(self):
     db.configure(self)
示例#15
0
async def on_ready():
    print('Logged in as')
    print(client.user.name)
    print(client.user.id)
    print('------')
    db.configure()
示例#16
0
def create_app():
    app = Flask(__name__)
    views.configure(app)
    db.configure(app)
    return app