Trim down messages, UX comes later
This commit is contained in:
parent
44b0658a31
commit
39fbc58420
68
second.py
68
second.py
@ -60,7 +60,7 @@ def stack_deploy(app_name, env):
|
|||||||
|
|
||||||
|
|
||||||
def get_loaded_env(app_name, request_form):
|
def get_loaded_env(app_name, request_form):
|
||||||
"""Load an environment with install form values for compose.yml injection."""
|
"""Load environment from install form for compose.yml injection."""
|
||||||
environment = environ.copy()
|
environment = environ.copy()
|
||||||
for key in request_form.keys():
|
for key in request_form.keys():
|
||||||
environment[key.upper()] = request.form[key]
|
environment[key.upper()] = request.form[key]
|
||||||
@ -71,80 +71,26 @@ class GiteaInstallForm(FlaskForm):
|
|||||||
"""Gitea installation form."""
|
"""Gitea installation form."""
|
||||||
|
|
||||||
app_name = StringField("Application name", default="Git with a cup of tea")
|
app_name = StringField("Application name", default="Git with a cup of tea")
|
||||||
domain = StringField(
|
domain = StringField("Domain name", validators=[DataRequired()],)
|
||||||
# TODO(decentral1se): missing domain name validator
|
|
||||||
"Domain name",
|
|
||||||
validators=[DataRequired("Please enter a domain name")],
|
|
||||||
)
|
|
||||||
|
|
||||||
db_host = StringField("Database host", default="mariadb:3306")
|
db_host = StringField("Database host", default="mariadb:3306")
|
||||||
db_name = StringField("Database name", default="gitea")
|
db_name = StringField("Database name", default="gitea")
|
||||||
db_passwd = PasswordField(
|
db_passwd = PasswordField(
|
||||||
"Database password",
|
"Database password", validators=[DataRequired(), Length(min=32)],
|
||||||
validators=[
|
|
||||||
DataRequired(),
|
|
||||||
Length(
|
|
||||||
min=32,
|
|
||||||
message=(
|
|
||||||
"Your chosen password length is too short, "
|
|
||||||
"must be at least 32 characters long"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
db_root_passwd = PasswordField(
|
db_root_passwd = PasswordField(
|
||||||
"Database root password",
|
"Database root password", validators=[DataRequired(), Length(min=32)],
|
||||||
validators=[
|
|
||||||
DataRequired(),
|
|
||||||
Length(
|
|
||||||
min=32,
|
|
||||||
message=(
|
|
||||||
"Your chosen password length is too short, "
|
|
||||||
"it must be at least 32 characters long"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
db_type = StringField("Database type", default="mysql")
|
db_type = StringField("Database type", default="mysql")
|
||||||
db_user = StringField("Database user", default="mysql")
|
db_user = StringField("Database user", default="mysql")
|
||||||
internal_token = PasswordField(
|
internal_token = PasswordField(
|
||||||
"Internal secret token",
|
"Internal secret token", validators=[DataRequired(), Length(min=105)],
|
||||||
validators=[
|
|
||||||
DataRequired(),
|
|
||||||
Length(
|
|
||||||
min=105,
|
|
||||||
message=(
|
|
||||||
"Your chosen token length is too short, "
|
|
||||||
"it must be at least 105 characters long"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
jwt_secret = PasswordField(
|
jwt_secret = PasswordField(
|
||||||
"JWT secret",
|
"JWT secret", validators=[DataRequired(), Length(min=43)],
|
||||||
validators=[
|
|
||||||
DataRequired(),
|
|
||||||
Length(
|
|
||||||
min=43,
|
|
||||||
message=(
|
|
||||||
"Your chosen password length is too short, "
|
|
||||||
"it must be at least 32 characters long"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
secret_key = PasswordField(
|
secret_key = PasswordField(
|
||||||
"Secret key",
|
"Secret key", validators=[DataRequired(), Length(min=64),],
|
||||||
validators=[
|
|
||||||
DataRequired(),
|
|
||||||
Length(
|
|
||||||
min=64,
|
|
||||||
message=(
|
|
||||||
"Your chosen password length is too short, "
|
|
||||||
"it must be at least 64 characters long"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
ssh_port = StringField("SSH port", default="2222")
|
ssh_port = StringField("SSH port", default="2222")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user