From 605377cf31c7ca974a69936c75fdf3aae64487e8 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 30 May 2017 15:35:51 +0200 Subject: [PATCH] update default configuration file with new attributes and comments --- config.example.js | 69 +++++++++++++++++++++++++++-------------------- rpc.js | 2 +- server.js | 4 ++- 3 files changed, 44 insertions(+), 31 deletions(-) diff --git a/config.example.js b/config.example.js index a0f3003e0..be7682162 100644 --- a/config.example.js +++ b/config.example.js @@ -10,7 +10,7 @@ module.exports = { // the port on which your httpd will listen - /* Cryptpad can be configured to send customized HTTP Headers + /* CryptPad can be configured to send customized HTTP Headers * These settings may vary widely depending on your needs * Examples are provided below */ @@ -31,7 +31,7 @@ module.exports = { * connect-src is used to restrict what domains can connect to the websocket. * * it is recommended that you configure these fields to match the - * domain which will serve your cryptpad instance. + * domain which will serve your CryptPad instance. */ "child-src 'self' *", @@ -82,24 +82,24 @@ module.exports = { */ //websocketPort: 3000, - /* if you want to run a different version of cryptpad but using the same websocket + /* if you want to run a different version of CryptPad but using the same websocket * server, you should use the other server port as websocketPort and disable * the websockets on that server */ //useExternalWebsocket: false, - /* If Cryptpad is proxied without using https, the server needs to know. + /* If CryptPad is proxied without using https, the server needs to know. * Specify 'useSecureWebsockets: true' so that it can send * Content Security Policy Headers that prevent http and https from mixing */ useSecureWebsockets: false, - /* Cryptpad can log activity to stdout + /* CryptPad can log activity to stdout * This may be useful for debugging */ logToStdout: false, - /* Cryptpad supports verbose logging + /* CryptPad supports verbose logging * (false by default) */ verbose: false, @@ -116,13 +116,16 @@ module.exports = { 'contact', ], - /* Limits, Subscriptions and Contact + /* Limits, Donations, Subscriptions and Contact + * + * By default, CryptPad limits every registered user to 50MB of storage. It also shows a + * donate button which allows for making a donation to support CryptPad development. * - * CryptPad limits every registered user to 50MB of storage. - * By default it also allows that limit to be increased by subscribing at accounts.cryptpad.fr * You can either: - * A: Hide the button for subscribing, so everyone is limited to 50MB - * B: Support cryptpad and share 50% of the revenue earned on your instance + * A: Leave it exactly as it is. + * B: Hide the donate button. + * C: Change the donate button to a subscribe button, people who subscribe will get more + * storage on your instance and you get 50% of the revenue earned. * * CryptPad is developed by people who need to live and who deserve an equivilent life to * what they would get at a company which monitizes user data. However, we intend to have @@ -131,28 +134,36 @@ module.exports = { * * If you are using CryptPad in a business context, please consider taking a support contract * by contacting sales@cryptpad.fr - * - * If you choose A, set this variable to true to hide the subscription button. + * + * If you choose A then there's nothing to do. + * + * If you choose B, set this variable to true and it will remove the donate button. */ - noSubscriptionButton: false, + removeDonateButton: false, /* - * If you choose B, set the domain of your cryptpad instance here and then contact - * sales@cryptpad.fr and tell us your domain, we will tell you what is needed to get paid. + * If you choose C, set allowSubscriptions to true, then set myDomain to the domain which people + * use to reach your CryptPad instance. Then contact sales@cryptpad.fr and tell us your domain. + * We will tell you what is needed to get paid. */ - myDomain: 'i.did.not.read.my.config.cryptpad.myserver.tld', + allowSubscriptions: false, + myDomain: 'i.did.not.read.my.config.myserver.tld', + /* * If you are using CryptPad internally and you want to increase the per-user storage limit, * change the following value. - * Please note: Providing a public offer that is better than cryptpad.fr is an attack on - * the project. Please leave this alone if you are providing a public service. + * + * Please note: This limit is what makes people subscribe and what pays for CryptPad + * development. Running a public instance that provides a "better deal" than cryptpad.fr + * is effectively using the project against itself. */ defaultStorageLimit: 50 * 1024 * 1024, + /* - * By default, CryptPad contacts our accounts server once a day to check for changes in the - * people who have accounts. This check-in will also send your email and the version of - * CryptPad you run so we can reach you if we are aware of a serious problem with your - * CryptPad instance. We will never sell it or use it for marketing. If you want to block this - * check-in and remain completely private, set this to false and noSubscriptionButton to true. + * By default, CryptPad also contacts our accounts server once a day to check for changes in + * the people who have accounts. This check-in will also send the version of your CryptPad + * instance and your email so we can reach you if we are aware of a serious problem. We will + * never sell it or send you marketing mail. If you want to block this check-in and remain + * completely invisible, set this and allowSubscriptions both to false. */ adminEmail: 'i.did.not.read.my.config@cryptpad.fr', @@ -176,7 +187,7 @@ module.exports = { storage: './storage/file', /* - Cryptpad stores each document in an individual file on your hard drive. + CryptPad stores each document in an individual file on your hard drive. Specify a directory where files should be stored. It will be created automatically if it does not already exist. */ @@ -199,17 +210,17 @@ module.exports = { */ blobStagingPath: './blobstage', - /* Cryptpad's file storage adaptor closes unused files after a configurale + /* CryptPad's file storage adaptor closes unused files after a configurale * number of milliseconds (default 30000 (30 seconds)) */ channelExpirationMs: 30000, - /* Cryptpad's file storage adaptor is limited by the number of open files. + /* CryptPad's file storage adaptor is limited by the number of open files. * When the adaptor reaches openFileLimit, it will clean up older files */ openFileLimit: 2048, - /* Cryptpad's socket server can be extended to respond to RPC calls + /* CryptPad's socket server can be extended to respond to RPC calls * you can configure it to respond to custom RPC calls if you like. * provide the path to your RPC module here, or `false` if you would * like to disable the RPC interface completely @@ -261,7 +272,7 @@ module.exports = { */ //logFeedback: true, - /* it is recommended that you serve cryptpad over https + /* it is recommended that you serve CryptPad over https * the filepaths below are used to configure your certificates */ //privKeyAndCertFiles: [ diff --git a/rpc.js b/rpc.js index 07ad2e1cd..fc204d87c 100644 --- a/rpc.js +++ b/rpc.js @@ -373,7 +373,7 @@ var getHash = function (Env, publicKey, cb) { // To each key is associated an object containing the 'limit' value and a 'note' explaining that limit var limits = {}; var updateLimits = function (config, publicKey, cb) { - if (config.adminEmail === false && config.noSubscriptionButton === true) { return; } + if (config.adminEmail === false && config.allowSubscriptions === false) { return; } if (typeof cb !== "function") { cb = function () {}; } var defaultLimit = typeof(config.defaultStorageLimit) === 'number'? diff --git a/server.js b/server.js index e2527fa7d..eb16fbcf1 100644 --- a/server.js +++ b/server.js @@ -121,7 +121,9 @@ app.get('/api/config', function(req, res){ waitSeconds: 60, urlArgs: 'ver=' + Package.version + (DEV_MODE? '-' + (+new Date()): ''), }, - noSubscriptionButton: (config.noSubscriptionButton === true), + removeDonateButton: (config.removeDonateButton === true), + allowSubscriptions: (config.allowSubscriptions === true), + websocketPath: config.useExternalWebsocket ? undefined : config.websocketPath, websocketURL:'ws' + ((useSecureWebsockets) ? 's' : '') + '://' + host + ':' + websocketPort + '/cryptpad_websocket',