Commit Graph

1086 Commits

Author SHA1 Message Date
holger krekel
a77f5c5f42 use a Deployer for setting the remote git hash 2025-11-10 18:08:59 +01:00
holger krekel
84b970f1ea strike unneccessary *,** argument flexibility 2025-11-10 18:04:07 +01:00
holger krekel
1f4ba7bf43 remove static method and Make Deployer instances not set any default state 2025-11-10 18:01:01 +01:00
holger krekel
5de5ba46ad now that Deployer class is clean and not mixed with what is in Deployment, use the simpler "install", "configure" and "activate" namings instead of *_impl 2025-11-10 17:47:52 +01:00
holger krekel
337e045284 further reduce indirections for staged install 2025-11-10 17:41:47 +01:00
holger krekel
b60bc1862a simplify required_users configuration (a method is not needed for now) 2025-11-10 17:24:58 +01:00
holger krekel
579e7c767d remove indirection with "stages" 2025-11-10 17:23:53 +01:00
holger krekel
a735543c80 strike unnccessary deployer variables 2025-11-10 17:23:49 +01:00
cliffmccarthy
948efff70d refactor: Move doveauth out of ChatmailVenvDeployer
- Revised DovecotDeployer to use _configure_remote_units() and
  _activate_remote_units() to deploy doveauth.  This keeps the
  Dovecot-related services in a single deployer class, leaving only
  services that are part of the chatmail project in
  ChatmailVenvDeployer.
- Removed doveauth from the unit list in ChatmailVenvDeployer.
2025-11-08 10:16:35 -06:00
cliffmccarthy
9945402d4c refactor: Move echobot out of ChatmailVenvDeployer
- Revised EchobotDeployer to use _configure_remote_units() and
  _activate_remote_units().  The 'activate' stage of
  ChatmailVenvDeployer was unconditionally restarting the service
  every time, so EchobotDeployer no longer needs to depend on the
  was_restarted attributes of the postfix and dovecot deployers in an
  attempt to avoid restarting it; we can just handle the unconditional
  restart in EchobotDeployer.activate_impl().
- Removed echobot from the unit list in ChatmailVenvDeployer.
- Removed now-unused was_restarted attribute from PostfixDeployer and
  DovecotDeployer.
2025-11-08 10:16:35 -06:00
cliffmccarthy
b39c27c5cc refactor: Move turnserver out of ChatmailVenvDeployer
- Revised TurnDeployer to use _configure_remote_units() and
  _activate_remote_units().  This class no longer uses need_restart
  and daemon_reload attributes to keep track of state.  The activate
  stage of ChatmailVenvDeployer was unconditionally restarting the
  service every time, so we don't need to keep track of extra state in
  an attempt to avoid restarting it; we can just handle the
  unconditional restart in TurnDeployer.activate_impl().
- Removed turnserver from the unit list in ChatmailVenvDeployer.
2025-11-08 10:16:35 -06:00
cliffmccarthy
38ba28be8a refactor: Move unit list to ChatmailVenvDeployer
- Split _configure_remote_venv_with_chatmaild() into two functions.
  _configure_remote_venv_with_chatmaild() handles details specific to
  the "venv", while the new _configure_remote_units() is a more
  general function that is applicable to several services.
- Renamed _activate_remote_venv_with_chatmaild() to
  _activate_remote_units() because doesn't have anything
  venv-specific.
- Removed list of units from helper functions (where it appeared
  twice); moved it to ChatmailVenvDeployer, where its is passed as an
  argument to _configure_remote_units() and _activate_remote_units().
2025-11-08 10:16:35 -06:00
cliffmccarthy
1aa4896260 chore: Add CHANGELOG.md entry for cmdeploy refactor 2025-11-08 10:16:35 -06:00
cliffmccarthy
823bf88c74 docs: Change wording in ARCHITECTURE.md
- Changed "server" to "relay".
- Suggested in review by missytake.
2025-11-08 10:16:35 -06:00
cliffmccarthy
78b326dbd1 feat: Reorder deployers
- Moved fcgiwrap before nginx.
- Exchanged order of turn and unbound.
- Moved journald as early as possible.
- Suggested in review by missytake.
2025-11-08 10:16:35 -06:00
cliffmccarthy
e708027edb feat: Remove obs-home-deltachat.gpg
- We don't install Dovecot from OBS anymore.
- Removed files.put() that creates
  /etc/apt/keyrings/obs-home-deltachat.gpg; replaced this with a
  files.file() that sets present=False to remove the file from any
  existing installations where it already has been installed.
