-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
What's new: - Update receiver/sender images to Alpine Linux 3.14 - Use docker-compose for managing deployment - Use Docker SDK for Python instead of own shell scripts - Rewrite CLI code - Use Renovate Bot for updating dependencies - Update all dependencies
- Loading branch information
Showing
66 changed files
with
1,205 additions
and
796 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../kolombo/docker/auth/requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
bandit --quiet -r kolombo | ||
safety check --full-report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
black --target-version=py39 --check kolombo tests setup.py | ||
mypy kolombo | ||
isort --project=kolombo --check kolombo tests setup.py | ||
flake8 kolombo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bandit==1.7.0 | ||
safety==1.10.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Static type check analysis | ||
mypy==0.910 | ||
types-setuptools==57.0.2 | ||
# Flake8 with extensions | ||
flake8==3.9.2 | ||
flake8-bugbear==21.4.3 | ||
flake8-pie==0.14.0 | ||
pep8-naming==0.12.1 | ||
flake8-simplify==0.14.1 | ||
flake8-comprehensions==3.6.1 | ||
flake8-fixme==1.1.1 | ||
flake8-cognitive-complexity==0.1.0 | ||
# Code style enforcing | ||
black==21.6b0 | ||
isort==5.9.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
/venv/ | ||
__pycache__/ | ||
/*.egg-info/ | ||
/.vscode/ | ||
__pycache__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
stages: | ||
- tests | ||
|
||
variables: | ||
PIP_CACHE_DIR: "${CI_PROJECT_DIR}/.cache/pip" | ||
|
||
cache: | ||
key: "${CI_JOB_STAGE}-${CI_COMMIT_REF_SLUG}-pip" | ||
paths: | ||
- .cache/pip | ||
- venv/ | ||
|
||
before_script: | ||
- pip install virtualenv && virtualenv venv && source venv/bin/activate | ||
|
||
check_style: | ||
stage: tests | ||
tags: | ||
- docker-other | ||
image: python:3.9-slim | ||
script: | ||
- pip install -r requirements.txt | ||
- pip install -r .ci/auth-requirements.txt | ||
- pip install -r .ci/style-requirements.txt | ||
- bash .ci/check_style | ||
only: | ||
refs: | ||
- main | ||
- merge_requests | ||
changes: | ||
- requirements.txt | ||
- setup.py | ||
- kolombo/**/* | ||
- tests/**/* | ||
- .ci/* | ||
- .gitlab-ci.yml | ||
|
||
check_security: | ||
stage: tests | ||
tags: | ||
- docker-other | ||
image: python:3.9-slim | ||
script: | ||
- pip install -r requirements.txt | ||
- pip install -r .ci/auth-requirements.txt | ||
- pip install -r .ci/security-requirements.txt | ||
- bash .ci/check_security | ||
only: | ||
refs: | ||
- main | ||
- merge_requests | ||
changes: | ||
- requirements.txt | ||
- setup.py | ||
- kolombo/**/* | ||
- tests/**/* | ||
- .ci/* | ||
- .gitlab-ci.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
include README.md kolombo/py.typed | ||
recursive-include kolombo *.py *.sh *.conf requirements.txt virtual-* Dockerfile | ||
include requirements.txt README.md logo.png kolombo/py.typed | ||
recursive-include kolombo *.py | ||
recursive-include kolombo_auth *.py | ||
recursive-include kolombo/docker * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,33 @@ | ||
# Kolombo | ||
|
||
![Kolombo Logo](https://raw.githubusercontent.com/HarrySky/kolombo/master/logo.png "Kolombo Logo") | ||
![Kolombo Logo](https://raw.githubusercontent.com/HarrySky/kolombo/main/logo.png "Kolombo Logo") | ||
|
||
Easy to manage mail server 💌 | ||
CLI for easy mail server managing 💌 | ||
|
||
**NB! Work in progress, not ready!** | ||
**NB! Work in progress, not ready for production use!** | ||
|
||
## Introduction | ||
## How to use | ||
|
||
TODO | ||
Documentation is coming, for now, | ||
this is how to setup mail server for | ||
domain example.com with email info@example.com | ||
|
||
```bash | ||
# Initialize Kolombo | ||
kolombo init | ||
|
||
# Add domain and generate DKIM keys for it | ||
kolombo domain add example.com mx.example.com # MX field is optional | ||
kolombo dkim generate example.com # generates DKIM keys and returns DNS TXT record to add | ||
kolombo dkim txt example.com # returns DNS TXT record to add | ||
|
||
# Add user (email) for domain you just added | ||
kolombo user add info@example.com | ||
|
||
# Deploy Kolombo services one by one... | ||
|
||
kolombo run receiver # Listens on 25 for incoming mail, gives emails to users that come through nginx 993/995 port | ||
kolombo run auth # Authenticates SMTP/POP3/IMAP users from nginx | ||
kolombo run nginx # Listens on 465 (SMTP), 993 (IMAP) and 995 (POP3) | ||
kolombo run senders # Sends emails that come through nginx 465 port | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
from kolombo.auth import api | ||
from kolombo.bin import main as cli | ||
|
||
__version__ = "0.2.0" | ||
__all__ = ["api", "cli"] | ||
__version__ = "0.3.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
from kolombo.auth.api import api # noqa: F401 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from socket import gethostbyname | ||
|
||
|
||
def get_ip_by_host(host: str) -> str: | ||
def get_ip_for_host(host: str) -> str: | ||
"""Return IP address for provided host (fast in Docker network)""" | ||
return gethostbyname(host) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,32 @@ | ||
from kolombo.bin.kolombo import main # noqa: F401 | ||
from os import path | ||
|
||
from typer import Context, Typer | ||
|
||
from kolombo import conf | ||
from kolombo.console import error | ||
from kolombo.dkim import dkim_cli | ||
from kolombo.domain import domain_cli | ||
from kolombo.init import init | ||
from kolombo.run import run_cli | ||
from kolombo.stop import stop_cli | ||
from kolombo.user import user_cli | ||
|
||
kolombo_cli = Typer(name="kolombo", add_completion=True) | ||
kolombo_cli.command("init")(init) | ||
kolombo_cli.add_typer(domain_cli, name="domain") | ||
kolombo_cli.add_typer(dkim_cli, name="dkim") | ||
kolombo_cli.add_typer(user_cli, name="user") | ||
kolombo_cli.add_typer(run_cli, name="run") | ||
kolombo_cli.add_typer(stop_cli, name="stop") | ||
|
||
|
||
@kolombo_cli.callback() | ||
def main(ctx: Context) -> None: | ||
if ctx.invoked_subcommand == "init": | ||
return | ||
|
||
if not path.exists("/etc/kolombo/kolombo.conf"): | ||
error("Kolombo is not initialized! Run [code]kolombo init[/] first") | ||
exit(1) | ||
|
||
conf.read_configuration() |
Oops, something went wrong.