diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-11 14:40:19 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-07-24 10:58:16 +0200 |
commit | dba85a1e9e9f603ba52e1ea42deaf3fdd799b1d8 (patch) | |
tree | 7695023d90b78f972abafc718346c50264587ff5 /server/helpers/custom-validators/plugins.ts | |
parent | d00dc28dd73ad9dd419d5a5ac6ac747cefbc6e8b (diff) | |
download | PeerTube-dba85a1e9e9f603ba52e1ea42deaf3fdd799b1d8.tar.gz PeerTube-dba85a1e9e9f603ba52e1ea42deaf3fdd799b1d8.tar.zst PeerTube-dba85a1e9e9f603ba52e1ea42deaf3fdd799b1d8.zip |
WIP plugins: add plugin settings/uninstall in client
Diffstat (limited to 'server/helpers/custom-validators/plugins.ts')
-rw-r--r-- | server/helpers/custom-validators/plugins.ts | 7 |
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 | ||
44 | function isPluginHomepage (value: string) { | ||
45 | return isUrlValid(value) | ||
46 | } | ||
47 | |||
44 | function isStaticDirectoriesValid (staticDirs: any) { | 48 | function 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, |