Browse Source

feat: storage module refactor + UI fixes

NGPixel 7 years ago
parent
commit
9e2f1caaf7
40 changed files with 334 additions and 329 deletions
  1. 1 1
      client/components/admin/admin-auth.vue
  2. 3 3
      client/components/admin/admin-contribute.vue
  3. 2 2
      client/components/admin/admin-general.vue
  4. 4 4
      client/components/admin/admin-groups.vue
  5. 2 2
      client/components/admin/admin-locale.vue
  6. 2 2
      client/components/admin/admin-rendering.vue
  7. 1 1
      client/components/admin/admin-storage.vue
  8. 3 3
      client/components/admin/admin-system.vue
  9. 1 1
      client/components/admin/admin-theme.vue
  10. 0 1
      client/scss/app.scss
  11. 2 3
      server/db/models/authentication.js
  12. 16 6
      server/db/models/storage.js
  13. 9 8
      server/helpers/common.js
  14. 0 30
      server/modules/storage/azure.js
  15. 7 0
      server/modules/storage/azure/definition.yml
  16. 23 0
      server/modules/storage/azure/storage.js
  17. 0 34
      server/modules/storage/digitalocean.js
  18. 10 0
      server/modules/storage/digitalocean/definition.yml
  19. 23 0
      server/modules/storage/digitalocean/storage.js
  20. 0 28
      server/modules/storage/disk.js
  21. 5 0
      server/modules/storage/disk/definition.yml
  22. 23 0
      server/modules/storage/disk/storage.js
  23. 0 29
      server/modules/storage/dropbox.js
  24. 6 0
      server/modules/storage/dropbox/definition.yml
  25. 23 0
      server/modules/storage/dropbox/storage.js
  26. 0 29
      server/modules/storage/gdrive.js
  27. 6 0
      server/modules/storage/gdrive/definition.yml
  28. 23 0
      server/modules/storage/gdrive/storage.js
  29. 0 44
      server/modules/storage/git.js
  30. 20 0
      server/modules/storage/git/definition.yml
  31. 23 0
      server/modules/storage/git/storage.js
  32. 0 29
      server/modules/storage/onedrive.js
  33. 6 0
      server/modules/storage/onedrive/definition.yml
  34. 23 0
      server/modules/storage/onedrive/storage.js
  35. 0 31
      server/modules/storage/s3.js
  36. 8 0
      server/modules/storage/s3/definition.yml
  37. 23 0
      server/modules/storage/s3/storage.js
  38. 0 38
      server/modules/storage/scp.js
  39. 13 0
      server/modules/storage/scp/definition.yml
  40. 23 0
      server/modules/storage/scp/storage.js

+ 1 - 1
client/components/admin/admin-auth.vue

@@ -51,7 +51,7 @@
                 v-model='cfg.value.value'
                 v-model='cfg.value.value'
                 prepend-icon='settings_applications'
                 prepend-icon='settings_applications'
                 )
                 )
