mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
config, names: Move setting hostname from config to names
Tests: - Config app description is as expected. - Config form does not show hostname anymore. - Submitting the form with changes works. - Names app has correct link for configuring Local Domain Name. Clicking it takes to page for setting hostname. - Avahi shows the current .local domain correctly in Names app. - Change hostname form shows correct value for current hostname. - Change hostname form sets the value for hostname properly. - Page title is correct. - Validations works. - Pre/post hostname change signals are sent properly - Success message as shown expected - hostnamectl shows the set domain - If domain name is not set, downloaded OpenVPN profile shows hostname. - Unit tests work. - Functional tests on names/config/avahi apps work. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
1 parent
dceee56684
commit
8c69858d43
16 files changed
+173
-120
No files matched your search
@@ -46,23 +46,6 @@ def get_homepage_choices():
|
||||
|
||||
class ConfigurationForm(forms.Form):
|
||||
"""Main system configuration form"""
|
||||
# See:
|
||||
# https://tools.ietf.org/html/rfc952
|
||||
# https://tools.ietf.org/html/rfc1035#section-2.3.1
|
||||
# https://tools.ietf.org/html/rfc1123#section-2
|
||||
# https://tools.ietf.org/html/rfc2181#section-11
|
||||
hostname = forms.CharField(
|
||||
label=gettext_lazy('Hostname'), help_text=format_lazy(
|
||||
gettext_lazy(
|
||||
'Hostname is the local name by which other devices on the '
|
||||
'local network can reach your {box_name}. It must start and '
|
||||
'end with an alphabet or a digit and have as interior '
|
||||
'characters only alphabets, digits and hyphens. Total '
|
||||
'length must be 63 characters or less.'),
|
||||
box_name=gettext_lazy(cfg.box_name)), validators=[
|
||||
validators.RegexValidator(HOSTNAME_REGEX,
|
||||
gettext_lazy('Invalid hostname'))
|
||||
], strip=True)
|
||||
|
||||
domainname = forms.CharField(
|
||||
label=gettext_lazy('Domain Name'), help_text=format_lazy(
|
||||
|
||||
Reference in new issue
Block a user