add doveauth entrypoint for lua

This commit is contained in:
missytake
2023-10-13 20:04:10 +02:00
parent 3b0037dc3a
commit 93a84617a8
7 changed files with 10 additions and 1 deletions

View File

@@ -6,6 +6,9 @@ build-backend = "setuptools.build_meta"
name = "doveauth"
version = "0.1"
[project.scripts]
doveauth = "doveauth.doveauth:main"
[tool.pytest.ini_options]
addopts = "-v -ra --strict-markers"

View File

View File

@@ -45,7 +45,7 @@ def dump_result(res):
print(f"{key}={value}")
if __name__ == "__main__":
def main():
if sys.argv[1] == "hexauth":
login = base64.b16decode(sys.argv[2]).decode()
password = base64.b16decode(sys.argv[3]).decode()
@@ -55,3 +55,7 @@ if __name__ == "__main__":
login = base64.b16decode(sys.argv[2]).decode()
res = lookup_user(login)
dump_result(res)
if __name__ == "__main__":
main()

View File

@@ -2,3 +2,5 @@
python3 -m venv chatmail-pyinfra/venv
chatmail-pyinfra/venv/bin/pip install pyinfra
chatmail-pyinfra/venv/bin/pip install -e chatmail-pyinfra
python3 -m venv doveauth/venv
doveauth/venv/bin/pip install -e doveauth