github.com/decred/politeia@v1.4.0/politeiawww/cmd/cmswww/policy.go (about) 1 // Copyright (c) 2017-2019 The Decred developers 2 // Use of this source code is governed by an ISC 3 // license that can be found in the LICENSE file. 4 5 package main 6 7 import "github.com/decred/politeia/politeiawww/cmd/shared" 8 9 // PolicyCmd gets the server policy information. 10 type PolicyCmd struct{} 11 12 // Execute executes the policy command. 13 func (cmd *PolicyCmd) Execute(args []string) error { 14 pr, err := client.CMSPolicy() 15 if err != nil { 16 return err 17 } 18 return shared.PrintJSON(pr) 19 } 20 21 // policyHelpMsg is the output of the help command when 'policy' is specified. 22 const policyHelpMsg = `policy 23 24 Fetch server policy. 25 26 Arguments: 27 None 28 29 Response: 30 { 31 "minpasswordlength" (uint) Minimum password length 32 "minusernamelength" (uint) Minimum username length 33 "maxusernamelength" (uint) Maximum username length 34 "usernamesupportedchars" ([]string) List of unsupported characters 35 "proposallistpagesize" (uint) Maximum proposals per page 36 "userlistpagesize" (uint) Maximum users per page 37 "maximages" (uint) Maximum number of proposal images 38 "maximagesize" (uint) Maximum image file size (in bytes) 39 "maxmds" (uint) Maximum number of markdown files 40 "maxmdsize" (uint) Maximum markdown file size (bytes) 41 "validmimetypes" ([]string) List of acceptable MIME types 42 "minproposalnamelength" (uint) Minimum length of a proposal name 43 "maxproposalnamelength" (uint) Maximum length of a proposal name 44 "proposalnamesupportedchars" ([]string) Regex of a valid proposal name 45 "maxcommentlength" (uint) Maximum characters in comments 46 "backendpublickey" (string) Backend public key 47 "maxnamelength" (uint) Maximum contractor name length 48 "minnamelength" (uint) Mininum contractor name length 49 "maxlocationlength" (uint) Maximum contractor location length 50 "minlocationlength" (uint) Minimum contractor location length 51 "invoicecommentchar" (rune) Character for comments on invoices 52 "invoicefielddelimiterchar" (rune) Character for invoice csv field separation 53 "invoicelineitemcount" (uint) Expected count for line item fields 54 }`