- {
- "interface":":4984",
- "adminInterface":":4985",
- "log":["*"],
- "logFilePath": "/var/log/sync_gateway/cb-sync-gateway.log",
- "compressResponses": false,
- "CORS": {
- "origin":[
- "http://localhost:8080",
- "http://localhost:8081",
- "http://localhost:3001",
- "http://localhost:3000",
- "https://etext2dev.pearson.com",
- "https://cb-sync.ppe.realizereader.com",
- "http://rr.ppe.realizereader.com",
- "https://etext2ppe.pearson.com"
- ],
- "loginOrigin":[
- "http://localhost:8080",
- "http://localhost:8081",
- "http://localhost:3001",
- "http://localhost:3000",
- "https://etext2dev.pearson.com",
- "https://cb-sync.ppe.realizereader.com",
- "http://rr.ppe.realizereader.com",
- "https://etext2ppe.pearson.com"
- ],
- "headers":[
- "DNT",
- "X-CustomHeader",
- "Keep-Alive",
- "User-Agent",
- "X-Requested-With",
- "If-Modified-Since",
- "Cache-Control",
- "Content-Type"
- ],
- "maxAge": 1728000
- },
- "databases": {
- "realize-reader": {
- "server":"http://internal-ppe-couchbase-internal-1806609473.us-east-1.elb.amazonaws.com:80",
- "bucket":"realize-reader",
- "sync": `function (doc, oldDoc) {
- if(!oldDoc) {
- if(doc && doc.type && doc.userId) {
- requireUser(doc.userId);
- channel("user_" + doc.userId);
- } else {
- throw ({forbidden: "Document type and userId must be specified"});
- }
- } else {
- if(oldDoc.type && oldDoc.userId) {
- requireUser(oldDoc.userId);
- channel("user_" + oldDoc.userId);
- } else if(oldDoc._deleted && doc.type && doc.userId) {
- requireUser(doc.userId);
- channel("user_" + doc.userId);
- } else {
- throw ({forbidden: "Document type and userId must be specified"});
- }
- }
- }`,
- "users": {
- "GUEST": {
- "disabled": true,
- "admin_channels": ["*"]
- },
- "admin": {
- "admin_channels": ["*"],
- "password": "QyeRDuwkX3ZLrbQMjZkguPww0"
- }
- }
- },
- "notebook": {
- "server":"http://internal-ppe-couchbase-internal-1806609473.us-east-1.elb.amazonaws.com:80",
- "event_handlers": {
- "max_processes": 500,
- "wait_for_process": "100",
- "document_changed": [
- {
- "handler": "webhook",
- "url": "https://syncgateway_client:syncgateway@ccci.realizeppe.com/ccci-service/api/v1/notebooksync/update",
- "filter": `function(doc) {
- if(doc.type == "note") {
- return true;
- }
- else if(doc._deleted === true) {
- return true;
- }
- return false;
- }`
- }
- ]
- },
- "bucket":"notebook",
- "username" :"notebook",
- "password":"testing123$",
- "sync": `function (doc, oldDoc) {
- if(doc && doc.type && (doc.type == "note" || doc.type == "snapshot")) {
- if(!oldDoc) {
- if(doc.userId) {
- requireUser(["admin", doc.userId]);
- channel("user_" + doc.userId);
- } else {
- throw ({forbidden: "userId must be specified"});
- }
- } else {
- if(oldDoc.type && oldDoc.userId) {
- requireUser(["admin", oldDoc.userId]);
- channel("user_" + oldDoc.userId);
- } else if(oldDoc._deleted && doc.type && doc.userId) {
- requireUser(["admin", doc.userId]);
- channel("user_" + doc.userId);
- } else {
- throw ({forbidden: "Document type and userId must be specified"});
- }
- }
- } else {
- channel(doc.channels);
- }
- }`,
- "users": {
- "GUEST": {
- "disabled": true,
- "admin_channels": ["*"]
- },
- "admin": {
- "admin_channels": ["*"],
- "password": "testing123$"
- }
- }
- },
- "openlrs": {
- "server":"http://internal-ppe-couchbase-internal-1806609473.us-east-1.elb.amazonaws.com:80",
- "event_handlers": {
- "max_processes": 500,
- "wait_for_process": "100",
- "document_changed": [
- {
- "handler": "webhook",
- "url": "http://openlrs:openlrs@openlrs-ppe.us-east-1.elasticbeanstalk.com/openlrs/assignment/state",
- "filter": `function(doc) {
- if (doc != null && doc.clientType != null && doc.clientType == 'iOS' && doc.clientType == 'Chrome') {
- return true;
- }
- return false;
- }`
- }
- ]
- },
- "bucket":"openlrs",
- "username" :"openlrs",
- "password":"testing123$",
- "sync": `function (doc, oldDoc) {
- if(!oldDoc) {
- if(doc && doc.agentAccountName) {
- requireUser(["admin", doc.agentAccountName]);
- channel("user_" + doc.agentAccountName);
- } else {
- requireUser("admin");
- channel(doc.channels);
- }
- } else {
- if (oldDoc.agentAccountName) {
- requireUser(["admin", oldDoc.agentAccountName]);
- channel("user_" + oldDoc.agentAccountName);
- } else if(oldDoc._deleted && doc.agentAccountName) {
- requireUser(["admin", doc.agentAccountName]);
- channel("user_" + doc.agentAccountName);
- } else if(doc.agentAccountName) {
- requireUser(["admin", doc.agentAccountName]);
- channel("user_" + doc.agentAccountName);
- } else {
- requireUser("admin");
- channel(doc.channels);
- }
- }
- }`,
- "users": {
- "GUEST": {
- "disabled": true,
- "admin_channels": ["*"]
- },
- "admin": {
- "admin_channels": ["*"],
- "password": "testing123$"
- }
- }
- },
- "desmos-calc": {
- "server":"http://internal-ppe-couchbase-internal-1806609473.us-east-1.elb.amazonaws.com:80",
- "bucket":"desmos-calc",
- "username" :"desmos-calc",
- "password":"testing123$",
- "sync": `function (doc, oldDoc) {
- if(!oldDoc) {
- if(doc && doc.userId) {
- requireUser(doc.userId);
- channel("user_" + doc.userId);
- } else {
- channel(doc.channels);
- throw ({forbidden: "Document type and userId must be specified"});
- }
- } else {
- if(oldDoc.userId) {
- requireUser(doc.userId);
- channel("user_" + oldDoc.userId);
- } else if(oldDoc._deleted && doc.userId) {
- requireUser(doc.userId);
- channel("user_" + doc.userId);
- } else {
- channel(doc.channels);
- throw ({forbidden: "Document type and userId must be specified"});
- }
- }
- }`,
- "users": {
- "GUEST": {
- "disabled": true,
- "admin_channels": ["*"]
- },
- "admin": {
- "admin_channels": ["*"],
- "password": "testing123$"
- }
- }
- }
- }
- }
Stikked
