UNPKG

webgme-engine

Version:

WebGME server and Client API without a GUI

325 lines (299 loc) 11.1 kB
/*eslint-env node*/ /** * @author lattmann / https://github.com/lattmann * @author pmeijer / https://github.com/pmeijer */ 'use strict'; var path = require('path'), config = { addOn: { enable: false, monitorTimeout: 2 * 60 * 1000, // stop monitoring after 2 minutes of no activity workerUrl: null, basePaths: [path.join(__dirname, '../src/addon/core')] }, authentication: { enable: false, authorizer: { path: path.join(__dirname, '../src/server/middleware/auth/defaultauthorizer'), options: {} }, allowGuests: true, allowUserRegistration: true, registeredUsersCanCreate: true, inferredUsersCanCreate: false, newUserNeedsVerification: false, userManagementPage: path.join(__dirname, '../src/server/middleware/auth/loginRouter'), guestAccount: 'guest', guestCanCreate: true, adminAccount: null, publicOrganizations: [], logOutUrl: '/profile/login', logInUrl: '/profile/login', salts: 10, jwt: { expiresIn: 3600 * 24 * 7, renewBeforeExpires: 3600, cookieId: 'access_token', // These are just examples and should be overwritten publicKey: path.join(__dirname, '../src/server/middleware/auth/EXAMPLE_PUBLIC_KEY'), tokenGenerator: path.join(__dirname, '../src/server/middleware/auth/localtokengenerator.js'), algorithm: 'RS256', allowInsecureKeySizes: true, // The private key is only needed if using the localtokengenerator privateKey: path.join(__dirname, '../src/server/middleware/auth/EXAMPLE_PRIVATE_KEY'), logOutUrlField: null, }, encryption: { algorithm: 'aes-256-cbc', key: path.join(__dirname, '../src/server/middleware/auth/EXAMPLE_ENCRYPTION_KEY') }, allowPasswordReset: false, allowedResetInterval: 3600000, resetTimeout: 1200000, resetUrl: '/profile/reset', useEmailForId: false, azureActiveDirectory: { enable: false, clientId: 'Example_Client_Id', authority: 'Example_authority_URI', jwksUri: 'https://login.microsoftonline.com/common/discovery/keys', // the following two are optionals, but if not // given, the device authentication will not work issuer: 'Example_token_issuer_for_verification', audience: 'Example_audience_for_token_validation', clientSecret: 'Example_client_Secret', cookieId: 'webgme_aad', redirectUri: 'need to set this temp, would be nice to deduct it', // optional, but if used an access token is will be fetched // after the authentication happens so router endpoints might use it accessScope: null, }, }, api: { useEnhancedStarterPage: false }, bin: { log: { transports: [{ transportType: 'Console', //patterns: ['gme:server:*', '-gme:server:worker*'], // ['gme:server:worker:*'], ['gme:server:*', '-gme:server:worker*'] options: { level: 'info', colorize: true, timestamp: true, prettyPrint: true, handleExceptions: true, // ignored by default when you create the logger // see the logger.create function depth: 2 } }] } }, blob: { compressionLevel: 0, allowListAll: false, type: 'FS', //'FS', 'S3' fsDir: './blob-local-storage', namespace: '', s3: { accessKeyId: '123', secretAccessKey: 'abc', region: '', s3ForcePathStyle: true, endpoint: 'http://localhost:4567', sslEnabled: false } }, client: { appDir: path.join(__dirname, '../src/app'), appVersion: '1.0.0', faviconPath: 'img/favicon.ico', pageTitle: null, log: { level: 'debug' } }, core: { enableCustomConstraints: false, inverseRelationsCacheSize: 2000, overlayShardSize: 10000 }, debug: false, documentEditing: { enable: true, disconnectTimeout: 20 * 1000 }, executor: { enable: false, authentication: { enable: false, allowGuests: true, }, nonce: null, workerRefreshInterval: 5000, clearOutputTimeout: 60000, clearOldDataAtStartUp: false, labelJobs: './labelJobs.json' }, mailer: { enable: false, service: '', host: '', port: 587, secure: false, user: 'none', pwd: 'none', sendPasswordReset: false }, mongo: { uri: 'mongodb://127.0.0.1:27017/multi', options: { writeConcern: { w: 1 }, autoReconnect: true, keepAlive: 1 } }, plugin: { allowBrowserExecution: true, allowServerExecution: false, basePaths: [path.join(__dirname, '../src/plugin/coreplugins')], displayAll: false, serverResultTimeout: 60000, suppressRegularNotifications: false }, requirejsPaths: {}, rest: { components: { //<id>: { // mount: 'path/subPath', // src: './middleware/ExampleRestRouter', // options: {} // } // Old format //'path/subPath': './middleware/ExampleRestRouter' } }, seedProjects: { enable: true, allowDuplication: true, //requires mongodb >= 2.6 defaultProject: 'EmptyProject', basePaths: [path.join(__dirname, '../seeds')], createAtStartup: [] }, server: { port: 8888, handle: null, timeout: -1, workerManager: { path: path.join(__dirname, '../src/server/worker/serverworkermanager'), options: {} }, // Default worker manager options (can be reused by custom worker managers too). maxWorkers: 10, maxQueuedWorkerRequests: -1, workerDisconnectTimeout: 2000, log: { //patterns: ['gme:server:*', '-gme:server:standalone*'], transports: [{ transportType: 'Console', //patterns: ['gme:server:*', '-gme:server:worker*'], // ['gme:server:worker:*'], ['gme:server:*', '-gme:server:worker*'] options: { level: 'info', // Set this back to info when merged colorize: true, timestamp: true, prettyPrint: true, handleExceptions: true, // ignored by default when you create the logger, // see the logger.create function depth: 2 } }, { transportType: 'File', options: { name: 'info-file', filename: './server.log', level: 'info', json: false } }, { transportType: 'File', options: { name: 'error-file', filename: './server-error.log', level: 'error', handleExceptions: true, // ignored by default when you create the logger, // see the logger.create function json: false } }] }, extlibExcludes: ['config/config..*.js$'], behindSecureProxy: false, // Configuration for bodyParser middlewares bodyParser: { json: {} } }, socketIO: { clientOptions: { reconnection: true, reconnectionDelay: 500, forceNew: true }, serverOptions: { // Changed to 1Mb in 2.5.0 but doc still refers to old value of 1e8. maxHttpBufferSize: 1e8 //transports: ['websocket', 'polling'] }, adapter: { type: 'Memory', // Memory, Redis options: { //uri: '127.0.0.1:6379' } } }, storage: { cache: 2000, freezeCache: false, // If true events such as PROJECT_CREATED and BRANCH_CREATED will only be broadcasted // and not emitted back to the web-socket that triggered the event. broadcastProjectEvents: false, maxEmittedCoreObjects: -1, loadBucketSize: 100, loadBucketTimer: 10, clientCacheSize: 2000, // overwrites cache on client autoMerge: { enable: false }, keyType: 'plainSHA1', // 'rand160Bits', 'plainSHA1', 'rustSHA1' database: { type: 'mongo', // mongo, redis, memory options: { // if mongo - settings will be used from config.mongo //port: 6666 } }, disableHashChecks: false, requireHashesToMatch: true }, visualization: { decoratorPaths: [], svgDirs: [], visualizerDescriptors: [], panelPaths: [], layout: { basePaths: [] } }, webhooks: { enable: false, manager: 'memory', // memory, redis defaults: { //myHook: {url: 'http://127.0.0.1:9000/MyWebHook', events: 'all', options: {}} } } }; module.exports = config;