-            v-divider
+            v-divider.mt-3
             v-subheader.pl-0 Registration
             v-subheader.pl-0 Registration
             .pr-3
             .pr-3
               v-switch.ml-3(
               v-switch.ml-3(

+ 3 - 3
client/components/admin/admin-contribute.vue

@@ -9,14 +9,14 @@
         a(href='https://requarks.io', target='_blank') requarks.io
         a(href='https://requarks.io', target='_blank') requarks.io
         a(href='https://github.com/Requarks/wiki/graphs/contributors', target='_blank') {{ $t('admin:contribute.openSourceContributors') }}
         a(href='https://github.com/Requarks/wiki/graphs/contributors', target='_blank') {{ $t('admin:contribute.openSourceContributors') }}
       .body-1.pt-3.pl-3 {{ $t('admin:contribute.needYourHelp') }}
       .body-1.pt-3.pl-3 {{ $t('admin:contribute.needYourHelp') }}
-      v-divider
+      v-divider.mt-3
       v-subheader {{ $t('admin:contribute.fundOurWork') }}
       v-subheader {{ $t('admin:contribute.fundOurWork') }}
       .body-1.pl-3 {{ $t('admin:contribute.openCollective') }}
       .body-1.pl-3 {{ $t('admin:contribute.openCollective') }}
       v-card-actions.mt-3.ml-2
       v-card-actions.mt-3.ml-2
         v-btn(depressed, color='primary', href='https://opencollective.com/wikijs')
         v-btn(depressed, color='primary', href='https://opencollective.com/wikijs')
           v-icon(left) local_atm
           v-icon(left) local_atm
           span {{ $t('admin:contribute.makeADonation') }}
           span {{ $t('admin:contribute.makeADonation') }}
-      v-divider
+      v-divider.mt-3
       v-subheader {{ $t('admin:contribute.contribute') }}
       v-subheader {{ $t('admin:contribute.contribute') }}
       .body-1.pl-3
       .body-1.pl-3
         ul
         ul
@@ -26,7 +26,7 @@
             a(href='https://github.com/Requarks/wiki/issues', target='_blank') Github
             a(href='https://github.com/Requarks/wiki/issues', target='_blank') Github
           i18next(path='admin:contribute.helpTranslate', tag='li')
           i18next(path='admin:contribute.helpTranslate', tag='li')
             a(href='https://gitter.im/Requarks/wiki', target='_blank') Gitter
             a(href='https://gitter.im/Requarks/wiki', target='_blank') Gitter
-      v-divider
+      v-divider.mt-3
       v-subheader {{ $t('admin:contribute.spreadTheWord') }}
       v-subheader {{ $t('admin:contribute.spreadTheWord') }}
       .body-1.pl-3
       .body-1.pl-3
         ul
         ul

+ 2 - 2
client/components/admin/admin-general.vue

@@ -15,7 +15,7 @@
                   v-subheader General
                   v-subheader General
                   .px-3
                   .px-3
                     v-text-field(label='Site Title', required, :counter='50', v-model='siteTitle', prepend-icon='public')
                     v-text-field(label='Site Title', required, :counter='50', v-model='siteTitle', prepend-icon='public')
-                    v-divider
+                  v-divider.mt-3
                   v-subheader SEO
                   v-subheader SEO
                   .px-3
                   .px-3
                     v-text-field(label='Site Description', :counter='255', prepend-icon='public')
                     v-text-field(label='Site Description', :counter='255', prepend-icon='public')
@@ -51,7 +51,7 @@
                     persistent-hint
                     persistent-hint
                     hint='Check this option if a round logo frame doesn\'t work with your logo.'
                     hint='Check this option if a round logo frame doesn\'t work with your logo.'
                     )
                     )
