mirror of
https://github.com/caprover/caprover
synced 2025-10-30 01:57:03 +00:00
Merge pull request #2343 from internet2000/master
Some checks failed
Run build / build (push) Has been cancelled
Run formatter / check-code-formatting (push) Has been cancelled
Run lint / run-lint (push) Has been cancelled
Build and push the edge image / run-pre-checks (push) Has been cancelled
Build and push the edge image / build-publish-docker-hub (push) Has been cancelled
Some checks failed
Run build / build (push) Has been cancelled
Run formatter / check-code-formatting (push) Has been cancelled
Run lint / run-lint (push) Has been cancelled
Build and push the edge image / run-pre-checks (push) Has been cancelled
Build and push the edge image / build-publish-docker-hub (push) Has been cancelled
Allow numbers in project name, fix #2130
This commit is contained in:
@@ -30,7 +30,7 @@ function isNameAllowed(name: string) {
|
||||
const isNameFormattingOk =
|
||||
!!name &&
|
||||
name.length < 50 &&
|
||||
/^[a-z]/.test(name) &&
|
||||
/^[a-z0-9]/.test(name) &&
|
||||
/[a-z0-9]$/.test(name) &&
|
||||
/^[a-z0-9\-]+$/.test(name) &&
|
||||
name.indexOf('--') < 0
|
||||
@@ -242,7 +242,7 @@ class AppsDataStore {
|
||||
if (!isNameAllowed(appName)) {
|
||||
throw ApiStatusCodes.createError(
|
||||
ApiStatusCodes.STATUS_ERROR_BAD_NAME,
|
||||
'App Name is not allowed. Only lowercase letters and single hyphens are allowed'
|
||||
'App Name is not allowed. Only lowercase letters, numbers and single hyphens are allowed'
|
||||
)
|
||||
}
|
||||
|
||||
@@ -873,7 +873,7 @@ class AppsDataStore {
|
||||
reject(
|
||||
ApiStatusCodes.createError(
|
||||
ApiStatusCodes.STATUS_ERROR_BAD_NAME,
|
||||
'App Name is not allowed. Only lowercase letters and single hyphens are allowed'
|
||||
'App Name is not allowed. Only lowercase letters, numbers and single hyphens are allowed'
|
||||
)
|
||||
)
|
||||
return
|
||||
@@ -915,7 +915,7 @@ class AppsDataStore {
|
||||
reject(
|
||||
ApiStatusCodes.createError(
|
||||
ApiStatusCodes.STATUS_ERROR_BAD_NAME,
|
||||
'App Name is not allowed. Only lowercase letters and single hyphens are allowed'
|
||||
'App Name is not allowed. Only lowercase letters, numbers and single hyphens are allowed'
|
||||
)
|
||||
)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user