diff --git a/README.md b/README.md index 72d2ddd..04c4763 100644 --- a/README.md +++ b/README.md @@ -67,5 +67,5 @@ A documentation is available [here](https://pumpkin-project.readthedocs.io). `Pumpkin` is distributed under the terms of the [GNU Affero General Public License version 3](https://www.gnu.org/licenses/agpl-3.0.html). -Copyright (C) 2022-2023 [Cédric Bonhomme](https://www.cedricbonhomme.org) +Copyright (C) 2022-2023 [Cédric Bonhomme](https://www.cedricbonhomme.org) Copyright (C) 2022-2023 CIRCL - Computer Incident Response Center Luxembourg diff --git a/api/crud.py b/api/crud.py index 724a08b..38d0a1b 100644 --- a/api/crud.py +++ b/api/crud.py @@ -1,6 +1,7 @@ from sqlalchemy.orm import Session -from . import models, schemas +from . import models +from . import schemas def get_items(db: Session, skip: int = 0, limit: int = 100): diff --git a/api/main.py b/api/main.py index 78f9bed..4afd2a4 100644 --- a/api/main.py +++ b/api/main.py @@ -1,14 +1,21 @@ from typing import List -from fastapi import Depends, FastAPI, HTTPException + +from fastapi import Depends +from fastapi import FastAPI +from fastapi import HTTPException from sqlalchemy.orm import Session -from . import crud, models, schemas -from .database import SessionLocal, engine +from . import crud +from . import models +from . import schemas +from .database import engine +from .database import SessionLocal models.Base.metadata.create_all(bind=engine) app = FastAPI() + # Dependency def get_db(): db = SessionLocal() diff --git a/api/models.py b/api/models.py index 048d967..4da7ed4 100644 --- a/api/models.py +++ b/api/models.py @@ -1,4 +1,6 @@ -from sqlalchemy import Boolean, Column, Integer +from sqlalchemy import Boolean +from sqlalchemy import Column +from sqlalchemy import Integer from sqlalchemy.dialects.postgresql import JSONB from .database import Base diff --git a/docs/deployment.rst b/docs/deployment.rst index abc5a9f..476afe1 100644 --- a/docs/deployment.rst +++ b/docs/deployment.rst @@ -8,7 +8,7 @@ Choose an XMPP server. Visit this [page](https://xmpp.org/software/servers.html) We mainly tested with [Prosody](https://prosody.im). To create a new XMPP account you can follow the steps -[here](https://xmpp.org/getting-started/). +[here](https://xmpp.org/getting-started/). Create an XMPP account for each demon. Each demon will have a different JID and a different password. @@ -18,7 +18,7 @@ Main steps: - configuration of the server (OMEMO, etc.); - creation of the required accounts for the correlation engine and the probes; - configuration of Pumpkin; -- +- Description of the steps: @@ -69,7 +69,7 @@ Luanching the correlation engine: .. code-block:: bash - $ python pumpkin/correlation.py + $ python pumpkin/correlation.py Password for correlation-engine@localhost: Agent starting . . . diff --git a/docs/formats.rst b/docs/formats.rst index 537257f..f32014c 100644 --- a/docs/formats.rst +++ b/docs/formats.rst @@ -31,7 +31,7 @@ HTTP API Documentation is OpenAPI Specification v3.1.0 compliant. -`FastAPI `_ is used. +`FastAPI `_ is used. For production you can use `Uvicorn `_. It's up to you. @@ -66,6 +66,3 @@ Agent configuration "jid": "", "passwd": "" } - - - diff --git a/docs/installation.rst b/docs/installation.rst index 719e3bd..d59ea1b 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -28,5 +28,3 @@ This will install FastAPI with its dependencies and SPADE. INFO: Started server process [19752] INFO: Waiting for application startup. INFO: Application startup complete. - - diff --git a/pyproject.toml b/pyproject.toml index 64767f0..ab07253 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,3 +72,7 @@ show_error_context = true pretty = true exclude = "build|dist|docs" + + +[tool.isort] +profile = "black"