Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve usability of config override/default CLI #762

Closed
chris-j-h opened this issue May 24, 2019 · 1 comment
Closed

Improve usability of config override/default CLI #762

chris-j-h opened this issue May 24, 2019 · 1 comment
Labels
enhancement Non-user code enhancements

Comments

@chris-j-h
Copy link
Collaborator

chris-j-h commented May 24, 2019

There are a large number of CLI options and the Tessera usage (tessera --help) is could do with some user friendly formatting for better understanding...

Click to see current Tessera usage
usage: tessera -configfile <PATH> [-keygen <PATH>] [-pidfile <PATH>]
    --alwaysSendTo <STRING[]...>                                                    Override option for alwaysSendTo , type: String[]
 -configfile <PATH>                                                                 Path to node configuration file
    --disablePeerDiscovery <BOOLEAN>                                                Override option for disablePeerDiscovery , type: boolean
 -filename <PATH>                                                                   Comma-separated list of paths to save generated key files. Can also be used with keyvault. Number of args equals
                                                                                    number of key-pairs generated.
    --jdbc.autoCreateTables <BOOLEAN>                                               Override option for jdbc.autoCreateTables , type: boolean
    --jdbc.password <STRING>                                                        Override option for jdbc.password , type: String
    --jdbc.url <STRING>                                                             Override option for jdbc.url , type: String
    --jdbc.username <STRING>                                                        Override option for jdbc.username , type: String
 -keygen                                                                            Use this option to generate public/private keypair
 -keygenconfig <PATH>                                                               Path to private key config for generation of missing key files
 -keygenvaultapprole <STRING>                                                       AppRole path for Hashicorp Vault authentication (defaults to 'approle')
 -keygenvaultkeystore <PATH>                                                        Path to JKS keystore for TLS Hashicorp Vault communication
 -keygenvaultsecretengine <STRING>                                                  Name of already enabled Hashicorp v2 kv secret engine
 -keygenvaulttruststore <PATH>                                                      Path to JKS truststore for TLS Hashicorp Vault communication
 -keygenvaulttype <KEYVAULTTYPE>                                                    Type of key vault the generated key is to be saved in
 -keygenvaulturl <STRING>                                                           Base url for key vault
    --keys.azureKeyVaultConfig.url <STRING>                                         Override option for keys.azureKeyVaultConfig.url , type: String
    --keys.hashicorpKeyVaultConfig.approlePath <STRING>                             Override option for keys.hashicorpKeyVaultConfig.approlePath , type: String
    --keys.hashicorpKeyVaultConfig.tlsKeyStorePath <PATH>                           Override option for keys.hashicorpKeyVaultConfig.tlsKeyStorePath , type: Path
    --keys.hashicorpKeyVaultConfig.tlsTrustStorePath <PATH>                         Override option for keys.hashicorpKeyVaultConfig.tlsTrustStorePath , type: Path
    --keys.hashicorpKeyVaultConfig.url <STRING>                                     Override option for keys.hashicorpKeyVaultConfig.url , type: String
    --keys.keyData.config.data.aopts.algorithm <STRING>                             Override option for keys.keyData.config.data.aopts.algorithm , type: String
    --keys.keyData.config.data.aopts.iterations <STRING>                            Override option for keys.keyData.config.data.aopts.iterations , type: String
    --keys.keyData.config.data.aopts.memory <STRING>                                Override option for keys.keyData.config.data.aopts.memory , type: String
    --keys.keyData.config.data.aopts.parallelism <STRING>                           Override option for keys.keyData.config.data.aopts.parallelism , type: String
    --keys.keyData.privateKeyPath <PATH>                                            Override option for keys.keyData.privateKeyPath , type: Path
    --keys.passwordFile <PATH>                                                      Override option for keys.passwordFile , type: Path
    --keys.passwords <STRING[]...>                                                  Override option for keys.passwords , type: String[]
 -output <arg>                                                                      Generate updated config file with generated keys
    --peer.url <STRING>                                                             Override option for peer.url , type: String
 -pidfile <PATH>                                                                    Path to pid file
    --server.bindingAddress <STRING>                                                Override option for server.bindingAddress , type: String
    --server.communicationType <COMMUNICATIONTYPE>                                  Override option for server.communicationType , type: CommunicationType
    --server.grpcPort <INTEGER>                                                     Override option for server.grpcPort , type: Integer
    --server.hostName <STRING>                                                      Override option for server.hostName , type: String
    --server.influxConfig.dbName <STRING>                                           Override option for server.influxConfig.dbName , type: String
    --server.influxConfig.pushIntervalInSecs <LONG>                                 Override option for server.influxConfig.pushIntervalInSecs , type: Long
    --server.influxConfig.serverAddress <STRING>                                    Override option for server.influxConfig.serverAddress , type: String
    --server.influxConfig.sslConfig.clientKeyStore <PATH>                           Override option for server.influxConfig.sslConfig.clientKeyStore , type: Path
    --server.influxConfig.sslConfig.clientKeyStorePassword <STRING>                 Override option for server.influxConfig.sslConfig.clientKeyStorePassword , type: String
    --server.influxConfig.sslConfig.clientTlsCertificatePath <PATH>                 Override option for server.influxConfig.sslConfig.clientTlsCertificatePath , type: Path
    --server.influxConfig.sslConfig.clientTlsKeyPath <PATH>                         Override option for server.influxConfig.sslConfig.clientTlsKeyPath , type: Path
    --server.influxConfig.sslConfig.clientTrustCertificates <PATH[]...>             Override option for server.influxConfig.sslConfig.clientTrustCertificates , type: Path[]
    --server.influxConfig.sslConfig.clientTrustMode <SSLTRUSTMODE>                  Override option for server.influxConfig.sslConfig.clientTrustMode , type: SslTrustMode
    --server.influxConfig.sslConfig.clientTrustStore <PATH>                         Override option for server.influxConfig.sslConfig.clientTrustStore , type: Path
    --server.influxConfig.sslConfig.clientTrustStorePassword <STRING>               Override option for server.influxConfig.sslConfig.clientTrustStorePassword , type: String
    --server.influxConfig.sslConfig.environmentVariablePrefix <STRING>              Override option for server.influxConfig.sslConfig.environmentVariablePrefix , type: String
    --server.influxConfig.sslConfig.generateKeyStoreIfNotExisted <BOOLEAN>          Override option for server.influxConfig.sslConfig.generateKeyStoreIfNotExisted , type: boolean
    --server.influxConfig.sslConfig.knownClientsFile <PATH>                         Override option for server.influxConfig.sslConfig.knownClientsFile , type: Path
    --server.influxConfig.sslConfig.knownServersFile <PATH>                         Override option for server.influxConfig.sslConfig.knownServersFile , type: Path
    --server.influxConfig.sslConfig.serverKeyStore <PATH>                           Override option for server.influxConfig.sslConfig.serverKeyStore , type: Path
    --server.influxConfig.sslConfig.serverKeyStorePassword <STRING>                 Override option for server.influxConfig.sslConfig.serverKeyStorePassword , type: String
    --server.influxConfig.sslConfig.serverTlsCertificatePath <PATH>                 Override option for server.influxConfig.sslConfig.serverTlsCertificatePath , type: Path
    --server.influxConfig.sslConfig.serverTlsKeyPath <PATH>                         Override option for server.influxConfig.sslConfig.serverTlsKeyPath , type: Path
    --server.influxConfig.sslConfig.serverTrustCertificates <PATH[]...>             Override option for server.influxConfig.sslConfig.serverTrustCertificates , type: Path[]
    --server.influxConfig.sslConfig.serverTrustMode <SSLTRUSTMODE>                  Override option for server.influxConfig.sslConfig.serverTrustMode , type: SslTrustMode
    --server.influxConfig.sslConfig.serverTrustStore <PATH>                         Override option for server.influxConfig.sslConfig.serverTrustStore , type: Path
    --server.influxConfig.sslConfig.serverTrustStorePassword <STRING>               Override option for server.influxConfig.sslConfig.serverTrustStorePassword , type: String
    --server.influxConfig.sslConfig.sslConfigType <SSLCONFIGTYPE>                   Override option for server.influxConfig.sslConfig.sslConfigType , type: SslConfigType
    --server.influxConfig.sslConfig.tls <SSLAUTHENTICATIONMODE>                     Override option for server.influxConfig.sslConfig.tls , type: SslAuthenticationMode
    --server.port <INTEGER>                                                         Override option for server.port , type: Integer
    --server.sslConfig.clientKeyStore <PATH>                                        Override option for server.sslConfig.clientKeyStore , type: Path
    --server.sslConfig.clientKeyStorePassword <STRING>                              Override option for server.sslConfig.clientKeyStorePassword , type: String
    --server.sslConfig.clientTlsCertificatePath <PATH>                              Override option for server.sslConfig.clientTlsCertificatePath , type: Path
    --server.sslConfig.clientTlsKeyPath <PATH>                                      Override option for server.sslConfig.clientTlsKeyPath , type: Path
    --server.sslConfig.clientTrustCertificates <PATH[]...>                          Override option for server.sslConfig.clientTrustCertificates , type: Path[]
    --server.sslConfig.clientTrustMode <SSLTRUSTMODE>                               Override option for server.sslConfig.clientTrustMode , type: SslTrustMode
    --server.sslConfig.clientTrustStore <PATH>                                      Override option for server.sslConfig.clientTrustStore , type: Path
    --server.sslConfig.clientTrustStorePassword <STRING>                            Override option for server.sslConfig.clientTrustStorePassword , type: String
    --server.sslConfig.environmentVariablePrefix <STRING>                           Override option for server.sslConfig.environmentVariablePrefix , type: String
    --server.sslConfig.generateKeyStoreIfNotExisted <BOOLEAN>                       Override option for server.sslConfig.generateKeyStoreIfNotExisted , type: boolean
    --server.sslConfig.knownClientsFile <PATH>                                      Override option for server.sslConfig.knownClientsFile , type: Path
    --server.sslConfig.knownServersFile <PATH>                                      Override option for server.sslConfig.knownServersFile , type: Path
    --server.sslConfig.serverKeyStore <PATH>                                        Override option for server.sslConfig.serverKeyStore , type: Path
    --server.sslConfig.serverKeyStorePassword <STRING>                              Override option for server.sslConfig.serverKeyStorePassword , type: String
    --server.sslConfig.serverTlsCertificatePath <PATH>                              Override option for server.sslConfig.serverTlsCertificatePath , type: Path
    --server.sslConfig.serverTlsKeyPath <PATH>                                      Override option for server.sslConfig.serverTlsKeyPath , type: Path
    --server.sslConfig.serverTrustCertificates <PATH[]...>                          Override option for server.sslConfig.serverTrustCertificates , type: Path[]
    --server.sslConfig.serverTrustMode <SSLTRUSTMODE>                               Override option for server.sslConfig.serverTrustMode , type: SslTrustMode
    --server.sslConfig.serverTrustStore <PATH>                                      Override option for server.sslConfig.serverTrustStore , type: Path
    --server.sslConfig.serverTrustStorePassword <STRING>                            Override option for server.sslConfig.serverTrustStorePassword , type: String
    --server.sslConfig.sslConfigType <SSLCONFIGTYPE>                                Override option for server.sslConfig.sslConfigType , type: SslConfigType
    --server.sslConfig.tls <SSLAUTHENTICATIONMODE>                                  Override option for server.sslConfig.tls , type: SslAuthenticationMode
    --serverConfigs.app <APPTYPE>                                                   Override option for serverConfigs.app , type: AppType
    --serverConfigs.bindingAddress <STRING>                                         Override option for serverConfigs.bindingAddress , type: String
    --serverConfigs.communicationType <COMMUNICATIONTYPE>                           Override option for serverConfigs.communicationType , type: CommunicationType
    --serverConfigs.cors.allowCredentials <BOOLEAN>                                 Override option for serverConfigs.cors.allowCredentials , type: Boolean
    --serverConfigs.cors.allowedHeaders <STRING[]...>                               Override option for serverConfigs.cors.allowedHeaders , type: String[]
    --serverConfigs.cors.allowedMethods <STRING[]...>                               Override option for serverConfigs.cors.allowedMethods , type: String[]
    --serverConfigs.cors.allowedOrigins <STRING[]...>                               Override option for serverConfigs.cors.allowedOrigins , type: String[]
    --serverConfigs.enabled <BOOLEAN>                                               Override option for serverConfigs.enabled , type: boolean
    --serverConfigs.influxConfig.dbName <STRING>                                    Override option for serverConfigs.influxConfig.dbName , type: String
    --serverConfigs.influxConfig.pushIntervalInSecs <LONG>                          Override option for serverConfigs.influxConfig.pushIntervalInSecs , type: Long
    --serverConfigs.influxConfig.serverAddress <STRING>                             Override option for serverConfigs.influxConfig.serverAddress , type: String
    --serverConfigs.influxConfig.sslConfig.clientKeyStore <PATH>                    Override option for serverConfigs.influxConfig.sslConfig.clientKeyStore , type: Path
    --serverConfigs.influxConfig.sslConfig.clientKeyStorePassword <STRING>          Override option for serverConfigs.influxConfig.sslConfig.clientKeyStorePassword , type: String
    --serverConfigs.influxConfig.sslConfig.clientTlsCertificatePath <PATH>          Override option for serverConfigs.influxConfig.sslConfig.clientTlsCertificatePath , type: Path
    --serverConfigs.influxConfig.sslConfig.clientTlsKeyPath <PATH>                  Override option for serverConfigs.influxConfig.sslConfig.clientTlsKeyPath , type: Path
    --serverConfigs.influxConfig.sslConfig.clientTrustCertificates <PATH[]...>      Override option for serverConfigs.influxConfig.sslConfig.clientTrustCertificates , type: Path[]
    --serverConfigs.influxConfig.sslConfig.clientTrustMode <SSLTRUSTMODE>           Override option for serverConfigs.influxConfig.sslConfig.clientTrustMode , type: SslTrustMode
    --serverConfigs.influxConfig.sslConfig.clientTrustStore <PATH>                  Override option for serverConfigs.influxConfig.sslConfig.clientTrustStore , type: Path
    --serverConfigs.influxConfig.sslConfig.clientTrustStorePassword <STRING>        Override option for serverConfigs.influxConfig.sslConfig.clientTrustStorePassword , type: String
    --serverConfigs.influxConfig.sslConfig.environmentVariablePrefix <STRING>       Override option for serverConfigs.influxConfig.sslConfig.environmentVariablePrefix , type: String
    --serverConfigs.influxConfig.sslConfig.generateKeyStoreIfNotExisted <BOOLEAN>   Override option for serverConfigs.influxConfig.sslConfig.generateKeyStoreIfNotExisted , type: boolean
    --serverConfigs.influxConfig.sslConfig.knownClientsFile <PATH>                  Override option for serverConfigs.influxConfig.sslConfig.knownClientsFile , type: Path
    --serverConfigs.influxConfig.sslConfig.knownServersFile <PATH>                  Override option for serverConfigs.influxConfig.sslConfig.knownServersFile , type: Path
    --serverConfigs.influxConfig.sslConfig.serverKeyStore <PATH>                    Override option for serverConfigs.influxConfig.sslConfig.serverKeyStore , type: Path
    --serverConfigs.influxConfig.sslConfig.serverKeyStorePassword <STRING>          Override option for serverConfigs.influxConfig.sslConfig.serverKeyStorePassword , type: String
    --serverConfigs.influxConfig.sslConfig.serverTlsCertificatePath <PATH>          Override option for serverConfigs.influxConfig.sslConfig.serverTlsCertificatePath , type: Path
    --serverConfigs.influxConfig.sslConfig.serverTlsKeyPath <PATH>                  Override option for serverConfigs.influxConfig.sslConfig.serverTlsKeyPath , type: Path
    --serverConfigs.influxConfig.sslConfig.serverTrustCertificates <PATH[]...>      Override option for serverConfigs.influxConfig.sslConfig.serverTrustCertificates , type: Path[]
    --serverConfigs.influxConfig.sslConfig.serverTrustMode <SSLTRUSTMODE>           Override option for serverConfigs.influxConfig.sslConfig.serverTrustMode , type: SslTrustMode
    --serverConfigs.influxConfig.sslConfig.serverTrustStore <PATH>                  Override option for serverConfigs.influxConfig.sslConfig.serverTrustStore , type: Path
    --serverConfigs.influxConfig.sslConfig.serverTrustStorePassword <STRING>        Override option for serverConfigs.influxConfig.sslConfig.serverTrustStorePassword , type: String
    --serverConfigs.influxConfig.sslConfig.sslConfigType <SSLCONFIGTYPE>            Override option for serverConfigs.influxConfig.sslConfig.sslConfigType , type: SslConfigType
    --serverConfigs.influxConfig.sslConfig.tls <SSLAUTHENTICATIONMODE>              Override option for serverConfigs.influxConfig.sslConfig.tls , type: SslAuthenticationMode
    --serverConfigs.serverAddress <STRING>                                          Override option for serverConfigs.serverAddress , type: String
    --serverConfigs.sslConfig.clientKeyStore <PATH>                                 Override option for serverConfigs.sslConfig.clientKeyStore , type: Path
    --serverConfigs.sslConfig.clientKeyStorePassword <STRING>                       Override option for serverConfigs.sslConfig.clientKeyStorePassword , type: String
    --serverConfigs.sslConfig.clientTlsCertificatePath <PATH>                       Override option for serverConfigs.sslConfig.clientTlsCertificatePath , type: Path
    --serverConfigs.sslConfig.clientTlsKeyPath <PATH>                               Override option for serverConfigs.sslConfig.clientTlsKeyPath , type: Path
    --serverConfigs.sslConfig.clientTrustCertificates <PATH[]...>                   Override option for serverConfigs.sslConfig.clientTrustCertificates , type: Path[]
    --serverConfigs.sslConfig.clientTrustMode <SSLTRUSTMODE>                        Override option for serverConfigs.sslConfig.clientTrustMode , type: SslTrustMode
    --serverConfigs.sslConfig.clientTrustStore <PATH>                               Override option for serverConfigs.sslConfig.clientTrustStore , type: Path
    --serverConfigs.sslConfig.clientTrustStorePassword <STRING>                     Override option for serverConfigs.sslConfig.clientTrustStorePassword , type: String
    --serverConfigs.sslConfig.environmentVariablePrefix <STRING>                    Override option for serverConfigs.sslConfig.environmentVariablePrefix , type: String
    --serverConfigs.sslConfig.generateKeyStoreIfNotExisted <BOOLEAN>                Override option for serverConfigs.sslConfig.generateKeyStoreIfNotExisted , type: boolean
    --serverConfigs.sslConfig.knownClientsFile <PATH>                               Override option for serverConfigs.sslConfig.knownClientsFile , type: Path
    --serverConfigs.sslConfig.knownServersFile <PATH>                               Override option for serverConfigs.sslConfig.knownServersFile , type: Path
    --serverConfigs.sslConfig.serverKeyStore <PATH>                                 Override option for serverConfigs.sslConfig.serverKeyStore , type: Path
    --serverConfigs.sslConfig.serverKeyStorePassword <STRING>                       Override option for serverConfigs.sslConfig.serverKeyStorePassword , type: String
    --serverConfigs.sslConfig.serverTlsCertificatePath <PATH>                       Override option for serverConfigs.sslConfig.serverTlsCertificatePath , type: Path
    --serverConfigs.sslConfig.serverTlsKeyPath <PATH>                               Override option for serverConfigs.sslConfig.serverTlsKeyPath , type: Path
    --serverConfigs.sslConfig.serverTrustCertificates <PATH[]...>                   Override option for serverConfigs.sslConfig.serverTrustCertificates , type: Path[]
    --serverConfigs.sslConfig.serverTrustMode <SSLTRUSTMODE>                        Override option for serverConfigs.sslConfig.serverTrustMode , type: SslTrustMode
    --serverConfigs.sslConfig.serverTrustStore <PATH>                               Override option for serverConfigs.sslConfig.serverTrustStore , type: Path
    --serverConfigs.sslConfig.serverTrustStorePassword <STRING>                     Override option for serverConfigs.sslConfig.serverTrustStorePassword , type: String
    --serverConfigs.sslConfig.sslConfigType <SSLCONFIGTYPE>                         Override option for serverConfigs.sslConfig.sslConfigType , type: SslConfigType
    --serverConfigs.sslConfig.tls <SSLAUTHENTICATIONMODE>                           Override option for serverConfigs.sslConfig.tls , type: SslAuthenticationMode
    --unixSocketFile <PATH>                                                         Override option for unixSocketFile , type: Path
 -updatepassword                                                                    Update the password for a locked key
    --useWhiteList <BOOLEAN>                                                        Override option for useWhiteList , type: boolean

