michael@0: #filter substitution michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: // Process each item in the "constants hash" to add to "global" and give a name michael@0: this.EXPORTED_SYMBOLS = [((this[key] = val), key) for ([key, val] in Iterator({ michael@0: michael@0: WEAVE_VERSION: "@weave_version@", michael@0: michael@0: // Sync Server API version that the client supports. michael@0: SYNC_API_VERSION: "1.1", michael@0: USER_API_VERSION: "1.0", michael@0: MISC_API_VERSION: "1.0", michael@0: michael@0: // Version of the data format this client supports. The data format describes michael@0: // how records are packaged; this is separate from the Server API version and michael@0: // the per-engine cleartext formats. michael@0: STORAGE_VERSION: 5, michael@0: PREFS_BRANCH: "services.sync.", michael@0: michael@0: // Host "key" to access Weave Identity in the password manager michael@0: PWDMGR_HOST: "chrome://weave", michael@0: PWDMGR_PASSWORD_REALM: "Mozilla Services Password", michael@0: PWDMGR_PASSPHRASE_REALM: "Mozilla Services Encryption Passphrase", michael@0: PWDMGR_KEYBUNDLE_REALM: "Mozilla Services Key Bundles", michael@0: michael@0: // Put in [] because those aren't allowed in a collection name. michael@0: DEFAULT_KEYBUNDLE_NAME: "[default]", michael@0: michael@0: // Our extra input to SHA256-HMAC in generateEntry. michael@0: // This includes the full crypto spec; change this when our algo changes. michael@0: HMAC_INPUT: "Sync-AES_256_CBC-HMAC256", michael@0: michael@0: // Key dimensions. michael@0: SYNC_KEY_ENCODED_LENGTH: 26, michael@0: SYNC_KEY_DECODED_LENGTH: 16, michael@0: SYNC_KEY_HYPHENATED_LENGTH: 31, // 26 chars, 5 hyphens. michael@0: michael@0: NO_SYNC_NODE_INTERVAL: 10 * 60 * 1000, // 10 minutes michael@0: michael@0: MAX_ERROR_COUNT_BEFORE_BACKOFF: 3, michael@0: MAX_IGNORE_ERROR_COUNT: 5, michael@0: michael@0: // Backoff intervals michael@0: MINIMUM_BACKOFF_INTERVAL: 15 * 60 * 1000, // 15 minutes michael@0: MAXIMUM_BACKOFF_INTERVAL: 8 * 60 * 60 * 1000, // 8 hours michael@0: michael@0: // HMAC event handling timeout. michael@0: // 10 minutes: a compromise between the multi-desktop sync interval michael@0: // and the mobile sync interval. michael@0: HMAC_EVENT_INTERVAL: 600000, michael@0: michael@0: // How long to wait between sync attempts if the Master Password is locked. michael@0: MASTER_PASSWORD_LOCKED_RETRY_INTERVAL: 15 * 60 * 1000, // 15 minutes michael@0: michael@0: // Separate from the ID fetch batch size to allow tuning for mobile. michael@0: MOBILE_BATCH_SIZE: 50, michael@0: michael@0: // 50 is hardcoded here because of URL length restrictions. michael@0: // (GUIDs can be up to 64 chars long.) michael@0: // Individual engines can set different values for their limit if their michael@0: // identifiers are shorter. michael@0: DEFAULT_GUID_FETCH_BATCH_SIZE: 50, michael@0: DEFAULT_MOBILE_GUID_FETCH_BATCH_SIZE: 50, michael@0: michael@0: // Default batch size for applying incoming records. michael@0: DEFAULT_STORE_BATCH_SIZE: 1, michael@0: HISTORY_STORE_BATCH_SIZE: 50, // same as MOBILE_BATCH_SIZE michael@0: FORMS_STORE_BATCH_SIZE: 50, // same as MOBILE_BATCH_SIZE michael@0: PASSWORDS_STORE_BATCH_SIZE: 50, // same as MOBILE_BATCH_SIZE michael@0: ADDONS_STORE_BATCH_SIZE: 1000000, // process all addons at once michael@0: APPS_STORE_BATCH_SIZE: 50, // same as MOBILE_BATCH_SIZE michael@0: michael@0: // score thresholds for early syncs michael@0: SINGLE_USER_THRESHOLD: 1000, michael@0: MULTI_DEVICE_THRESHOLD: 300, michael@0: michael@0: // Other score increment constants michael@0: SCORE_INCREMENT_SMALL: 1, michael@0: SCORE_INCREMENT_MEDIUM: 10, michael@0: michael@0: // Instant sync score increment michael@0: SCORE_INCREMENT_XLARGE: 300 + 1, //MULTI_DEVICE_THRESHOLD + 1 michael@0: michael@0: // Delay before incrementing global score michael@0: SCORE_UPDATE_DELAY: 100, michael@0: michael@0: // Delay for the back observer debouncer. This is chosen to be longer than any michael@0: // observed spurious idle/back events and short enough to pre-empt user activity. michael@0: IDLE_OBSERVER_BACK_DELAY: 100, michael@0: michael@0: // Number of records to upload in a single POST (multiple POSTS if exceeded) michael@0: // FIXME: Record size limit is 256k (new cluster), so this can be quite large! michael@0: // (Bug 569295) michael@0: MAX_UPLOAD_RECORDS: 100, michael@0: MAX_HISTORY_UPLOAD: 5000, michael@0: MAX_HISTORY_DOWNLOAD: 5000, michael@0: michael@0: // Top-level statuses: michael@0: STATUS_OK: "success.status_ok", michael@0: SYNC_FAILED: "error.sync.failed", michael@0: LOGIN_FAILED: "error.login.failed", michael@0: SYNC_FAILED_PARTIAL: "error.sync.failed_partial", michael@0: CLIENT_NOT_CONFIGURED: "service.client_not_configured", michael@0: STATUS_DISABLED: "service.disabled", michael@0: MASTER_PASSWORD_LOCKED: "service.master_password_locked", michael@0: michael@0: // success states michael@0: LOGIN_SUCCEEDED: "success.login", michael@0: SYNC_SUCCEEDED: "success.sync", michael@0: ENGINE_SUCCEEDED: "success.engine", michael@0: michael@0: // login failure status codes: michael@0: LOGIN_FAILED_NO_USERNAME: "error.login.reason.no_username", michael@0: LOGIN_FAILED_NO_PASSWORD: "error.login.reason.no_password2", michael@0: LOGIN_FAILED_NO_PASSPHRASE: "error.login.reason.no_recoverykey", michael@0: LOGIN_FAILED_NETWORK_ERROR: "error.login.reason.network", michael@0: LOGIN_FAILED_SERVER_ERROR: "error.login.reason.server", michael@0: LOGIN_FAILED_INVALID_PASSPHRASE: "error.login.reason.recoverykey", michael@0: LOGIN_FAILED_LOGIN_REJECTED: "error.login.reason.account", michael@0: LOGIN_FAILED_NOT_READY: "error.login.reason.initializing", michael@0: michael@0: // sync failure status codes michael@0: METARECORD_DOWNLOAD_FAIL: "error.sync.reason.metarecord_download_fail", michael@0: VERSION_OUT_OF_DATE: "error.sync.reason.version_out_of_date", michael@0: DESKTOP_VERSION_OUT_OF_DATE: "error.sync.reason.desktop_version_out_of_date", michael@0: SETUP_FAILED_NO_PASSPHRASE: "error.sync.reason.setup_failed_no_passphrase", michael@0: CREDENTIALS_CHANGED: "error.sync.reason.credentials_changed", michael@0: ABORT_SYNC_COMMAND: "aborting sync, process commands said so", michael@0: NO_SYNC_NODE_FOUND: "error.sync.reason.no_node_found", michael@0: OVER_QUOTA: "error.sync.reason.over_quota", michael@0: PROLONGED_SYNC_FAILURE: "error.sync.prolonged_failure", michael@0: SERVER_MAINTENANCE: "error.sync.reason.serverMaintenance", michael@0: michael@0: RESPONSE_OVER_QUOTA: "14", michael@0: michael@0: // engine failure status codes michael@0: ENGINE_UPLOAD_FAIL: "error.engine.reason.record_upload_fail", michael@0: ENGINE_DOWNLOAD_FAIL: "error.engine.reason.record_download_fail", michael@0: ENGINE_UNKNOWN_FAIL: "error.engine.reason.unknown_fail", michael@0: ENGINE_APPLY_FAIL: "error.engine.reason.apply_fail", michael@0: ENGINE_METARECORD_DOWNLOAD_FAIL: "error.engine.reason.metarecord_download_fail", michael@0: ENGINE_METARECORD_UPLOAD_FAIL: "error.engine.reason.metarecord_upload_fail", michael@0: michael@0: JPAKE_ERROR_CHANNEL: "jpake.error.channel", michael@0: JPAKE_ERROR_NETWORK: "jpake.error.network", michael@0: JPAKE_ERROR_SERVER: "jpake.error.server", michael@0: JPAKE_ERROR_TIMEOUT: "jpake.error.timeout", michael@0: JPAKE_ERROR_INTERNAL: "jpake.error.internal", michael@0: JPAKE_ERROR_INVALID: "jpake.error.invalid", michael@0: JPAKE_ERROR_NODATA: "jpake.error.nodata", michael@0: JPAKE_ERROR_KEYMISMATCH: "jpake.error.keymismatch", michael@0: JPAKE_ERROR_WRONGMESSAGE: "jpake.error.wrongmessage", michael@0: JPAKE_ERROR_USERABORT: "jpake.error.userabort", michael@0: JPAKE_ERROR_DELAYUNSUPPORTED: "jpake.error.delayunsupported", michael@0: michael@0: // info types for Service.getStorageInfo michael@0: INFO_COLLECTIONS: "collections", michael@0: INFO_COLLECTION_USAGE: "collection_usage", michael@0: INFO_COLLECTION_COUNTS: "collection_counts", michael@0: INFO_QUOTA: "quota", michael@0: michael@0: // Ways that a sync can be disabled (messages only to be printed in debug log) michael@0: kSyncMasterPasswordLocked: "User elected to leave Master Password locked", michael@0: kSyncWeaveDisabled: "Weave is disabled", michael@0: kSyncNetworkOffline: "Network is offline", michael@0: kSyncBackoffNotMet: "Trying to sync before the server said it's okay", michael@0: kFirstSyncChoiceNotMade: "User has not selected an action for first sync", michael@0: michael@0: // Application IDs michael@0: FIREFOX_ID: "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}", michael@0: FENNEC_ID: "{a23983c0-fd0e-11dc-95ff-0800200c9a66}", michael@0: SEAMONKEY_ID: "{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}", michael@0: TEST_HARNESS_ID: "xuth@mozilla.org", michael@0: michael@0: MIN_PP_LENGTH: 12, michael@0: MIN_PASS_LENGTH: 8, michael@0: michael@0: LOG_DATE_FORMAT: "%Y-%m-%d %H:%M:%S", michael@0: michael@0: }))];