From 815d3ec0e873d92c3e424951f2505ad55e5db355 Mon Sep 17 00:00:00 2001 From: Joseph Nuthalapati Date: Tue, 12 Nov 2019 21:33:09 +0530 Subject: [PATCH] firstboot: reading firstboot-wizard-secret file Explain how to read the firstboot-wizard-secret file using shell commands. Remove output of the cat command. Signed-off-by: Joseph Nuthalapati Reviewed-by: James Valleroy --- debian/templates | 8 ++++---- plinth/modules/first_boot/forms.py | 9 ++++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/debian/templates b/debian/templates index ae46d4e76..8e56ca1cf 100644 --- a/debian/templates +++ b/debian/templates @@ -2,8 +2,8 @@ Template: plinth/firstboot_wizard_secret Type: note #flag:translate!:3 _Description: FreedomBox first wizard secret - ${secret} - Please save this string. You will be asked to enter this in the first screen - after you launch the FreedomBox interface. In case you lose it, you can find - it in the file /var/lib/plinth/firstboot-wizard-secret. + Please note down the above secret. You will be asked to enter this in the + first screen after you launch the FreedomBox web interface. In case you lose + it, you can retrieve it by running the following command: . - ${secret} + $ sudo cat /var/lib/plinth/firstboot-wizard-secret diff --git a/plinth/modules/first_boot/forms.py b/plinth/modules/first_boot/forms.py index 8cd9596f0..82a508310 100644 --- a/plinth/modules/first_boot/forms.py +++ b/plinth/modules/first_boot/forms.py @@ -18,6 +18,7 @@ from django import forms from django.utils.translation import ugettext_lazy as _ +from plinth import cfg from plinth.modules import first_boot @@ -26,9 +27,11 @@ class FirstbootWizardSecretForm(forms.Form): secret = forms.CharField( label='', help_text=_( 'Enter the secret generated during FreedomBox installation. ' - 'This secret can also be obtained from the file ' - '/var/lib/plinth/firstboot-wizard-secret'), required=False, - widget=forms.PasswordInput(attrs={'placeholder': _('Secret')})) + 'This secret can also be obtained by running the command "sudo ' + 'cat /var/lib/plinth/firstboot-wizard-secret" on your {box_name}'. + format(box_name=_(cfg.box_name))), required=False, + widget=forms.PasswordInput( + attrs={'placeholder': _('Firstboot Wizard Secret')})) def validate_secret(self, secret): """Match the secret provided by the user with the one