- Removed now-unused obs-home-deltachat.gpg file.
- Clarified description of sources.list operation.
- Suggested in review by missytake and hpk42.
2025-11-08 10:16:35 -06:00
cliffmccarthy
27b72039c8 fix: Block unbound from starting up on install
- On an IPv4-only system, if unbound is started but not configured, it
  causes subsequent steps to fail to resolve hosts.
- Revised UnboundDeployer.install_impl() to use policy-rc.d to prevent
  the service from starting when installed.  This is the same
  mechanism used to keep nginx from starting on install.
2025-11-08 10:16:35 -06:00
cliffmccarthy
32534251bf docs: Add architectural information about deployer classes
- Updated ARCHITECTURE.md to describe the Deployer class hierarchy and
  the motivations behind it.
2025-11-08 10:16:35 -06:00
cliffmccarthy
1a03d56c80 refactor: Call install, configure, and activate methods in loops
- Revised deploy_chatmail() to use all_deployers to call the
  install(), configure(), and activate() methods on all the deployers,
  rather than listing them explicitly in the code.
2025-11-08 10:16:35 -06:00
cliffmccarthy
e043c1baff refactor: Reorder deploy_chatmail()
- The previous commits that added Deployer classes mostly kept
  deployment operations in the same order that they were in before.
  To organize the process into separate stages for install, configure,
  and activate, we need to reorder the method calls.  This is the
  commit that does that, and thus this is the commit that has the
  largest effect on the order of operations.
- The calls for the deployer objects are all reordered here so that
  the methods are called in the same sequence for each stage.  This
  will allow us to collect the calls into loops in the next commit.
  This commit provides a way to see a diff showing exactly how the
  sequence changed.
- The sequence of deployers was largely based on preserving the order
  of the "activate" stage, as this seems like the place order might be
  the most likely to matter.  Installation of packages and
  configuration of files should generally be able to run in any order.
  (ChatmailDeployer handles updating the apt data, and therefore needs
  to be first, however.)
2025-11-08 10:16:35 -06:00
cliffmccarthy
a9d3709663 refactor: Move curl installation from IrohDeployer to ChatmailDeployer
- The 'curl' program is used in TurnDeployer and IrohDeployer, so it
  makes more sense to install it at the beginning in ChatmailDeployer,
  rather than have each thing that uses it install it separately.
2025-11-08 10:16:35 -06:00
cliffmccarthy
741948682f refactor: Add TurnDeployer
- This splits the existing deploy_turn_server() routine into methods
  for the install, configure, and activate stages.
2025-11-08 10:16:35 -06:00
cliffmccarthy
68b78bf6d2 refactor: Add WebsiteDeployer
- This adds a step to create /var/www in the install stage, because
  the directory needs to exist for the rsync in the configure stage to
  work.
2025-11-08 10:16:35 -06:00
cliffmccarthy
0e756c653d refactor: Add EchobotDeployer
- This class is a special case because it has a dependency on the
  Postfix and Dovecot deployers.  When deciding whether to restart the
  echobot service, it needs to know whether the Postfix and Dovecot
  deployers restarted their services.  To support this dependency, the
  PostfixDeployer and DovecotDeployer objects are passed to the
  EchobotDeployer object, so it can check their was_restarted
  attributes.
2025-11-08 10:16:35 -06:00
cliffmccarthy
69de709b0f refactor: Add FcgiwrapDeployer 2025-11-08 10:16:35 -06:00
cliffmccarthy
d11163629b refactor: Add ChatmailDeployer
- This moves the installation of cron earlier in the deployment sequence.
2025-11-08 10:16:35 -06:00
cliffmccarthy
e92c8766f6 refactor: Add ChatmailVenvDeployer 2025-11-08 10:16:35 -06:00
cliffmccarthy
334e468889 refactor: Split _install_remote_venv_with_chatmaild into stages
- Split _install_remote_venv_with_chatmaild() into three routines, to
  handle the install, configure, and activate stages.
- This moves the upload of chatmail.ini later in the deployment
  process, because it is a configuration file specific to the
  instance, not software installation that would be uniform across all
  deployments.
2025-11-08 10:16:35 -06:00
cliffmccarthy
33e6807ca4 refactor: Add RspamdDeployer
- This replaces the existing _remove_rspamd() routine with a method
  for the install stage.
2025-11-08 10:16:35 -06:00
cliffmccarthy
2029acc5a9 refactor: Add MtastsDeployer
- This splits the existing _uninstall_mta_sts_daemon() routine into
  methods for the configure and activate stages.
