Commit 1daa5203 authored by Mickaël Desfrênes's avatar Mickaël Desfrênes
Browse files

bump sanic version to latest and fix static route

parent 846c1982
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -222,7 +222,6 @@ async def job_get(request: sanic.request, job_id: str):

if CONFIG["CIRCE_ENABLE_WEB_UI"]:
    cookie_signer = Signer(CONFIG["CIRCE_WEB_UI_CRYPT_KEY"])
    server.static("/static/", os.path.dirname(os.path.abspath(__file__)) + "/static/")

    def _check_request_session(request: sanic.request) -> str:
        try:
@@ -351,11 +350,18 @@ def serve(
    workers=CONFIG["CIRCE_WORKERS"],
    debug=CONFIG["CIRCE_DEBUG"],
    access_log=CONFIG["CIRCE_ACCESS_LOG"],
    static_dir=None,
):
    """
    Start Circe HTTP server
    """
    _check_port(host, port)
    if static_dir:
        server.static("/static", static_dir, name="static_files")
    else:
        server.static(
            "/static", os.path.dirname(os.path.abspath(__file__)) + "/static/"
        )
    try:
        server.run(
            host=host,
@@ -379,8 +385,17 @@ def run(
    Start both HTTP server and job workers
    """
    _check_port(host, port)
    static_dir = os.path.dirname(os.path.abspath(__file__)) + "/static/"
    http_process = Process(
        target=serve, args=(host, int(port), int(workers), bool(debug))
        target=serve,
        args=(
            host,
            int(port),
            int(workers),
            bool(debug),
            CONFIG["CIRCE_ACCESS_LOG"],
            static_dir,
        ),
    )
    http_process.start()
    if not CONFIG["CIRCE_IMMEDIATE_MODE"]:
+1 −1
Original line number Diff line number Diff line
sanic==20.12.3
sanic
argh
requests
huey
+2 −2
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:

setuptools.setup(
    name="circe-CERTIC",
    version="0.0.22",
    version="0.0.23",
    author="Mickaël Desfrênes",
    author_email="mickael.desfrenes@unicaen.fr",
    description="Circe server",
@@ -21,7 +21,7 @@ setuptools.setup(
    install_requires=[
        "requests",
        "argh",
        "sanic==20.12.3",
        "sanic",
        "huey",
        "asyncio",
        "itsdangerous",