config: Convert entered domain name to lower case

Domain name is not case sensitive, but Let's Encrypt certificate paths
use lower-case domain name.

Closes: #1964.

Tests: Config functional tests passed.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
James Valleroy authored and Veiko Aasa committed 2021-03-29 12:58:13 +03:00
1 parent adae894362
commit 043b329e7d
2 files changed
+8

No files matched your search

@@ -15,6 +15,10 @@ Scenario: Change domain name
When I change the domain name to mydomain.example
Then the domain name should be mydomain.example
Scenario: Capitalized domain name
When I change the domain name to Mydomain.example
Then the domain name should be mydomain.example
Scenario: Change webserver home page
Given the syncthing application is installed
And the syncthing application is enabled
+4
View File
@@ -120,6 +120,10 @@ def set_domainname(domainname, old_domainname):
# Domain name should be ASCII. If it's unicode, convert to ASCII.
domainname = str(domainname)
# Domain name is not case sensitive, but Let's Encrypt certificate
# paths use lower-case domain name.
domainname = domainname.lower()
LOGGER.info('Changing domain name to - %s', domainname)
actions.superuser_run('domainname-change', [domainname])