Currently I’m using community version: CBLite 2.1.3 , CBServer 6.0, CB-Sync-Gateway 2.1.2
Problem: When set locally, I am able to see my channels and documents without any problems.
When I set my environment to production, I can not see any channels or documents. Also there’s a pushPull Replication for error 61 on CBLite.
This is my sync-gateway-config-file:
{
“logging”: {
“console”: {
“log_keys”: [""]
}
},
“log”: [""],
“adminInterface”: “:4985”,
“interface”: “:4984”,
“CORS”: {
“origin”:[""],
“loginorigin”:[""],
“headers”:[“Content-Type”],
“maxAge”: 1728000
},
“databases”: {
“signup”: {
“server”: “http://non-localhost:8091”,
“bucket”: “signup”,
“username”: “signup”,
“password”: “@arbitrary”,
“import_docs”: “continuous”,
“enable_shared_bucket_access”: true,
“allow_conflicts”: false,
“revs_limit”: 20,
“use_views”: false,
“num_index_replicas” : 0
},
“housr-bucket”: {
“server”: “http://non-localhost:8091”,
“bucket”: “some-bucket”,
“username”: “Administrator”,
“password”: “@arbitrary”,
“import_docs”: “continuous”,
“enable_shared_bucket_access”: true,
“allow_conflicts”: false,
“revs_limit”: 20,
“use_views”: false,
“num_index_replicas” : 0,
“roles”: {
“tenant”: {},
“company”: {},
“employee”: {}
},
“users”: {
“GUEST”: { “disabled”: true, “admin_channels”: ["*"]}
},
“sync”: `
function(doc, oldDoc){
channel(doc.channels);
if(doc.DocType == "AppServerUser"){
requireRole("Company");
access(doc.Username, "AppServerUser");
}else if(doc.DocType == "Tenant"){
channel("Tenant." + doc._id);
access(doc.Username, "Tenant." + doc._id);
}else if(doc.DocType == "Employee"){
channel("Employee." + doc._id);
access(doc.Username, "Employee." + doc._id);
}else if(doc.DocType == "Residential"){
channel("Company." + doc.CompanyID);
}else if(doc.DocType == "Commercial"){
channel("Company." + doc.CompanyID);
}else if(doc.DocType == "MaintenanceTask"){
channel("Tenant." + doc.TenantID);
}else if(doc.DocType == "Contract"){
channel("Contract." + doc._id);
access(doc.CompanyUsername, "Contract." + doc._id);
access(doc.EmployeesUsername, "Contract." + doc._id);
access(doc.TenantsUsername, "Contract." + doc._id);
for (var i = 0; i < doc.TenantsID.length; i += 1) {
access(doc.CompanyUsername, "Tenant." + doc.TenantsID[i]);
}
for (var i = 0; i < doc.EmployeesID.length; i += 1) {
access(doc.CompanyUsername, "Employee." + doc.EmployeesID[i]);
}
}else if(doc.DocType == "Company"){
channel("Company." + doc._id);
access(doc.Username, "Company." + doc._id);
requireUser(doc.Username);
if(!doc.CompanyPhone){
throw({forbidden: "CompanyPhone(Verified) is required for Landlord."});
};
}else if(doc.DocType == "Landlord"){
channel("Company." + doc.CompanyID);
}else if (doc.DocType == "LandlordAuth"){
channel("!");
}else if (doc.DocType == "PendingAuth"){
channel("PendingAuth." + doc._id);
access(doc.Username, "PendingAuth." + doc._id);
}else {
throw({forbidden: "Invalid document type."});
}
}
`
}
}
}