mirror of
https://seed.flo-the.dev/z3gWc1qgaeZaoGwL4WTstLNoqjayM.git
synced 2025-12-06 04:47:35 +01:00
version 0.1.0
- add nixosModules config part to readme - cleanup - add version tag 0.1.0 Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
This commit is contained in:
53
README.md
53
README.md
@@ -17,7 +17,7 @@ For now, this is a proof-of-concept.
|
||||
## Features
|
||||
|
||||
- Relay emails received on a locally listening SMTP server
|
||||
- Encrypt and sign the relayed mails (experimental)
|
||||
- Encrypt and sign the relayed mails
|
||||
|
||||
|
||||
## Installation/Hacking
|
||||
@@ -57,7 +57,7 @@ Please read https://radicle.xyz/guides/user to get used to clone this repo with
|
||||
|
||||
If you just want to clone the repo without `radicle` you can clone the repo with `git clone https://seed.radicle.garden/z3gWc1qgaeZaoGwL4WTstLNoqjayM.git smtprd-ng`
|
||||
|
||||
Beware: This is very early alpha ;-)
|
||||
Beware: This is alpha ;-)
|
||||
|
||||
## License
|
||||
|
||||
@@ -86,13 +86,58 @@ Where
|
||||
|
||||
Plese note: Right now, there is no way to set a password, so the private key is unprotected and should only be used for this automation and have appropiate file permissions. I might add the option to set a password through the config file in the future, though.
|
||||
|
||||
### Systemd
|
||||
|
||||
An example `systemd` file is in the `sytemd` subfolder. Be sure to replace @smtprd@ with a path to the python executable.
|
||||
|
||||
For `NixOS` you yan use the provided `nixosModule` like so:
|
||||
|
||||
```nix
|
||||
# flake.nix
|
||||
{
|
||||
inputs.smtp = {
|
||||
url = "git+https://seed.radicle.garden/z3gWc1qgaeZaoGwL4WTstLNoqjayM.git";
|
||||
|
||||
};
|
||||
|
||||
outputs = inputs@{ ... }: {
|
||||
|
||||
nixosConfigurations = {
|
||||
my-config = inputs.nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
inputs.smtp.nixosModules.smtprd-ng
|
||||
{
|
||||
services.smtprd-ng = {
|
||||
enable = true;
|
||||
client = {
|
||||
hostname = "smtp.example.com";
|
||||
username = "username";
|
||||
password_file = "/etc/smtp_pw";
|
||||
sender = "username@example.com";
|
||||
start_tls = true;
|
||||
smime_cert = "${./smime.crt}";
|
||||
smime_cert_private = "/etc/private.key";
|
||||
};
|
||||
emails = {
|
||||
"monitor@example.com" = "${./cert_for_monitor_example_com}";
|
||||
"second_monitor@example.com" = "";
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
## Roadmap
|
||||
|
||||
- Add wheel for pypi
|
||||
|
||||
- Add systemd service
|
||||
|
||||
- Cleanup code
|
||||
|
||||
|
||||
|
||||
10
default.nix
10
default.nix
@@ -1,11 +1,8 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, lib ? pkgs.lib
|
||||
,
|
||||
}:
|
||||
{ pkgs ? import <nixpkgs> { }, lib ? pkgs.lib, }:
|
||||
|
||||
pkgs.python3Packages.buildPythonPackage rec {
|
||||
pname = "smtprd-ng";
|
||||
version = "git";
|
||||
version = "0.1.0";
|
||||
pyproject = true;
|
||||
|
||||
src = lib.cleanSource ./.;
|
||||
@@ -24,7 +21,8 @@ pkgs.python3Packages.buildPythonPackage rec {
|
||||
|
||||
meta = {
|
||||
description = "SMTP forwarding relay daemon with signing and encryption";
|
||||
homepage = "https://app.radicle.xyz/nodes/seed.radicle.garden/rad:z3gWc1qgaeZaoGwL4WTstLNoqjayM";
|
||||
homepage =
|
||||
"https://app.radicle.xyz/nodes/seed.radicle.garden/rad:z3gWc1qgaeZaoGwL4WTstLNoqjayM";
|
||||
license = lib.licenses.agpl3Only;
|
||||
maintainers = [ lib.maintainers.gador ];
|
||||
};
|
||||
|
||||
14
devenv.nix
14
devenv.nix
@@ -6,15 +6,6 @@ in {
|
||||
# https://devenv.sh/packages/
|
||||
packages = [ pkgs.file pkgs.swig4 pkgs.openssl ];
|
||||
|
||||
# https://devenv.sh/tests/
|
||||
# enterTest = ''
|
||||
# echo "Running tests"
|
||||
# git --version | grep "2.42.0"
|
||||
# '';
|
||||
|
||||
# https://devenv.sh/services/
|
||||
# services.postgres.enable = true;
|
||||
|
||||
# https://devenv.sh/languages/
|
||||
languages.nix.enable = true;
|
||||
languages.python = {
|
||||
@@ -42,9 +33,4 @@ in {
|
||||
detect-private-keys.excludes = [ "tests/" ];
|
||||
|
||||
};
|
||||
|
||||
# https://devenv.sh/processes/
|
||||
# processes.ping.exec = "ping example.com";
|
||||
|
||||
# See full reference at https://devenv.sh/reference/options/
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "smtprd-ng"
|
||||
version = "0.0.1"
|
||||
version = "0.1.0"
|
||||
description = "SMTP forwarding relay daemon with signing and encryption"
|
||||
authors = [{ name = "Florian Brandes", email = "dev@mail.flo-the.dev" }]
|
||||
classifiers = [
|
||||
|
||||
@@ -139,6 +139,7 @@ class Config:
|
||||
password=cls._read_from_file(
|
||||
(config.get("client", "password_file", fallback=""))
|
||||
),
|
||||
# TODO: Remove or add nixos option
|
||||
set_reply_to=config.getboolean(
|
||||
"client", "set_reply_to", fallback=False
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user