Skip to content

Instantly share code, notes, and snippets.

View chrisbnt's full-sized avatar

Chris Barnett chrisbnt

  • Sydney, Australia
View GitHub Profile
@fdmanana
fdmanana / gist:832610
Created February 17, 2011 20:27
The CouchDB replicator database

1. Introduction to the replicator database

A database where you PUT/POST documents to trigger replications and you DELETE to cancel ongoing replications. These documents have exactly the same content as the JSON objects we used to POST to /_replicate/ (fields "source", "target", "create_target", "continuous", "doc_ids", "filter", "query_params".

Replication documents can have a user defined "_id". Design documents (and _local documents) added to the replicator database are ignored.

The default name of this database is _replicator. The name can be changed in the .ini configuration, section [replicator], parameter db.

2. Basics

# provides a ridiculously simple SSL VPN, using a client side certificate.
# Issuing client side certificates is easy, and there are plenty of
# demos already.
#
# The following files are assumed:
# ca.crt This is your root certificate (note: NOT the key!)
# apache.crt An SSL certificate for this webserver
# apache.key The SSL key (to go with the SSL certificate)
# ca.crl The revocation list from your CA (so you can disable access!)
#
#!/bin/bash
# Your original postgres is assumed to be running on the local machine
# on $OLD_PORT. You may wish to modify --encoding.
DB_NAME=live
OLD_PORT=5432
DUMP_OPTIONS="--no-owner --encoding=latin1"
# This is the configuration of your new postgres. Version is purely
# used to autopopulate the NEW_PG variable and some status messages.