Commit 81a1bce5 authored by Jason Song's avatar Jason Song

misc changes for 1.3.0

1. fix flyway migration Chinese garbled issue
2. limit hibernate query plan cache
3. fix import/export api
4. wording update for yaml/yml namespace support
5. update ldap sample configurations
parent b45405bd
# ldap sample for active directory, need to rename this file to application-ldap.yml to make it effective
spring:
ldap:
base: "dc=example,dc=com"
username: "admin" # 配置管理员账号,用于搜索、匹配用户
password: "password"
searchFilter: "(sAMAccountName={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户
urls:
- "ldap://1.1.1.1:389"
ldap:
mapping: # 配置 ldap 属性
objectClass: "user" # ldap 用户 objectClass 配置
loginId: "sAMAccountName" # ldap 用户惟一 id,用来作为登录的 id
userDisplayName: "cn" # ldap 用户名,用来作为显示名
email: "userPrincipalName" # ldap 邮箱属性
filter: # 可选项,配置过滤,目前只支持 memberOf
memberOf: "CN=ServiceDEV,OU=test,DC=example,DC=com|CN=WebDEV,OU=test,DC=example,DC=com" # 只允许 memberOf 属性为 ServiceDEV 和 WebDEV 的用户访问
# ldap sample for apache ds, need to rename this file to application-ldap.yml to make it effective
spring: spring:
ldap: ldap:
base: "dc=example,dc=com" base: "dc=example,dc=com"
...@@ -11,11 +12,11 @@ ldap: ...@@ -11,11 +12,11 @@ ldap:
mapping: # 配置 ldap 属性 mapping: # 配置 ldap 属性
objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置 objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置
loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id
rdnKey: "cn" # ldap rdn key rdnKey: "cn" # ldap rdn key,可选项,如需启用group search需要配置
userDisplayName: "displayName" # ldap 用户名,用来作为显示名 userDisplayName: "displayName" # ldap 用户名,用来作为显示名
email: "mail" # ldap 邮箱属性 email: "mail" # ldap 邮箱属性
group: # 配置ldap group group: # 配置ldap group,可选配置,启用后只有特定group的用户可以登录apollo
objectClass: "groupOfNames" # 配置groupClassName objectClass: "groupOfNames" # 配置groupClassName
groupBase: "ou=group" # group search base groupBase: "ou=group" # group search base
groupSearch: "(&(cn=apollo-admins)(&(member=*)))" # group filter groupSearch: "(&(cn=dev))" # group filter
groupMembership: "member" # group memberShip eg. member or memberUid groupMembership: "member" # group memberShip eg. member or memberUid
\ No newline at end of file
# ldap sample for open ldap, need to rename this file to application-ldap.yml to make it effective
spring: spring:
ldap: ldap:
base: "dc=example,dc=com" base: "dc=example,dc=org"
username: "cn=Manager,dc=example,dc=com" # 配置管理员账号,用于搜索、匹配用户 username: "cn=admin,dc=example,dc=org" # 配置管理员账号,用于搜索、匹配用户
password: "password" password: "password"
searchFilter: "(uid={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 searchFilter: "(uid={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户
urls: urls:
- "ldap://localhost:389" - "ldap://localhost:389"
...@@ -11,10 +12,11 @@ ldap: ...@@ -11,10 +12,11 @@ ldap:
mapping: # 配置 ldap 属性 mapping: # 配置 ldap 属性
objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置 objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置
loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id
rdnKey: "uid" # ldap rdn key rdnKey: "uid" # ldap rdn key,可选项,如需启用group search需要配置
userDisplayName: "displayName" # ldap 用户名,用来作为显示名 userDisplayName: "cn" # ldap 用户名,用来作为显示名
email: "mail" # ldap 邮箱属性 email: "mail" # ldap 邮箱属性
group: # 配置ldap group group: # 启用group search,可选配置,启用后只有特定group的用户可以登录apollo
groupBase: "ou=Group" # group search base objectClass: "posixGroup" # 配置groupClassName
groupSearch: "(&(cn=apollo-admins))" # group filter groupBase: "ou=group" # group search base
groupMembership: "memberUid" # group memberShip groupSearch: "(&(cn=dev))" # group filter
\ No newline at end of file groupMembership: "memberUid" # group memberShip eg. member or memberUid
...@@ -48,7 +48,6 @@ public class ConfigsExportController { ...@@ -48,7 +48,6 @@ public class ConfigsExportController {
@PostMapping("/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName}/items/import") @PostMapping("/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName}/items/import")
public void importConfigFile(@PathVariable String appId, @PathVariable String env, public void importConfigFile(@PathVariable String appId, @PathVariable String env,
@PathVariable String clusterName, @PathVariable String namespaceName, @PathVariable String clusterName, @PathVariable String namespaceName,
@RequestParam Integer namespaceId,
@RequestParam("file") MultipartFile file) { @RequestParam("file") MultipartFile file) {
if (file.isEmpty()) { if (file.isEmpty()) {
throw new BadRequestException("The file is empty."); throw new BadRequestException("The file is empty.");
...@@ -73,7 +72,7 @@ public class ConfigsExportController { ...@@ -73,7 +72,7 @@ public class ConfigsExportController {
model.setEnv(env); model.setEnv(env);
model.setClusterName(clusterName); model.setClusterName(clusterName);
model.setNamespaceName(namespaceName); model.setNamespaceName(namespaceName);
model.setNamespaceId(namespaceId); model.setNamespaceId(namespaceDTO.getId());
String configText; String configText;
try(InputStream in = file.getInputStream()){ try(InputStream in = file.getInputStream()){
configText = ConfigToFileUtils.fileToString(in); configText = ConfigToFileUtils.fileToString(in);
......
...@@ -11,7 +11,7 @@ public class NamespaceTextModel implements Verifiable { ...@@ -11,7 +11,7 @@ public class NamespaceTextModel implements Verifiable {
private String env; private String env;
private String clusterName; private String clusterName;
private String namespaceName; private String namespaceName;
private int namespaceId; private long namespaceId;
private String format; private String format;
private String configText; private String configText;
...@@ -30,7 +30,7 @@ public class NamespaceTextModel implements Verifiable { ...@@ -30,7 +30,7 @@ public class NamespaceTextModel implements Verifiable {
} }
public Env getEnv() { public Env getEnv() {
return Env.valueOf(env); return Env.fromString(env);
} }
public void setEnv(String env) { public void setEnv(String env) {
...@@ -53,11 +53,11 @@ public class NamespaceTextModel implements Verifiable { ...@@ -53,11 +53,11 @@ public class NamespaceTextModel implements Verifiable {
this.namespaceName = namespaceName; this.namespaceName = namespaceName;
} }
public int getNamespaceId() { public long getNamespaceId() {
return namespaceId; return namespaceId;
} }
public void setNamespaceId(int namespaceId) { public void setNamespaceId(long namespaceId) {
this.namespaceId = namespaceId; this.namespaceId = namespaceId;
} }
......
...@@ -3,6 +3,11 @@ spring: ...@@ -3,6 +3,11 @@ spring:
name: apollo-portal name: apollo-portal
profiles: profiles:
active: ${apollo_profile} active: ${apollo_profile}
jpa:
properties:
hibernate:
query:
plan_cache_max_size: 192 # limit query plan cache max size
server: server:
port: 8070 port: 8070
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
通过创建一个私有的Namespace可以实现分组管理配置 通过创建一个私有的Namespace可以实现分组管理配置
</li> </li>
<li>私有Namespace的格式可以是xml、yml、yaml、json. 您可以通过apollo-client中ConfigFile接口来获取非properties格式Namespace的内容</li> <li>私有Namespace的格式可以是xml、yml、yaml、json. 您可以通过apollo-client中ConfigFile接口来获取非properties格式Namespace的内容</li>
<li>1.3.0及以上版本的apollo-client针对yaml/yml提供了更好的支持,可以通过ConfigService.getConfig("someNamespace.yaml")直接获取Config对象,也可以通过@EnableApolloConfig("someNamespace.yaml")注入yaml配置到Spring中去</li> <li>1.3.0及以上版本的apollo-client针对yaml/yml提供了更好的支持,可以通过ConfigService.getConfig("someNamespace.yml")直接获取Config对象,也可以通过@EnableApolloConfig("someNamespace.yml")或apollo.bootstrap.namespaces=someNamespace.yml注入yml配置到Spring/Spring Boot中去</li>
</ul> </ul>
</div> </div>
<div class="row text-right" style="padding-right: 20px;"> <div class="row text-right" style="padding-right: 20px;">
......
flyway.user=root flyway.user=root
flyway.password=root flyway.password=root
flyway.schemas=ApolloConfigDB flyway.schemas=ApolloConfigDB
flyway.url=jdbc:mysql://localhost:3306 flyway.url=jdbc:mysql://localhost:3306?useSSL=false&characterEncoding=utf8
flyway.locations=filesystem:scripts/db/migration/configdb flyway.locations=filesystem:scripts/db/migration/configdb
flyway.user=root flyway.user=root
flyway.password=root flyway.password=root
flyway.schemas=ApolloPortalDB flyway.schemas=ApolloPortalDB
flyway.url=jdbc:mysql://localhost:3306 flyway.url=jdbc:mysql://localhost:3306?useSSL=false&characterEncoding=utf8
flyway.locations=filesystem:scripts/db/migration/portaldb flyway.locations=filesystem:scripts/db/migration/portaldb
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment