github.com/silveraid/fabric-ca@v1.1.0-preview.0.20180127000700-71974f53ab08/lib/serverconfig.go (about)

     1  /*
     2  Copyright IBM Corp. 2017 All Rights Reserved.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8                   http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package lib
    18  
    19  import "github.com/hyperledger/fabric-ca/lib/tls"
    20  
    21  const (
    22  	// DefaultServerPort is the default listening port for the fabric-ca server
    23  	DefaultServerPort = 7054
    24  
    25  	// DefaultServerAddr is the default listening address for the fabric-ca server
    26  	DefaultServerAddr = "0.0.0.0"
    27  )
    28  
    29  // ServerConfig is the fabric-ca server's config
    30  // The tags are recognized by the RegisterFlags function in fabric-ca/lib/util.go
    31  // and are as follows:
    32  // "def" - the default value of the field;
    33  // "opt" - the optional one character short name to use on the command line;
    34  // "help" - the help message to display on the command line;
    35  // "skip" - to skip the field.
    36  type ServerConfig struct {
    37  	// Listening port for the server
    38  	Port int `def:"7054" opt:"p" help:"Listening port of fabric-ca-server"`
    39  	// Bind address for the server
    40  	Address string `def:"0.0.0.0" help:"Listening address of fabric-ca-server"`
    41  	// Enables debug logging
    42  	Debug bool `def:"false" opt:"d" help:"Enable debug level logging"`
    43  	// TLS for the server's listening endpoint
    44  	TLS tls.ServerTLSConfig
    45  	// Optional client config for an intermediate server which acts as a client
    46  	// of the root (or parent) server
    47  	Client *ClientConfig
    48  	// CACfg is the default CA's config
    49  	CAcfg CAConfig `skip:"true"`
    50  	// The names of the CA configuration files
    51  	// This is empty unless there are non-default CAs served by this server
    52  	CAfiles []string `help:"A list of comma-separated CA configuration files"`
    53  	// The number of non-default CAs, which is useful for a dev environment to
    54  	// quickly start any number of CAs in a single server
    55  	CAcount int `def:"0" help:"Number of non-default CA instances"`
    56  	// Size limit of an acceptable CRL in bytes
    57  	CRLSizeLimit int `def:"512000" help:"Size limit of an acceptable CRL in bytes"`
    58  }