|
20 | 20 | import java.util.LinkedHashMap; |
21 | 21 | import java.util.Map; |
22 | 22 |
|
| 23 | +import com.cloud.network.rules.LoadBalancer; |
23 | 24 | import com.cloud.network.rules.LoadBalancerConfig.Scope; |
24 | 25 | import com.cloud.utils.Pair; |
| 26 | +import org.apache.cloudstack.framework.config.ConfigKey; |
| 27 | +import org.apache.cloudstack.framework.config.Configurable; |
25 | 28 |
|
26 | | -public enum LoadBalancerConfigKey { |
| 29 | +public enum LoadBalancerConfigKey implements Configurable { |
27 | 30 |
|
28 | 31 | LbStatsEnable(Category.Stats, "lb.stats.enable", "LB stats enable", Boolean.class, "true", "Enable statistics reporting with default settings, default is 'true'", Scope.Network, Scope.Vpc), |
29 | 32 |
|
@@ -63,7 +66,22 @@ public enum LoadBalancerConfigKey { |
63 | 66 |
|
64 | 67 | LbServerMaxQueue(Category.LoadBalancer, "lb.server.maxqueue", "Max conn wait in queue per server", Long.class, "<0 means unlimited in haproxy>", "Maximum number of connections which will wait in queue for this server, default is ''", Scope.LoadBalancerRule), |
65 | 68 |
|
66 | | - LbSslConfiguration(Category.LoadBalancer, "lb.ssl.configuration", "SSL configuration, could be 'none', 'old' or 'intermediate'", String.class, "none", "if 'none', no SSL configurations will be added, if 'old', refer to https://ssl-config.mozilla.org/#server=haproxy&server-version=1.8.17&config=old&openssl-version=1.0.2l if 'intermediate', refer to https://ssl-config.mozilla.org/#server=haproxy&server-version=1.8.17&config=intermediate&openssl-version=1.0.2l default value is 'none'", Scope.LoadBalancerRule); |
| 69 | + LbSslConfiguration(Category.LoadBalancer, "lb.ssl.configuration", "SSL configuration, could be 'none', 'old' or 'intermediate'", String.class, "none" , "if 'none', no SSL configurations will be added, if 'old', refer to https://ssl-config.mozilla.org/#server=haproxy&server-version=1.8.17&config=old&openssl-version=1.0.2l if 'intermediate', refer to https://ssl-config.mozilla.org/#server=haproxy&server-version=1.8.17&config=intermediate&openssl-version=1.0.2l default value is 'none'", Scope.LoadBalancerRule); |
| 70 | + |
| 71 | + private static final String DefaultValueOfSSLCustomizationCK = "default.value.of.ssl.customization"; |
| 72 | + |
| 73 | + private static final ConfigKey<String> DefaultValueOfSALCustomization = new ConfigKey<>("Advanced", String.class, DefaultValueOfSSLCustomizationCK, "none", |
| 74 | + "Control default value of load balancer ssl customization", true, ConfigKey.Scope.Global); |
| 75 | + |
| 76 | + @Override |
| 77 | + public String getConfigComponentName() { |
| 78 | + return LoadBalancerConfigKey.class.getSimpleName(); |
| 79 | + } |
| 80 | + |
| 81 | + @Override |
| 82 | + public ConfigKey<?>[] getConfigKeys() { |
| 83 | + return new ConfigKey[]{DefaultValueOfSALCustomization}; |
| 84 | + } |
67 | 85 |
|
68 | 86 | public static enum Category { |
69 | 87 | General, Advanced, Stats, LoadBalancer |
@@ -104,6 +122,8 @@ public String displayText() { |
104 | 122 | } |
105 | 123 |
|
106 | 124 | public String defaultValue() { |
| 125 | + if(key().equals("lb.ssl.configuration")) |
| 126 | + return DefaultValueOfSALCustomization.value(); |
107 | 127 | return _defaultValue; |
108 | 128 | } |
109 | 129 |
|
|
0 commit comments