diff --git a/config/dev-server-config.json b/config/dev-server-config.json index d793c410a..609d8de58 100644 --- a/config/dev-server-config.json +++ b/config/dev-server-config.json @@ -211,7 +211,7 @@ "enabled": ["_env", "${CAMLI_MONGO_ENABLED}", true], "handler": "storage-mongodbindexer", "handlerArgs": { - "servers": "localhost", + "host": "localhost", "database": ["_env", "${CAMLI_DBNAME}"], "blobSource": "/bs/" } diff --git a/pkg/serverconfig/testdata/mongo-want.json b/pkg/serverconfig/testdata/mongo-want.json new file mode 100644 index 000000000..018fca955 --- /dev/null +++ b/pkg/serverconfig/testdata/mongo-want.json @@ -0,0 +1,113 @@ +{ + "listen": "localhost:3179", + "auth": "userpass:camlistore:pass3179", + "https": false, + "prefixes": { + "/": { + "handler": "root", + "handlerArgs": { + "blobRoot": "/bs-and-maybe-also-index/", + "ownerName": "Alice", + "searchRoot": "/my-search/", + "statusRoot": "/status/", + "stealth": false + } + }, + + "/ui/": { + "handler": "ui", + "handlerArgs": { + "jsonSignRoot": "/sighelper/", + "cache": "/cache/", + "scaledImage": "lrucache" + } + }, + + "/setup/": { + "handler": "setup" + }, + + "/status/": { + "handler": "status" + }, + + "/share/": { + "handler": "share", + "handlerArgs": { + "blobRoot": "/bs/" + } + }, + + "/sync/": { + "handler": "sync", + "handlerArgs": { + "from": "/bs/", + "to": "/index-mongo/" + } + }, + + "/sighelper/": { + "handler": "jsonsign", + "handlerArgs": { + "secretRing": "/path/to/secring", + "keyId": "26F5ABDA", + "publicKeyDest": "/bs-and-index/" + } + }, + + "/bs-and-index/": { + "handler": "storage-replica", + "handlerArgs": { + "backends": ["/bs/", "/index-mongo/"] + } + }, + + "/bs-and-maybe-also-index/": { + "handler": "storage-cond", + "handlerArgs": { + "write": { + "if": "isSchema", + "then": "/bs-and-index/", + "else": "/bs/" + }, + "read": "/bs/" + } + }, + + "/bs/": { + "handler": "storage-filesystem", + "handlerArgs": { + "path": "/tmp/blobs" + } + }, + + "/cache/": { + "handler": "storage-filesystem", + "handlerArgs": { + "path": "/tmp/blobs/cache" + } + }, + + "/index-mongo/": { + "enabled": true, + "handler": "storage-mongodbindexer", + "handlerArgs": { + "host": "localhost", + "database": "camlitest", + "blobSource": "/bs/", + "user": "", + "password": "" + } + }, + + "/my-search/": { + "handler": "search", + "handlerArgs": { + "index": "/index-mongo/", + "owner": "sha1-f2b0b7da718b97ce8c31591d8ed4645c777f3ef4" + } + } + + } + +} diff --git a/pkg/serverconfig/testdata/mongo.json b/pkg/serverconfig/testdata/mongo.json new file mode 100644 index 000000000..ff6bfd757 --- /dev/null +++ b/pkg/serverconfig/testdata/mongo.json @@ -0,0 +1,11 @@ +{ + "listen": "localhost:3179", + "auth": "userpass:camlistore:pass3179", + "blobPath": "/tmp/blobs", + "dbname": "camlitest", + "mongo": ":@localhost", + "identity": "26F5ABDA", + "identitySecretRing": "/path/to/secring", + "ownerName": "Alice", + "shareHandlerPath": "/share/" +}