-                  v-divider
+                  v-divider.mt-3
                   v-switch(
                   v-switch(
                     v-model='displayMascot'
                     v-model='displayMascot'
                     label='Display Wiki.js Mascot'
                     label='Display Wiki.js Mascot'

+ 4 - 4
client/components/admin/admin-groups.vue

@@ -22,10 +22,10 @@
         v-spacer
         v-spacer
         v-text-field(solo, append-icon='search', label='Search', single-line, hide-details, v-model='search')
         v-text-field(solo, append-icon='search', label='Search', single-line, hide-details, v-model='search')
       v-data-table(
       v-data-table(
-        :items='groups',
-        :headers='headers',
-        :search='search',
-        :pagination.sync='pagination',
+        :items='groups'
+        :headers='headers'
+        :search='search'
+        :pagination.sync='pagination'
         :rows-per-page-items='[15]'
         :rows-per-page-items='[15]'
         hide-actions
         hide-actions
       )
       )

+ 2 - 2
client/components/admin/admin-locale.vue

@@ -31,7 +31,7 @@
                         v-list-tile-content
                         v-list-tile-content
                           v-list-tile-title(v-html='data.item.name')
                           v-list-tile-title(v-html='data.item.name')
                           v-list-tile-sub-title(v-html='data.item.nativeName')
                           v-list-tile-sub-title(v-html='data.item.nativeName')
-                  v-divider
+                  v-divider.mt-3
                   v-switch(
                   v-switch(
                     v-model='autoUpdate'
                     v-model='autoUpdate'
                     :label='$t("admin:locale.autoUpdate.label")'
                     :label='$t("admin:locale.autoUpdate.label")'
@@ -65,7 +65,7 @@
                     )
                     )
                     span {{ $t('admin:locale.namespacingPrefixWarning.title', { langCode: selectedLocale }) }}
                     span {{ $t('admin:locale.namespacingPrefixWarning.title', { langCode: selectedLocale }) }}
                     .caption.grey--text {{ $t('admin:locale.namespacingPrefixWarning.subtitle') }}
                     .caption.grey--text {{ $t('admin:locale.namespacingPrefixWarning.subtitle') }}
-                  v-divider
+                  v-divider.mt-3.mb-4
                   v-select(
                   v-select(
                     :disabled='!namespacing'
                     :disabled='!namespacing'
                     :items='installedLocales'
                     :items='installedLocales'

+ 2 - 2
client/components/admin/admin-rendering.vue

@@ -169,7 +169,7 @@
                   persistent-hint
                   persistent-hint
                   hint='Links will automatically be converted to clickable links.'
                   hint='Links will automatically be converted to clickable links.'
                   )
                   )
-                v-divider
+                v-divider.mt-3
                 v-switch(
                 v-switch(
                   v-model='linkify'
                   v-model='linkify'
                   label='Automatically convert line breaks'
                   label='Automatically convert line breaks'
@@ -177,7 +177,7 @@
                   persistent-hint
                   persistent-hint
                   hint='Add linebreaks within paragraphs.'
                   hint='Add linebreaks within paragraphs.'
                   )
                   )
-                v-divider
+                v-divider.mt-3
                 v-switch(
                 v-switch(
                   v-model='linkify'
                   v-model='linkify'
                   label='Highlight code blocks'
                   label='Highlight code blocks'

+ 1 - 1
client/components/admin/admin-storage.vue

@@ -51,7 +51,7 @@
                 v-model='cfg.value.value'
                 v-model='cfg.value.value'
                 prepend-icon='settings_applications'
                 prepend-icon='settings_applications'
                 )
                 )
-            v-divider
+            v-divider.mt-3
             v-subheader.pl-0 Sync Direction
             v-subheader.pl-0 Sync Direction
             .body-1.ml-3 Choose how content synchronization is handled for this storage target.
             .body-1.ml-3 Choose how content synchronization is handled for this storage target.
             .pr-3.pt-3
             .pr-3.pt-3

+ 3 - 3
client/components/admin/admin-system.vue

@@ -25,7 +25,7 @@
                   v-list-tile-action
                   v-list-tile-action
                     v-list-tile-action-text {{ $t('admin:system.published') }} {{ info.latestVersionReleaseDate | moment('from') }}
                     v-list-tile-action-text {{ $t('admin:system.published') }} {{ info.latestVersionReleaseDate | moment('from') }}
 
 
-                v-divider
+                v-divider.mt-3
 
 
                 v-subheader {{ $t('admin:system.hostInfo') }}
                 v-subheader {{ $t('admin:system.hostInfo') }}
                 v-list-tile(avatar)
                 v-list-tile(avatar)
@@ -76,7 +76,7 @@
                   v-list-tile-content
                   v-list-tile-content
                     v-list-tile-title {{ info.nodeVersion }}
                     v-list-tile-title {{ info.nodeVersion }}
 
 
-                v-divider
+                v-divider.mt-3
 
 
                 v-subheader Redis
                 v-subheader Redis
                 v-list-tile(avatar)
                 v-list-tile(avatar)
@@ -89,7 +89,7 @@
                   v-list-tile-action
                   v-list-tile-action
                     v-list-tile-action-text {{ $t('admin:system.ramUsage', { used: info.redisUsedRAM, total: info.redisTotalRAM }) }}
                     v-list-tile-action-text {{ $t('admin:system.ramUsage', { used: info.redisUsedRAM, total: info.redisTotalRAM }) }}
 
 
-                v-divider
+                v-divider.mt-3
 
 
                 v-subheader {{ info.dbType }}
                 v-subheader {{ info.dbType }}
                 v-list-tile(avatar)
                 v-list-tile(avatar)

+ 1 - 1
client/components/admin/admin-theme.vue

@@ -26,7 +26,7 @@
                       v-list-tile-content
                       v-list-tile-content
                         v-list-tile-title(v-html='data.item.text')
                         v-list-tile-title(v-html='data.item.text')
                         v-list-tile-sub-title(v-html='data.item.author')
                         v-list-tile-sub-title(v-html='data.item.author')
-                  v-divider
+                  v-divider.mt-3
                   v-switch(
                   v-switch(
                     v-model='darkMode'
                     v-model='darkMode'
                     label='Dark Mode'
                     label='Dark Mode'

+ 0 - 1
client/scss/app.scss

@@ -1,6 +1,5 @@
 @import "global";
 @import "global";
 
 
-@import "base/reset";
 @import "base/base";
 @import "base/base";
 @import 'base/icons';
 @import 'base/icons';
 
 

+ 2 - 3
server/db/models/authentication.js

@@ -2,7 +2,6 @@ const Model = require('objection').Model
 const autoload = require('auto-load')
 const autoload = require('auto-load')
 const path = require('path')
 const path = require('path')
 const _ = require('lodash')
 const _ = require('lodash')
-const commonHelper = require('../../helpers/common')
 
 
 /* global WIKI */
 /* global WIKI */
 
 
@@ -56,7 +55,7 @@ module.exports = class Authentication extends Model {
               if (_.isPlainObject(value)) {
               if (_.isPlainObject(value)) {
                 let cfgValue = {
                 let cfgValue = {
                   type: typeof value.type(),
                   type: typeof value.type(),
-                  value: !_.isNil(value.default) ? value.default : commonHelper.getTypeDefaultValue(value)
+                  value: !_.isNil(value.default) ? value.default : new value() // eslint-disable-line new-cap
                 }
                 }
                 if (_.isArray(value.enum)) {
                 if (_.isArray(value.enum)) {
                   cfgValue.enum = value.enum
                   cfgValue.enum = value.enum
@@ -65,7 +64,7 @@ module.exports = class Authentication extends Model {
               } else {
               } else {
                 _.set(result, key, {
                 _.set(result, key, {
                   type: typeof value(),
                   type: typeof value(),
-                  value: commonHelper.getTypeDefaultValue(value)
+                  value: new value() // eslint-disable-line new-cap
                 })
                 })
               }
               }
               return result
               return result

+ 16 - 6
server/db/models/storage.js

@@ -1,7 +1,8 @@
 const Model = require('objection').Model
 const Model = require('objection').Model
-const autoload = require('auto-load')
 const path = require('path')
 const path = require('path')
+const fs = require('fs-extra')
 const _ = require('lodash')
 const _ = require('lodash')
+const yaml = require('js-yaml')
 const commonHelper = require('../../helpers/common')
 const commonHelper = require('../../helpers/common')
 
 
 /* global WIKI */
 /* global WIKI */
@@ -35,9 +36,18 @@ module.exports = class Storage extends Model {
   static async refreshTargetsFromDisk() {
   static async refreshTargetsFromDisk() {
     try {
     try {
       const dbTargets = await WIKI.db.storage.query()
       const dbTargets = await WIKI.db.storage.query()
-      const diskTargets = autoload(path.join(WIKI.SERVERPATH, 'modules/storage'))
+
+      // -> Fetch definitions from disk
+      const storageDirs = await fs.readdir(path.join(WIKI.SERVERPATH, 'modules/storage'))
+      let diskTargets = []
+      for (let dir of storageDirs) {
+        const def = await fs.readFile(path.join(WIKI.SERVERPATH, 'modules/storage', dir, 'definition.yml'), 'utf8')
+        diskTargets.push(yaml.safeLoad(def))
+      }
+
+      // -> Insert new targets
       let newTargets = []
       let newTargets = []
-      _.forOwn(diskTargets, (target, targetKey) => {
+      _.forEach(diskTargets, target => {
         if (!_.some(dbTargets, ['key', target.key])) {
         if (!_.some(dbTargets, ['key', target.key])) {
           newTargets.push({
           newTargets.push({
             key: target.key,
             key: target.key,
@@ -47,8 +57,8 @@ module.exports = class Storage extends Model {
             config: _.transform(target.props, (result, value, key) => {
             config: _.transform(target.props, (result, value, key) => {
               if (_.isPlainObject(value)) {
               if (_.isPlainObject(value)) {
                 let cfgValue = {
                 let cfgValue = {
-                  type: typeof value.type(),
-                  value: !_.isNil(value.default) ? value.default : commonHelper.getTypeDefaultValue(value)
+                  type: value.type.toLowerCase(),
+                  value: !_.isNil(value.default) ? value.default : commonHelper.getTypeDefaultValue(value.type)
                 }
                 }
                 if (_.isArray(value.enum)) {
                 if (_.isArray(value.enum)) {
                   cfgValue.enum = value.enum
                   cfgValue.enum = value.enum
@@ -56,7 +66,7 @@ module.exports = class Storage extends Model {
                 _.set(result, key, cfgValue)
                 _.set(result, key, cfgValue)
               } else {
               } else {
                 _.set(result, key, {
                 _.set(result, key, {
-                  type: typeof value(),
+                  type: value.toLowerCase(),
                   value: commonHelper.getTypeDefaultValue(value)
                   value: commonHelper.getTypeDefaultValue(value)
                 })
                 })
               }
               }

+ 9 - 8
server/helpers/common.js

@@ -1,17 +1,18 @@
-const _ = require('lodash')
-
 module.exports = {
 module.exports = {
   /**
   /**
    * Get default value of type
    * Get default value of type
    *
    *
-   * @param {any} Type Primitive Type
+   * @param {any} type primitive type name
    * @returns Default value
    * @returns Default value
    */
    */
-  getTypeDefaultValue (Type) {
-    if (_.isArray(Type)) {
-      return _.head(Type)
-    } else {
-      return new Type()
+  getTypeDefaultValue (type) {
+    switch (type.toLowerCase()) {
+      case 'string':
+        return ''
+      case 'number':
+        return 0
+      case 'boolean':
+        return false
     }
     }
   }
   }
 }
 }

+ 0 - 30
server/modules/storage/azure.js

@@ -1,30 +0,0 @@
-module.exports = {
-  key: 'azure',
-  title: 'Azure Blob Storage',
-  props: {
-    accountName: String,
-    accountKey: String,
-    container: String
-  },
-  activated(opts) {
-
-  },
-  deactivated(opts) {
-
-  },
-  init(opts) {
-
-  },
-  created(opts) {
-
-  },
-  updated(opts) {
-
-  },
-  deleted(opts) {
-
-  },
-  renamed(opts) {
-
-  }
-}

+ 7 - 0
server/modules/storage/azure/definition.yml

@@ -0,0 +1,7 @@
+key: azure
+title: Azure Blob Storage
+author: requarks.io
+props:
+  accountName: String
+  accountKey: String
+  container: String

+ 23 - 0
server/modules/storage/azure/storage.js

@@ -0,0 +1,23 @@
+module.exports = {
+  async activated(opts) {
+
+  },
+  async deactivated(opts) {
+
+  },
+  async init(opts) {
+
+  },
+  async created(opts) {
+
+  },
+  async updated(opts) {
+
+  },
+  async deleted(opts) {
+
+  },
+  async renamed(opts) {
+
+  }
+}

+ 0 - 34
server/modules/storage/digitalocean.js

@@ -1,34 +0,0 @@
-module.exports = {
-  key: 'digitalocean',
-  title: 'DigialOcean Spaces',
-  props: {
-    accessKeyId: String,
-    accessSecret: String,
-    region: {
-      type: String,
-      default: 'nyc3'
-    },
-    bucket: String
-  },
-  activated(opts) {
-
-  },
-  deactivated(opts) {
-
-  },
-  init(opts) {
-
-  },
-  created(opts) {
-
-  },
-  updated(opts) {
-
-  },
-  deleted(opts) {
-
-  },
-  renamed(opts) {
-
-  }
-}

+ 10 - 0
server/modules/storage/digitalocean/definition.yml

@@ -0,0 +1,10 @@
+key: digitalocean
+title: DigialOcean Spaces
+author: requarks.io
+props:
+  accessKeyId: String
+  accessSecret: String
+  region:
+    type: String
+    default: nyc3
+  bucket: String

+ 23 - 0
server/modules/storage/digitalocean/storage.js

@@ -0,0 +1,23 @@
+module.exports = {
+  async activated(opts) {
+
+  },
+  async deactivated(opts) {
+
+  },
+  async init(opts) {
+
+  },
+  async created(opts) {
+
+  },
+  async updated(opts) {
+
+  },
+  async deleted(opts) {
+
+  },
+  async renamed(opts) {
+
+  }
+}

+ 0 - 28
server/modules/storage/disk.js

@@ -1,28 +0,0 @@
-module.exports = {
-  key: 'disk',
-  title: 'Local FS',
-  props: {
-    path: String
-  },
-  activated(opts) {
-
-  },
-  deactivated(opts) {
-
-  },
-  init(opts) {
-
-  },
-  created(opts) {
-
-  },
-  updated(opts) {
-
-  },
-  deleted(opts) {
-
-  },
-  renamed(opts) {
-
-  }
-}

+ 5 - 0
server/modules/storage/disk/definition.yml

@@ -0,0 +1,5 @@
+key: disk
+title: Local FS
+author: requarks.io
+props:
+  path: String

+ 23 - 0
server/modules/storage/disk/storage.js

@@ -0,0 +1,23 @@
+module.exports = {
+  async activated(opts) {
+
+  },
+  async deactivated(opts) {
+
+  },
+  async init(opts) {
+
+  },
+  async created(opts) {
+
+  },
+  async updated(opts) {
+
+  },
+  async deleted(opts) {
+
+  },
+  async renamed(opts) {
+
+  }
+}

+ 0 - 29
server/modules/storage/dropbox.js

@@ -1,29 +0,0 @@
-module.exports = {
-  key: 'dropbox',
-  title: 'Dropbox',
-  props: {
-    appKey: String,
-    appSecret: String
-  },
-  activated(opts) {
-
-  },
-  deactivated(opts) {
-
-  },
-  init(opts) {
-
-  },
-  created(opts) {
-
-  },
-  updated(opts) {
-
-  },
-  deleted(opts) {
-
-  },
-  renamed(opts) {
-
-  }
-}

+ 6 - 0
server/modules/storage/dropbox/definition.yml

@@ -0,0 +1,6 @@
+key: dropbox
+title: Dropbox
+author: requarks.io
+props:
+  appKey: String
+  appSecret: String

+ 23 - 0
server/modules/storage/dropbox/storage.js

@@ -0,0 +1,23 @@
+module.exports = {
+  async activated(opts) {
+
+  },
+  async deactivated(opts) {
+
+  },
+  async init(opts) {
+
+  },
+  async created(opts) {
+
+  },
+  async updated(opts) {
+
+  },
+  async deleted(opts) {
+
+  },
+  async renamed(opts) {
+
+  }
+}

+ 0 - 29
server/modules/storage/gdrive.js

@@ -1,29 +0,0 @@
-module.exports = {
-  key: 'gdrive',
-  title: 'Google Drive',
-  props: {
-    clientId: String,
-    clientSecret: String
-  },
-  activated(opts) {
-
-  },
-  deactivated(opts) {
-
-  },
-  init(opts) {
-
-  },
-  created(opts) {
-
-  },
-  updated(opts) {
-
-  },
-  deleted(opts) {
-
-  },
-  renamed(opts) {
-
-  }
-}

+ 6 - 0
server/modules/storage/gdrive/definition.yml

@@ -0,0 +1,6 @@
+key: gdrive
+title: Google Drive
+author: requarks.io
+props:
+  clientId: String
+  clientSecret: String

+ 23 - 0
server/modules/storage/gdrive/storage.js

@@ -0,0 +1,23 @@
+module.exports = {
+  async activated(opts) {
+
+  },
+  async deactivated(opts) {
+
+  },
+  async init(opts) {
+
+  },
+  async created(opts) {
+
+  },
+  async updated(opts) {
+
+  },
+  async deleted(opts) {
+
+  },
+  async renamed(opts) {
+
+  }
+}

+ 0 - 44
server/modules/storage/git.js

@@ -1,44 +0,0 @@
-module.exports = {
-  key: 'git',
-  title: 'Git',
-  props: {
-    authType: {
-      type: String,
-      default: 'ssh',
-      enum: ['basic', 'ssh']
-    },
-    repoUrl: String,
-    branch: {
-      type: String,
-      default: 'master'
-    },
-    verifySSL: {
-      type: Boolean,
-      default: true
-    },
-    sshPrivateKeyPath: String,
-    basicUsername: String,
-    basicPassword: String
-  },
-  activated(opts) {
-
-  },
-  deactivated(opts) {
-
-  },
-  init(opts) {
-
-  },
-  created(opts) {
-
-  },
-  updated(opts) {
-
-  },
-  deleted(opts) {
-
-  },
-  renamed(opts) {
-
-  }
-}

+ 20 - 0
server/modules/storage/git/definition.yml

@@ -0,0 +1,20 @@
+key: git
+title: Git
+author: requarks.io
+props:
+  authType:
+    type: String
+    default: 'ssh'
+    enum:
+      - 'basic'
+      - 'ssh'
+  repoUrl: String
+  branch:
+    type: String
+    default: 'master'
+  verifySSL:
+    type: Boolean
+    default: true
+  sshPrivateKeyPath: String
+  basicUsername: String
+  basicPassword: String

+ 23 - 0
server/modules/storage/git/storage.js

@@ -0,0 +1,23 @@
+module.exports = {
+  async activated(opts) {
+
+  },
+  async deactivated(opts) {
+
+  },
+  async init(opts) {
+
+  },
+  async created(opts) {
+
+  },
+  async updated(opts) {
+
+  },
+  async deleted(opts) {
+
+  },
+  async renamed(opts) {
+
+  }
+}

+ 0 - 29
server/modules/storage/onedrive.js

@@ -1,29 +0,0 @@
-module.exports = {
-  key: 'onedrive',
-  title: 'OneDrive',
-  props: {
-    clientId: String,
-    clientSecret: String
-  },
-  activated(opts) {
-
-  },
-  deactivated(opts) {
-
-  },
-  init(opts) {
-
-  },
-  created(opts) {
-
-  },
-  updated(opts) {
-
-  },
-  deleted(opts) {
-
-  },
-  renamed(opts) {
-
-  }
-}

+ 6 - 0
server/modules/storage/onedrive/definition.yml

@@ -0,0 +1,6 @@
+key: onedrive
+title: OneDrive
+author: requarks.io
+props:
+  clientId: String
+  clientSecret: String

+ 23 - 0
server/modules/storage/onedrive/storage.js

@@ -0,0 +1,23 @@
+module.exports = {
+  async activated(opts) {
+
+  },
+  async deactivated(opts) {
+
+  },
+  async init(opts) {
+
+  },
+  async created(opts) {
+
+  },
+  async updated(opts) {
+
+  },
+  async deleted(opts) {
+
+  },
+  async renamed(opts) {
+
+  }
+}

+ 0 - 31
server/modules/storage/s3.js

@@ -1,31 +0,0 @@
-module.exports = {
-  key: 's3',
-  title: 'Amazon S3',
-  props: {
-    accessKeyId: String,
-    accessSecret: String,
-    region: String,
-    bucket: String
-  },
-  activated(opts) {
-
-  },
-  deactivated(opts) {
-
-  },
-  init(opts) {
-
-  },
-  created(opts) {
-
-  },
-  updated(opts) {
-
-  },
-  deleted(opts) {
-
-  },
-  renamed(opts) {
-
-  }
-}

+ 8 - 0
server/modules/storage/s3/definition.yml

@@ -0,0 +1,8 @@
+key: s3
+title: Amazon S3
+author: requarks.io
+props:
+  accessKeyId: String
+  accessSecret: String
+  region: String
+  bucket: String

+ 23 - 0
server/modules/storage/s3/storage.js

@@ -0,0 +1,23 @@
+module.exports = {
+  async activated(opts) {
+
+  },
+  async deactivated(opts) {
+
+  },
+  async init(opts) {
+
+  },
+  async created(opts) {
+
+  },
+  async updated(opts) {
+
+  },
+  async deleted(opts) {
+
+  },
+  async renamed(opts) {
+
+  }
+}

+ 0 - 38
server/modules/storage/scp.js

@@ -1,38 +0,0 @@
-module.exports = {
-  key: 'scp',
-  title: 'SCP (SSH)',
-  props: {
-    host: String,
-    port: {
-      type: Number,
-      default: 22
-    },
-    username: String,
-    privateKeyPath: String,
-    basePath: {
-      type: String,
-      default: '~'
-    }
-  },
-  activated(opts) {
-
-  },
-  deactivated(opts) {
-
-  },
-  init(opts) {
-
-  },
-  created(opts) {
-
-  },
-  updated(opts) {
-
-  },
-  deleted(opts) {
-
-  },
-  renamed(opts) {
-
-  }
-}

+ 13 - 0
server/modules/storage/scp/definition.yml

@@ -0,0 +1,13 @@
+key: scp
+title: SCP (SSH)
+author: requarks.io
+props:
+  host: String
+  port:
+    type: Number
+    default: 22
+  username: String
+  privateKeyPath: String
+  basePath:
+    type: String
+    default: '~'

+ 23 - 0
server/modules/storage/scp/storage.js

@@ -0,0 +1,23 @@
+module.exports = {
+  async activated(opts) {
+
+  },
+  async deactivated(opts) {
+
+  },
+  async init(opts) {
+
+  },
+  async created(opts) {
+
+  },
+  async updated(opts) {
+
+  },
+  async deleted(opts) {
+
+  },
+  async renamed(opts) {
+
+  }
+}