Wrapping up the portal settings
This commit is contained in:
parent
2d3338b835
commit
a7cb20cf2f
4 changed files with 16 additions and 11 deletions
10
app/forms.py
10
app/forms.py
|
|
@ -4,6 +4,7 @@ from wtforms import StringField, PasswordField, SubmitField, BooleanField, FileF
|
|||
from wtforms.validators import DataRequired, ValidationError, Length
|
||||
from flask_babel import lazy_gettext as _l
|
||||
import re
|
||||
from wtforms.widgets import PasswordInput
|
||||
|
||||
def hostname_check(form, field):
|
||||
regex= re.compile("[a-zA-Z0-9-_]+")
|
||||
|
|
@ -35,11 +36,12 @@ class SettingsForm(FlaskForm):
|
|||
enable_deltachat = BooleanField(_l('Enable DeltaChat'))
|
||||
enable_wifi_sharing = BooleanField(_l('Enable WiFi Sharing'))
|
||||
# Access Settings
|
||||
admin_password = PasswordField(_l('Admin Password'))
|
||||
|
||||
root_account_settings= RadioField(_l('Secure Root Account Method'), choices=[ ('lock_root_account', 'Lock root account'), ( 'set_root_password', 'Set root password')], validators=[DataRequired()])
|
||||
ssh_access_settings = RadioField(_l('SSH Access Method'), choices=[ ('disable_ssh', 'Disable SSH'), ( 'enable_ssh_with_root_password', 'Enable SSH with root password'), ('enable_ssh_with_public_key', 'Enable SSH with public key'), ], validators=[DataRequired()])
|
||||
admin_password = StringField('Admin Password', widget=PasswordInput(hide_value=False))
|
||||
root_password = StringField('Root Password', widget=PasswordInput(hide_value=False), validators=[DataRequired()])
|
||||
|
||||
root_account_settings= RadioField(_l('Secure Root Account Method'), choices=[ ('lock_root_account', 'Lock root account'), ( 'set_root_password', 'Use root password')], validators=[DataRequired()])
|
||||
ssh_access_settings = RadioField(_l('SSH Access Method'), choices=[ ('disable_ssh', 'Disable SSH'), ( 'enable_ssh_with_root_password', 'Enable SSH with root password'), ], validators=[DataRequired()])
|
||||
# ('enable_ssh_with_public_key', 'Enable SSH with public key'),
|
||||
lock_root_account = BooleanField(_l('Lock Root Account'))
|
||||
butterbox_hostname = StringField(_l('Butterbox Hostname'), validators=[DataRequired(), Length(1, 64), hostname_check])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue