@@ -1063,11 +1063,12 @@ def activate(self):
10631063 )
10641064
10651065
1066- def deploy_chatmail (config_path : Path , disable_mail : bool ) -> None :
1066+ def deploy_chatmail (config_path : Path , disable_mail : bool , docker : bool ) -> None :
10671067 """Deploy a chat-mail instance.
10681068
10691069 :param config_path: path to chatmail.ini
10701070 :param disable_mail: whether to disable postfix & dovecot
1071+ :param docker: whether it is running in a docker container
10711072 """
10721073 config = read_config (config_path )
10731074 check_config (config )
@@ -1080,31 +1081,32 @@ def deploy_chatmail(config_path: Path, disable_mail: bool) -> None:
10801081 line = "nameserver 9.9.9.9" ,
10811082 )
10821083
1083- port_services = [
1084- (["master" , "smtpd" ], 25 ),
1085- ("unbound" , 53 ),
1086- ("acmetool" , 80 ),
1087- (["imap-login" , "dovecot" ], 143 ),
1088- ("nginx" , 443 ),
1089- (["master" , "smtpd" ], 465 ),
1090- (["master" , "smtpd" ], 587 ),
1091- (["imap-login" , "dovecot" ], 993 ),
1092- ("iroh-relay" , 3340 ),
1093- ("nginx" , 8443 ),
1094- (["master" , "smtpd" ], config .postfix_reinject_port ),
1095- (["master" , "smtpd" ], config .postfix_reinject_port_incoming ),
1096- ("filtermail" , config .filtermail_smtp_port ),
1097- ("filtermail" , config .filtermail_smtp_port_incoming ),
1098- ]
1099- for service , port in port_services :
1100- print (f"Checking if port { port } is available for { service } ..." )
1101- running_service = host .get_fact (Port , port = port )
1102- if running_service :
1103- if running_service not in service :
1104- Out ().red (
1105- f"Deploy failed: port { port } is occupied by: { running_service } "
1106- )
1107- exit (1 )
1084+ if not docker :
1085+ port_services = [
1086+ (["master" , "smtpd" ], 25 ),
1087+ ("unbound" , 53 ),
1088+ ("acmetool" , 80 ),
1089+ (["imap-login" , "dovecot" ], 143 ),
1090+ ("nginx" , 443 ),
1091+ (["master" , "smtpd" ], 465 ),
1092+ (["master" , "smtpd" ], 587 ),
1093+ (["imap-login" , "dovecot" ], 993 ),
1094+ ("iroh-relay" , 3340 ),
1095+ ("nginx" , 8443 ),
1096+ (["master" , "smtpd" ], config .postfix_reinject_port ),
1097+ (["master" , "smtpd" ], config .postfix_reinject_port_incoming ),
1098+ ("filtermail" , config .filtermail_smtp_port ),
1099+ ("filtermail" , config .filtermail_smtp_port_incoming ),
1100+ ]
1101+ for service , port in port_services :
1102+ print (f"Checking if port { port } is available for { service } ..." )
1103+ running_service = host .get_fact (Port , port = port )
1104+ if running_service :
1105+ if running_service not in service :
1106+ Out ().red (
1107+ f"Deploy failed: port { port } is occupied by: { running_service } "
1108+ )
1109+ exit (1 )
11081110
11091111 tls_domains = [mail_domain , f"mta-sts.{ mail_domain } " , f"www.{ mail_domain } " ]
11101112
0 commit comments