Enforce HTTPS urls for network files (#78)

Drop requirement for them to be on Github. Noobpwnftw will be hosting a server for the NNUE files. @vshcherbyna has more information.
This commit is contained in:
Volodymyr Shcherbyna authored and GitHub committed 2020-09-04 17:11:49 -04:00
1 parent 6fd87a2c3c
commit b72c0dfcb2
1 file changed
+5 -5
+5 -5
View File
@@ -203,9 +203,9 @@ def verifyNewTest(request):
if request.POST[field] not in OpenBench.config.OPENBENCH_CONFIG[parent].keys(): if request.POST[field] not in OpenBench.config.OPENBENCH_CONFIG[parent].keys():
errors.append('{0} was not found in the configuration'.format(fieldName)) errors.append('{0} was not found in the configuration'.format(fieldName))
def verifyGithubLink(field, fieldName): def verifySecureLink(field, fieldName):
if request.POST[field] and not request.POST[field].startswith('https://github.com/'): if request.POST[field] and not request.POST[field].startswith('https://'):
errors.append('{0} must be located on a Github URL'.format(fieldName)) errors.append('{0} must be located on a HTTPS URL'.format(fieldName))
verifications = [ verifications = [
(verifyInteger, 'priority', 'Priority'), (verifyInteger, 'priority', 'Priority'),
@@ -225,8 +225,8 @@ def verifyNewTest(request):
(verifyOptions, 'baseoptions', 'Hash', 'Base Options'), (verifyOptions, 'baseoptions', 'Hash', 'Base Options'),
(verifyConfiguration, 'enginename', 'Engine', 'engines'), (verifyConfiguration, 'enginename', 'Engine', 'engines'),
(verifyConfiguration, 'bookname', 'Book', 'books'), (verifyConfiguration, 'bookname', 'Book', 'books'),
(verifyGithubLink, 'devnetwork', 'Dev Network'), (verifySecureLink, 'devnetwork', 'Dev Network'),
(verifyGithubLink, 'basenetwork', 'Base Network'), (verifySecureLink, 'basenetwork', 'Base Network'),
] ]
for verification in verifications: for verification in verifications: