|
|
@ -31,6 +31,8 @@ def base_url_slash_cleaner(uri):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def validate_ip_address(ip_string):
|
|
|
|
def validate_ip_address(ip_string):
|
|
|
|
|
|
|
|
if ip_string == '*':
|
|
|
|
|
|
|
|
return True
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
ip_address(ip_string)
|
|
|
|
ip_address(ip_string)
|
|
|
|
return True
|
|
|
|
return True
|
|
|
@ -73,7 +75,7 @@ validators = [
|
|
|
|
# general section
|
|
|
|
# general section
|
|
|
|
Validator('general.flask_secret_key', must_exist=True, default=hexlify(os.urandom(16)).decode(),
|
|
|
|
Validator('general.flask_secret_key', must_exist=True, default=hexlify(os.urandom(16)).decode(),
|
|
|
|
is_type_of=str),
|
|
|
|
is_type_of=str),
|
|
|
|
Validator('general.ip', must_exist=True, default='0.0.0.0', is_type_of=str, condition=validate_ip_address),
|
|
|
|
Validator('general.ip', must_exist=True, default='*', is_type_of=str, condition=validate_ip_address),
|
|
|
|
Validator('general.port', must_exist=True, default=6767, is_type_of=int, gte=1, lte=65535),
|
|
|
|
Validator('general.port', must_exist=True, default=6767, is_type_of=int, gte=1, lte=65535),
|
|
|
|
Validator('general.base_url', must_exist=True, default='', is_type_of=str),
|
|
|
|
Validator('general.base_url', must_exist=True, default='', is_type_of=str),
|
|
|
|
Validator('general.path_mappings', must_exist=True, default=[], is_type_of=list),
|
|
|
|
Validator('general.path_mappings', must_exist=True, default=[], is_type_of=list),
|
|
|
|