mirror of
				https://source.quilibrium.com/quilibrium/ceremonyclient.git
				synced 2025-04-04 19:36:54 +00:00 
			
		
		
		
	Merge branch 'signature_check' into 'v1.4.19'
add default of signature check from QUILIBRIUM_SIGNATURE_CHECK env var See merge request quilibrium/ceremonyclient!1
This commit is contained in:
		
						commit
						986e12c88b
					
				| @ -1,6 +1,7 @@ | ||||
| FROM golang:1.20.14-alpine3.19 as build | ||||
| 
 | ||||
| ENV GOEXPERIMENT=arenas | ||||
| ENV QUILIBRIUM_SIGNATURE_CHECK=false | ||||
| 
 | ||||
| WORKDIR /opt/ceremonyclient | ||||
| 
 | ||||
|  | ||||
| @ -7,7 +7,6 @@ services: | ||||
|   node: | ||||
|     image: ${QUILIBRIUM_IMAGE_NAME:-quilibrium} | ||||
|     restart: unless-stopped | ||||
|     command: ["--signature-check=false"] | ||||
|     deploy: | ||||
|       resources: | ||||
|         limits: | ||||
|  | ||||
							
								
								
									
										20
									
								
								node/main.go
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								node/main.go
									
									
									
									
									
								
							| @ -102,8 +102,8 @@ var ( | ||||
| 	) | ||||
| 	signatureCheck = flag.Bool( | ||||
| 		"signature-check", | ||||
| 		true, | ||||
| 		"enables or disables signature validation (default true)", | ||||
| 		signatureCheckDefault(), | ||||
| 		"enables or disables signature validation (default true or value of QUILIBRIUM_SIGNATURE_CHECK env var)", | ||||
| 	) | ||||
| 	core = flag.Int( | ||||
| 		"core", | ||||
| @ -137,6 +137,20 @@ var signatories = []string{ | ||||
| 	"a114b061f8d35e3f3497c8c43d83ba6b4af67aa7b39b743b1b0a35f2d66110b5051dd3d86f69b57122a35b64e624b8180bee63b6152fce4280", | ||||
| } | ||||
| 
 | ||||
| func signatureCheckDefault() bool { | ||||
| 	envVarValue, envVarExists := os.LookupEnv("QUILIBRIUM_SIGNATURE_CHECK") | ||||
| 	if envVarExists { | ||||
| 		def, err := strconv.ParseBool(envVarValue) | ||||
| 		if err == nil { | ||||
| 			return def | ||||
| 		} else { | ||||
| 			fmt.Println("Invalid environment variable QUILIBRIUM_SIGNATURE_CHECK, must be 'true' or 'false'. Got: " + envVarValue) | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	return true | ||||
| } | ||||
| 
 | ||||
| func main() { | ||||
| 	flag.Parse() | ||||
| 
 | ||||
| @ -206,6 +220,8 @@ func main() { | ||||
| 
 | ||||
| 			fmt.Println("Signature check passed") | ||||
| 		} | ||||
| 	} else { | ||||
| 		fmt.Println("Signature check disabled, skipping...") | ||||
| 	} | ||||
| 
 | ||||
| 	if *memprofile != "" { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Cassie Heart
						Cassie Heart