Skip to content

feat(cmdeploy): add ssh_host chatmail.ini option to deploy remotely, recommend localhost deployment as default#852

Open
missytake wants to merge 5 commits into
mainfrom
docs-ssh-host-local
Open

feat(cmdeploy): add ssh_host chatmail.ini option to deploy remotely, recommend localhost deployment as default#852
missytake wants to merge 5 commits into
mainfrom
docs-ssh-host-local

Conversation

@missytake

@missytake missytake commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

pyinfra, stemming from ansible, has a build machine / deployment server separation which we don't actually need in this project. We are mostly using it to script the installation, not to document our deployment; and I don't know of anyone importing cmdeploy as a pyinfra deployment module (other than https://github.com/deltachat/pyinfra-borgbackup/ for example).

Let's make it easier for future operators by simply assuming that you install cmdeploy on the relay itself. This also helps with people having weird laptop OSes.

The idea is to add a chatmail.ini config parameter, ssh_host, which will be set to "localhost" on cmdeploy init to be the default for new operators, but which will default to mail_domain if unset, so existing deployments keep working with their chatmail.ini files. This could become a problem if some is used to setup chatmail relays remotely without keeping the chatmail.ini file around, though.

@missytake missytake temporarily deployed to staging-ipv4.testrun.org February 16, 2026 15:18 — with GitHub Actions Inactive
@missytake missytake temporarily deployed to staging.chatmail.at/doc/relay/ February 16, 2026 15:18 — with GitHub Actions Inactive
@missytake missytake temporarily deployed to staging2.testrun.org February 16, 2026 15:18 — with GitHub Actions Inactive
@missytake missytake temporarily deployed to staging.chatmail.at/doc/relay/ February 16, 2026 15:59 — with GitHub Actions Inactive
@missytake missytake temporarily deployed to staging-ipv4.testrun.org February 16, 2026 15:59 — with GitHub Actions Inactive
@missytake missytake temporarily deployed to staging2.testrun.org February 16, 2026 15:59 — with GitHub Actions Inactive
@missytake missytake temporarily deployed to staging.chatmail.at/doc/relay/ February 17, 2026 09:58 — with GitHub Actions Inactive
@missytake missytake temporarily deployed to staging2.testrun.org February 17, 2026 09:58 — with GitHub Actions Inactive
@missytake missytake temporarily deployed to staging-ipv4.testrun.org February 17, 2026 09:58 — with GitHub Actions Inactive
@missytake missytake temporarily deployed to staging.chatmail.at/doc/relay/ February 17, 2026 12:23 — with GitHub Actions Inactive
@missytake missytake had a problem deploying to staging-ipv4.testrun.org February 17, 2026 12:23 — with GitHub Actions Error
@missytake missytake temporarily deployed to staging.chatmail.at/doc/relay/ February 17, 2026 14:17 — with GitHub Actions Inactive
@missytake missytake temporarily deployed to staging.chatmail.at/doc/relay/ February 17, 2026 14:38 — with GitHub Actions Inactive
@missytake missytake temporarily deployed to staging.chatmail.at/doc/relay/ February 17, 2026 15:05 — with GitHub Actions Inactive
@missytake missytake temporarily deployed to staging.chatmail.at/doc/relay/ February 17, 2026 17:11 — with GitHub Actions Inactive
@missytake missytake temporarily deployed to staging2.testrun.org February 17, 2026 20:00 — with GitHub Actions Inactive
@missytake missytake temporarily deployed to staging.chatmail.at/doc/relay/ February 17, 2026 20:00 — with GitHub Actions Inactive
@missytake missytake had a problem deploying to staging-ipv4.testrun.org February 17, 2026 20:00 — with GitHub Actions Error
@missytake missytake temporarily deployed to staging.chatmail.at/doc/relay/ February 17, 2026 20:07 — with GitHub Actions Inactive
@missytake missytake temporarily deployed to staging.chatmail.at/doc/relay/ February 17, 2026 20:14 — with GitHub Actions Inactive
@missytake missytake temporarily deployed to staging.chatmail.at/doc/relay/ February 17, 2026 20:18 — with GitHub Actions Inactive
@missytake missytake temporarily deployed to staging2.testrun.org February 17, 2026 20:18 — with GitHub Actions Inactive
@hpk42

hpk42 commented May 1, 2026

Copy link
Copy Markdown
Contributor

is this PR still needed?

@missytake

missytake commented May 2, 2026

Copy link
Copy Markdown
Contributor Author

is this PR still needed?

I still think it is a great improvement, but it's not a priority for the first half of May. I'll continue to work on it in a few weeks

@missytake

missytake commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

cmlxc fails, because the default now says to deploy in the builder container. Should we change cmlxc to deploy on the relay itself, or remove the ssh_host option in the generated chatmail.ini?

I'll proceed with hardcoding the ssh_host option to mail_domain for now.

@j-g00da j-g00da left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, left some nits

Comment on lines +6 to +7
# Where to deploy the relay - if unspecified, mail_domain will be used.
ssh_host = localhost

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm still a bit worried, this will confuse some people (although, it indeed makes more sense).

@missytake missytake Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I couldn't come up with a better path forward. If you have a better wording, let me work :)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It's mostly confusing because mail_domain is the default... except it's not because it is also overwritten by default by localhost.

Maybe something like:

Suggested change
# Where to deploy the relay - if unspecified, mail_domain will be used.
ssh_host = localhost
# Where to deploy the relay.
# Change the following line to deploy on a remote machine instead,
# or remove it to deploy on mail_domain.

Not sure :/

Comment thread cmdeploy/src/cmdeploy/cmdeploy.py
Comment thread doc/source/getting_started.rst

@j4n j4n left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm :) we've been deploying nine like this for a while and its just much faster in the very least.

@missytake

Copy link
Copy Markdown
Contributor Author

I started a small poll in the operators community to see if this breaks anyone's workflows or is viewed critically in any way.

@missytake

Copy link
Copy Markdown
Contributor Author

The change is not uncontroversial:
image

Let's talk about it next week.

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.

4 participants