diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 93f5fb0..b2f684f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,6 +21,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Display Python version run: python -c "import sys; print(sys.version)" + - name: Install OS dependencies + run: sudo apt-get install -y --no-install-recommends freetds-dev libkrb5-dev - name: Install dependencies run: python -m pip install --upgrade pip setuptools wheel - name: Installation diff --git a/honeypots/helper.py b/honeypots/helper.py index e226f0d..1d3660e 100644 --- a/honeypots/helper.py +++ b/honeypots/helper.py @@ -25,7 +25,6 @@ import psutil from OpenSSL import crypto from psutil import process_iter -#from psycopg2 import connect as psycopg2_connect, sql def set_up_error_logging(): @@ -249,17 +248,6 @@ def __init__( # noqa: PLR0913 self.logs = logs self.uuid = uuid self.custom_filter = custom_filter - if config and "db_postgres_removed" in self.logs: - parsed = urlparse(config["postgres"]) - #self.db["db_postgres"] = PostgresClass( - # host=parsed.hostname, - # port=parsed.port, - # username=parsed.username, - # password=parsed.password, - # db=parsed.path[1:], - # uuid=self.uuid, - # drop=drop, - #### if config and "db_sqlite" in self.logs: self.db["db_sqlite"] = SqliteClass( file=config["sqlite_file"], drop=drop, uuid=self.uuid @@ -303,6 +291,7 @@ def emit(self, record: LogRecord): # noqa: C901,PLR0912 stdout.write(f"{json.dumps(log_entry, sort_keys=True, cls=ComplexEncoder)}\n") stdout.flush() + class SqliteClass: def __init__(self, file=None, drop=False, uuid=None): self.file = file @@ -501,7 +490,7 @@ def check_bytes(string: Any) -> str: def load_template(filename: str) -> str: file_path = Path(__file__).parent / "data" / filename - return file_path.read_text() + return file_path.read_bytes() def get_headers_and_ip_from_request(request, options):