Browse Source

docs: merge config schema and gaia admin files

fix/update-miner-config
Alexander Graebe 4 years ago
parent
commit
23d0255a82
  1. 7
      next.config.js
  2. 1
      src/common/navigation.yaml
  3. 206
      src/pages/storage-hubs/config-schema.md
  4. 186
      src/pages/storage-hubs/gaia-admin.md

7
next.config.js

@ -327,7 +327,7 @@ async function redirects() {
},
{
source: '/storage/config-schema.html',
destination: '/storage-hubs/config-schema',
destination: '/storage-hubs/gaia-admin',
permanent: true,
},
{ source: '/org/secureref.html', destination: '/stacks-wallet/security', permanent: true },
@ -404,6 +404,11 @@ async function redirects() {
destination: '/naming-services/overview',
permanent: true,
},
{
source: '/storage-hubs/config-schema',
destination: '/storage-hubs/gaia-admin',
permanent: true,
},
];
}

1
src/common/navigation.yaml

@ -97,7 +97,6 @@ sections:
pages:
- path: /overview
- path: /gaia-admin
- path: /config-schema
- path: /digital-ocean-deploy
- path: /amazon-s3-deploy
- path: /references

206
src/pages/storage-hubs/config-schema.md

@ -1,206 +0,0 @@
---
title: Hub configuration
description: 'Storing user data with Blockstack'
---
## Schema
The following JSON schema details the possible parameters for a hub configuration:
```json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"argsTransport": {
"additionalProperties": false,
"properties": {
"colorize": {
"default": true,
"type": "boolean"
},
"handleExceptions": {
"default": true,
"type": "boolean"
},
"json": {
"default": false,
"type": "boolean"
},
"level": {
"default": "warn",
"enum": ["debug", "error", "info", "verbose", "warn"],
"type": "string"
},
"timestamp": {
"default": true,
"type": "boolean"
}
},
"type": "object"
},
"authTimestampCacheSize": {
"default": 50000,
"type": "integer"
},
"awsCredentials": {
"additionalProperties": false,
"description": "Required if `driver` is `aws`",
"properties": {
"accessKeyId": {
"type": "string"
},
"endpoint": {
"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"
}
},
"required": ["driver", "port"],
"type": "object"
}
```
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).

186
src/pages/storage-hubs/gaia-admin.md

@ -71,6 +71,8 @@ The `reloadSettings` configure the command that is used to reload your Gaia hub.
| setuid | This is the UID under which the command will be run. This is optional. |
| setgid | This is the GID under which the command will run. This is optional. |
-> Please review the [JSON config schema](#optional-understand-the-configuration-file-schema) for a list of all available parameters and possible values.
## Using the admin service APIs
You use the admin service APIs to manage the hub. Administrating a hub requires
@ -271,3 +273,187 @@ $ docker logs docker_hub_1
Successfully compiled 13 files with Babel.
{"level":"warn","message":"Listening on port 3000 in development mode","timestamp":"2019-02-14T04:00:06.071Z"}
```
## Optional: Understand the configuration file schema
The following JSON schema details the possible parameters for a hub configuration:
```json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"argsTransport": {
"additionalProperties": false,
"properties": {
"colorize": {
"default": true,
"type": "boolean"
},
"handleExceptions": {
"default": true,
"type": "boolean"
},
"json": {
"default": false,
"type": "boolean"
},
"level": {
"default": "warn",
"enum": ["debug", "error", "info", "verbose", "warn"],
"type": "string"
},
"timestamp": {
"default": true,
"type": "boolean"
}
},
"type": "object"
},
"authTimestampCacheSize": {
"default": 50000,
"type": "integer"
},
"awsCredentials": {
"additionalProperties": false,
"description": "Required if `driver` is `aws`",
"properties": {
"accessKeyId": {
"type": "string"
},
"endpoint": {
"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"
}
},
"required": ["driver", "port"],
"type": "object"
}
```
-> A full list of examples can be found in [the Gaia repository on GitHub](https://github.com/blockstack/gaia/tree/master/hub)

Loading…
Cancel
Save