aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r--server/helpers/custom-validators/plugins.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/helpers/custom-validators/plugins.ts b/server/helpers/custom-validators/plugins.ts
index 4ab5f9ce8..064af9ead 100644
--- a/server/helpers/custom-validators/plugins.ts
+++ b/server/helpers/custom-validators/plugins.ts
@@ -41,6 +41,10 @@ function isPluginEngineValid (engine: any) {
41 return exists(engine) && exists(engine.peertube) 41 return exists(engine) && exists(engine.peertube)
42} 42}
43 43
44function isPluginHomepage (value: string) {
45 return isUrlValid(value)
46}
47
44function isStaticDirectoriesValid (staticDirs: any) { 48function isStaticDirectoriesValid (staticDirs: any) {
45 if (!exists(staticDirs) || typeof staticDirs !== 'object') return false 49 if (!exists(staticDirs) || typeof staticDirs !== 'object') return false
46 50
@@ -70,7 +74,7 @@ function isPackageJSONValid (packageJSON: PluginPackageJson, pluginType: PluginT
70 return isNpmPluginNameValid(packageJSON.name) && 74 return isNpmPluginNameValid(packageJSON.name) &&
71 isPluginDescriptionValid(packageJSON.description) && 75 isPluginDescriptionValid(packageJSON.description) &&
72 isPluginEngineValid(packageJSON.engine) && 76 isPluginEngineValid(packageJSON.engine) &&
73 isUrlValid(packageJSON.homepage) && 77 isPluginHomepage(packageJSON.homepage) &&
74 exists(packageJSON.author) && 78 exists(packageJSON.author) &&
75 isUrlValid(packageJSON.bugs) && 79 isUrlValid(packageJSON.bugs) &&
76 (pluginType === PluginType.THEME || isSafePath(packageJSON.library)) && 80 (pluginType === PluginType.THEME || isSafePath(packageJSON.library)) &&
@@ -88,6 +92,7 @@ export {
88 isPluginTypeValid, 92 isPluginTypeValid,
89 isPackageJSONValid, 93 isPackageJSONValid,
90 isThemeValid, 94 isThemeValid,
95 isPluginHomepage,
91 isPluginVersionValid, 96 isPluginVersionValid,
92 isPluginNameValid, 97 isPluginNameValid,
93 isPluginDescriptionValid, 98 isPluginDescriptionValid,