Add genconfig support for flickr importer

Change-Id: I8be13f81fae15acfe87cce9d65318524efc3035d
This commit is contained in:
Aaron Boodman 2013-11-17 00:39:43 -08:00
parent b33a785e62
commit b53e79614d
2 changed files with 14 additions and 0 deletions

View File

@ -44,6 +44,7 @@ type configPrefixesParams struct {
blobPath string blobPath string
searchOwner blob.Ref searchOwner blob.Ref
shareHandlerPath string shareHandlerPath string
flickr map[string]interface{}
} }
var ( var (
@ -444,6 +445,13 @@ func genLowLevelPrefixes(params *configPrefixesParams, ownerName string) (m json
} }
} }
if params.flickr != nil {
m["/importer-flickr/"] = map[string]interface{}{
"handler": "importer-flickr",
"handlerArgs": params.flickr,
}
}
if haveIndex { if haveIndex {
syncArgs := map[string]interface{}{ syncArgs := map[string]interface{}{
"from": "/bs/", "from": "/bs/",
@ -530,6 +538,9 @@ func genLowLevelConfig(conf *Config) (lowLevelConf *Config, err error) {
sqliteFile = conf.OptionalString("sqlite", "") sqliteFile = conf.OptionalString("sqlite", "")
kvFile = conf.OptionalString("kvIndexFile", "") kvFile = conf.OptionalString("kvIndexFile", "")
// Importer options
flickr = conf.OptionalObject("flickr")
_ = conf.OptionalList("replicateTo") _ = conf.OptionalList("replicateTo")
publish = conf.OptionalObject("publish") publish = conf.OptionalObject("publish")
// alternative source tree, to override the embedded ui and/or closure resources. // alternative source tree, to override the embedded ui and/or closure resources.
@ -638,6 +649,7 @@ func genLowLevelConfig(conf *Config) (lowLevelConf *Config, err error) {
blobPath: blobPath, blobPath: blobPath,
searchOwner: blob.SHA1FromString(armoredPublicKey), searchOwner: blob.SHA1FromString(armoredPublicKey),
shareHandlerPath: shareHandlerPath, shareHandlerPath: shareHandlerPath,
flickr: flickr,
} }
prefixes := genLowLevelPrefixes(prefixesParams, ownerName) prefixes := genLowLevelPrefixes(prefixesParams, ownerName)

View File

@ -23,6 +23,8 @@ web browser and restart the server.</p>
<li><b><code>baseURL</code></b>: Optional. If non-empty, this is the root of your URL prefix for your Camlistore server. Useful for when running behind a reverse proxy. Should not end in a slash. e.g. <code>https://yourserver.example.com</code></li> <li><b><code>baseURL</code></b>: Optional. If non-empty, this is the root of your URL prefix for your Camlistore server. Useful for when running behind a reverse proxy. Should not end in a slash. e.g. <code>https://yourserver.example.com</code></li>
<li><b><code>flickr</code></b>: Optional, and doesn't do anything yet. Support for continuous import from Flickr. Enter two child keys: <code>appKey</code> and <code>appSecret</code>, which you can get by filling out <a href="http://www.flickr.com/services/apps/create/noncommercial/">this form</a>.</li>
<li><b><code>https</code></b>: if "true", HTTPS is used <li><b><code>https</code></b>: if "true", HTTPS is used
<ul> <ul>
<li><b><code>HTTPSCertFile</code></b>: if using https</li> <li><b><code>HTTPSCertFile</code></b>: if using https</li>