4

Problem

The collaborative Markdown editor StackEdit can be used with the essentially free Italian CouchDB hosting provider Couchappy to store one's documents. StackEdit is a web service without accounts. It connects to your Couchappy CouchDB instance, simply by providing a URL like this:

https://instance.couchappy.com/documents

The problem is that anyone in the world can do so. According to StackEdit's CouchDB setup documentation, one can still set permissions for CouchDB and configure StackEdit to connect to it using a URL like the one below:

https://username:password@instance.couchappy.com/documents

Questions

  1. How do I create additional CouchDB users in Couchappy?
  2. How do I enforce authentication for all CouchDB requests on Couchappy?

What I tried so far

In addition to the required configuration modifications, I added a line credentials = true. This had no effect.

[httpd]
enable_cors = true

[cors]
credentials = true
origins = http://localhost, https://stackedit.io 

Couchappy's FAQ mentions something about cors headers, but CouchDB's documentation on this topic is meagre.

headers = accept, authorization, cookie, content-type
  • One important thing I already learned, is not to choose a CouchDB password containing the @ character. This will prevent errors with authenticated URL requests (see Problem). – Serge Stroobandt Dec 1 '14 at 19:33
  • According to smileupps.com/news Couchhappy was renamed as smileupps – Rubén Sep 19 '16 at 15:36
2

These are essentially CouchDB authentication related questions, not specific to Couchappy:

1. How do I create additional CouchDB users in Couchappy?

You can use Futon to create a new admin account in your Couchdb instance:

  1. Go to https://instance.couchappy.com/_utils/
  2. Login as admin
  3. Go to configuration
  4. At the bottom click on "Add a new section"
    Section: admin
    Option: username
    Value: password

2. How do I enforce authentication for all CouchDB requests on Couchappy?

Change value of: couch_httpd_auth->require_valid_user to true

  • This is not working. I get Error 0: NS_ERROR_DOM_BAD_URI: Access to restricted URI denied. (I did change the URL to the long version with username and password.) – Serge Stroobandt Dec 2 '14 at 0:37
  • 1
    If you use an url like username:password@instance.couchappy.com to access your instance, then you have to be sure that username and password does not contain special characters.. Try to use only letters. – giowild Dec 2 '14 at 9:44
  • Otherwise you can ask authentication by using the plain instance url (instance.couchappy.com), but sending a request header for http basic authentication like "Authorization: Basic bXlfdXNlcm5hbWU6bXlfcGFzc3dvcmQ=", where "bXlfdXNlcm5hbWU6bXlfcGFzc3dvcmQ=" is the base64_encode("my_username:my_password"). You can use base64encode.org to encode your own credentials – giowild Dec 2 '14 at 9:45
  • I am using only letters and numbers for my credentials. Perhaps it has something to do with StackEdit. You should give it a quick try. – Serge Stroobandt Dec 2 '14 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.