mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
pagekite: Convert entered kite name to lower case
Let's Encrypt certificate paths use lower-case kite name. Test: Pagekite functional tests are passing. Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
parent
929e7626f0
commit
0b630037f9
@ -67,11 +67,17 @@ class ConfigurationForm(forms.Form):
|
||||
old = _filter(self.initial)
|
||||
new = _filter(self.cleaned_data)
|
||||
|
||||
# Kite name should be ASCII. If it's unicode, convert to
|
||||
# ASCII.
|
||||
kite_name = str(new['kite_name'])
|
||||
|
||||
# Let's Encrypt certificate paths use lower-case kite name.
|
||||
kite_name = kite_name.lower()
|
||||
|
||||
if old != new:
|
||||
frontend = f"{new['server_domain']}:{new['server_port']}"
|
||||
utils.run([
|
||||
'set-config', '--kite-name', new['kite_name'], '--frontend',
|
||||
frontend
|
||||
'set-config', '--kite-name', kite_name, '--frontend', frontend
|
||||
], input=new['kite_secret'].encode())
|
||||
messages.success(request, _('Configuration updated'))
|
||||
|
||||
|
||||
@ -23,6 +23,11 @@ Scenario: Configure pagekite application
|
||||
When I configure pagekite with host pagekite.example.com, port 8080, kite name mykite.example.com and kite secret mysecret
|
||||
Then pagekite should be configured with host pagekite.example.com, port 8080, kite name mykite.example.com and kite secret mysecret
|
||||
|
||||
Scenario: Capitalized kite name
|
||||
Given the pagekite application is enabled
|
||||
When I configure pagekite with host pagekite.example.com, port 8080, kite name Mykite.example.com and kite secret mysecret
|
||||
Then pagekite should be configured with host pagekite.example.com, port 8080, kite name mykite.example.com and kite secret mysecret
|
||||
|
||||
@backups
|
||||
Scenario: Backup and restore pagekite
|
||||
Given the pagekite application is enabled
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user