Possible areas for improvement are:

  • Be able to specify exactly which property in an array to override, e.g.

    --serverConfigs[1].serverAddress <new addr>
    

    instead of

    --serverConfigs.serverAddress <same as in configfile> --serverConfigs.serverAddress <new addr> 
    
  • The config CLI does not just handle overriding on startup, it can also be used to generate new keys as well as change the password of existing keys. These could be split out into separate commands (similar to how the geth CLI works), e.g.:

    tessera --<config override options>
    tessera keygen --<keygen options>
    tessera keyman --<pwd change options>
    

    This would allow for separate usages for each command and make it easier to understand which options are available for each, i.e. tessera help, tessera keygen help, tessera keyman help

    This would also free up single - options to be used for short-options if we wished.

@chris-j-h chris-j-h added enhancement Non-user code enhancements 0.10.0 labels May 24, 2019
@prd-fox prd-fox removed the 0.10.0 label Aug 6, 2019
@chris-j-h
Copy link
Collaborator Author

The Tessera CLI was updated in #946 and included this fix as well as several others. This was released in Tessera 0.10.3. Usage is documented here https://docs.goquorum.com/en/latest/Privacy/Tessera/Configuration/Using%20CLI%20to%20override%20config%20v0.10.3/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Non-user code enhancements
Projects
None yet
Development

No branches or pull requests

2 participants