sumba 2.47.0 → 2.47.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/FUNDING.yml +0 -0
- package/.github/workflows/repo-lockdown.yml +0 -0
- package/.jsdoc.conf.json +0 -0
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/docs/Sumba.html +0 -0
- package/docs/data/search.json +0 -0
- package/docs/fonts/Inconsolata-Regular.ttf +0 -0
- package/docs/fonts/OpenSans-Regular.ttf +0 -0
- package/docs/fonts/WorkSans-Bold.ttf +0 -0
- package/docs/global.html +0 -0
- package/docs/index.html +0 -0
- package/docs/index.js.html +0 -0
- package/docs/lib_config.js.html +0 -0
- package/docs/lib_constant.js.html +0 -0
- package/docs/lib_token-schema.js.html +0 -0
- package/docs/scripts/core.js +0 -0
- package/docs/scripts/core.min.js +0 -0
- package/docs/scripts/resize.js +0 -0
- package/docs/scripts/search.js +0 -0
- package/docs/scripts/search.min.js +5 -5
- package/docs/scripts/third-party/Apache-License-2.0.txt +0 -0
- package/docs/scripts/third-party/fuse.js +0 -0
- package/docs/scripts/third-party/hljs-line-num-original.js +0 -0
- package/docs/scripts/third-party/hljs-line-num.js +0 -0
- package/docs/scripts/third-party/hljs-original.js +0 -0
- package/docs/scripts/third-party/hljs.js +0 -0
- package/docs/scripts/third-party/popper.js +0 -0
- package/docs/scripts/third-party/tippy.js +0 -0
- package/docs/scripts/third-party/tocbot.js +0 -0
- package/docs/scripts/third-party/tocbot.min.js +0 -0
- package/docs/static/bitcoin.jpeg +0 -0
- package/docs/static/home.md +0 -0
- package/docs/static/logo-ecosystem.png +0 -0
- package/docs/static/logo.png +0 -0
- package/docs/styles/clean-jsdoc-theme-base.css +0 -0
- package/docs/styles/clean-jsdoc-theme-dark.css +0 -0
- package/docs/styles/clean-jsdoc-theme-light.css +0 -0
- package/docs/styles/clean-jsdoc-theme-scrollbar.css +0 -0
- package/docs/styles/clean-jsdoc-theme-without-scrollbar.min.css +0 -0
- package/docs/styles/clean-jsdoc-theme.min.css +0 -0
- package/extend/bajo/hook.js +300 -300
- package/extend/bajo/intl/en-US.json +0 -0
- package/extend/bajo/intl/id.json +0 -0
- package/extend/bajoCli/applet/create-new-site.js +21 -21
- package/extend/bajoCli/applet/populate-model-with-site.js +54 -54
- package/extend/bajoCli/applet/remove-site.js +20 -20
- package/extend/bajoCli/applet.js +0 -0
- package/extend/bajoTemplate/layout/centered.html +0 -0
- package/extend/bajoTemplate/layout/default.html +0 -0
- package/extend/bajoTemplate/layout/email.html +0 -0
- package/extend/bajoTemplate/layout/email.id.html +0 -0
- package/extend/bajoTemplate/layout/error.html +0 -0
- package/extend/bajoTemplate/layout/info.html +0 -0
- package/extend/bajoTemplate/partial/403.html +0 -0
- package/extend/bajoTemplate/partial/_admin/reset-user-password.html +0 -0
- package/extend/bajoTemplate/partial/_mail/help-contact-form.html +0 -0
- package/extend/bajoTemplate/partial/_mail/help-contact-form.id.html +0 -0
- package/extend/bajoTemplate/partial/_mail/mystuff-change-password.html +0 -0
- package/extend/bajoTemplate/partial/_mail/mystuff-change-password.id.html +0 -0
- package/extend/bajoTemplate/partial/_mail/mystuff-reset-api-key.html +0 -0
- package/extend/bajoTemplate/partial/_mail/mystuff-reset-api-key.id.html +0 -0
- package/extend/bajoTemplate/partial/_mail/user-activation-success.html +0 -0
- package/extend/bajoTemplate/partial/_mail/user-activation-success.id.html +0 -0
- package/extend/bajoTemplate/partial/_mail/user-forgot-password-changed.html +0 -0
- package/extend/bajoTemplate/partial/_mail/user-forgot-password-changed.id.html +0 -0
- package/extend/bajoTemplate/partial/_mail/user-forgot-password-link.html +0 -0
- package/extend/bajoTemplate/partial/_mail/user-forgot-password-link.id.html +0 -0
- package/extend/bajoTemplate/partial/_mail/user-signup-success-active.html +0 -0
- package/extend/bajoTemplate/partial/_mail/user-signup-success-active.id.html +0 -0
- package/extend/bajoTemplate/partial/_mail/user-signup-success.html +0 -0
- package/extend/bajoTemplate/partial/_mail/user-signup-success.id.html +0 -0
- package/extend/bajoTemplate/partial/api-key-modal.html +0 -0
- package/extend/bajoTemplate/partial/app-launcher.html +0 -0
- package/extend/bajoTemplate/partial/help/contact-form/form.html +0 -0
- package/extend/bajoTemplate/partial/help/contact-form/success.html +0 -0
- package/extend/bajoTemplate/partial/help/trouble-tickets/add.html +0 -0
- package/extend/bajoTemplate/partial/help/trouble-tickets/details.html +0 -0
- package/extend/bajoTemplate/partial/help/trouble-tickets/list.html +0 -0
- package/extend/bajoTemplate/partial/layout/address.html +0 -0
- package/extend/bajoTemplate/partial/layout/breadcrumb.html +0 -0
- package/extend/bajoTemplate/partial/layout/footer.html +0 -0
- package/extend/bajoTemplate/partial/layout/more-info.html +0 -0
- package/extend/bajoTemplate/partial/layout/more-info.id.html +0 -0
- package/extend/bajoTemplate/partial/layout/navbar.html +0 -0
- package/extend/bajoTemplate/partial/layout/sidebar.html +0 -0
- package/extend/bajoTemplate/partial/layout/socmed.html +0 -0
- package/extend/bajoTemplate/partial/list-item/change-password.html +0 -0
- package/extend/bajoTemplate/partial/list-item/forgot-password.html +0 -0
- package/extend/bajoTemplate/partial/list-item/goto-home.html +0 -0
- package/extend/bajoTemplate/partial/list-item/member-links.html +0 -0
- package/extend/bajoTemplate/partial/list-item/oauth-signin.html +0 -0
- package/extend/bajoTemplate/partial/list-item/signin.html +0 -0
- package/extend/bajoTemplate/partial/list-item/signout.html +0 -0
- package/extend/bajoTemplate/partial/list-item/user-signup.html +0 -0
- package/extend/bajoTemplate/partial/list-item/your-profile.html +0 -0
- package/extend/bajoTemplate/partial/signin.html +0 -0
- package/extend/bajoTemplate/partial/signout.html +0 -0
- package/extend/bajoTemplate/partial/user/activation.html +0 -0
- package/extend/bajoTemplate/partial/user/forgot-password-nomail.id.md +0 -0
- package/extend/bajoTemplate/partial/user/forgot-password-nomail.md +0 -0
- package/extend/bajoTemplate/partial/user/forgot-password.html +0 -0
- package/extend/bajoTemplate/partial/user/fpl-invalid.html +0 -0
- package/extend/bajoTemplate/partial/user/fpl-invalid.id.md +0 -0
- package/extend/bajoTemplate/partial/user/fpl-invalid.md +0 -0
- package/extend/bajoTemplate/partial/user/fpl.html +0 -0
- package/extend/bajoTemplate/partial/user/signup/form.html +0 -0
- package/extend/bajoTemplate/partial/user/signup/success-mail.id.md +0 -0
- package/extend/bajoTemplate/partial/user/signup/success-mail.md +0 -0
- package/extend/bajoTemplate/partial/user/signup/success-nomail.id.md +0 -0
- package/extend/bajoTemplate/partial/user/signup/success-nomail.md +0 -0
- package/extend/bajoTemplate/partial/user/signup/success.html +0 -0
- package/extend/bajoTemplate/partial/your-stuff/change-password.html +0 -0
- package/extend/bajoTemplate/partial/your-stuff/profile/edit.html +0 -0
- package/extend/bajoTemplate/partial/your-stuff/profile/view.html +0 -0
- package/extend/bajoTemplate/partial/your-stuff/reset-api-key.html +0 -0
- package/extend/bajoTemplate/template/403.html +0 -0
- package/extend/bajoTemplate/template/_admin/reset-user-password.html +0 -0
- package/extend/bajoTemplate/template/_mail/help-contact-form.html +0 -0
- package/extend/bajoTemplate/template/_mail/mystuff-change-password.html +0 -0
- package/extend/bajoTemplate/template/_mail/mystuff-reset-api-key.html +0 -0
- package/extend/bajoTemplate/template/_mail/user-activation-success.html +0 -0
- package/extend/bajoTemplate/template/_mail/user-forgot-password-changed.html +0 -0
- package/extend/bajoTemplate/template/_mail/user-forgot-password-link.html +0 -0
- package/extend/bajoTemplate/template/_mail/user-signup-success-active.html +0 -0
- package/extend/bajoTemplate/template/_mail/user-signup-success.html +0 -0
- package/extend/bajoTemplate/template/help/contact-form/form.html +0 -0
- package/extend/bajoTemplate/template/help/contact-form/success.html +0 -0
- package/extend/bajoTemplate/template/help/trouble-tickets/add.html +0 -0
- package/extend/bajoTemplate/template/help/trouble-tickets/details.html +0 -0
- package/extend/bajoTemplate/template/help/trouble-tickets/list.html +0 -0
- package/extend/bajoTemplate/template/info/about-us.md +0 -0
- package/extend/bajoTemplate/template/info/cookie-policy.md +0 -0
- package/extend/bajoTemplate/template/info/privacy.md +0 -0
- package/extend/bajoTemplate/template/info/terms-conditions.md +0 -0
- package/extend/bajoTemplate/template/signin.html +0 -0
- package/extend/bajoTemplate/template/signout.html +0 -0
- package/extend/bajoTemplate/template/user/activation.html +0 -0
- package/extend/bajoTemplate/template/user/forgot-password.html +0 -0
- package/extend/bajoTemplate/template/user/fpl-invalid.html +0 -0
- package/extend/bajoTemplate/template/user/fpl.html +0 -0
- package/extend/bajoTemplate/template/user/signup/form.html +0 -0
- package/extend/bajoTemplate/template/user/signup/success.html +0 -0
- package/extend/bajoTemplate/template/your-stuff/change-password.html +0 -0
- package/extend/bajoTemplate/template/your-stuff/profile/edit.html +0 -0
- package/extend/bajoTemplate/template/your-stuff/profile/view.html +0 -0
- package/extend/bajoTemplate/template/your-stuff/reset-api-key.html +0 -0
- package/extend/dobo/feature/address.js +0 -0
- package/extend/dobo/feature/category.js +0 -0
- package/extend/dobo/feature/country.js +4 -2
- package/extend/dobo/feature/email.js +0 -0
- package/extend/dobo/feature/lat-lng.js +0 -0
- package/extend/dobo/feature/lat.js +0 -0
- package/extend/dobo/feature/lng.js +0 -0
- package/extend/dobo/feature/notes.js +0 -0
- package/extend/dobo/feature/person-in-charge.js +0 -0
- package/extend/dobo/feature/phone.js +0 -0
- package/extend/dobo/feature/site-id.js +0 -0
- package/extend/dobo/feature/site-ids.js +0 -0
- package/extend/dobo/feature/slug.js +0 -0
- package/extend/dobo/feature/social.js +0 -0
- package/extend/dobo/feature/status.js +0 -0
- package/extend/dobo/feature/team-id.js +0 -0
- package/extend/dobo/feature/team-ids.js +0 -0
- package/extend/dobo/feature/ts.js +0 -0
- package/extend/dobo/feature/url.js +0 -0
- package/extend/dobo/feature/user-id.js +0 -0
- package/extend/dobo/fixture/contact-form-cat.json +0 -0
- package/extend/dobo/fixture/site.json +0 -0
- package/extend/dobo/fixture/team-user.json +0 -0
- package/extend/dobo/fixture/team.json +0 -0
- package/extend/dobo/fixture/ticket-cat.json +0 -0
- package/extend/dobo/fixture/user.json +0 -0
- package/extend/dobo/model.js +303 -303
- package/extend/dobo/model.json +161 -161
- package/extend/masohiSocketIo/middleware/server/auth.js +0 -0
- package/extend/sumba/route/anonymous.json +5 -5
- package/extend/sumba/route/secure.json +8 -8
- package/extend/waibuBootstrap/theme/component/widget/nav-dropdown-user.js +0 -0
- package/extend/waibuDb/schema/anonymous-guard.js +0 -0
- package/extend/waibuDb/schema/attrib-guard.js +0 -0
- package/extend/waibuDb/schema/contact-form-cat.json +0 -0
- package/extend/waibuDb/schema/contact-form.json +0 -0
- package/extend/waibuDb/schema/download.js +0 -0
- package/extend/waibuDb/schema/model-guard.js +0 -0
- package/extend/waibuDb/schema/secure-guard.js +0 -0
- package/extend/waibuDb/schema/site-setting.js +0 -0
- package/extend/waibuDb/schema/site.js +0 -0
- package/extend/waibuDb/schema/team-setting.js +0 -0
- package/extend/waibuDb/schema/team-user.js +0 -0
- package/extend/waibuDb/schema/team.json +0 -0
- package/extend/waibuDb/schema/ticket-cat.json +0 -0
- package/extend/waibuDb/schema/ticket.js +0 -0
- package/extend/waibuDb/schema/user-setting.js +0 -0
- package/extend/waibuDb/schema/user.js +0 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/action-guard/@action.js +0 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/anonymous-guard/@action.js +0 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/attrib-guard/@action.js +0 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/contact-form/@action.js +0 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/contact-form-cat/@action.js +0 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/download/@action.js +0 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/query-guard/@action.js +0 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/reset-user-password.js +0 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/secure-guard/@action.js +0 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/site-setting/@action.js +0 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/site.js +0 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/team/@action.js +0 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/team-setting/@action.js +0 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/team-user/@action.js +0 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/ticket/@action.js +0 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/ticket-cat/@action.js +0 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/user/@action.js +0 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/user-setting/@action.js +0 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/x/cache/@action.js +0 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/x/session/@action.js +0 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/x/site/@action.js +0 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/x/site-setting/@action.js +0 -0
- package/extend/waibuMpa/route/access-token.js +0 -0
- package/extend/waibuMpa/route/help/contact-form.js +0 -0
- package/extend/waibuMpa/route/help/trouble-tickets/add.js +0 -0
- package/extend/waibuMpa/route/help/trouble-tickets/details/@id.js +0 -0
- package/extend/waibuMpa/route/help/trouble-tickets/list.js +0 -0
- package/extend/waibuMpa/route/info/@item.js +0 -0
- package/extend/waibuMpa/route/signin.js +0 -0
- package/extend/waibuMpa/route/signout.js +0 -0
- package/extend/waibuMpa/route/user/activation.js +0 -0
- package/extend/waibuMpa/route/user/forgot-password/@fpl.js +0 -0
- package/extend/waibuMpa/route/user/forgot-password.js +0 -0
- package/extend/waibuMpa/route/user/signup.js +0 -0
- package/extend/waibuMpa/route/your-stuff/change-password.js +0 -0
- package/extend/waibuMpa/route/your-stuff/download/@action.js +0 -0
- package/extend/waibuMpa/route/your-stuff/download/get.js +0 -0
- package/extend/waibuMpa/route/your-stuff/profile/edit.js +0 -0
- package/extend/waibuMpa/route/your-stuff/profile.js +0 -0
- package/extend/waibuMpa/route/your-stuff/reset-api-key.js +0 -0
- package/extend/waibuRestApi/route/info/get.js +0 -0
- package/extend/waibuRestApi/route/manage/anonymous-guard/model-builder.json +0 -0
- package/extend/waibuRestApi/route/manage/secure-guard/model-builder.json +0 -0
- package/extend/waibuRestApi/route/manage/team/model-builder.json +0 -0
- package/extend/waibuRestApi/route/manage/ticket-cat/model-builder.json +0 -0
- package/extend/waibuRestApi/route/manage/user/model-builder.json +0 -0
- package/extend/waibuRestApi/route/user/access-token/@type/create.js +0 -0
- package/extend/waibuRestApi/route/user/api-key/get.js +0 -0
- package/extend/waibuRestApi/route/your-stuff/api-key/get.js +0 -0
- package/extend/waibuRestApi/route/your-stuff/api-key/update.js +0 -0
- package/extend/waibuRestApi/route/your-stuff/change-password/update.js +0 -0
- package/extend/waibuRestApi/route/your-stuff/profile/get.js +0 -0
- package/extend/waibuRestApi/route/your-stuff/profile/update.js +0 -0
- package/extend/waibuSocketIo/middleware/server/auth.js +0 -0
- package/extend/waibuStatic/asset/user-profile.png +0 -0
- package/index.js +2 -1
- package/lib/config.js +202 -202
- package/lib/constant.js +0 -0
- package/logo.png +0 -0
- package/package.json +1 -1
- package/wiki/CHANGES.md +395 -383
- package/wiki/CONFIG.md +0 -0
- package/wiki/CONTRIBUTING.md +0 -0
- package/wiki/DEV-GUIDE.md +0 -0
- package/wiki/ECOSYSTEM.md +0 -0
- package/wiki/GETTING-STARTED.md +0 -0
- package/wiki/USER-GUIDE.md +0 -0
package/lib/config.js
CHANGED
|
@@ -1,202 +1,202 @@
|
|
|
1
|
-
export const defMultiSite = {
|
|
2
|
-
enabled: false,
|
|
3
|
-
catchAll: 'default'
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Sumba configuration object
|
|
8
|
-
*
|
|
9
|
-
* @typedef {object} TConfig
|
|
10
|
-
* @type {object}
|
|
11
|
-
* @property {object} [config={}] - Configuration object
|
|
12
|
-
* @property {object} [config.multiSite={}] - Multi-site configuration object
|
|
13
|
-
* @property {boolean} [config.multiSite.enabled=false] - Whether multi-site is enabled or not. Default: false
|
|
14
|
-
* @property {string} [config.multiSite.catchAll='default'] - Which site alias to use as the catch-all. Default: 'default'
|
|
15
|
-
* @property {array} [config.xSiteAdmins=[]] - List of cross-site administrators. Format: "<siteAlias>:<username>"
|
|
16
|
-
* @property {object} [config.waibu={}] - Waibu configuration object
|
|
17
|
-
* @property {string} [config.waibu.prefix='site'] - Waibu prefix
|
|
18
|
-
* @property {string} [config.waibu.title='site'] - Waibu title
|
|
19
|
-
* @property {object} [config.waibuMpa={}] - Waibu MPA configuration object
|
|
20
|
-
* @property {object} [config.waibuMpa.auth={}] - Waibu MPA authentication configuration object
|
|
21
|
-
* @property {array} [config.waibuMpa.auth.methods=['session']] - Waibu MPA authentication methods. Default: ['session']
|
|
22
|
-
* @property {boolean} [config.waibuMpa.auth.silentOnError=false] - Whether to silently ignore authentication errors or not. Default: false
|
|
23
|
-
* @property {string} [config.waibuMpa.icon='globe'] - Waibu MPA icon. Default: 'globe'
|
|
24
|
-
* @property {object} [config.waibuMpa.redirect={}] - Waibu MPA route redirection
|
|
25
|
-
* @property {object} [config.waibuMpa.redirectSubRoute={}] - Waibu MPA sub-route redirection
|
|
26
|
-
* @property {object} [config.waibuRestApi={}] - Waibu REST API configuration object
|
|
27
|
-
* @property {object} [config.waibuRestApi.auth={}] - Waibu REST API authentication configuration object
|
|
28
|
-
* @property {array} [config.waibuRestApi.auth.methods=['basic', 'apiKey', 'jwt']] - Waibu REST API authentication methods. Default: ['basic', 'apiKey', 'jwt']
|
|
29
|
-
* @property {boolean} [config.waibuRestApi.auth.silentOnError=false] - Whether to silently ignore authentication errors or not. Default: false
|
|
30
|
-
* @property {object} [config.waibuStatic={}] - Waibu Static configuration object
|
|
31
|
-
* @property {object} [config.waibuStatic.auth={}] - Waibu Static authentication configuration object
|
|
32
|
-
* @property {array} [config.waibuStatic.auth.methods=['basic', 'apiKey', 'jwt']]
|
|
33
|
-
* @property {object} [config.waibuStatic.auth.basic={}] - Waibu Static Basic authentication configuration object
|
|
34
|
-
* @property {boolean} [config.waibuStatic.auth.basic.useUtf8=true] - Whether to use UTF-8 encoding for Basic authentication or not. Default: true
|
|
35
|
-
* @property {boolean} [config.waibuStatic.auth.basic.realm=true] - Whether to use realm for Basic authentication or not. Default: true
|
|
36
|
-
* @property {string} [config.waibuStatic.auth.basic.warningMessage='pleaseAuthenticate'] - Warning message for Basic authentication. Default: 'pleaseAuthenticate'
|
|
37
|
-
* @property {boolean} [config.waibuStatic.auth.silentOnError=false] - Whether to silently ignore authentication errors or not. Default: false
|
|
38
|
-
* @property {array} [config.waibuMpa.menuHandler=[]] - Waibu MPA menu handler
|
|
39
|
-
* @property {object} [config.waibuAdmin={}] - Waibu Admin configuration object
|
|
40
|
-
* @property {string} [config.waibuAdmin.menuHandler='sumba:adminMenu'] - Waibu Admin menu handler. Default: 'sumba:adminMenu'
|
|
41
|
-
* @property {boolean} [config.waibuAdmin.menuCollapsible=true] - Whether the Waibu Admin menu is collapsible or not. Default: true
|
|
42
|
-
* @property {object} [config.auth={}] - Authentication configuration object
|
|
43
|
-
* @property {object} [config.auth.apiKey={}] - API Key authentication configuration object
|
|
44
|
-
* @property {string} [config.auth.apiKey.type='Bearer'] - API Key authentication type. Default: 'Bearer'
|
|
45
|
-
* @property {string} [config.auth.apiKey.qsKey='apiKey'] - API Key authentication query string key. Default: 'apiKey'
|
|
46
|
-
* @property {string} [config.auth.apiKey.headerKey='X-Auth-ApiKey'] - API Key authentication header key. Default: 'X-Auth-ApiKey'
|
|
47
|
-
* @property {string} [config.auth.apiKey.algo='sha256'] - API Key authentication hashing algorithm. Default: 'sha256'
|
|
48
|
-
* @property {object} [config.auth.basic={}] - Basic authentication configuration object
|
|
49
|
-
* @property {object} [config.auth.jwt={}] - JWT authentication configuration object
|
|
50
|
-
* @property {string} [config.auth.jwt.type='Bearer'] - JWT authentication type. Default: 'Bearer'
|
|
51
|
-
* @property {string} [config.auth.jwt.qsKey='token'] - JWT authentication query string key. Default: 'token'
|
|
52
|
-
* @property {string} [config.auth.jwt.headerKey='X-Auth-Jwt'] - JWT authentication header key. Default: 'X-Auth-Jwt'
|
|
53
|
-
* @property {string} [config.auth.jwt.secret] - JWT authentication secret. Default: hard coded value, should be changed in production
|
|
54
|
-
* @property {string} [config.auth.jwt.expiresInDur='7d'] - JWT authentication token expiration duration. Default: '7d'
|
|
55
|
-
* @property {object} [config.redirect={}] - Redirection configuration object
|
|
56
|
-
* @property {object} [config.queue={}] - Internal Queue configuration object
|
|
57
|
-
* @property {string} [config.queue.intvDur='1m'] - Queue interval duration. Default: '1m'
|
|
58
|
-
*/
|
|
59
|
-
|
|
60
|
-
async function configFactory () {
|
|
61
|
-
const { cloneDeep } = this.app.lib._
|
|
62
|
-
const config = {
|
|
63
|
-
multiSite: cloneDeep(defMultiSite),
|
|
64
|
-
xSiteAdmins: [], // format: "<siteAlias>:<username>"
|
|
65
|
-
waibu: {
|
|
66
|
-
title: 'site',
|
|
67
|
-
prefix: 'site'
|
|
68
|
-
},
|
|
69
|
-
dobo: {
|
|
70
|
-
model: {}
|
|
71
|
-
},
|
|
72
|
-
waibuRestApi: {
|
|
73
|
-
auth: {
|
|
74
|
-
methods: ['basic', 'apiKey', 'jwt'],
|
|
75
|
-
silentOnError: false
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
waibuStatic: {
|
|
79
|
-
auth: {
|
|
80
|
-
methods: ['basic', 'apiKey', 'jwt'],
|
|
81
|
-
basic: {
|
|
82
|
-
useUtf8: true,
|
|
83
|
-
realm: true,
|
|
84
|
-
warningMessage: 'pleaseAuthenticate'
|
|
85
|
-
},
|
|
86
|
-
silentOnError: false
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
waibuMpa: {
|
|
90
|
-
icon: 'globe',
|
|
91
|
-
auth: {
|
|
92
|
-
methods: ['session'],
|
|
93
|
-
silentOnError: false
|
|
94
|
-
},
|
|
95
|
-
redirect: {
|
|
96
|
-
'/': 'sumba:/your-stuff/profile',
|
|
97
|
-
'/your-stuff': 'sumba:/your-stuff/profile',
|
|
98
|
-
'/info': 'sumba:/info/about-us',
|
|
99
|
-
'/user': 'sumba:/your-stuff/profile',
|
|
100
|
-
'/db/export': 'sumba:/db/export/list',
|
|
101
|
-
'/help': 'sumba:/help/contact-form',
|
|
102
|
-
'/help/trouble-tickets': 'sumba:/help/trouble-tickets/list'
|
|
103
|
-
},
|
|
104
|
-
redirectSubRoute: {
|
|
105
|
-
waibuAdmin: {
|
|
106
|
-
'/': 'waibuAdmin:/site/site',
|
|
107
|
-
'/x': 'waibuAdmin:/site/x/site/list',
|
|
108
|
-
'/x/*': 'waibuAdmin:/site/x/{2}/list',
|
|
109
|
-
'/*': 'waibuAdmin:/site/{1}/list'
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
menuHandler: [{
|
|
113
|
-
title: 'account',
|
|
114
|
-
icon: 'person',
|
|
115
|
-
level: 9998,
|
|
116
|
-
children: [
|
|
117
|
-
// anonymous only
|
|
118
|
-
{ title: 'signin', href: 'sumba:/signin', visible: 'anon' },
|
|
119
|
-
{ title: 'forgotPassword', href: 'sumba:/user/forgot-password', visible: 'anon' },
|
|
120
|
-
{ title: 'newUserSignup', href: 'sumba:/user/signup', visible: 'anon' },
|
|
121
|
-
{ title: '-', visible: 'anon' },
|
|
122
|
-
{ title: 'activation', href: 'sumba:/user/activation', visible: 'anon' },
|
|
123
|
-
// authenticated only
|
|
124
|
-
{ title: 'yourProfile', href: 'sumba:/your-stuff/profile', visible: 'auth' },
|
|
125
|
-
{ title: 'changePassword', href: 'sumba:/your-stuff/change-password', visible: 'auth' },
|
|
126
|
-
{ title: 'downloadList', href: 'sumba:/your-stuff/download/list', visible: 'auth' },
|
|
127
|
-
{ title: '-', visible: 'auth' },
|
|
128
|
-
{ title: 'signout', href: 'sumba:/signout', visible: 'auth' }
|
|
129
|
-
]
|
|
130
|
-
}, {
|
|
131
|
-
title: 'help',
|
|
132
|
-
icon: 'signInfo',
|
|
133
|
-
level: 9999,
|
|
134
|
-
children: [
|
|
135
|
-
{ title: 'contactForm', href: 'sumba:/help/contact-form' },
|
|
136
|
-
{ title: 'troubleTickets', href: 'sumba:/help/trouble-tickets', visible: 'auth' },
|
|
137
|
-
{ title: '-' },
|
|
138
|
-
{ title: 'cookiePolicy', href: 'sumba:/info/cookie-policy' },
|
|
139
|
-
{ title: 'privacy', href: 'sumba:/info/privacy' },
|
|
140
|
-
{ title: 'termsConditions', href: 'sumba:/info/terms-conditions' }
|
|
141
|
-
]
|
|
142
|
-
}]
|
|
143
|
-
},
|
|
144
|
-
waibuAdmin: {
|
|
145
|
-
menuHandler: 'sumba:adminMenu',
|
|
146
|
-
menuCollapsible: true,
|
|
147
|
-
modelDisabled: 'all'
|
|
148
|
-
},
|
|
149
|
-
auth: {
|
|
150
|
-
apiKey: {
|
|
151
|
-
type: 'Bearer',
|
|
152
|
-
qsKey: 'apiKey',
|
|
153
|
-
headerKey: 'X-Auth-ApiKey',
|
|
154
|
-
algo: 'sha256' // changing this require each and every user to reset their apiKey
|
|
155
|
-
},
|
|
156
|
-
basic: {
|
|
157
|
-
},
|
|
158
|
-
jwt: {
|
|
159
|
-
type: 'Bearer',
|
|
160
|
-
qsKey: 'token',
|
|
161
|
-
headerKey: 'X-Auth-Jwt',
|
|
162
|
-
secret: '668de9cf57316c7dbf52f7ff7611c299',
|
|
163
|
-
expiresInDur: '7d'
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
|
-
redirect: {
|
|
167
|
-
signin: 'sumba:/signin',
|
|
168
|
-
afterSignin: '/',
|
|
169
|
-
signout: 'sumba:/signout',
|
|
170
|
-
afterSignout: '/'
|
|
171
|
-
},
|
|
172
|
-
siteSetting: {
|
|
173
|
-
forgotPasswordExpDur: '5m',
|
|
174
|
-
userPassword: {
|
|
175
|
-
minUpperCase: 1,
|
|
176
|
-
minLowerCase: 1,
|
|
177
|
-
minSpecialChar: 1,
|
|
178
|
-
minNumeric: 1,
|
|
179
|
-
noWhitespace: false,
|
|
180
|
-
latinOnlyChars: false,
|
|
181
|
-
pattern: {
|
|
182
|
-
lowerCase: 'abcdefghijklmnopqrstuvwxyz',
|
|
183
|
-
upperCase: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
|
184
|
-
specialChar: '!@#$%*',
|
|
185
|
-
numeric: '0123456789'
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
cacheTtl: {
|
|
190
|
-
getSiteDur: '1m',
|
|
191
|
-
getUserByIdDur: '1m',
|
|
192
|
-
getUserByTokenDur: '1m'
|
|
193
|
-
},
|
|
194
|
-
queue: {
|
|
195
|
-
intvDur: '1m'
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
return config
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
export default configFactory
|
|
1
|
+
export const defMultiSite = {
|
|
2
|
+
enabled: false,
|
|
3
|
+
catchAll: 'default'
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Sumba configuration object
|
|
8
|
+
*
|
|
9
|
+
* @typedef {object} TConfig
|
|
10
|
+
* @type {object}
|
|
11
|
+
* @property {object} [config={}] - Configuration object
|
|
12
|
+
* @property {object} [config.multiSite={}] - Multi-site configuration object
|
|
13
|
+
* @property {boolean} [config.multiSite.enabled=false] - Whether multi-site is enabled or not. Default: false
|
|
14
|
+
* @property {string} [config.multiSite.catchAll='default'] - Which site alias to use as the catch-all. Default: 'default'
|
|
15
|
+
* @property {array} [config.xSiteAdmins=[]] - List of cross-site administrators. Format: "<siteAlias>:<username>"
|
|
16
|
+
* @property {object} [config.waibu={}] - Waibu configuration object
|
|
17
|
+
* @property {string} [config.waibu.prefix='site'] - Waibu prefix
|
|
18
|
+
* @property {string} [config.waibu.title='site'] - Waibu title
|
|
19
|
+
* @property {object} [config.waibuMpa={}] - Waibu MPA configuration object
|
|
20
|
+
* @property {object} [config.waibuMpa.auth={}] - Waibu MPA authentication configuration object
|
|
21
|
+
* @property {array} [config.waibuMpa.auth.methods=['session']] - Waibu MPA authentication methods. Default: ['session']
|
|
22
|
+
* @property {boolean} [config.waibuMpa.auth.silentOnError=false] - Whether to silently ignore authentication errors or not. Default: false
|
|
23
|
+
* @property {string} [config.waibuMpa.icon='globe'] - Waibu MPA icon. Default: 'globe'
|
|
24
|
+
* @property {object} [config.waibuMpa.redirect={}] - Waibu MPA route redirection
|
|
25
|
+
* @property {object} [config.waibuMpa.redirectSubRoute={}] - Waibu MPA sub-route redirection
|
|
26
|
+
* @property {object} [config.waibuRestApi={}] - Waibu REST API configuration object
|
|
27
|
+
* @property {object} [config.waibuRestApi.auth={}] - Waibu REST API authentication configuration object
|
|
28
|
+
* @property {array} [config.waibuRestApi.auth.methods=['basic', 'apiKey', 'jwt']] - Waibu REST API authentication methods. Default: ['basic', 'apiKey', 'jwt']
|
|
29
|
+
* @property {boolean} [config.waibuRestApi.auth.silentOnError=false] - Whether to silently ignore authentication errors or not. Default: false
|
|
30
|
+
* @property {object} [config.waibuStatic={}] - Waibu Static configuration object
|
|
31
|
+
* @property {object} [config.waibuStatic.auth={}] - Waibu Static authentication configuration object
|
|
32
|
+
* @property {array} [config.waibuStatic.auth.methods=['basic', 'apiKey', 'jwt']]
|
|
33
|
+
* @property {object} [config.waibuStatic.auth.basic={}] - Waibu Static Basic authentication configuration object
|
|
34
|
+
* @property {boolean} [config.waibuStatic.auth.basic.useUtf8=true] - Whether to use UTF-8 encoding for Basic authentication or not. Default: true
|
|
35
|
+
* @property {boolean} [config.waibuStatic.auth.basic.realm=true] - Whether to use realm for Basic authentication or not. Default: true
|
|
36
|
+
* @property {string} [config.waibuStatic.auth.basic.warningMessage='pleaseAuthenticate'] - Warning message for Basic authentication. Default: 'pleaseAuthenticate'
|
|
37
|
+
* @property {boolean} [config.waibuStatic.auth.silentOnError=false] - Whether to silently ignore authentication errors or not. Default: false
|
|
38
|
+
* @property {array} [config.waibuMpa.menuHandler=[]] - Waibu MPA menu handler
|
|
39
|
+
* @property {object} [config.waibuAdmin={}] - Waibu Admin configuration object
|
|
40
|
+
* @property {string} [config.waibuAdmin.menuHandler='sumba:adminMenu'] - Waibu Admin menu handler. Default: 'sumba:adminMenu'
|
|
41
|
+
* @property {boolean} [config.waibuAdmin.menuCollapsible=true] - Whether the Waibu Admin menu is collapsible or not. Default: true
|
|
42
|
+
* @property {object} [config.auth={}] - Authentication configuration object
|
|
43
|
+
* @property {object} [config.auth.apiKey={}] - API Key authentication configuration object
|
|
44
|
+
* @property {string} [config.auth.apiKey.type='Bearer'] - API Key authentication type. Default: 'Bearer'
|
|
45
|
+
* @property {string} [config.auth.apiKey.qsKey='apiKey'] - API Key authentication query string key. Default: 'apiKey'
|
|
46
|
+
* @property {string} [config.auth.apiKey.headerKey='X-Auth-ApiKey'] - API Key authentication header key. Default: 'X-Auth-ApiKey'
|
|
47
|
+
* @property {string} [config.auth.apiKey.algo='sha256'] - API Key authentication hashing algorithm. Default: 'sha256'
|
|
48
|
+
* @property {object} [config.auth.basic={}] - Basic authentication configuration object
|
|
49
|
+
* @property {object} [config.auth.jwt={}] - JWT authentication configuration object
|
|
50
|
+
* @property {string} [config.auth.jwt.type='Bearer'] - JWT authentication type. Default: 'Bearer'
|
|
51
|
+
* @property {string} [config.auth.jwt.qsKey='token'] - JWT authentication query string key. Default: 'token'
|
|
52
|
+
* @property {string} [config.auth.jwt.headerKey='X-Auth-Jwt'] - JWT authentication header key. Default: 'X-Auth-Jwt'
|
|
53
|
+
* @property {string} [config.auth.jwt.secret] - JWT authentication secret. Default: hard coded value, should be changed in production
|
|
54
|
+
* @property {string} [config.auth.jwt.expiresInDur='7d'] - JWT authentication token expiration duration. Default: '7d'
|
|
55
|
+
* @property {object} [config.redirect={}] - Redirection configuration object
|
|
56
|
+
* @property {object} [config.queue={}] - Internal Queue configuration object
|
|
57
|
+
* @property {string} [config.queue.intvDur='1m'] - Queue interval duration. Default: '1m'
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
async function configFactory () {
|
|
61
|
+
const { cloneDeep } = this.app.lib._
|
|
62
|
+
const config = {
|
|
63
|
+
multiSite: cloneDeep(defMultiSite),
|
|
64
|
+
xSiteAdmins: [], // format: "<siteAlias>:<username>"
|
|
65
|
+
waibu: {
|
|
66
|
+
title: 'site',
|
|
67
|
+
prefix: 'site'
|
|
68
|
+
},
|
|
69
|
+
dobo: {
|
|
70
|
+
model: {}
|
|
71
|
+
},
|
|
72
|
+
waibuRestApi: {
|
|
73
|
+
auth: {
|
|
74
|
+
methods: ['basic', 'apiKey', 'jwt'],
|
|
75
|
+
silentOnError: false
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
waibuStatic: {
|
|
79
|
+
auth: {
|
|
80
|
+
methods: ['basic', 'apiKey', 'jwt'],
|
|
81
|
+
basic: {
|
|
82
|
+
useUtf8: true,
|
|
83
|
+
realm: true,
|
|
84
|
+
warningMessage: 'pleaseAuthenticate'
|
|
85
|
+
},
|
|
86
|
+
silentOnError: false
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
waibuMpa: {
|
|
90
|
+
icon: 'globe',
|
|
91
|
+
auth: {
|
|
92
|
+
methods: ['basic', 'apiKey', 'jwt', 'session'],
|
|
93
|
+
silentOnError: false
|
|
94
|
+
},
|
|
95
|
+
redirect: {
|
|
96
|
+
'/': 'sumba:/your-stuff/profile',
|
|
97
|
+
'/your-stuff': 'sumba:/your-stuff/profile',
|
|
98
|
+
'/info': 'sumba:/info/about-us',
|
|
99
|
+
'/user': 'sumba:/your-stuff/profile',
|
|
100
|
+
'/db/export': 'sumba:/db/export/list',
|
|
101
|
+
'/help': 'sumba:/help/contact-form',
|
|
102
|
+
'/help/trouble-tickets': 'sumba:/help/trouble-tickets/list'
|
|
103
|
+
},
|
|
104
|
+
redirectSubRoute: {
|
|
105
|
+
waibuAdmin: {
|
|
106
|
+
'/': 'waibuAdmin:/site/site',
|
|
107
|
+
'/x': 'waibuAdmin:/site/x/site/list',
|
|
108
|
+
'/x/*': 'waibuAdmin:/site/x/{2}/list',
|
|
109
|
+
'/*': 'waibuAdmin:/site/{1}/list'
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
menuHandler: [{
|
|
113
|
+
title: 'account',
|
|
114
|
+
icon: 'person',
|
|
115
|
+
level: 9998,
|
|
116
|
+
children: [
|
|
117
|
+
// anonymous only
|
|
118
|
+
{ title: 'signin', href: 'sumba:/signin', visible: 'anon' },
|
|
119
|
+
{ title: 'forgotPassword', href: 'sumba:/user/forgot-password', visible: 'anon' },
|
|
120
|
+
{ title: 'newUserSignup', href: 'sumba:/user/signup', visible: 'anon' },
|
|
121
|
+
{ title: '-', visible: 'anon' },
|
|
122
|
+
{ title: 'activation', href: 'sumba:/user/activation', visible: 'anon' },
|
|
123
|
+
// authenticated only
|
|
124
|
+
{ title: 'yourProfile', href: 'sumba:/your-stuff/profile', visible: 'auth' },
|
|
125
|
+
{ title: 'changePassword', href: 'sumba:/your-stuff/change-password', visible: 'auth' },
|
|
126
|
+
{ title: 'downloadList', href: 'sumba:/your-stuff/download/list', visible: 'auth' },
|
|
127
|
+
{ title: '-', visible: 'auth' },
|
|
128
|
+
{ title: 'signout', href: 'sumba:/signout', visible: 'auth' }
|
|
129
|
+
]
|
|
130
|
+
}, {
|
|
131
|
+
title: 'help',
|
|
132
|
+
icon: 'signInfo',
|
|
133
|
+
level: 9999,
|
|
134
|
+
children: [
|
|
135
|
+
{ title: 'contactForm', href: 'sumba:/help/contact-form' },
|
|
136
|
+
{ title: 'troubleTickets', href: 'sumba:/help/trouble-tickets', visible: 'auth' },
|
|
137
|
+
{ title: '-' },
|
|
138
|
+
{ title: 'cookiePolicy', href: 'sumba:/info/cookie-policy' },
|
|
139
|
+
{ title: 'privacy', href: 'sumba:/info/privacy' },
|
|
140
|
+
{ title: 'termsConditions', href: 'sumba:/info/terms-conditions' }
|
|
141
|
+
]
|
|
142
|
+
}]
|
|
143
|
+
},
|
|
144
|
+
waibuAdmin: {
|
|
145
|
+
menuHandler: 'sumba:adminMenu',
|
|
146
|
+
menuCollapsible: true,
|
|
147
|
+
modelDisabled: 'all'
|
|
148
|
+
},
|
|
149
|
+
auth: {
|
|
150
|
+
apiKey: {
|
|
151
|
+
type: 'Bearer',
|
|
152
|
+
qsKey: 'apiKey',
|
|
153
|
+
headerKey: 'X-Auth-ApiKey',
|
|
154
|
+
algo: 'sha256' // changing this require each and every user to reset their apiKey
|
|
155
|
+
},
|
|
156
|
+
basic: {
|
|
157
|
+
},
|
|
158
|
+
jwt: {
|
|
159
|
+
type: 'Bearer',
|
|
160
|
+
qsKey: 'token',
|
|
161
|
+
headerKey: 'X-Auth-Jwt',
|
|
162
|
+
secret: '668de9cf57316c7dbf52f7ff7611c299',
|
|
163
|
+
expiresInDur: '7d'
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
redirect: {
|
|
167
|
+
signin: 'sumba:/signin',
|
|
168
|
+
afterSignin: '/',
|
|
169
|
+
signout: 'sumba:/signout',
|
|
170
|
+
afterSignout: '/'
|
|
171
|
+
},
|
|
172
|
+
siteSetting: {
|
|
173
|
+
forgotPasswordExpDur: '5m',
|
|
174
|
+
userPassword: {
|
|
175
|
+
minUpperCase: 1,
|
|
176
|
+
minLowerCase: 1,
|
|
177
|
+
minSpecialChar: 1,
|
|
178
|
+
minNumeric: 1,
|
|
179
|
+
noWhitespace: false,
|
|
180
|
+
latinOnlyChars: false,
|
|
181
|
+
pattern: {
|
|
182
|
+
lowerCase: 'abcdefghijklmnopqrstuvwxyz',
|
|
183
|
+
upperCase: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
|
184
|
+
specialChar: '!@#$%*',
|
|
185
|
+
numeric: '0123456789'
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
cacheTtl: {
|
|
190
|
+
getSiteDur: '1m',
|
|
191
|
+
getUserByIdDur: '1m',
|
|
192
|
+
getUserByTokenDur: '1m'
|
|
193
|
+
},
|
|
194
|
+
queue: {
|
|
195
|
+
intvDur: '1m'
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return config
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export default configFactory
|
package/lib/constant.js
CHANGED
|
File without changes
|
package/logo.png
CHANGED
|
File without changes
|