From Beefy Macaw, 8 Years ago, written in Plain Text.
Embed
  1. {
  2.   "interface":":4984",
  3.   "adminInterface":":4985",
  4.   "log":["*"],
  5.   "logFilePath": "/var/log/sync_gateway/cb-sync-gateway.log",
  6.   "compressResponses": false,
  7.   "CORS": {
  8.     "origin":[
  9.         "http://localhost:8080",
  10.         "http://localhost:8081",
  11.         "http://localhost:3001",
  12.         "http://localhost:3000",
  13.         "https://etext2dev.pearson.com",
  14.         "https://cb-sync.ppe.realizereader.com",
  15.         "http://rr.ppe.realizereader.com",
  16.         "https://etext2ppe.pearson.com"
  17.         ],
  18.     "loginOrigin":[
  19.         "http://localhost:8080",
  20.         "http://localhost:8081",
  21.         "http://localhost:3001",
  22.         "http://localhost:3000",
  23.         "https://etext2dev.pearson.com",
  24.         "https://cb-sync.ppe.realizereader.com",
  25.         "http://rr.ppe.realizereader.com",
  26.         "https://etext2ppe.pearson.com"
  27.         ],
  28.     "headers":[
  29.         "DNT",
  30.         "X-CustomHeader",
  31.         "Keep-Alive",
  32.         "User-Agent",
  33.         "X-Requested-With",
  34.         "If-Modified-Since",
  35.         "Cache-Control",
  36.         "Content-Type"
  37.         ],
  38.     "maxAge": 1728000
  39.   },
  40.   "databases": {
  41.     "realize-reader": {
  42.       "server":"http://internal-ppe-couchbase-internal-1806609473.us-east-1.elb.amazonaws.com:80",
  43.       "bucket":"realize-reader",
  44.       "sync": `function (doc, oldDoc) {
  45.           if(!oldDoc) {
  46.             if(doc && doc.type && doc.userId) {
  47.               requireUser(doc.userId);
  48.               channel("user_" + doc.userId);
  49.             } else {
  50.               throw ({forbidden: "Document type and userId must be specified"});
  51.             }
  52.           } else {
  53.             if(oldDoc.type && oldDoc.userId) {
  54.               requireUser(oldDoc.userId);
  55.               channel("user_" + oldDoc.userId);
  56.             } else if(oldDoc._deleted && doc.type && doc.userId) {
  57.               requireUser(doc.userId);
  58.               channel("user_" + doc.userId);
  59.             } else {
  60.               throw ({forbidden: "Document type and userId must be specified"});
  61.             }
  62.           }
  63.       }`,
  64.       "users": {
  65.           "GUEST": {
  66.             "disabled": true,
  67.             "admin_channels": ["*"]
  68.           },
  69.           "admin": {
  70.             "admin_channels": ["*"],
  71.             "password": "QyeRDuwkX3ZLrbQMjZkguPww0"
  72.           }
  73.       }
  74.     },
  75.        "notebook": {
  76.       "server":"http://internal-ppe-couchbase-internal-1806609473.us-east-1.elb.amazonaws.com:80",
  77.       "event_handlers": {
  78.         "max_processes": 500,
  79.         "wait_for_process": "100",
  80.         "document_changed": [
  81.           {
  82.             "handler": "webhook",
  83.             "url": "https://syncgateway_client:syncgateway@ccci.realizeppe.com/ccci-service/api/v1/notebooksync/update",
  84.             "filter": `function(doc) {
  85.               if(doc.type == "note") {
  86.                 return true;
  87.               }
  88.               else if(doc._deleted === true) {
  89.                 return true;
  90.               }
  91.               return false;
  92.             }`
  93.           }
  94.         ]
  95.       },
  96.       "bucket":"notebook",
  97.       "username" :"notebook",
  98.       "password":"testing123$",
  99.       "sync": `function (doc, oldDoc) {
  100.         if(doc && doc.type && (doc.type == "note" || doc.type == "snapshot")) {
  101.           if(!oldDoc) {
  102.             if(doc.userId) {
  103.               requireUser(["admin", doc.userId]);
  104.               channel("user_" + doc.userId);          
  105.             } else {
  106.               throw ({forbidden: "userId must be specified"});
  107.             }
  108.           } else {
  109.             if(oldDoc.type && oldDoc.userId) {
  110.               requireUser(["admin", oldDoc.userId]);          
  111.               channel("user_" + oldDoc.userId);
  112.             } else if(oldDoc._deleted && doc.type && doc.userId) {            
  113.               requireUser(["admin", doc.userId]);
  114.               channel("user_" + doc.userId);
  115.             } else {
  116.               throw ({forbidden: "Document type and userId must be specified"});
  117.             }
  118.           }
  119.         } else {
  120.           channel(doc.channels);
  121.         }
  122.       }`,
  123.       "users": {
  124.           "GUEST": {
  125.             "disabled": true,
  126.             "admin_channels": ["*"]
  127.           },
  128.           "admin": {
  129.             "admin_channels": ["*"],
  130.             "password": "testing123$"
  131.           }
  132.       }
  133.     },
  134.     "openlrs": {
  135.       "server":"http://internal-ppe-couchbase-internal-1806609473.us-east-1.elb.amazonaws.com:80",
  136.       "event_handlers": {
  137.         "max_processes": 500,
  138.         "wait_for_process": "100",
  139.         "document_changed": [
  140.           {
  141.             "handler": "webhook",
  142.             "url": "http://openlrs:openlrs@openlrs-ppe.us-east-1.elasticbeanstalk.com/openlrs/assignment/state",
  143.             "filter": `function(doc) {
  144.               if (doc != null && doc.clientType != null && doc.clientType == 'iOS' && doc.clientType == 'Chrome') {
  145.                 return true;
  146.               }
  147.               return false;
  148.             }`
  149.           }
  150.         ]
  151.       },
  152.       "bucket":"openlrs",
  153.       "username" :"openlrs",
  154.       "password":"testing123$",
  155.       "sync": `function (doc, oldDoc) {
  156.         if(!oldDoc) {
  157.           if(doc && doc.agentAccountName) {
  158.             requireUser(["admin", doc.agentAccountName]);
  159.             channel("user_" + doc.agentAccountName);
  160.           } else {
  161.             requireUser("admin");
  162.             channel(doc.channels);
  163.           }
  164.         } else {
  165.           if (oldDoc.agentAccountName) {
  166.             requireUser(["admin", oldDoc.agentAccountName]);
  167.             channel("user_" + oldDoc.agentAccountName);
  168.           } else if(oldDoc._deleted && doc.agentAccountName) {
  169.             requireUser(["admin", doc.agentAccountName]);
  170.             channel("user_" + doc.agentAccountName);
  171.           } else if(doc.agentAccountName) {
  172.             requireUser(["admin", doc.agentAccountName]);
  173.             channel("user_" + doc.agentAccountName);
  174.           } else {
  175.             requireUser("admin");
  176.             channel(doc.channels);
  177.           }
  178.         }
  179.       }`,
  180.       "users": {
  181.           "GUEST": {
  182.             "disabled": true,
  183.             "admin_channels": ["*"]
  184.           },
  185.           "admin": {
  186.             "admin_channels": ["*"],
  187.             "password": "testing123$"
  188.           }
  189.       }
  190.     },
  191.     "desmos-calc": {
  192.       "server":"http://internal-ppe-couchbase-internal-1806609473.us-east-1.elb.amazonaws.com:80",
  193.       "bucket":"desmos-calc",
  194.       "username" :"desmos-calc",
  195.       "password":"testing123$",
  196.       "sync": `function (doc, oldDoc) {
  197.           if(!oldDoc) {
  198.             if(doc && doc.userId) {
  199.               requireUser(doc.userId);
  200.               channel("user_" + doc.userId);
  201.             } else {
  202.               channel(doc.channels);
  203.               throw ({forbidden: "Document type and userId must be specified"});
  204.             }
  205.           } else {
  206.             if(oldDoc.userId) {
  207.               requireUser(doc.userId);
  208.               channel("user_" + oldDoc.userId);
  209.             } else if(oldDoc._deleted && doc.userId) {
  210.               requireUser(doc.userId);
  211.               channel("user_" + doc.userId);
  212.             } else {
  213.               channel(doc.channels);
  214.               throw ({forbidden: "Document type and userId must be specified"});
  215.             }
  216.           }
  217.       }`,
  218.       "users": {
  219.           "GUEST": {
  220.             "disabled": true,
  221.             "admin_channels": ["*"]
  222.           },
  223.           "admin": {
  224.             "admin_channels": ["*"],
  225.             "password": "testing123$"
  226.           }
  227.       }
  228.     }
  229.   }
  230. }