diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..1519bec --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.yaml] +indent_size = 2 + +[*.yml] +indent_size = 2 + +[Makefile] +indent_style = tab diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..13ab406 --- /dev/null +++ b/.env.example @@ -0,0 +1,5 @@ +# daena configuration +DAENA_CONFIG_PATH=/etc/daena/daena.yaml +DAENA_DATA_DIR=/var/lib/daena +DAENA_LOG_DIR=/var/log/daena +DAENA_PID_FILE=/run/daena/daena.pid diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f558782 --- /dev/null +++ b/.gitignore @@ -0,0 +1,34 @@ +# Python +__pycache__/ +*.py[cod] +*.egg-info/ +dist/ +build/ +*.egg +.venv/ +venv/ + +# uv +.lock +uv.lock + +# IDE +.vscode/ +.idea/ +*.swp +*.swo +*~ + +# OS +.DS_Store +Thumbs.db + +# Project +data/ +logs/ +*.pid +*.sock + +# Env +.env +.env.local diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..86f8c02 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.13.5 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a55a6ff --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,91 @@ +[project] +name = "daena" +version = "0.1.0" +description = "Collect, buffer, and forward logs and events from Linux to central observability backends" +readme = "README.md" +license = { file = "LICENSE" } +requires-python = ">=3.13" +authors = [ + { name = "Amir Husayn Panahifar", email = "ahp@panahifar.ir" }, +] +keywords = ["logging", "observability", "linux", "daemon", "events"] +classifiers = [ + "Development Status :: 3 - Alpha", + "Environment :: Console", + "Intended Audience :: System Administrators", + "License :: OSI Approved :: MIT License", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3.13", + "Topic :: System :: Logging", + "Topic :: System :: Monitoring", +] + +dependencies = [ + "fastapi>=0.115", + "uvicorn[standard]>=0.30", + "pydantic>=2.0", + "pydantic-settings>=2.0", + "PyYAML>=6.0", + "structlog>=24.0", + "typer>=0.12", + "httpx>=0.28", + "lmdb>=1.5", + "tenacity>=8.0", + "rich>=13.0", +] + +[project.optional-dependencies] +dev = [ + "pytest>=8.0", + "pytest-asyncio>=0.24", + "pytest-cov>=5.0", + "mypy>=1.10", + "ruff>=0.5", +] + +[project.scripts] +daena = "daena.cli.main:app" +daena-serve = "daena.app:serve" + +[project.entry-points."daena.sources"] +dummy = "daena.pipeline.sources.dummy:DummySource" + +[project.entry-points."daena.sinks"] +dummy = "daena.pipeline.sinks.dummy:DummySink" +http = "daena.pipeline.sinks.http:HTTPSink" + +[project.entry-points."daena.processors"] +passthrough = "daena.pipeline.processors.passthrough:PassthroughProcessor" + +[tool.pyproject-fmt] +max_blank_lines = 1 + +[tool.ruff] +target-version = "py313" +line-length = 100 + +[tool.ruff.lint] +select = ["E", "F", "I", "N", "W", "UP", "B", "SIM", "ARG"] + +[tool.ruff.format] +quote-style = "double" + +[tool.mypy] +python_version = "3.13" +strict = true +warn_unused_ignores = true +exclude = [ + "tests/", + ".venv/", +] + +[tool.pytest.ini_options] +testpaths = ["tests"] +asyncio_mode = "auto" +filterwarnings = [ + "ignore::DeprecationWarning", +] + +[build-system] +requires = ["hatchling>=1.25"] +build-backend = "hatchling.build" diff --git a/src/daena/__init__.py b/src/daena/__init__.py new file mode 100644 index 0000000..3f4c88c --- /dev/null +++ b/src/daena/__init__.py @@ -0,0 +1 @@ +from daena._version import __version__ diff --git a/src/daena/_version.py b/src/daena/_version.py new file mode 100644 index 0000000..3dc1f76 --- /dev/null +++ b/src/daena/_version.py @@ -0,0 +1 @@ +__version__ = "0.1.0"