Skip to content

docs: Add ARCHITECTURE.md with diagram of components #615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cliffmccarthy
Copy link
Contributor

  • For starters, this file is just a diagram of components of a chatmail server. In the future, this document can grow into a more complete description of the architecture of the server, the deployment process, and the design intent behind what is and isn't in the code base.
  • The name ARCHITECTURE.md is inspired by this article, which also has good suggestions about what to put in the file: https://matklad.github.io/2021/02/06/ARCHITECTURE.md.html

@cliffmccarthy
Copy link
Contributor Author

The current revision is a rough draft, and will probably be revised further as I study the code more.

Copy link
Contributor

@hpk42 hpk42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good as a start. thanks!

ARCHITECTURE.md Outdated
@@ -0,0 +1,37 @@
This diagram shows components of the chatmail server:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please qualify this sentence that's it's a draft overview as of mid August 2025.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review! I updated the text as you suggested. I also added labels to some of the arrows to indicate the ports and sockets that the components communicate by.

- For starters, this file is just a diagram of components of a
  chatmail server.  In the future, this document can grow into a more
  complete description of the architecture of the server, the
  deployment process, and the design intent behind what is and isn't
  in the code base.
- The name ARCHITECTURE.md is inspired by this article, which also has
  good suggestions about what to put in the file:
  https://matklad.github.io/2021/02/06/ARCHITECTURE.md.html
- Suggested in review by hpk42.
Copy link
Contributor

@missytake missytake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great start, the only missing things I can think of are opendkim and the lastlogin service, but we can also merge it as it is and add them later :)

I added some suggestions, which would make more sense for me - but as this diagram is not so I can understand it, but for newcomers, I'd leave it to you which you want to adapt :)

For others looking at this, a preview is at https://github.com/cliffmccarthy/chatmail-relay/blob/architecture-doc/ARCHITECTURE.md

chatmail-metrics --> /var/www/html;
acmetool --> certs;
acmetool --> acmetool-redirector;
acmetool-redirector --> certs;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
acmetool-redirector --> certs;
acmetool-redirector --> nginx;

I would argue that acmetool-redirector doesn't actually have much to do with certs, and mostly just redirects traffic to nginx?

acmetool --> certs;
acmetool --> acmetool-redirector;
acmetool-redirector --> certs;
nginx --> /var/www/html;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
nginx --> /var/www/html;
nginx --> |8443|/var/www/html;

We could include that port 8443 is needed to show the webroot directory :)

acmetool-redirector --> certs;
nginx --> /var/www/html;
nginx --> certs;
nginx --> newemail.py;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
nginx --> newemail.py;
nginx --> |8443|newemail.py;

same for newemail.py :)

acmetool --> acmetool-redirector;
acmetool-redirector --> certs;
nginx --> /var/www/html;
nginx --> certs;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
nginx --> certs;
certs --> nginx;

And one could argue that nginx is dependent on the certs, not the other way round.

nginx --> |993|dovecot;
autoconfig.xml --> postfix;
autoconfig.xml --> dovecot;
postfix --> certs;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
postfix --> certs;
certs --> postfix;

same for postfix...

postfix --> |10080,10081|filtermail;
postfix --> echobot;
postfix --> |doveauth.socket|doveauth;
dovecot --> certs;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dovecot --> certs;
certs --> dovecot;

...and dovecot ;)

cron --> acmetool;
cron --> chatmail-metrics;
chatmail-metrics --> /var/www/html;
acmetool --> certs;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
acmetool --> certs;
acmetool --> /var/lib/acme;

For /home/vmail and /var/www/html we also talk about the path, because they contain state... we could do that for the certs as well :) that would make it clearer what to backup/manage. maybe TLS certs /var/lib/acme, Users /home/vmail, and Website /var/www/html? That would make it more obvious what the paths contain.

@missytake
Copy link
Contributor

Let me know what changes you want to include, then I'll merge this :)

@cliffmccarthy
Copy link
Contributor Author

Thanks for all the review feedback! I will submit a new revision in the next day or two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants