modoboa / modoboa-installer

An installer for Modoboa
MIT License
264 stars 138 forks source link

KeyError: 'tls_cert_file' #554

Closed muslu closed 6 months ago

muslu commented 6 months ago

Impacted versions

We got error tls_cert_file even "certificate" -> generate is false

[certificate]
generate = false
type = self-signed
tls_cert_file_path =
tls_key_file_path =
Traceback (most recent call last):
  File "/tmp/modoboa-installer/run.py", line 317, in <module>
    main(sys.argv[1:])
  File "/tmp/modoboa-installer/run.py", line 288, in main
    scripts.install(appname, config, args.upgrade, args.restore)
  File "/tmp/modoboa-installer/modoboa_installer/scripts/__init__.py", line 29, in install
    getattr(script, appname.capitalize())(config, upgrade, archive_path).run()
  File "/tmp/modoboa-installer/modoboa_installer/scripts/base.py", line 206, in run
    self.post_run()
  File "/tmp/modoboa-installer/modoboa_installer/scripts/nginx.py", line 85, in post_run
    self._setup_config(
  File "/tmp/modoboa-installer/modoboa_installer/scripts/nginx.py", line 43, in _setup_config
    utils.copy_from_template(src, dst, context)
  File "/tmp/modoboa-installer/modoboa_installer/utils.py", line 172, in copy_from_template
    fp.write(ConfigFileTemplate(buf).substitute(context))
  File "/usr/lib/python3.10/string.py", line 121, in substitute
    return self.pattern.sub(convert, self.template)
  File "/usr/lib/python3.10/string.py", line 114, in convert
    return str(mapping[named])
KeyError: 'tls_cert_file'
tonioo commented 6 months ago

@muslu That was indeed any issue happening when you set generate parameter to false. Since this parameter is not so clear, I removed it. If you don't want certificate generation to happen, I suggest you select 'manual' mode