2. Configuration

Grégoire Jeanmart edited this page Jun 9, 2018 · 6 revisions

The following section shows how to tweak IPFS-store. Any of these properties can be overwritten using command arguments --{property_name}={property_value} (for example --server.port=8888)

Full configuration file:

server:
  port: 8040
  contextPath: /ipfs-store

logging:
  level:
    net.consensys: ${LOG_LEVEL:TRACE}

ipfs-store:
  storage:
    type: IPFS
    host: ${IPFS_HOST:localhost}
    port: ${IPFS_PORT:5001}
    additional:
      timeout: 5000
      thread_pool: 10
    
  index:
    type: ELASTICSEARCH
    host: ${ELASTIC_HOST:localhost}
    port: ${ELASTIC_PORT:9300}
    additional:
      clusterName: ${ELASTIC_CLUSTERNAME:docker-cluster}
      indexNullValue: true
      
  pinning:
    strategies:
      - 
        id: ipfs_node
        type: native
        host: ${IPFS_HOST:localhost}
        port: ${IPFS_PORT:5001}
      - 
        id: ipfs_cluster
        type: ipfs_cluster
        enable: ${IPFS_CLUSTER_ENABLE:false}
        host: ${IPFS_CLUSTER_HOST:localhost}
        port: ${IPFS_CLUSTER_PORT:9094}
        store_index: /json/store_index
  
  security:
    cors:
      origins: "*"
      methods: "GET,POST"
      headers: "Origin,Content-Type,Accept"
      credentials: "false"
       
  healthcheck:
    pollInterval: 10000

  api-spec:
    query:
      fetch: /query/fetch/{hash}
      search: /query/search
    config:
      index: /config/index/{index}
    persistence:
      raw:
        store: /raw/store
        index: /raw/index
        store_index: /raw/store_index
      json:
        store: /json/store
        index: /json/index
        store_index: /json/store_index   

Storage layer

The storage layer is built in a generic way where different storage technologies could be used.

At the moment, only IPFS is supported.

IPFS

Property Type Sample value Description
ipfs-store.storage.type String IPFS Select IPFS as a storage layer
ipfs-store.storage.host String localhost Host to connect to the node
ipfs-store.storage.port Integer 5000 Port to connect to the node
ipfs-store.storage.additional.timeout Integer 10000 Timeout to find a file by hash

SWARM

Coming soon

Index layer

The Index layer is built in a generic way where different search engine technologies could be used.

At the moment, only ElasticSearch is supported.

ELASTICSEARCH

Property Type Sample value Description
ipfs-store.index.type String ELASTICTSEARCH Select ELASTICTSEARCH as a index layer
ipfs-store.index.host String localhost Host to connect to ElasticSearch
ipfs-store.index.port Integer 9300 Port to connect to ElasticSearch
ipfs-store.index.additional.clusterName String es-cluster Name of the cluster
ipfs-store.index.additional.indexNullValue Boolean true Index empty/null value with a default value NULL (useful to search on empty field)

Pinning strategy

A pinning strategy define the way you want to pin (permanently store) your content. Whilst a native pinning strategy consists in pinning the content directly in a node. Another one, ipfs_cluster consist in pinning an IPFS-cluster to replicate the content across the cluster of nodes. Other implementations could be imagined.

Pinning stategies can be combined together and are executed asynchronously from the main thread.

Strategies

Name (type) Description
native Pin the node
ipfs_cluster Pin an ipfs cluster node that replicates the content
Property Type Sample value Description
ipfs-store.pinning.strategies Strategy[] List og strategies
ipfs-store.pinning.strategies[0].id String Unique identifier of the stratefy
ipfs-store.pinning.strategies[0].type String Type of the strategy (native, ipfs_cluster)
ipfs-store.pinning.strategies[0].enable Boolean Enable/Disable the strategy
ipfs-store.pinning.strategies[0].host String Basic configuration (host)
ipfs-store.pinning.strategies[0].port String Basic configuration (port)
ipfs-store.pinning.strategies[0].additional Map Basic configuration (additional)

Security

Cross-Origin Resource Sharing (CORS)

Property Type Sample value Description
ipfs-store.security.cors.origin String * The Access-Control-Allow-Origin response header indicates whether the response can be shared with resources with the given origin.
ipfs-store.security.cors.methods String GET,POST,PUT,DELETE The Access-Control-Allow-Methods response header specifies the method or methods allowed when accessing the resource in response to a preflight request.
ipfs-store.security.cors.headers String Accept,Content-Type The Access-Control-Expose-Headers response header indicates which headers can be exposed as part of the response by listing their names.
ipfs-store.security.cors.credentials Boolean false The Access-Control-Allow-Credentials response header indicates whether or not the response to the request can be exposed to the page. It can be exposed when the true value is returned.

Access control

TBC

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.