diff --git a/pkg/serverconfig/testdata/baseurl-want.json b/pkg/serverconfig/testdata/baseurl-want.json index 62494a891..919ff43ac 100644 --- a/pkg/serverconfig/testdata/baseurl-want.json +++ b/pkg/serverconfig/testdata/baseurl-want.json @@ -1,8 +1,8 @@ { - "listen": "localhost:3179", "auth": "userpass:camlistore:pass3179", + "baseURL": "http://monkey.foo.com", "https": false, - "baseURL": "http://monkey.foo.com", + "listen": "localhost:3179", "prefixes": { "/": { "handler": "root", @@ -14,31 +14,72 @@ "stealth": false } }, - - "/ui/": { - "handler": "ui", + "/bs-and-index/": { + "handler": "storage-replica", "handlerArgs": { - "jsonSignRoot": "/sighelper/", - "cache": "/cache/", - "scaledImage": "lrucache" + "backends": [ + "/bs/", + "/index-kv/" + ] + } + }, + "/bs-and-maybe-also-index/": { + "handler": "storage-cond", + "handlerArgs": { + "read": "/bs/", + "write": { + "else": "/bs/", + "if": "isSchema", + "then": "/bs-and-index/" + } + } + }, + "/bs/": { + "handler": "storage-filesystem", + "handlerArgs": { + "path": "/tmp/blobs" + } + }, + "/cache/": { + "handler": "storage-filesystem", + "handlerArgs": { + "path": "/tmp/blobs/cache" + } + }, + "/index-kv/": { + "handler": "storage-kvfileindexer", + "handlerArgs": { + "blobSource": "/bs/", + "file": "/path/to/indexkv.db" + } + }, + "/my-search/": { + "handler": "search", + "handlerArgs": { + "index": "/index-kv/", + "owner": "sha1-f2b0b7da718b97ce8c31591d8ed4645c777f3ef4" } }, - "/setup/": { "handler": "setup" }, - - "/status/": { - "handler": "status" - }, - "/share/": { "handler": "share", "handlerArgs": { "blobRoot": "/bs/" } }, - + "/sighelper/": { + "handler": "jsonsign", + "handlerArgs": { + "keyId": "26F5ABDA", + "publicKeyDest": "/bs-and-index/", + "secretRing": "/Users/bradfitz/src/camlistore.org/pkg/jsonsign/testdata/test-secring.gpg" + } + }, + "/status/": { + "handler": "status" + }, "/sync/": { "handler": "sync", "handlerArgs": { @@ -46,65 +87,13 @@ "to": "/index-kv/" } }, - - "/sighelper/": { - "handler": "jsonsign", + "/ui/": { + "handler": "ui", "handlerArgs": { - "secretRing": "/path/to/secring", - "keyId": "26F5ABDA", - "publicKeyDest": "/bs-and-index/" - } - }, - - "/bs-and-index/": { - "handler": "storage-replica", - "handlerArgs": { - "backends": ["/bs/", "/index-kv/"] - } - }, - - "/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-kv/": { - "handler": "storage-kvfileindexer", - "handlerArgs": { - "blobSource": "/bs/", - "file": "/path/to/indexkv.db" - } - }, - - "/my-search/": { - "handler": "search", - "handlerArgs": { - "index": "/index-kv/", - "owner": "sha1-f2b0b7da718b97ce8c31591d8ed4645c777f3ef4" + "cache": "/cache/", + "jsonSignRoot": "/sighelper/", + "scaledImage": "lrucache" } } - } - -} +} \ No newline at end of file diff --git a/pkg/serverconfig/testdata/default-want.json b/pkg/serverconfig/testdata/default-want.json index 8d3f15831..d4122ffdf 100644 --- a/pkg/serverconfig/testdata/default-want.json +++ b/pkg/serverconfig/testdata/default-want.json @@ -1,7 +1,7 @@ { - "listen": "localhost:3179", "auth": "userpass:camlistore:pass3179", "https": false, + "listen": "localhost:3179", "prefixes": { "/": { "handler": "root", @@ -13,31 +13,72 @@ "stealth": false } }, - - "/ui/": { - "handler": "ui", + "/bs-and-index/": { + "handler": "storage-replica", "handlerArgs": { - "jsonSignRoot": "/sighelper/", - "cache": "/cache/", - "scaledImage": "lrucache" + "backends": [ + "/bs/", + "/index-kv/" + ] + } + }, + "/bs-and-maybe-also-index/": { + "handler": "storage-cond", + "handlerArgs": { + "read": "/bs/", + "write": { + "else": "/bs/", + "if": "isSchema", + "then": "/bs-and-index/" + } + } + }, + "/bs/": { + "handler": "storage-filesystem", + "handlerArgs": { + "path": "/tmp/blobs" + } + }, + "/cache/": { + "handler": "storage-filesystem", + "handlerArgs": { + "path": "/tmp/blobs/cache" + } + }, + "/index-kv/": { + "handler": "storage-kvfileindexer", + "handlerArgs": { + "blobSource": "/bs/", + "file": "/path/to/indexkv.db" + } + }, + "/my-search/": { + "handler": "search", + "handlerArgs": { + "index": "/index-kv/", + "owner": "sha1-f2b0b7da718b97ce8c31591d8ed4645c777f3ef4" } }, - "/setup/": { "handler": "setup" }, - - "/status/": { - "handler": "status" - }, - "/share/": { "handler": "share", "handlerArgs": { "blobRoot": "/bs/" } }, - + "/sighelper/": { + "handler": "jsonsign", + "handlerArgs": { + "keyId": "26F5ABDA", + "publicKeyDest": "/bs-and-index/", + "secretRing": "/Users/bradfitz/src/camlistore.org/pkg/jsonsign/testdata/test-secring.gpg" + } + }, + "/status/": { + "handler": "status" + }, "/sync/": { "handler": "sync", "handlerArgs": { @@ -45,65 +86,13 @@ "to": "/index-kv/" } }, - - "/sighelper/": { - "handler": "jsonsign", + "/ui/": { + "handler": "ui", "handlerArgs": { - "secretRing": "/path/to/secring", - "keyId": "26F5ABDA", - "publicKeyDest": "/bs-and-index/" - } - }, - - "/bs-and-index/": { - "handler": "storage-replica", - "handlerArgs": { - "backends": ["/bs/", "/index-kv/"] - } - }, - - "/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-kv/": { - "handler": "storage-kvfileindexer", - "handlerArgs": { - "blobSource": "/bs/", - "file": "/path/to/indexkv.db" - } - }, - - "/my-search/": { - "handler": "search", - "handlerArgs": { - "index": "/index-kv/", - "owner": "sha1-f2b0b7da718b97ce8c31591d8ed4645c777f3ef4" + "cache": "/cache/", + "jsonSignRoot": "/sighelper/", + "scaledImage": "lrucache" } } - } - -} +} \ No newline at end of file diff --git a/pkg/serverconfig/testdata/listenbase-want.json b/pkg/serverconfig/testdata/listenbase-want.json index 920c77a01..2a116129f 100644 --- a/pkg/serverconfig/testdata/listenbase-want.json +++ b/pkg/serverconfig/testdata/listenbase-want.json @@ -1,8 +1,8 @@ { - "baseURL": "http://foo.com", - "listen": "1.2.3.4:80", "auth": "userpass:camlistore:pass3179", + "baseURL": "http://foo.com", "https": false, + "listen": "1.2.3.4:80", "prefixes": { "/": { "handler": "root", @@ -13,96 +13,85 @@ "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-mem/" - } - }, - - "/sighelper/": { - "handler": "jsonsign", - "handlerArgs": { - "secretRing": "/path/to/secring", - "keyId": "26F5ABDA", - "publicKeyDest": "/bs-and-index/" - } - }, - "/bs-and-index/": { "handler": "storage-replica", "handlerArgs": { - "backends": ["/bs/", "/index-mem/"] + "backends": [ + "/bs/", + "/index-mem/" + ] } }, - "/bs-and-maybe-also-index/": { "handler": "storage-cond", "handlerArgs": { + "read": "/bs/", "write": { + "else": "/bs/", "if": "isSchema", - "then": "/bs-and-index/", - "else": "/bs/" - }, - "read": "/bs/" + "then": "/bs-and-index/" + } } }, - "/bs/": { "handler": "storage-filesystem", "handlerArgs": { "path": "/tmp/blobs" } }, - "/cache/": { "handler": "storage-filesystem", "handlerArgs": { "path": "/tmp/blobs/cache" } }, - "/index-mem/": { "handler": "storage-memory-only-dev-indexer", "handlerArgs": { "blobSource": "/bs/" } }, - "/my-search/": { "handler": "search", "handlerArgs": { "index": "/index-mem/", "owner": "sha1-f2b0b7da718b97ce8c31591d8ed4645c777f3ef4" } + }, + "/setup/": { + "handler": "setup" + }, + "/share/": { + "handler": "share", + "handlerArgs": { + "blobRoot": "/bs/" + } + }, + "/sighelper/": { + "handler": "jsonsign", + "handlerArgs": { + "keyId": "26F5ABDA", + "publicKeyDest": "/bs-and-index/", + "secretRing": "/Users/bradfitz/src/camlistore.org/pkg/jsonsign/testdata/test-secring.gpg" + } + }, + "/status/": { + "handler": "status" + }, + "/sync/": { + "handler": "sync", + "handlerArgs": { + "from": "/bs/", + "to": "/index-mem/" + } + }, + "/ui/": { + "handler": "ui", + "handlerArgs": { + "cache": "/cache/", + "jsonSignRoot": "/sighelper/", + "scaledImage": "lrucache" + } } } - -} - +} \ No newline at end of file diff --git a/pkg/serverconfig/testdata/mem-want.json b/pkg/serverconfig/testdata/mem-want.json index 65f764f58..b6b8f0aa6 100644 --- a/pkg/serverconfig/testdata/mem-want.json +++ b/pkg/serverconfig/testdata/mem-want.json @@ -1,7 +1,7 @@ { - "listen": "localhost:3179", "auth": "userpass:camlistore:pass3179", "https": false, + "listen": "localhost:3179", "prefixes": { "/": { "handler": "root", @@ -13,88 +13,44 @@ "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-mem/" - } - }, - - "/sighelper/": { - "handler": "jsonsign", - "handlerArgs": { - "secretRing": "/path/to/secring", - "keyId": "26F5ABDA", - "publicKeyDest": "/bs-and-index/" - } - }, - "/bs-and-index/": { "handler": "storage-replica", "handlerArgs": { - "backends": ["/bs/", "/index-mem/"] + "backends": [ + "/bs/", + "/index-mem/" + ] } }, - "/bs-and-maybe-also-index/": { "handler": "storage-cond", "handlerArgs": { + "read": "/bs/", "write": { + "else": "/bs/", "if": "isSchema", - "then": "/bs-and-index/", - "else": "/bs/" - }, - "read": "/bs/" + "then": "/bs-and-index/" + } } }, - "/bs/": { "handler": "storage-filesystem", "handlerArgs": { "path": "/tmp/blobs" } }, - "/cache/": { "handler": "storage-filesystem", "handlerArgs": { "path": "/tmp/blobs/cache" } }, - "/index-mem/": { "handler": "storage-memory-only-dev-indexer", "handlerArgs": { "blobSource": "/bs/" } }, - "/my-search/": { "handler": "search", "handlerArgs": { @@ -102,24 +58,26 @@ "owner": "sha1-f2b0b7da718b97ce8c31591d8ed4645c777f3ef4" } }, - - "/sto-s3/": { - "handler": "storage-s3", + "/setup/": { + "handler": "setup" + }, + "/share/": { + "handler": "share", "handlerArgs": { - "aws_access_key": "key", - "aws_secret_access_key": "secret", - "bucket": "bucket" + "blobRoot": "/bs/" } }, - - "/sync-to-s3/": { - "handler": "sync", + "/sighelper/": { + "handler": "jsonsign", "handlerArgs": { - "from": "/bs/", - "to": "/sto-s3/" + "keyId": "26F5ABDA", + "publicKeyDest": "/bs-and-index/", + "secretRing": "/Users/bradfitz/src/camlistore.org/pkg/jsonsign/testdata/test-secring.gpg" } }, - + "/status/": { + "handler": "status" + }, "/sto-googlecloudstorage/": { "handler": "storage-googlecloudstorage", "handlerArgs": { @@ -131,15 +89,6 @@ "bucket": "bucketName" } }, - - "/sync-to-googlecloudstorage/": { - "handler": "sync", - "handlerArgs": { - "from": "/bs/", - "to": "/sto-googlecloudstorage/" - } - }, - "/sto-googledrive/": { "handler": "storage-googledrive", "handlerArgs": { @@ -151,15 +100,49 @@ "parent_id": "parentDirId" } }, - + "/sto-s3/": { + "handler": "storage-s3", + "handlerArgs": { + "aws_access_key": "key", + "aws_secret_access_key": "secret", + "bucket": "bucket" + } + }, + "/sync-to-googlecloudstorage/": { + "handler": "sync", + "handlerArgs": { + "from": "/bs/", + "to": "/sto-googlecloudstorage/" + } + }, "/sync-to-googledrive/": { "handler": "sync", "handlerArgs": { "from": "/bs/", "to": "/sto-googledrive/" } + }, + "/sync-to-s3/": { + "handler": "sync", + "handlerArgs": { + "from": "/bs/", + "to": "/sto-s3/" + } + }, + "/sync/": { + "handler": "sync", + "handlerArgs": { + "from": "/bs/", + "to": "/index-mem/" + } + }, + "/ui/": { + "handler": "ui", + "handlerArgs": { + "cache": "/cache/", + "jsonSignRoot": "/sighelper/", + "scaledImage": "lrucache" + } } - } - -} +} \ No newline at end of file diff --git a/pkg/serverconfig/testdata/mongo-want.json b/pkg/serverconfig/testdata/mongo-want.json index 018fca955..227847799 100644 --- a/pkg/serverconfig/testdata/mongo-want.json +++ b/pkg/serverconfig/testdata/mongo-want.json @@ -1,7 +1,7 @@ { - "listen": "localhost:3179", "auth": "userpass:camlistore:pass3179", "https": false, + "listen": "localhost:3179", "prefixes": { "/": { "handler": "root", @@ -13,31 +13,76 @@ "stealth": false } }, - - "/ui/": { - "handler": "ui", + "/bs-and-index/": { + "handler": "storage-replica", "handlerArgs": { - "jsonSignRoot": "/sighelper/", - "cache": "/cache/", - "scaledImage": "lrucache" + "backends": [ + "/bs/", + "/index-mongo/" + ] + } + }, + "/bs-and-maybe-also-index/": { + "handler": "storage-cond", + "handlerArgs": { + "read": "/bs/", + "write": { + "else": "/bs/", + "if": "isSchema", + "then": "/bs-and-index/" + } + } + }, + "/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": { + "blobSource": "/bs/", + "database": "camlitest", + "host": "localhost", + "password": "", + "user": "" + } + }, + "/my-search/": { + "handler": "search", + "handlerArgs": { + "index": "/index-mongo/", + "owner": "sha1-f2b0b7da718b97ce8c31591d8ed4645c777f3ef4" } }, - "/setup/": { "handler": "setup" }, - - "/status/": { - "handler": "status" - }, - "/share/": { "handler": "share", "handlerArgs": { "blobRoot": "/bs/" } }, - + "/sighelper/": { + "handler": "jsonsign", + "handlerArgs": { + "keyId": "26F5ABDA", + "publicKeyDest": "/bs-and-index/", + "secretRing": "/Users/bradfitz/src/camlistore.org/pkg/jsonsign/testdata/test-secring.gpg" + } + }, + "/status/": { + "handler": "status" + }, "/sync/": { "handler": "sync", "handlerArgs": { @@ -45,69 +90,13 @@ "to": "/index-mongo/" } }, - - "/sighelper/": { - "handler": "jsonsign", + "/ui/": { + "handler": "ui", "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" + "cache": "/cache/", + "jsonSignRoot": "/sighelper/", + "scaledImage": "lrucache" } } - } - -} +} \ No newline at end of file diff --git a/pkg/serverconfig/testdata/sqlite-want.json b/pkg/serverconfig/testdata/sqlite-want.json index ff6b48d39..4efcd2c5f 100644 --- a/pkg/serverconfig/testdata/sqlite-want.json +++ b/pkg/serverconfig/testdata/sqlite-want.json @@ -1,7 +1,7 @@ { - "listen": "localhost:3179", "auth": "userpass:camlistore:pass3179", "https": false, + "listen": "localhost:3179", "prefixes": { "/": { "handler": "root", @@ -12,81 +12,38 @@ "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-sqlite/" - } - }, - - "/sighelper/": { - "handler": "jsonsign", - "handlerArgs": { - "secretRing": "/path/to/secring", - "keyId": "26F5ABDA", - "publicKeyDest": "/bs-and-index/" - } - }, - "/bs-and-index/": { "handler": "storage-replica", "handlerArgs": { - "backends": ["/bs/", "/index-sqlite/"] + "backends": [ + "/bs/", + "/index-sqlite/" + ] } }, - "/bs-and-maybe-also-index/": { "handler": "storage-cond", "handlerArgs": { + "read": "/bs/", "write": { + "else": "/bs/", "if": "isSchema", - "then": "/bs-and-index/", - "else": "/bs/" - }, - "read": "/bs/" + "then": "/bs-and-index/" + } } }, - "/bs/": { "handler": "storage-filesystem", "handlerArgs": { "path": "/tmp/blobs" } }, - "/cache/": { "handler": "storage-filesystem", "handlerArgs": { "path": "/tmp/blobs/cache" } }, - "/index-sqlite/": { "handler": "storage-sqliteindexer", "handlerArgs": { @@ -94,15 +51,47 @@ "file": "/tmp/camli.db" } }, - "/my-search/": { "handler": "search", "handlerArgs": { "index": "/index-sqlite/", "owner": "sha1-f2b0b7da718b97ce8c31591d8ed4645c777f3ef4" } + }, + "/setup/": { + "handler": "setup" + }, + "/share/": { + "handler": "share", + "handlerArgs": { + "blobRoot": "/bs/" + } + }, + "/sighelper/": { + "handler": "jsonsign", + "handlerArgs": { + "keyId": "26F5ABDA", + "publicKeyDest": "/bs-and-index/", + "secretRing": "/Users/bradfitz/src/camlistore.org/pkg/jsonsign/testdata/test-secring.gpg" + } + }, + "/status/": { + "handler": "status" + }, + "/sync/": { + "handler": "sync", + "handlerArgs": { + "from": "/bs/", + "to": "/index-sqlite/" + } + }, + "/ui/": { + "handler": "ui", + "handlerArgs": { + "cache": "/cache/", + "jsonSignRoot": "/sighelper/", + "scaledImage": "lrucache" + } } - } - -} +} \ No newline at end of file diff --git a/pkg/serverconfig/testdata/tls-want.json b/pkg/serverconfig/testdata/tls-want.json index adc0bd507..e98826a98 100644 --- a/pkg/serverconfig/testdata/tls-want.json +++ b/pkg/serverconfig/testdata/tls-want.json @@ -1,9 +1,9 @@ { - "listen": "1.2.3.4:443", + "TLSCertFile": "/tls.crt", + "TLSKeyFile": "/tls.key", "auth": "userpass:camlistore:pass3179", "https": true, - "TLSCertFile": "/tls.crt", - "TLSKeyFile": "/tls.key", + "listen": "1.2.3.4:443", "prefixes": { "/": { "handler": "root", @@ -14,95 +14,85 @@ "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-mem/" - } - }, - - "/sighelper/": { - "handler": "jsonsign", - "handlerArgs": { - "secretRing": "/path/to/secring", - "keyId": "26F5ABDA", - "publicKeyDest": "/bs-and-index/" - } - }, - "/bs-and-index/": { "handler": "storage-replica", "handlerArgs": { - "backends": ["/bs/", "/index-mem/"] + "backends": [ + "/bs/", + "/index-mem/" + ] } }, - "/bs-and-maybe-also-index/": { "handler": "storage-cond", "handlerArgs": { + "read": "/bs/", "write": { + "else": "/bs/", "if": "isSchema", - "then": "/bs-and-index/", - "else": "/bs/" - }, - "read": "/bs/" + "then": "/bs-and-index/" + } } }, - "/bs/": { "handler": "storage-filesystem", "handlerArgs": { "path": "/tmp/blobs" } }, - "/cache/": { "handler": "storage-filesystem", "handlerArgs": { "path": "/tmp/blobs/cache" } }, - "/index-mem/": { "handler": "storage-memory-only-dev-indexer", "handlerArgs": { "blobSource": "/bs/" } }, - "/my-search/": { "handler": "search", "handlerArgs": { "index": "/index-mem/", "owner": "sha1-f2b0b7da718b97ce8c31591d8ed4645c777f3ef4" } + }, + "/setup/": { + "handler": "setup" + }, + "/share/": { + "handler": "share", + "handlerArgs": { + "blobRoot": "/bs/" + } + }, + "/sighelper/": { + "handler": "jsonsign", + "handlerArgs": { + "keyId": "26F5ABDA", + "publicKeyDest": "/bs-and-index/", + "secretRing": "/Users/bradfitz/src/camlistore.org/pkg/jsonsign/testdata/test-secring.gpg" + } + }, + "/status/": { + "handler": "status" + }, + "/sync/": { + "handler": "sync", + "handlerArgs": { + "from": "/bs/", + "to": "/index-mem/" + } + }, + "/ui/": { + "handler": "ui", + "handlerArgs": { + "cache": "/cache/", + "jsonSignRoot": "/sighelper/", + "scaledImage": "lrucache" + } } } - -} +} \ No newline at end of file diff --git a/pkg/serverconfig/testdata/with_blog-want.json b/pkg/serverconfig/testdata/with_blog-want.json index 72e113529..051f9feaf 100644 --- a/pkg/serverconfig/testdata/with_blog-want.json +++ b/pkg/serverconfig/testdata/with_blog-want.json @@ -1,7 +1,7 @@ { - "listen": "localhost:3179", "auth": "userpass:camlistore:pass3179", "https": false, + "listen": "localhost:3179", "prefixes": { "/": { "handler": "root", @@ -12,110 +12,106 @@ "stealth": false } }, - "/blog/": { "handler": "publish", "handlerArgs": { - "rootName": "blogRoot", "blobRoot": "/bs-and-maybe-also-index/", - "searchRoot": "/my-search/", - "rootPermanode": ["/sighelper/", "sha1-xxxxx"], "cache": "/cache/", + "css": [ + "blog-purple.css" + ], "goTemplate": "blog.html", - "css": ["blog-purple.css"], - "scaledImage": "lrucache" - } - }, - - "/ui/": { - "handler": "ui", - "handlerArgs": { - "jsonSignRoot": "/sighelper/", - "cache": "/cache/", + "rootName": "blogRoot", + "rootPermanode": [ + "/sighelper/", + "sha1-xxxxx" + ], "scaledImage": "lrucache", - "publishRoots": ["/blog/"] + "searchRoot": "/my-search/" } }, - - "/setup/": { - "handler": "setup" - }, - - "/status/": { - "handler": "status" - }, - - "/share/": { - "handler": "share", - "handlerArgs": { - "blobRoot": "/bs/" - } - }, - - "/sync/": { - "handler": "sync", - "handlerArgs": { - "from": "/bs/", - "to": "/index-mem/" - } - }, - - "/sighelper/": { - "handler": "jsonsign", - "handlerArgs": { - "secretRing": "/path/to/secring", - "keyId": "26F5ABDA", - "publicKeyDest": "/bs-and-index/" - } - }, - "/bs-and-index/": { "handler": "storage-replica", "handlerArgs": { - "backends": ["/bs/", "/index-mem/"] + "backends": [ + "/bs/", + "/index-mem/" + ] } }, - "/bs-and-maybe-also-index/": { "handler": "storage-cond", "handlerArgs": { + "read": "/bs/", "write": { + "else": "/bs/", "if": "isSchema", - "then": "/bs-and-index/", - "else": "/bs/" - }, - "read": "/bs/" + "then": "/bs-and-index/" + } } }, - "/bs/": { "handler": "storage-filesystem", "handlerArgs": { "path": "/tmp/blobs" } }, - "/cache/": { "handler": "storage-filesystem", "handlerArgs": { "path": "/tmp/blobs/cache" } }, - "/index-mem/": { "handler": "storage-memory-only-dev-indexer", "handlerArgs": { "blobSource": "/bs/" } }, - "/my-search/": { "handler": "search", "handlerArgs": { "index": "/index-mem/", "owner": "sha1-f2b0b7da718b97ce8c31591d8ed4645c777f3ef4" } + }, + "/setup/": { + "handler": "setup" + }, + "/share/": { + "handler": "share", + "handlerArgs": { + "blobRoot": "/bs/" + } + }, + "/sighelper/": { + "handler": "jsonsign", + "handlerArgs": { + "keyId": "26F5ABDA", + "publicKeyDest": "/bs-and-index/", + "secretRing": "/Users/bradfitz/src/camlistore.org/pkg/jsonsign/testdata/test-secring.gpg" + } + }, + "/status/": { + "handler": "status" + }, + "/sync/": { + "handler": "sync", + "handlerArgs": { + "from": "/bs/", + "to": "/index-mem/" + } + }, + "/ui/": { + "handler": "ui", + "handlerArgs": { + "cache": "/cache/", + "jsonSignRoot": "/sighelper/", + "publishRoots": [ + "/blog/" + ], + "scaledImage": "lrucache" + } } } - -} +} \ No newline at end of file diff --git a/pkg/serverconfig/testdata/with_gallery-want.json b/pkg/serverconfig/testdata/with_gallery-want.json index 02d9dc23c..ee21a229c 100644 --- a/pkg/serverconfig/testdata/with_gallery-want.json +++ b/pkg/serverconfig/testdata/with_gallery-want.json @@ -1,7 +1,7 @@ { - "listen": "localhost:3179", "auth": "userpass:camlistore:pass3179", "https": false, + "listen": "localhost:3179", "prefixes": { "/": { "handler": "root", @@ -12,111 +12,109 @@ "stealth": false } }, - - "/pics/": { - "handler": "publish", - "handlerArgs": { - "rootName": "picsRoot", - "blobRoot": "/bs-and-maybe-also-index/", - "searchRoot": "/my-search/", - "rootPermanode": ["/sighelper/", "sha1-xxxxx"], - "cache": "/cache/", - "css": ["pics.css"], - "js": ["pics.js"], - "goTemplate": "gallery.html", - "scaledImage": "lrucache" - } - }, - - "/ui/": { - "handler": "ui", - "handlerArgs": { - "jsonSignRoot": "/sighelper/", - "cache": "/cache/", - "scaledImage": "lrucache", - "publishRoots": ["/pics/"] - } - }, - - "/setup/": { - "handler": "setup" - }, - - "/status/": { - "handler": "status" - }, - - "/share/": { - "handler": "share", - "handlerArgs": { - "blobRoot": "/bs/" - } - }, - - "/sync/": { - "handler": "sync", - "handlerArgs": { - "from": "/bs/", - "to": "/index-mem/" - } - }, - - "/sighelper/": { - "handler": "jsonsign", - "handlerArgs": { - "secretRing": "/path/to/secring", - "keyId": "26F5ABDA", - "publicKeyDest": "/bs-and-index/" - } - }, - "/bs-and-index/": { "handler": "storage-replica", "handlerArgs": { - "backends": ["/bs/", "/index-mem/"] + "backends": [ + "/bs/", + "/index-mem/" + ] } }, - "/bs-and-maybe-also-index/": { "handler": "storage-cond", "handlerArgs": { + "read": "/bs/", "write": { + "else": "/bs/", "if": "isSchema", - "then": "/bs-and-index/", - "else": "/bs/" - }, - "read": "/bs/" + "then": "/bs-and-index/" + } } }, - "/bs/": { "handler": "storage-filesystem", "handlerArgs": { "path": "/tmp/blobs" } }, - "/cache/": { "handler": "storage-filesystem", "handlerArgs": { "path": "/tmp/blobs/cache" } }, - "/index-mem/": { "handler": "storage-memory-only-dev-indexer", "handlerArgs": { "blobSource": "/bs/" } }, - "/my-search/": { "handler": "search", "handlerArgs": { "index": "/index-mem/", "owner": "sha1-f2b0b7da718b97ce8c31591d8ed4645c777f3ef4" } + }, + "/pics/": { + "handler": "publish", + "handlerArgs": { + "blobRoot": "/bs-and-maybe-also-index/", + "cache": "/cache/", + "css": [ + "pics.css" + ], + "goTemplate": "gallery.html", + "js": [ + "pics.js" + ], + "rootName": "picsRoot", + "rootPermanode": [ + "/sighelper/", + "sha1-xxxxx" + ], + "scaledImage": "lrucache", + "searchRoot": "/my-search/" + } + }, + "/setup/": { + "handler": "setup" + }, + "/share/": { + "handler": "share", + "handlerArgs": { + "blobRoot": "/bs/" + } + }, + "/sighelper/": { + "handler": "jsonsign", + "handlerArgs": { + "keyId": "26F5ABDA", + "publicKeyDest": "/bs-and-index/", + "secretRing": "/Users/bradfitz/src/camlistore.org/pkg/jsonsign/testdata/test-secring.gpg" + } + }, + "/status/": { + "handler": "status" + }, + "/sync/": { + "handler": "sync", + "handlerArgs": { + "from": "/bs/", + "to": "/index-mem/" + } + }, + "/ui/": { + "handler": "ui", + "handlerArgs": { + "cache": "/cache/", + "jsonSignRoot": "/sighelper/", + "publishRoots": [ + "/pics/" + ], + "scaledImage": "lrucache" + } } } - -} +} \ No newline at end of file diff --git a/pkg/serverconfig/testdata/with_sourceroot-want.json b/pkg/serverconfig/testdata/with_sourceroot-want.json index 67fc771b8..cbb9b8b63 100644 --- a/pkg/serverconfig/testdata/with_sourceroot-want.json +++ b/pkg/serverconfig/testdata/with_sourceroot-want.json @@ -1,7 +1,7 @@ { - "listen": "localhost:3179", "auth": "userpass:camlistore:pass3179", "https": false, + "listen": "localhost:3179", "prefixes": { "/": { "handler": "root", @@ -12,89 +12,44 @@ "stealth": false } }, - - "/ui/": { - "handler": "ui", - "handlerArgs": { - "jsonSignRoot": "/sighelper/", - "cache": "/cache/", - "scaledImage": "lrucache", - "sourceRoot": "/path/to/alternative/camli/source" - } - }, - - "/setup/": { - "handler": "setup" - }, - - "/status/": { - "handler": "status" - }, - - "/share/": { - "handler": "share", - "handlerArgs": { - "blobRoot": "/bs/" - } - }, - - "/sync/": { - "handler": "sync", - "handlerArgs": { - "from": "/bs/", - "to": "/index-mem/" - } - }, - - "/sighelper/": { - "handler": "jsonsign", - "handlerArgs": { - "secretRing": "/path/to/secring", - "keyId": "26F5ABDA", - "publicKeyDest": "/bs-and-index/" - } - }, - "/bs-and-index/": { "handler": "storage-replica", "handlerArgs": { - "backends": ["/bs/", "/index-mem/"] + "backends": [ + "/bs/", + "/index-mem/" + ] } }, - "/bs-and-maybe-also-index/": { "handler": "storage-cond", "handlerArgs": { + "read": "/bs/", "write": { + "else": "/bs/", "if": "isSchema", - "then": "/bs-and-index/", - "else": "/bs/" - }, - "read": "/bs/" + "then": "/bs-and-index/" + } } }, - "/bs/": { "handler": "storage-filesystem", "handlerArgs": { "path": "/tmp/blobs" } }, - "/cache/": { "handler": "storage-filesystem", "handlerArgs": { "path": "/tmp/blobs/cache" } }, - "/index-mem/": { "handler": "storage-memory-only-dev-indexer", "handlerArgs": { "blobSource": "/bs/" } }, - "/my-search/": { "handler": "search", "handlerArgs": { @@ -102,7 +57,26 @@ "owner": "sha1-f2b0b7da718b97ce8c31591d8ed4645c777f3ef4" } }, - + "/setup/": { + "handler": "setup" + }, + "/share/": { + "handler": "share", + "handlerArgs": { + "blobRoot": "/bs/" + } + }, + "/sighelper/": { + "handler": "jsonsign", + "handlerArgs": { + "keyId": "26F5ABDA", + "publicKeyDest": "/bs-and-index/", + "secretRing": "/Users/bradfitz/src/camlistore.org/pkg/jsonsign/testdata/test-secring.gpg" + } + }, + "/status/": { + "handler": "status" + }, "/sto-s3/": { "handler": "storage-s3", "handlerArgs": { @@ -111,14 +85,28 @@ "bucket": "bucket" } }, - - "/sync-to-s3/": { + "/sync-to-s3/": { "handler": "sync", "handlerArgs": { "from": "/bs/", "to": "/sto-s3/" } + }, + "/sync/": { + "handler": "sync", + "handlerArgs": { + "from": "/bs/", + "to": "/index-mem/" + } + }, + "/ui/": { + "handler": "ui", + "handlerArgs": { + "cache": "/cache/", + "jsonSignRoot": "/sighelper/", + "scaledImage": "lrucache", + "sourceRoot": "/path/to/alternative/camli/source" + } } } - -} +} \ No newline at end of file