Some notes toward a fully distributed, serverless socnet/communications network using CouchDB.

Bryce Lynch virtualadept at gmail.com
Sat Dec 8 22:49:10 PST 2012


Now that Windbringer's been upgraded, I was able to install and run
CouchDB.  Which means that I've been hacking around.

Take cover.  Incoming JSON and incoherent rambling.

couchdb listens on 127.0.0.1:5984 by default.  Configure Tor to expose port
5984/tcp on <foo>.onion.  Voila.

creating new databases (even remotely) is as simple as making an HTTP
request to localhost:5984 consisting of
    PUT http://localhost:5984/<database>
Then documents can start being added to it.

The array "acl" has a couple of default values.  An an entry "all" mean
that anyone can read and replicate it.  "private" means that only the
author is allowed to access it; an empty entry means the same thing.

>From http://www.cmlenz.net/archives/2007/10/couchdb-joins
Every post and comment is stored as a separate document with the same
schema.  The key "acl" is an array of usernames that are allowed to see the
post.  By extension, this is also the list of nodes that are allowed to
replicate this document.  The field "post" is an integer that increments
with every blog post one makes.  This field is used to tie together a post
and all comments that are tied to it.  The key "type" is the type of
document, either "post" (a blog post) or "comment" (a comment on a blog
post).

database name: n25_blog_<username>
blog schema:
{_id: "autogenerated",
 _rev: "autogenerated, too",
 acl: ["all", ],
 author: "me",
 content: "Contents of my blog post",
 post: 0,
 title: "Frist psot!",
 type: "post",
}

Every bookmark one stores is kept as a separate document in a database.
All have the same schema.  The "acl" key works as defined earlier.
Eventually, I'd like to make a JavaScript bookmarklet that makes it much
easier to store a bookmark in this database.  I'm not sure if bookmarks are
going to be private only (i.e., personal) or

database name: n25_bookmarks_<username>
bookmarks schema:
{{title: "",
  url: "",
  description: "",
  tags: ["", ],
  categories: ["", ],
  acl: ["all", ],
  date_added: ["YYYY/MM/DD", "HH:MM", "TZ"],
  date_modified: ["YYYY/MM/DD", "HH:MM", "TZ"], },
}

Yes, I know that JSON documents aren't really schemas.  I need to call them
something, and I don't yet know the terminology ("layout" says HTML to me
and not the format of the data in a document because it's not markup.  Then
again, I relate to device drivers better than I do websites.)

database name: n25_profile_username
profile schema (dumped from my CouchDB instance and reformatted for
readability):

{
   "_id": "<autogenerated>",
   "_rev": "<autogenerated>",
   "profile": "{"chosen_name": "Bryce A. Lynch",
                "aliases": ["Bryce",
                            "The Doctor [412/724/301/703][ZS|Media]", ]

                 gender: ["Androgynous", ],
                 identification: "Organic sapient with semiautonomous
software augmentations",
                 location: "I am everywhere.",

                 email_addresses: ["virtualadept at gmail.com",
                                   "bryce.lynch at zerostate.net",

                                   "bryce at somewhereelse.com", ],
                 websites: ["https://drwho.virtadpt.net", ],

                 IM: [{network: "gchat",
                       protocol: "XMPP",
                       handle: "virtualadept at gmail.com"},

                      {network: "Network25",
                       protocol: "torchat",
                       handle: "foo.onion"}, ],

                 public_keys: [{"My PGP public key goes here"}],

                 profile_address: ["something.onion", ],
                 tor_sites: [""],
                 bio: "This is where I write freeform stuff about myself.",
                 interests: ["ad-hocracy",

                             "anhedonia",
                             "anonymity",
                             "privacy",
                             "assembly language",

                             "blogging",
                             "hacktivism",
                             "tor",
                             "python",
                             "mesh networking",

                             "couchdb", ],
                 skillset: ["system administration",
                            "system architecture",
                            "information security",

                            "security research",
                            "mesh networking",
                            "linux",
                            "bsd",
                            "software engineering", ],

                 projects: [{name: "Project Byzantium",
                             position: "core developer",
                             website: "http://project-byzantium.org"},

                            {name: "Zero State: Media",
                             position: "Project Manager",
                             website: "http://zerostate.net/"}, ],

                 affiliations: ["Project Byzantium", "Zero State", ],
                 bitcoin_address: "blahblahblah",
                 blog_db: "n25_blog_brycealynch",

                 bookmarks_db: "n25_bookmarks_brycealynch", },
"friends": "{acl: ["all", ],
             friends: [{chosen_name: "Amon Zero",
                        local_name: "Amon",

                        profile_address: "something_else.onion"}, ]
         }",
"cached_friend_profiles": "{}", // Note, these are duplicates of the
profiles of everyone on this user's friends list.  I'm not going to
reproduce them here.
   "date_updated": ["2012/12/08",
                    "18:19",
                    "EST5EDT"],
   "groups": "[acl: ["all", ],
              {name: "Zero State General",
               description: "General Zero State discussion",

               database: "zerostategeneral", },

              {name: "Network25 Updates",
               description: "Status and development reports for the
Network25 package",

               database: "n25updates", },

              {name: "",
               description: "",
               database: "", },]"
}

TODO: Finish adding ACLs to the profiles.  Also, figure out how to write
CouchDB design docs to make this information accessible without using Futon.

-- 
The Doctor [412/724/301/703] [ZS|Media]
https://drwho.virtadpt.net/
"I am everywhere."

-- 
You received this message because you are subscribed to the Google Groups "ZS-P2P" group.
To post to this group, send email to zs-p2p at googlegroups.com.
To unsubscribe from this group, send email to zs-p2p+unsubscribe at googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



----- End forwarded message -----
-- 
Eugen* Leitl <a href="http://leitl.org">leitl</a> http://leitl.org
______________________________________________________________
ICBM: 48.07100, 11.36820 http://www.ativel.com http://postbiota.org
8B29F6BE: 099D 78BA 2FD3 B014 B08A  7779 75B0 2443 8B29 F6BE





More information about the cypherpunks-legacy mailing list