Browse Source

Merge pull request #478 from moxiegirl/update-gaia-reference

Updating the configuration reference
feat/clarity-updates
Moxiegirl 5 years ago
committed by GitHub
parent
commit
f01e407983
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 304
      _storage/config-schema.md

304
_storage/config-schema.md

@ -5,103 +5,217 @@ permalink: /:collection/:path.html
--- ---
# Hub configuration parameters # Hub configuration parameters
The following JSON schema details the possible parameters for a hub configuration:
```json ```json
{ {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"type": "object", "additionalProperties": false,
"properties": { "properties": {
"servername": { "type": "string" }, "argsTransport": {
"port": { "type": "integer" }, "additionalProperties": false,
"driver": { "type": "string" }, "properties": {
"bucket": { "type": "string" }, "colorize": {
"readURL": { "type": "string" }, "default": true,
"requireCorrectHubUrl": { "type": "string" }, "type": "boolean"
"awsCredentials": { },
"type": "object", "handleExceptions": {
"properties": { "default": true,
"endpoint": { "type": "string"}, "type": "boolean"
"accessKeyId": { "type": "string"}, },
"secretAccessKey": { "type": "string"} "json": {
}, "default": false,
"required": [ "type": "boolean"
"endpoint", },
"accessKeyId", "level": {
"secretAccessKey" "default": "warn",
] "enum": [
}, "debug",
"proofsConfig": { "error",
"type": "object", "info",
"properties": { "verbose",
"proofsRequired": { "type": "string"} "warn"
}, ],
"required": [ "type": "string"
"proofsRequired" },
] "timestamp": {
}, "default": true,
"azCredentials": { "type": "boolean"
"type": "object", }
"properties": { },
"accountName": { "type": "string"}, "type": "object"
"accountKey": { "type": "string"} },
}, "authTimestampCacheSize": {
"required": [ "default": 50000,
"accountName", "type": "integer"
"accountKey" },
] "awsCredentials": {
}, "additionalProperties": false,
"gcCredentials": { "description": "Required if `driver` is `aws`",
"type": "object", "properties": {
"properties": { "accessKeyId": {
"keyFilename": { "type": "string"} "type": "string"
}, },
"required": [ "endpoint": {
"keyFilename" "type": "string"
] },
"secretAccessKey": {
"type": "string"
},
"sessionToken": {
"type": "string"
}
},
"type": "object"
},
"azCredentials": {
"additionalProperties": false,
"description": "Required if `driver` is `azure`",
"properties": {
"accountKey": {
"type": "string"
},
"accountName": {
"type": "string"
}
},
"type": "object"
},
"bucket": {
"default": "hub",
"type": "string"
},
"cacheControl": {
"default": "public, max-age=1",
"type": "string"
},
"diskSettings": {
"additionalProperties": false,
"description": "Required if `driver` is `disk`",
"properties": {
"storageRootDirectory": {
"type": "string"
}
},
"type": "object"
},
"driver": {
"enum": [
"aws",
"azure",
"disk",
"google-cloud"
],
"type": "string"
},
"gcCredentials": {
"additionalProperties": false,
"description": "Required if `driver` is `google-cloud`",
"properties": {
"credentials": {
"additionalProperties": false,
"properties": {
"client_email": {
"type": "string"
},
"private_key": {
"type": "string"
}
},
"type": "object"
},
"email": {
"type": "string"
},
"keyFilename": {
"type": "string"
},
"projectId": {
"type": "string"
}
},
"type": "object"
},
"maxFileUploadSize": {
"default": 20,
"description": "The maximum allowed POST body size in megabytes. \nThe content-size header is checked, and the POST body stream \nis monitoring while streaming from the client. \n[Recommended] Minimum 100KB (or approximately 0.1MB)",
"minimum": 0.1,
"type": "number"
},
"pageSize": {
"default": 100,
"maximum": 4096,
"minimum": 1,
"type": "integer"
},
"port": {
"default": 3000,
"maximum": 65535,
"minimum": 0,
"type": "integer"
},
"proofsConfig": {
"additionalProperties": false,
"properties": {
"proofsRequired": {
"default": 0,
"type": "integer"
}
},
"type": "object"
},
"readURL": {
"type": "string"
},
"requireCorrectHubUrl": {
"default": false,
"type": "boolean"
},
"serverName": {
"default": "gaia-0",
"description": "Domain name used for auth/signing challenges. \nIf `requireCorrectHubUrl` is true then this must match the hub url in an auth payload.",
"type": "string"
},
"validHubUrls": {
"description": "If `requireCorrectHubUrl` is true then the hub specified in an auth payload can also be\ncontained within in array.",
"items": {
"type": "string"
},
"type": "array"
},
"whitelist": {
"description": "List of ID addresses allowed to use this hub. Specifying this makes the hub private \nand only accessible to the specified addresses. Leaving this unspecified makes the hub \npublicly usable by any ID.",
"items": {
"type": "string"
},
"type": "array"
}
}, },
"diskSettings": { "required": [
"type": "object", "driver",
"properties": { "port"
"storageRootDirectory": { "type": "string"} ],
}, "type": "object"
"required": [
"storageRootDirectory"
]
},
"pageSize": { "type": "integer"},
"argsTransport": {
"type": "object",
"properties": {
"level": { "type": "string"},
"handleExceptions": { "type": "boolean" },
"stringify": { "type": "boolean" },
"timestamp": { "type": "boolean" },
"colorize": { "type": "boolean" },
"json":{ "type": "boolean" }
},
"required": [
"level",
"handleExceptions",
"stringify",
"timestamp",
"colorize",
"json"
]
}
},
"required": [
"servername",
"port",
"driver",
"bucket",
"readURL",
"requireCorrectHubUrl",
"awsCredentials",
"proofsConfig",
"azCredentials",
"gcCredentials",
"diskSettings",
"pageSize",
"argsTransport"
]
} }
``` ```
The following is an simple example of a Gaia hub configuration:
```json
{
"port": 3000,
"driver": "",
"bucket": "",
"readURL": "",
"argsTransport": {
"level": "debug",
"handleExceptions": true,
"timestamp": true,
"colorize": false,
"json": true
}
}
```
A full list of example can be found in [the Gaia repository on GitHub](https://github.com/blockstack/gaia/tree/master/hub).
Loading…
Cancel
Save