2025-11-08 10:16:35 -06:00
cliffmccarthy
d1788b7c65 refactor: Add MtailDeployer
- This splits the existing deploy_mtail() routine into methods for the
  install, configure, and activate stages.
2025-11-08 10:16:35 -06:00
cliffmccarthy
84ab4bb6b8 refactor: Add AcmetoolDeployer
- This splits the existing deploy_acmetool() routine into methods for
  the install, configure, and activate stages.
2025-11-08 10:16:35 -06:00
cliffmccarthy
04451ad537 refactor: Add JournaldDeployer 2025-11-08 10:16:35 -06:00
cliffmccarthy
d09a118e54 refactor: Add IrohDeployer
- This splits the existing deploy_iroh_relay() routine into methods
  for the install, configure, and activate stages.
2025-11-08 10:16:35 -06:00
cliffmccarthy
5b982a3b0f refactor: Add UnboundDeployer 2025-11-08 10:16:35 -06:00
cliffmccarthy
71636b8250 refactor: Add OpendkimDeployer
- Note that this moves the installation of the opendkim package
  earlier in the deployment sequence.  Previously, it was installed
  during the _configure_opendkim() routine.
2025-11-08 10:16:35 -06:00
cliffmccarthy
e7df1a43a3 refactor: Add NginxDeployer
- Use policy-rc.d during nginx install.  This is needed to keep nginx
  from starting up and interfering with acmetool.  For more information see:
    - https://serverfault.com/questions/861583/how-to-stop-nginx-from-being-automatically-started-on-install
    - https://major.io/p/install-debian-packages-without-starting-daemons/
    - https://people.debian.org/~hmh/invokerc.d-policyrc.d-specification.txt
2025-11-08 10:16:35 -06:00
cliffmccarthy
cfc94a37b3 refactor: Add PostfixDeployer
- Removed now-unused 'debug' variable from deploy_chatmail().
2025-11-08 10:16:35 -06:00
cliffmccarthy
22b77168ed refactor: Add DovecotDeployer 2025-11-08 10:16:35 -06:00
cliffmccarthy
ffcd657a88 refactor: Add Deployer base class
- Added a Deployer class that defines the base for objects that will
  handle installation of individual components, with install,
  configure, and activate stages.  Subclasses will override the
  implementation methods of those stages as needed, while the base
  class handles all the logic of deciding which stages to execute.
- The CMDEPLOY_STAGES environment variable is used to determine what
  stages to run.  If this is not defined, all stages run as usual.
- Added import of Deployer to cmdeploy/__init__.py.  This is not yet
  used, but the next series of commits will use it.
- In deploy_chatmail(), define an empty list of deployers, and call
  the create_groups() and create_users() methods for the items in the
  list.  This list will get filled with Deployer objects in the next
  series of commits.
2025-11-08 10:16:35 -06:00
cliffmccarthy
39fd04473c refactor: Move addition of 9.9.9.9 resolver earlier
- Moved the "Add 9.9.9.9 to resolv.conf" step earlier, before the
  creation of users or updates to any config files.  This should not
  affect any of those operations.  Moving this step earlier makes it
  easier to accommodate the restructuring of the deployment process
  into separate components with separate stages for install,
  configure, and activate.
2025-11-08 10:16:35 -06:00
cliffmccarthy
49613f7e71 refactor: Move all imports to top of cmdeploy/__init__.py 2025-11-08 10:16:35 -06:00
missytake
ded9dd470d www: add changelog 2025-11-06 16:19:02 +01:00
Alexander
b94ad729fd Update cmdeploy/src/cmdeploy/__init__.py
Co-authored-by: missytake <missytake@systemli.org>
2025-11-06 16:17:12 +01:00
Alexander Dietrich
b60267f37f Skip www_folder if merge conflict marker found 2025-11-06 16:17:12 +01:00
missytake
a0aa2912dd ci: fix test methods for deltachat 2.23.0 2025-11-06 12:33:59 +01:00
Serge Matveenko
76108c1c03 Test dig output with dns comments 2025-11-06 11:26:02 +01:00
Serge Matveenko
61b8dc4637 Improve dns responses parsing 2025-11-06 11:26:02 +01:00
Lars-Dominik Braun
d42f579291 turnserver: Strip newline from response. 2025-11-03 22:57:43 +00:00
Serge Matveenko
dd3cf4d449 Update dovecot-core deb sha256 sums 2025-10-30 11:23:19 +01:00