db: { username: process.env.RDS_USERNAME || "root", password: process.env.RDS_PASSWORD || "password", database: process.env.DATA_BASE || "codepush", host: process.env.RDS_HOST || "localhost", port: process.env.RDS_PORT || 4306, dialect: "mysql", logging: false }, // ... local: { // Binary files storage dir, Do not use tmpdir and it's public download dir. storageDir: process.env.STORAGE_DIR || "/home/michael/code-push/storage", // Binary files download host address which Code Push Server listen to. the files storage in storageDir. downloadUrl: process.env.LOCAL_DOWNLOAD_URL || "https://update.michaelxu.top/download", // public static download spacename. public: process.env.PUBLIC || '/download' },
// ... common: { /* * tryLoginTimes is control login error times to avoid force attack. * if value is 0, no limit for login auth, it may not safe for account. when it's a number, it means you can * try that times today. but it need config redis server. */ tryLoginTimes: 3, // CodePush Web(https://github.com/lisong/code-push-web) login address. //codePushWebUrl: "http://localhost:3001/login", // create patch updates's number. default value is 3 diffNums: 3, // data dir for caclulate diff files. it's optimization. dataDir: process.env.DATA_DIR || "/home/michael/code-push/storage", // storageType which is your binary package files store. options value is ("local" | "qiniu" | "s3") storageType: process.env.STORAGE_TYPE || "local", // options value is (true | false), when it's true, it will cache updateCheck results in redis. updateCheckCache: true }, // ... // Config for redis (register module, tryLoginTimes module) redis: { default: { host: "localhost", port: 6379, password: 'password', retry_strategy: function (options) { if (options.error.code === 'ECONNREFUSED') { // End reconnecting on a specific error and flush all commands with a individual error returnnewError('The server refused the connection'); } if (options.total_retry_time > 1000 * 60 * 60) { // End reconnecting after a specific timeout and flush all commands with a individual error returnnewError('Retry time exhausted'); } if (options.times_connected > 10) { // End reconnecting with built in error returnundefined; } // reconnect after returnMath.max(options.attempt * 100, 3000); } } }