Closed mrjones-plip closed 2 years ago
cc @garethbowen per our call today
I think we should not default the UUID too.
I had a look at this in the 7812-require-password
branch but ran out of time to get the build to pass. I think there's some issue with making the entire cluster use the same secret and UUID...
This is ready for AT on 7800-no-couch-secret
.
Please make sure that:
Compose files:
Thanks @dianabarsan for the steps and the files to test.
Here are the testing results using the files provided in the previous comment and the branch 7800-no-couch-secret
docker-compose up
On the error, it looks like the haproxy container failed to come up. Can you check the logs? It can be something as simple as a port clash or something else.
I had problems when I tried to log in using an offline user. Not sure if I am missing something
From the video, it looks like your browser doesn't accept the self signed certificate and doesn't download the service worker, which is required for offline users. How do you usually handle self signed certificates?
About the certificate problems, I have never had this issue before. I was reading about it, so I tried using Firefox, exported the certificates and added them to the keychanin access
to be trusted, but that did not work for chrome, don't understand why because it is working fine in Firefox, will need to investigate a little bit more, but meanwhile, I was testing that the offline users didn't download all docs again when I restarted CouchDb container.
offline users didn't download
Since your user only has 37 docs, then you would not notice them downloading in a sync unless you inspected the network requests, and check how many docs the server sends back.
About the error when I try to use the clustered CouchDB..
I don't have a lot of knowledge with docker so I just try changing the name of the COUCHDB_SERVERS
in the docker-compose_cht-core.yml
from couchdb
to couchdb.1
/couchdb.2
/couchdb.3
just to see what happened.
Using couchdb.1
the result was that the container that failed this time was the cht-api
with the error:
Using couchdb.2
or couchdb.3
all the containers were up successfully but I am seeing this error:
Not sure if this helps you or not, I just wanted to try different things 🙂
...you would not notice them downloading in a sync unless you inspected the network requests, and check how many docs the server sends back.
Thanks for pointing that @dianabarsan I think this video is better, isn't it?
Unfortunately no :(
Pouch <-> Couch replication is optimized to not download a document if it already exists locally (and this check is made via the _revs_diff) call.
In your case, you should inspect the response of the changes requests after you restart the container (the one that doesn't fail). There should be no changes there at all (or 1-2 docs that were updated in the meantime).
Another option is to check that the since
parameter is never rolled back, so you would look at every /medic/_changes request and check the since
parameter, which should never go back to 0.
When checking, please be aware that there will be a _changes request for the users meta database. Checking that can also be used to verify, but then please be sure you manually sync once before restarting the container - the meta database doesn't automatically sync on startup.
I don't have a lot of knowledge with docker so I just try changing the name of the COUCHDB_SERVERS in the docker-compose_cht-core.yml from couchdb to couchdb.1/couchdb.2/couchdb.3 just to see what happened.
Looking into how core-eng/sre architected this, the readme specifies you were right! You do need to set them. But seperate them with ,
, not /
;) (note, readme is wrong! We want to use a single COUCHDB_SERVERS
, not discrete COUCHDB1_SERVER
etc - I'll open another PR to fix this tomorrow)
I was able to use these steps to test with clustered couch on this branch:
COUCHDB_SERVERS="couchdb.1,couchdb.2,couchdb.3" COUCHDB_PASSWORD=password COUCHDB_USER=medic docker-compose -f docker-compose_cht-couchdb-clustered.yml -f docker-compose_cht-core.yml up
Thank you @dianabarsan and @mrjones-plip for your help.
I think that I have tested everything correctly this time, here are the results:
since
parameter never goes back to 0
since
parameter never goes back to 0
@dianabarsan please let me know is there is anything else that I am missing and should test, and thanks again, I learned a lot from this ticket.
Excellent testing, thank you so much @tatilepizs !
Merged to master
Describe the issue We hard code the secret for CouchDB in the Arch v3 docker setup as shown here:
This is insecure as it is public and will be used by default unless users override it.
Describe the improvement you'd like We should dynamically generate this at install time or mandate that users specify a unique one per install.
Describe alternatives you've considered NA