repo_name
stringclasses
5 values
pr_number
int64
1.52k
15.5k
pr_title
stringlengths
8
143
pr_description
stringlengths
0
10.2k
author
stringlengths
3
18
date_created
timestamp[ns, tz=UTC]
date_merged
timestamp[ns, tz=UTC]
previous_commit
stringlengths
40
40
pr_commit
stringlengths
40
40
query
stringlengths
11
10.2k
filepath
stringlengths
6
220
before_content
stringlengths
0
597M
after_content
stringlengths
0
597M
label
int64
-1
1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/util/OpenApiBeanUtils.java
package com.ctrip.framework.apollo.openapi.util; import java.lang.reflect.Type; import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; import org.springframework.util.CollectionUtils; import com.ctrip.framework.apollo.common.dto.ClusterDTO; import com.ctrip.framework.apollo.common.dto.GrayReleaseRuleDTO; import com.ctrip.framework.apollo.common.dto.GrayReleaseRuleItemDTO; import com.ctrip.framework.apollo.common.dto.ItemDTO; import com.ctrip.framework.apollo.common.dto.NamespaceLockDTO; import com.ctrip.framework.apollo.common.dto.ReleaseDTO; import com.ctrip.framework.apollo.common.entity.App; import com.ctrip.framework.apollo.common.entity.AppNamespace; import com.ctrip.framework.apollo.common.utils.BeanUtils; import com.ctrip.framework.apollo.openapi.dto.OpenAppDTO; import com.ctrip.framework.apollo.openapi.dto.OpenAppNamespaceDTO; import com.ctrip.framework.apollo.openapi.dto.OpenClusterDTO; import com.ctrip.framework.apollo.openapi.dto.OpenGrayReleaseRuleDTO; import com.ctrip.framework.apollo.openapi.dto.OpenGrayReleaseRuleItemDTO; import com.ctrip.framework.apollo.openapi.dto.OpenItemDTO; import com.ctrip.framework.apollo.openapi.dto.OpenNamespaceDTO; import com.ctrip.framework.apollo.openapi.dto.OpenNamespaceLockDTO; import com.ctrip.framework.apollo.openapi.dto.OpenReleaseDTO; import com.ctrip.framework.apollo.portal.entity.bo.ItemBO; import com.ctrip.framework.apollo.portal.entity.bo.NamespaceBO; import com.google.common.base.Preconditions; import com.google.common.reflect.TypeToken; import com.google.gson.Gson; public class OpenApiBeanUtils { private static final Gson GSON = new Gson(); private static Type type = new TypeToken<Map<String, String>>() {}.getType(); public static OpenItemDTO transformFromItemDTO(ItemDTO item) { Preconditions.checkArgument(item != null); return BeanUtils.transform(OpenItemDTO.class, item); } public static ItemDTO transformToItemDTO(OpenItemDTO openItemDTO) { Preconditions.checkArgument(openItemDTO != null); return BeanUtils.transform(ItemDTO.class, openItemDTO); } public static OpenAppNamespaceDTO transformToOpenAppNamespaceDTO(AppNamespace appNamespace) { Preconditions.checkArgument(appNamespace != null); return BeanUtils.transform(OpenAppNamespaceDTO.class, appNamespace); } public static AppNamespace transformToAppNamespace(OpenAppNamespaceDTO openAppNamespaceDTO) { Preconditions.checkArgument(openAppNamespaceDTO != null); return BeanUtils.transform(AppNamespace.class, openAppNamespaceDTO); } public static OpenReleaseDTO transformFromReleaseDTO(ReleaseDTO release) { Preconditions.checkArgument(release != null); OpenReleaseDTO openReleaseDTO = BeanUtils.transform(OpenReleaseDTO.class, release); Map<String, String> configs = GSON.fromJson(release.getConfigurations(), type); openReleaseDTO.setConfigurations(configs); return openReleaseDTO; } public static OpenNamespaceDTO transformFromNamespaceBO(NamespaceBO namespaceBO) { Preconditions.checkArgument(namespaceBO != null); OpenNamespaceDTO openNamespaceDTO = BeanUtils.transform(OpenNamespaceDTO.class, namespaceBO.getBaseInfo()); // app namespace info openNamespaceDTO.setFormat(namespaceBO.getFormat()); openNamespaceDTO.setComment(namespaceBO.getComment()); openNamespaceDTO.setPublic(namespaceBO.isPublic()); // items List<OpenItemDTO> items = new LinkedList<>(); List<ItemBO> itemBOs = namespaceBO.getItems(); if (!CollectionUtils.isEmpty(itemBOs)) { items.addAll(itemBOs.stream().map(itemBO -> transformFromItemDTO(itemBO.getItem())) .collect(Collectors.toList())); } openNamespaceDTO.setItems(items); return openNamespaceDTO; } public static List<OpenNamespaceDTO> batchTransformFromNamespaceBOs( List<NamespaceBO> namespaceBOs) { if (CollectionUtils.isEmpty(namespaceBOs)) { return Collections.emptyList(); } List<OpenNamespaceDTO> openNamespaceDTOs = namespaceBOs.stream().map(OpenApiBeanUtils::transformFromNamespaceBO) .collect(Collectors.toCollection(LinkedList::new)); return openNamespaceDTOs; } public static OpenNamespaceLockDTO transformFromNamespaceLockDTO(String namespaceName, NamespaceLockDTO namespaceLock) { OpenNamespaceLockDTO lock = new OpenNamespaceLockDTO(); lock.setNamespaceName(namespaceName); if (namespaceLock == null) { lock.setLocked(false); } else { lock.setLocked(true); lock.setLockedBy(namespaceLock.getDataChangeCreatedBy()); } return lock; } public static OpenGrayReleaseRuleDTO transformFromGrayReleaseRuleDTO( GrayReleaseRuleDTO grayReleaseRuleDTO) { Preconditions.checkArgument(grayReleaseRuleDTO != null); return BeanUtils.transform(OpenGrayReleaseRuleDTO.class, grayReleaseRuleDTO); } public static GrayReleaseRuleDTO transformToGrayReleaseRuleDTO( OpenGrayReleaseRuleDTO openGrayReleaseRuleDTO) { Preconditions.checkArgument(openGrayReleaseRuleDTO != null); String appId = openGrayReleaseRuleDTO.getAppId(); String branchName = openGrayReleaseRuleDTO.getBranchName(); String clusterName = openGrayReleaseRuleDTO.getClusterName(); String namespaceName = openGrayReleaseRuleDTO.getNamespaceName(); GrayReleaseRuleDTO grayReleaseRuleDTO = new GrayReleaseRuleDTO(appId, clusterName, namespaceName, branchName); Set<OpenGrayReleaseRuleItemDTO> openGrayReleaseRuleItemDTOSet = openGrayReleaseRuleDTO.getRuleItems(); openGrayReleaseRuleItemDTOSet.forEach(openGrayReleaseRuleItemDTO -> { String clientAppId = openGrayReleaseRuleItemDTO.getClientAppId(); Set<String> clientIpList = openGrayReleaseRuleItemDTO.getClientIpList(); GrayReleaseRuleItemDTO ruleItem = new GrayReleaseRuleItemDTO(clientAppId, clientIpList); grayReleaseRuleDTO.addRuleItem(ruleItem); }); return grayReleaseRuleDTO; } public static List<OpenAppDTO> transformFromApps(final List<App> apps) { if (CollectionUtils.isEmpty(apps)) { return Collections.emptyList(); } return apps.stream().map(OpenApiBeanUtils::transformFromApp).collect(Collectors.toList()); } public static OpenAppDTO transformFromApp(final App app) { Preconditions.checkArgument(app != null); return BeanUtils.transform(OpenAppDTO.class, app); } public static OpenClusterDTO transformFromClusterDTO(ClusterDTO Cluster) { Preconditions.checkArgument(Cluster != null); return BeanUtils.transform(OpenClusterDTO.class, Cluster); } public static ClusterDTO transformToClusterDTO(OpenClusterDTO openClusterDTO) { Preconditions.checkArgument(openClusterDTO != null); return BeanUtils.transform(ClusterDTO.class, openClusterDTO); } }
package com.ctrip.framework.apollo.openapi.util; import java.lang.reflect.Type; import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; import org.springframework.util.CollectionUtils; import com.ctrip.framework.apollo.common.dto.ClusterDTO; import com.ctrip.framework.apollo.common.dto.GrayReleaseRuleDTO; import com.ctrip.framework.apollo.common.dto.GrayReleaseRuleItemDTO; import com.ctrip.framework.apollo.common.dto.ItemDTO; import com.ctrip.framework.apollo.common.dto.NamespaceLockDTO; import com.ctrip.framework.apollo.common.dto.ReleaseDTO; import com.ctrip.framework.apollo.common.entity.App; import com.ctrip.framework.apollo.common.entity.AppNamespace; import com.ctrip.framework.apollo.common.utils.BeanUtils; import com.ctrip.framework.apollo.openapi.dto.OpenAppDTO; import com.ctrip.framework.apollo.openapi.dto.OpenAppNamespaceDTO; import com.ctrip.framework.apollo.openapi.dto.OpenClusterDTO; import com.ctrip.framework.apollo.openapi.dto.OpenGrayReleaseRuleDTO; import com.ctrip.framework.apollo.openapi.dto.OpenGrayReleaseRuleItemDTO; import com.ctrip.framework.apollo.openapi.dto.OpenItemDTO; import com.ctrip.framework.apollo.openapi.dto.OpenNamespaceDTO; import com.ctrip.framework.apollo.openapi.dto.OpenNamespaceLockDTO; import com.ctrip.framework.apollo.openapi.dto.OpenReleaseDTO; import com.ctrip.framework.apollo.portal.entity.bo.ItemBO; import com.ctrip.framework.apollo.portal.entity.bo.NamespaceBO; import com.google.common.base.Preconditions; import com.google.common.reflect.TypeToken; import com.google.gson.Gson; public class OpenApiBeanUtils { private static final Gson GSON = new Gson(); private static Type type = new TypeToken<Map<String, String>>() {}.getType(); public static OpenItemDTO transformFromItemDTO(ItemDTO item) { Preconditions.checkArgument(item != null); return BeanUtils.transform(OpenItemDTO.class, item); } public static ItemDTO transformToItemDTO(OpenItemDTO openItemDTO) { Preconditions.checkArgument(openItemDTO != null); return BeanUtils.transform(ItemDTO.class, openItemDTO); } public static OpenAppNamespaceDTO transformToOpenAppNamespaceDTO(AppNamespace appNamespace) { Preconditions.checkArgument(appNamespace != null); return BeanUtils.transform(OpenAppNamespaceDTO.class, appNamespace); } public static AppNamespace transformToAppNamespace(OpenAppNamespaceDTO openAppNamespaceDTO) { Preconditions.checkArgument(openAppNamespaceDTO != null); return BeanUtils.transform(AppNamespace.class, openAppNamespaceDTO); } public static OpenReleaseDTO transformFromReleaseDTO(ReleaseDTO release) { Preconditions.checkArgument(release != null); OpenReleaseDTO openReleaseDTO = BeanUtils.transform(OpenReleaseDTO.class, release); Map<String, String> configs = GSON.fromJson(release.getConfigurations(), type); openReleaseDTO.setConfigurations(configs); return openReleaseDTO; } public static OpenNamespaceDTO transformFromNamespaceBO(NamespaceBO namespaceBO) { Preconditions.checkArgument(namespaceBO != null); OpenNamespaceDTO openNamespaceDTO = BeanUtils.transform(OpenNamespaceDTO.class, namespaceBO.getBaseInfo()); // app namespace info openNamespaceDTO.setFormat(namespaceBO.getFormat()); openNamespaceDTO.setComment(namespaceBO.getComment()); openNamespaceDTO.setPublic(namespaceBO.isPublic()); // items List<OpenItemDTO> items = new LinkedList<>(); List<ItemBO> itemBOs = namespaceBO.getItems(); if (!CollectionUtils.isEmpty(itemBOs)) { items.addAll(itemBOs.stream().map(itemBO -> transformFromItemDTO(itemBO.getItem())) .collect(Collectors.toList())); } openNamespaceDTO.setItems(items); return openNamespaceDTO; } public static List<OpenNamespaceDTO> batchTransformFromNamespaceBOs( List<NamespaceBO> namespaceBOs) { if (CollectionUtils.isEmpty(namespaceBOs)) { return Collections.emptyList(); } List<OpenNamespaceDTO> openNamespaceDTOs = namespaceBOs.stream().map(OpenApiBeanUtils::transformFromNamespaceBO) .collect(Collectors.toCollection(LinkedList::new)); return openNamespaceDTOs; } public static OpenNamespaceLockDTO transformFromNamespaceLockDTO(String namespaceName, NamespaceLockDTO namespaceLock) { OpenNamespaceLockDTO lock = new OpenNamespaceLockDTO(); lock.setNamespaceName(namespaceName); if (namespaceLock == null) { lock.setLocked(false); } else { lock.setLocked(true); lock.setLockedBy(namespaceLock.getDataChangeCreatedBy()); } return lock; } public static OpenGrayReleaseRuleDTO transformFromGrayReleaseRuleDTO( GrayReleaseRuleDTO grayReleaseRuleDTO) { Preconditions.checkArgument(grayReleaseRuleDTO != null); return BeanUtils.transform(OpenGrayReleaseRuleDTO.class, grayReleaseRuleDTO); } public static GrayReleaseRuleDTO transformToGrayReleaseRuleDTO( OpenGrayReleaseRuleDTO openGrayReleaseRuleDTO) { Preconditions.checkArgument(openGrayReleaseRuleDTO != null); String appId = openGrayReleaseRuleDTO.getAppId(); String branchName = openGrayReleaseRuleDTO.getBranchName(); String clusterName = openGrayReleaseRuleDTO.getClusterName(); String namespaceName = openGrayReleaseRuleDTO.getNamespaceName(); GrayReleaseRuleDTO grayReleaseRuleDTO = new GrayReleaseRuleDTO(appId, clusterName, namespaceName, branchName); Set<OpenGrayReleaseRuleItemDTO> openGrayReleaseRuleItemDTOSet = openGrayReleaseRuleDTO.getRuleItems(); openGrayReleaseRuleItemDTOSet.forEach(openGrayReleaseRuleItemDTO -> { String clientAppId = openGrayReleaseRuleItemDTO.getClientAppId(); Set<String> clientIpList = openGrayReleaseRuleItemDTO.getClientIpList(); GrayReleaseRuleItemDTO ruleItem = new GrayReleaseRuleItemDTO(clientAppId, clientIpList); grayReleaseRuleDTO.addRuleItem(ruleItem); }); return grayReleaseRuleDTO; } public static List<OpenAppDTO> transformFromApps(final List<App> apps) { if (CollectionUtils.isEmpty(apps)) { return Collections.emptyList(); } return apps.stream().map(OpenApiBeanUtils::transformFromApp).collect(Collectors.toList()); } public static OpenAppDTO transformFromApp(final App app) { Preconditions.checkArgument(app != null); return BeanUtils.transform(OpenAppDTO.class, app); } public static OpenClusterDTO transformFromClusterDTO(ClusterDTO Cluster) { Preconditions.checkArgument(Cluster != null); return BeanUtils.transform(OpenClusterDTO.class, Cluster); } public static ClusterDTO transformToClusterDTO(OpenClusterDTO openClusterDTO) { Preconditions.checkArgument(openClusterDTO != null); return BeanUtils.transform(ClusterDTO.class, openClusterDTO); } }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-portal/src/test/java/com/ctrip/framework/apollo/openapi/filter/ConsumerAuthenticationFilterTest.java
package com.ctrip.framework.apollo.openapi.filter; import com.ctrip.framework.apollo.openapi.util.ConsumerAuditUtil; import com.ctrip.framework.apollo.openapi.util.ConsumerAuthUtil; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import javax.servlet.FilterChain; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.http.HttpHeaders; import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; /** * @author Jason Song([email protected]) */ @RunWith(MockitoJUnitRunner.class) public class ConsumerAuthenticationFilterTest { private ConsumerAuthenticationFilter authenticationFilter; @Mock private ConsumerAuthUtil consumerAuthUtil; @Mock private ConsumerAuditUtil consumerAuditUtil; @Mock private HttpServletRequest request; @Mock private HttpServletResponse response; @Mock private FilterChain filterChain; @Before public void setUp() throws Exception { authenticationFilter = new ConsumerAuthenticationFilter(consumerAuthUtil, consumerAuditUtil); } @Test public void testAuthSuccessfully() throws Exception { String someToken = "someToken"; Long someConsumerId = 1L; when(request.getHeader(HttpHeaders.AUTHORIZATION)).thenReturn(someToken); when(consumerAuthUtil.getConsumerId(someToken)).thenReturn(someConsumerId); authenticationFilter.doFilter(request, response, filterChain); verify(consumerAuthUtil, times(1)).storeConsumerId(request, someConsumerId); verify(consumerAuditUtil, times(1)).audit(request, someConsumerId); verify(filterChain, times(1)).doFilter(request, response); } @Test public void testAuthFailed() throws Exception { String someInvalidToken = "someInvalidToken"; when(request.getHeader(HttpHeaders.AUTHORIZATION)).thenReturn(someInvalidToken); when(consumerAuthUtil.getConsumerId(someInvalidToken)).thenReturn(null); authenticationFilter.doFilter(request, response, filterChain); verify(response, times(1)).sendError(eq(HttpServletResponse.SC_UNAUTHORIZED), anyString()); verify(consumerAuthUtil, never()).storeConsumerId(eq(request), anyLong()); verify(consumerAuditUtil, never()).audit(eq(request), anyLong()); verify(filterChain, never()).doFilter(request, response); } }
package com.ctrip.framework.apollo.openapi.filter; import com.ctrip.framework.apollo.openapi.util.ConsumerAuditUtil; import com.ctrip.framework.apollo.openapi.util.ConsumerAuthUtil; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import javax.servlet.FilterChain; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.http.HttpHeaders; import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; /** * @author Jason Song([email protected]) */ @RunWith(MockitoJUnitRunner.class) public class ConsumerAuthenticationFilterTest { private ConsumerAuthenticationFilter authenticationFilter; @Mock private ConsumerAuthUtil consumerAuthUtil; @Mock private ConsumerAuditUtil consumerAuditUtil; @Mock private HttpServletRequest request; @Mock private HttpServletResponse response; @Mock private FilterChain filterChain; @Before public void setUp() throws Exception { authenticationFilter = new ConsumerAuthenticationFilter(consumerAuthUtil, consumerAuditUtil); } @Test public void testAuthSuccessfully() throws Exception { String someToken = "someToken"; Long someConsumerId = 1L; when(request.getHeader(HttpHeaders.AUTHORIZATION)).thenReturn(someToken); when(consumerAuthUtil.getConsumerId(someToken)).thenReturn(someConsumerId); authenticationFilter.doFilter(request, response, filterChain); verify(consumerAuthUtil, times(1)).storeConsumerId(request, someConsumerId); verify(consumerAuditUtil, times(1)).audit(request, someConsumerId); verify(filterChain, times(1)).doFilter(request, response); } @Test public void testAuthFailed() throws Exception { String someInvalidToken = "someInvalidToken"; when(request.getHeader(HttpHeaders.AUTHORIZATION)).thenReturn(someInvalidToken); when(consumerAuthUtil.getConsumerId(someInvalidToken)).thenReturn(null); authenticationFilter.doFilter(request, response, filterChain); verify(response, times(1)).sendError(eq(HttpServletResponse.SC_UNAUTHORIZED), anyString()); verify(consumerAuthUtil, never()).storeConsumerId(eq(request), anyLong()); verify(consumerAuditUtil, never()).audit(eq(request), anyLong()); verify(filterChain, never()).doFilter(request, response); } }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-portal/src/main/resources/static/vendor/bootstrap/css/bootstrap-theme.min.css
/*! * Bootstrap v3.3.5 (http://getbootstrap.com) * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ /*! * Generated using the Bootstrap Customizer (http://v3.bootcss.com/customize/?id=822d18dc2e4e823a577b) * Config saved to config.json and https://gist.github.com/822d18dc2e4e823a577b *//*! * Bootstrap v3.3.5 (http://getbootstrap.com) * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ .btn-default, .btn-primary, .btn-success, .btn-info, .btn-warning, .btn-danger { text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075) } .btn-default:active, .btn-primary:active, .btn-success:active, .btn-info:active, .btn-warning:active, .btn-danger:active, .btn-default.active, .btn-primary.active, .btn-success.active, .btn-info.active, .btn-warning.active, .btn-danger.active { -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125) } .btn-default.disabled, .btn-primary.disabled, .btn-success.disabled, .btn-info.disabled, .btn-warning.disabled, .btn-danger.disabled, .btn-default[disabled], .btn-primary[disabled], .btn-success[disabled], .btn-info[disabled], .btn-warning[disabled], .btn-danger[disabled], fieldset[disabled] .btn-default, fieldset[disabled] .btn-primary, fieldset[disabled] .btn-success, fieldset[disabled] .btn-info, fieldset[disabled] .btn-warning, fieldset[disabled] .btn-danger { -webkit-box-shadow: none; box-shadow: none } .btn-default .badge, .btn-primary .badge, .btn-success .badge, .btn-info .badge, .btn-warning .badge, .btn-danger .badge { text-shadow: none } .btn:active, .btn.active { background-image: none } .btn-default { background-image: -webkit-linear-gradient(top, #fff 0, #e0e0e0 100%); background-image: -o-linear-gradient(top, #fff 0, #e0e0e0 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), to(#e0e0e0)); background-image: linear-gradient(to bottom, #fff 0, #e0e0e0 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); background-repeat: repeat-x; border-color: #dbdbdb; text-shadow: 0 1px 0 #fff; border-color: #ccc } .btn-default:hover, .btn-default:focus { background-color: #e0e0e0; background-position: 0 -15px } .btn-default:active, .btn-default.active { background-color: #e0e0e0; border-color: #dbdbdb } .btn-default.disabled, .btn-default[disabled], fieldset[disabled] .btn-default, .btn-default.disabled:hover, .btn-default[disabled]:hover, fieldset[disabled] .btn-default:hover, .btn-default.disabled:focus, .btn-default[disabled]:focus, fieldset[disabled] .btn-default:focus, .btn-default.disabled.focus, .btn-default[disabled].focus, fieldset[disabled] .btn-default.focus, .btn-default.disabled:active, .btn-default[disabled]:active, fieldset[disabled] .btn-default:active, .btn-default.disabled.active, .btn-default[disabled].active, fieldset[disabled] .btn-default.active { background-color: #e0e0e0; background-image: none } .btn-primary { background-image: -webkit-linear-gradient(top, #337ab7 0, #265a88 100%); background-image: -o-linear-gradient(top, #337ab7 0, #265a88 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#265a88)); background-image: linear-gradient(to bottom, #337ab7 0, #265a88 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); background-repeat: repeat-x; border-color: #245580 } .btn-primary:hover, .btn-primary:focus { background-color: #265a88; background-position: 0 -15px } .btn-primary:active, .btn-primary.active { background-color: #265a88; border-color: #245580 } .btn-primary.disabled, .btn-primary[disabled], fieldset[disabled] .btn-primary, .btn-primary.disabled:hover, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus, .btn-primary.disabled.focus, .btn-primary[disabled].focus, fieldset[disabled] .btn-primary.focus, .btn-primary.disabled:active, .btn-primary[disabled]:active, fieldset[disabled] .btn-primary:active, .btn-primary.disabled.active, .btn-primary[disabled].active, fieldset[disabled] .btn-primary.active { background-color: #265a88; background-image: none } .btn-success { background-image: -webkit-linear-gradient(top, #5cb85c 0, #419641 100%); background-image: -o-linear-gradient(top, #5cb85c 0, #419641 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #5cb85c), to(#419641)); background-image: linear-gradient(to bottom, #5cb85c 0, #419641 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); background-repeat: repeat-x; border-color: #3e8f3e } .btn-success:hover, .btn-success:focus { background-color: #419641; background-position: 0 -15px } .btn-success:active, .btn-success.active { background-color: #419641; border-color: #3e8f3e } .btn-success.disabled, .btn-success[disabled], fieldset[disabled] .btn-success, .btn-success.disabled:hover, .btn-success[disabled]:hover, fieldset[disabled] .btn-success:hover, .btn-success.disabled:focus, .btn-success[disabled]:focus, fieldset[disabled] .btn-success:focus, .btn-success.disabled.focus, .btn-success[disabled].focus, fieldset[disabled] .btn-success.focus, .btn-success.disabled:active, .btn-success[disabled]:active, fieldset[disabled] .btn-success:active, .btn-success.disabled.active, .btn-success[disabled].active, fieldset[disabled] .btn-success.active { background-color: #419641; background-image: none } .btn-info { background-image: -webkit-linear-gradient(top, #5bc0de 0, #2aabd2 100%); background-image: -o-linear-gradient(top, #5bc0de 0, #2aabd2 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #5bc0de), to(#2aabd2)); background-image: linear-gradient(to bottom, #5bc0de 0, #2aabd2 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); background-repeat: repeat-x; border-color: #28a4c9 } .btn-info:hover, .btn-info:focus { background-color: #2aabd2; background-position: 0 -15px } .btn-info:active, .btn-info.active { background-color: #2aabd2; border-color: #28a4c9 } .btn-info.disabled, .btn-info[disabled], fieldset[disabled] .btn-info, .btn-info.disabled:hover, .btn-info[disabled]:hover, fieldset[disabled] .btn-info:hover, .btn-info.disabled:focus, .btn-info[disabled]:focus, fieldset[disabled] .btn-info:focus, .btn-info.disabled.focus, .btn-info[disabled].focus, fieldset[disabled] .btn-info.focus, .btn-info.disabled:active, .btn-info[disabled]:active, fieldset[disabled] .btn-info:active, .btn-info.disabled.active, .btn-info[disabled].active, fieldset[disabled] .btn-info.active { background-color: #2aabd2; background-image: none } .btn-warning { background-image: -webkit-linear-gradient(top, #f0ad4e 0, #eb9316 100%); background-image: -o-linear-gradient(top, #f0ad4e 0, #eb9316 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f0ad4e), to(#eb9316)); background-image: linear-gradient(to bottom, #f0ad4e 0, #eb9316 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); background-repeat: repeat-x; border-color: #e38d13 } .btn-warning:hover, .btn-warning:focus { background-color: #eb9316; background-position: 0 -15px } .btn-warning:active, .btn-warning.active { background-color: #eb9316; border-color: #e38d13 } .btn-warning.disabled, .btn-warning[disabled], fieldset[disabled] .btn-warning, .btn-warning.disabled:hover, .btn-warning[disabled]:hover, fieldset[disabled] .btn-warning:hover, .btn-warning.disabled:focus, .btn-warning[disabled]:focus, fieldset[disabled] .btn-warning:focus, .btn-warning.disabled.focus, .btn-warning[disabled].focus, fieldset[disabled] .btn-warning.focus, .btn-warning.disabled:active, .btn-warning[disabled]:active, fieldset[disabled] .btn-warning:active, .btn-warning.disabled.active, .btn-warning[disabled].active, fieldset[disabled] .btn-warning.active { background-color: #eb9316; background-image: none } .btn-danger { background-image: -webkit-linear-gradient(top, #d9534f 0, #c12e2a 100%); background-image: -o-linear-gradient(top, #d9534f 0, #c12e2a 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #d9534f), to(#c12e2a)); background-image: linear-gradient(to bottom, #d9534f 0, #c12e2a 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); background-repeat: repeat-x; border-color: #b92c28 } .btn-danger:hover, .btn-danger:focus { background-color: #c12e2a; background-position: 0 -15px } .btn-danger:active, .btn-danger.active { background-color: #c12e2a; border-color: #b92c28 } .btn-danger.disabled, .btn-danger[disabled], fieldset[disabled] .btn-danger, .btn-danger.disabled:hover, .btn-danger[disabled]:hover, fieldset[disabled] .btn-danger:hover, .btn-danger.disabled:focus, .btn-danger[disabled]:focus, fieldset[disabled] .btn-danger:focus, .btn-danger.disabled.focus, .btn-danger[disabled].focus, fieldset[disabled] .btn-danger.focus, .btn-danger.disabled:active, .btn-danger[disabled]:active, fieldset[disabled] .btn-danger:active, .btn-danger.disabled.active, .btn-danger[disabled].active, fieldset[disabled] .btn-danger.active { background-color: #c12e2a; background-image: none } .thumbnail, .img-thumbnail { -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075) } .dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { background-image: -webkit-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%); background-image: -o-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f5f5f5), to(#e8e8e8)); background-image: linear-gradient(to bottom, #f5f5f5 0, #e8e8e8 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); background-color: #e8e8e8 } .dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus { background-image: -webkit-linear-gradient(top, #337ab7 0, #2e6da4 100%); background-image: -o-linear-gradient(top, #337ab7 0, #2e6da4 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#2e6da4)); background-image: linear-gradient(to bottom, #337ab7 0, #2e6da4 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0); background-color: #2e6da4 } .navbar-default { background-image: -webkit-linear-gradient(top, #fff 0, #f8f8f8 100%); background-image: -o-linear-gradient(top, #fff 0, #f8f8f8 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), to(#f8f8f8)); background-image: linear-gradient(to bottom, #fff 0, #f8f8f8 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); border-radius: 4px; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075) } .navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .active > a { background-image: -webkit-linear-gradient(top, #dbdbdb 0, #e2e2e2 100%); background-image: -o-linear-gradient(top, #dbdbdb 0, #e2e2e2 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #dbdbdb), to(#e2e2e2)); background-image: linear-gradient(to bottom, #dbdbdb 0, #e2e2e2 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0); -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075); box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075) } .navbar-brand, .navbar-nav > li > a { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) } .navbar-inverse { background-image: -webkit-linear-gradient(top, #3c3c3c 0, #222 100%); background-image: -o-linear-gradient(top, #3c3c3c 0, #222 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #3c3c3c), to(#222)); background-image: linear-gradient(to bottom, #3c3c3c 0, #222 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); border-radius: 4px } .navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .active > a { background-image: -webkit-linear-gradient(top, #080808 0, #0f0f0f 100%); background-image: -o-linear-gradient(top, #080808 0, #0f0f0f 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #080808), to(#0f0f0f)); background-image: linear-gradient(to bottom, #080808 0, #0f0f0f 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0); -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25); box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25) } .navbar-inverse .navbar-brand, .navbar-inverse .navbar-nav > li > a { text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25) } .navbar-static-top, .navbar-fixed-top, .navbar-fixed-bottom { border-radius: 0 } @media (max-width: 767px) { .navbar .navbar-nav .open .dropdown-menu > .active > a, .navbar .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar .navbar-nav .open .dropdown-menu > .active > a:focus { color: #fff; background-image: -webkit-linear-gradient(top, #337ab7 0, #2e6da4 100%); background-image: -o-linear-gradient(top, #337ab7 0, #2e6da4 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#2e6da4)); background-image: linear-gradient(to bottom, #337ab7 0, #2e6da4 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0) } } .alert { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2); -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05) } .alert-success { background-image: -webkit-linear-gradient(top, #dff0d8 0, #c8e5bc 100%); background-image: -o-linear-gradient(top, #dff0d8 0, #c8e5bc 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #dff0d8), to(#c8e5bc)); background-image: linear-gradient(to bottom, #dff0d8 0, #c8e5bc 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0); border-color: #b2dba1 } .alert-info { background-image: -webkit-linear-gradient(top, #d9edf7 0, #b9def0 100%); background-image: -o-linear-gradient(top, #d9edf7 0, #b9def0 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #d9edf7), to(#b9def0)); background-image: linear-gradient(to bottom, #d9edf7 0, #b9def0 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0); border-color: #9acfea } .alert-warning { background-image: -webkit-linear-gradient(top, #fcf8e3 0, #f8efc0 100%); background-image: -o-linear-gradient(top, #fcf8e3 0, #f8efc0 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fcf8e3), to(#f8efc0)); background-image: linear-gradient(to bottom, #fcf8e3 0, #f8efc0 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0); border-color: #f5e79e } .alert-danger { background-image: -webkit-linear-gradient(top, #f2dede 0, #e7c3c3 100%); background-image: -o-linear-gradient(top, #f2dede 0, #e7c3c3 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f2dede), to(#e7c3c3)); background-image: linear-gradient(to bottom, #f2dede 0, #e7c3c3 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0); border-color: #dca7a7 } .progress { background-image: -webkit-linear-gradient(top, #ebebeb 0, #f5f5f5 100%); background-image: -o-linear-gradient(top, #ebebeb 0, #f5f5f5 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ebebeb), to(#f5f5f5)); background-image: linear-gradient(to bottom, #ebebeb 0, #f5f5f5 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0) } .progress-bar { background-image: -webkit-linear-gradient(top, #337ab7 0, #286090 100%); background-image: -o-linear-gradient(top, #337ab7 0, #286090 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#286090)); background-image: linear-gradient(to bottom, #337ab7 0, #286090 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0) } .progress-bar-success { background-image: -webkit-linear-gradient(top, #5cb85c 0, #449d44 100%); background-image: -o-linear-gradient(top, #5cb85c 0, #449d44 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #5cb85c), to(#449d44)); background-image: linear-gradient(to bottom, #5cb85c 0, #449d44 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0) } .progress-bar-info { background-image: -webkit-linear-gradient(top, #5bc0de 0, #31b0d5 100%); background-image: -o-linear-gradient(top, #5bc0de 0, #31b0d5 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #5bc0de), to(#31b0d5)); background-image: linear-gradient(to bottom, #5bc0de 0, #31b0d5 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0) } .progress-bar-warning { background-image: -webkit-linear-gradient(top, #f0ad4e 0, #ec971f 100%); background-image: -o-linear-gradient(top, #f0ad4e 0, #ec971f 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f0ad4e), to(#ec971f)); background-image: linear-gradient(to bottom, #f0ad4e 0, #ec971f 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0) } .progress-bar-danger { background-image: -webkit-linear-gradient(top, #d9534f 0, #c9302c 100%); background-image: -o-linear-gradient(top, #d9534f 0, #c9302c 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #d9534f), to(#c9302c)); background-image: linear-gradient(to bottom, #d9534f 0, #c9302c 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0) } .progress-bar-striped { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent) } .list-group { border-radius: 4px; -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075) } .list-group-item.active, .list-group-item.active:hover, .list-group-item.active:focus { text-shadow: 0 -1px 0 #286090; background-image: -webkit-linear-gradient(top, #337ab7 0, #2b669a 100%); background-image: -o-linear-gradient(top, #337ab7 0, #2b669a 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#2b669a)); background-image: linear-gradient(to bottom, #337ab7 0, #2b669a 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0); border-color: #2b669a } .list-group-item.active .badge, .list-group-item.active:hover .badge, .list-group-item.active:focus .badge { text-shadow: none } .panel { -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) } .panel-default > .panel-heading { background-image: -webkit-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%); background-image: -o-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f5f5f5), to(#e8e8e8)); background-image: linear-gradient(to bottom, #f5f5f5 0, #e8e8e8 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0) } .panel-primary > .panel-heading { background-image: -webkit-linear-gradient(top, #337ab7 0, #2e6da4 100%); background-image: -o-linear-gradient(top, #337ab7 0, #2e6da4 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#2e6da4)); background-image: linear-gradient(to bottom, #337ab7 0, #2e6da4 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0) } .panel-success > .panel-heading { background-image: -webkit-linear-gradient(top, #dff0d8 0, #d0e9c6 100%); background-image: -o-linear-gradient(top, #dff0d8 0, #d0e9c6 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #dff0d8), to(#d0e9c6)); background-image: linear-gradient(to bottom, #dff0d8 0, #d0e9c6 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0) } .panel-info > .panel-heading { background-image: -webkit-linear-gradient(top, #d9edf7 0, #c4e3f3 100%); background-image: -o-linear-gradient(top, #d9edf7 0, #c4e3f3 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #d9edf7), to(#c4e3f3)); background-image: linear-gradient(to bottom, #d9edf7 0, #c4e3f3 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0) } .panel-warning > .panel-heading { background-image: -webkit-linear-gradient(top, #fcf8e3 0, #faf2cc 100%); background-image: -o-linear-gradient(top, #fcf8e3 0, #faf2cc 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fcf8e3), to(#faf2cc)); background-image: linear-gradient(to bottom, #fcf8e3 0, #faf2cc 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0) } .panel-danger > .panel-heading { background-image: -webkit-linear-gradient(top, #f2dede 0, #ebcccc 100%); background-image: -o-linear-gradient(top, #f2dede 0, #ebcccc 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f2dede), to(#ebcccc)); background-image: linear-gradient(to bottom, #f2dede 0, #ebcccc 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0) } .well { background-image: -webkit-linear-gradient(top, #e8e8e8 0, #f5f5f5 100%); background-image: -o-linear-gradient(top, #e8e8e8 0, #f5f5f5 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #e8e8e8), to(#f5f5f5)); background-image: linear-gradient(to bottom, #e8e8e8 0, #f5f5f5 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0); border-color: #dcdcdc; -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1) }
/*! * Bootstrap v3.3.5 (http://getbootstrap.com) * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ /*! * Generated using the Bootstrap Customizer (http://v3.bootcss.com/customize/?id=822d18dc2e4e823a577b) * Config saved to config.json and https://gist.github.com/822d18dc2e4e823a577b *//*! * Bootstrap v3.3.5 (http://getbootstrap.com) * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ .btn-default, .btn-primary, .btn-success, .btn-info, .btn-warning, .btn-danger { text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075) } .btn-default:active, .btn-primary:active, .btn-success:active, .btn-info:active, .btn-warning:active, .btn-danger:active, .btn-default.active, .btn-primary.active, .btn-success.active, .btn-info.active, .btn-warning.active, .btn-danger.active { -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125) } .btn-default.disabled, .btn-primary.disabled, .btn-success.disabled, .btn-info.disabled, .btn-warning.disabled, .btn-danger.disabled, .btn-default[disabled], .btn-primary[disabled], .btn-success[disabled], .btn-info[disabled], .btn-warning[disabled], .btn-danger[disabled], fieldset[disabled] .btn-default, fieldset[disabled] .btn-primary, fieldset[disabled] .btn-success, fieldset[disabled] .btn-info, fieldset[disabled] .btn-warning, fieldset[disabled] .btn-danger { -webkit-box-shadow: none; box-shadow: none } .btn-default .badge, .btn-primary .badge, .btn-success .badge, .btn-info .badge, .btn-warning .badge, .btn-danger .badge { text-shadow: none } .btn:active, .btn.active { background-image: none } .btn-default { background-image: -webkit-linear-gradient(top, #fff 0, #e0e0e0 100%); background-image: -o-linear-gradient(top, #fff 0, #e0e0e0 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), to(#e0e0e0)); background-image: linear-gradient(to bottom, #fff 0, #e0e0e0 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); background-repeat: repeat-x; border-color: #dbdbdb; text-shadow: 0 1px 0 #fff; border-color: #ccc } .btn-default:hover, .btn-default:focus { background-color: #e0e0e0; background-position: 0 -15px } .btn-default:active, .btn-default.active { background-color: #e0e0e0; border-color: #dbdbdb } .btn-default.disabled, .btn-default[disabled], fieldset[disabled] .btn-default, .btn-default.disabled:hover, .btn-default[disabled]:hover, fieldset[disabled] .btn-default:hover, .btn-default.disabled:focus, .btn-default[disabled]:focus, fieldset[disabled] .btn-default:focus, .btn-default.disabled.focus, .btn-default[disabled].focus, fieldset[disabled] .btn-default.focus, .btn-default.disabled:active, .btn-default[disabled]:active, fieldset[disabled] .btn-default:active, .btn-default.disabled.active, .btn-default[disabled].active, fieldset[disabled] .btn-default.active { background-color: #e0e0e0; background-image: none } .btn-primary { background-image: -webkit-linear-gradient(top, #337ab7 0, #265a88 100%); background-image: -o-linear-gradient(top, #337ab7 0, #265a88 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#265a88)); background-image: linear-gradient(to bottom, #337ab7 0, #265a88 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); background-repeat: repeat-x; border-color: #245580 } .btn-primary:hover, .btn-primary:focus { background-color: #265a88; background-position: 0 -15px } .btn-primary:active, .btn-primary.active { background-color: #265a88; border-color: #245580 } .btn-primary.disabled, .btn-primary[disabled], fieldset[disabled] .btn-primary, .btn-primary.disabled:hover, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus, .btn-primary.disabled.focus, .btn-primary[disabled].focus, fieldset[disabled] .btn-primary.focus, .btn-primary.disabled:active, .btn-primary[disabled]:active, fieldset[disabled] .btn-primary:active, .btn-primary.disabled.active, .btn-primary[disabled].active, fieldset[disabled] .btn-primary.active { background-color: #265a88; background-image: none } .btn-success { background-image: -webkit-linear-gradient(top, #5cb85c 0, #419641 100%); background-image: -o-linear-gradient(top, #5cb85c 0, #419641 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #5cb85c), to(#419641)); background-image: linear-gradient(to bottom, #5cb85c 0, #419641 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); background-repeat: repeat-x; border-color: #3e8f3e } .btn-success:hover, .btn-success:focus { background-color: #419641; background-position: 0 -15px } .btn-success:active, .btn-success.active { background-color: #419641; border-color: #3e8f3e } .btn-success.disabled, .btn-success[disabled], fieldset[disabled] .btn-success, .btn-success.disabled:hover, .btn-success[disabled]:hover, fieldset[disabled] .btn-success:hover, .btn-success.disabled:focus, .btn-success[disabled]:focus, fieldset[disabled] .btn-success:focus, .btn-success.disabled.focus, .btn-success[disabled].focus, fieldset[disabled] .btn-success.focus, .btn-success.disabled:active, .btn-success[disabled]:active, fieldset[disabled] .btn-success:active, .btn-success.disabled.active, .btn-success[disabled].active, fieldset[disabled] .btn-success.active { background-color: #419641; background-image: none } .btn-info { background-image: -webkit-linear-gradient(top, #5bc0de 0, #2aabd2 100%); background-image: -o-linear-gradient(top, #5bc0de 0, #2aabd2 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #5bc0de), to(#2aabd2)); background-image: linear-gradient(to bottom, #5bc0de 0, #2aabd2 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); background-repeat: repeat-x; border-color: #28a4c9 } .btn-info:hover, .btn-info:focus { background-color: #2aabd2; background-position: 0 -15px } .btn-info:active, .btn-info.active { background-color: #2aabd2; border-color: #28a4c9 } .btn-info.disabled, .btn-info[disabled], fieldset[disabled] .btn-info, .btn-info.disabled:hover, .btn-info[disabled]:hover, fieldset[disabled] .btn-info:hover, .btn-info.disabled:focus, .btn-info[disabled]:focus, fieldset[disabled] .btn-info:focus, .btn-info.disabled.focus, .btn-info[disabled].focus, fieldset[disabled] .btn-info.focus, .btn-info.disabled:active, .btn-info[disabled]:active, fieldset[disabled] .btn-info:active, .btn-info.disabled.active, .btn-info[disabled].active, fieldset[disabled] .btn-info.active { background-color: #2aabd2; background-image: none } .btn-warning { background-image: -webkit-linear-gradient(top, #f0ad4e 0, #eb9316 100%); background-image: -o-linear-gradient(top, #f0ad4e 0, #eb9316 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f0ad4e), to(#eb9316)); background-image: linear-gradient(to bottom, #f0ad4e 0, #eb9316 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); background-repeat: repeat-x; border-color: #e38d13 } .btn-warning:hover, .btn-warning:focus { background-color: #eb9316; background-position: 0 -15px } .btn-warning:active, .btn-warning.active { background-color: #eb9316; border-color: #e38d13 } .btn-warning.disabled, .btn-warning[disabled], fieldset[disabled] .btn-warning, .btn-warning.disabled:hover, .btn-warning[disabled]:hover, fieldset[disabled] .btn-warning:hover, .btn-warning.disabled:focus, .btn-warning[disabled]:focus, fieldset[disabled] .btn-warning:focus, .btn-warning.disabled.focus, .btn-warning[disabled].focus, fieldset[disabled] .btn-warning.focus, .btn-warning.disabled:active, .btn-warning[disabled]:active, fieldset[disabled] .btn-warning:active, .btn-warning.disabled.active, .btn-warning[disabled].active, fieldset[disabled] .btn-warning.active { background-color: #eb9316; background-image: none } .btn-danger { background-image: -webkit-linear-gradient(top, #d9534f 0, #c12e2a 100%); background-image: -o-linear-gradient(top, #d9534f 0, #c12e2a 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #d9534f), to(#c12e2a)); background-image: linear-gradient(to bottom, #d9534f 0, #c12e2a 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); background-repeat: repeat-x; border-color: #b92c28 } .btn-danger:hover, .btn-danger:focus { background-color: #c12e2a; background-position: 0 -15px } .btn-danger:active, .btn-danger.active { background-color: #c12e2a; border-color: #b92c28 } .btn-danger.disabled, .btn-danger[disabled], fieldset[disabled] .btn-danger, .btn-danger.disabled:hover, .btn-danger[disabled]:hover, fieldset[disabled] .btn-danger:hover, .btn-danger.disabled:focus, .btn-danger[disabled]:focus, fieldset[disabled] .btn-danger:focus, .btn-danger.disabled.focus, .btn-danger[disabled].focus, fieldset[disabled] .btn-danger.focus, .btn-danger.disabled:active, .btn-danger[disabled]:active, fieldset[disabled] .btn-danger:active, .btn-danger.disabled.active, .btn-danger[disabled].active, fieldset[disabled] .btn-danger.active { background-color: #c12e2a; background-image: none } .thumbnail, .img-thumbnail { -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075) } .dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { background-image: -webkit-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%); background-image: -o-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f5f5f5), to(#e8e8e8)); background-image: linear-gradient(to bottom, #f5f5f5 0, #e8e8e8 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); background-color: #e8e8e8 } .dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus { background-image: -webkit-linear-gradient(top, #337ab7 0, #2e6da4 100%); background-image: -o-linear-gradient(top, #337ab7 0, #2e6da4 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#2e6da4)); background-image: linear-gradient(to bottom, #337ab7 0, #2e6da4 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0); background-color: #2e6da4 } .navbar-default { background-image: -webkit-linear-gradient(top, #fff 0, #f8f8f8 100%); background-image: -o-linear-gradient(top, #fff 0, #f8f8f8 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), to(#f8f8f8)); background-image: linear-gradient(to bottom, #fff 0, #f8f8f8 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); border-radius: 4px; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075) } .navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .active > a { background-image: -webkit-linear-gradient(top, #dbdbdb 0, #e2e2e2 100%); background-image: -o-linear-gradient(top, #dbdbdb 0, #e2e2e2 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #dbdbdb), to(#e2e2e2)); background-image: linear-gradient(to bottom, #dbdbdb 0, #e2e2e2 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0); -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075); box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075) } .navbar-brand, .navbar-nav > li > a { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) } .navbar-inverse { background-image: -webkit-linear-gradient(top, #3c3c3c 0, #222 100%); background-image: -o-linear-gradient(top, #3c3c3c 0, #222 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #3c3c3c), to(#222)); background-image: linear-gradient(to bottom, #3c3c3c 0, #222 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); border-radius: 4px } .navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .active > a { background-image: -webkit-linear-gradient(top, #080808 0, #0f0f0f 100%); background-image: -o-linear-gradient(top, #080808 0, #0f0f0f 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #080808), to(#0f0f0f)); background-image: linear-gradient(to bottom, #080808 0, #0f0f0f 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0); -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25); box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25) } .navbar-inverse .navbar-brand, .navbar-inverse .navbar-nav > li > a { text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25) } .navbar-static-top, .navbar-fixed-top, .navbar-fixed-bottom { border-radius: 0 } @media (max-width: 767px) { .navbar .navbar-nav .open .dropdown-menu > .active > a, .navbar .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar .navbar-nav .open .dropdown-menu > .active > a:focus { color: #fff; background-image: -webkit-linear-gradient(top, #337ab7 0, #2e6da4 100%); background-image: -o-linear-gradient(top, #337ab7 0, #2e6da4 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#2e6da4)); background-image: linear-gradient(to bottom, #337ab7 0, #2e6da4 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0) } } .alert { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2); -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05) } .alert-success { background-image: -webkit-linear-gradient(top, #dff0d8 0, #c8e5bc 100%); background-image: -o-linear-gradient(top, #dff0d8 0, #c8e5bc 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #dff0d8), to(#c8e5bc)); background-image: linear-gradient(to bottom, #dff0d8 0, #c8e5bc 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0); border-color: #b2dba1 } .alert-info { background-image: -webkit-linear-gradient(top, #d9edf7 0, #b9def0 100%); background-image: -o-linear-gradient(top, #d9edf7 0, #b9def0 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #d9edf7), to(#b9def0)); background-image: linear-gradient(to bottom, #d9edf7 0, #b9def0 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0); border-color: #9acfea } .alert-warning { background-image: -webkit-linear-gradient(top, #fcf8e3 0, #f8efc0 100%); background-image: -o-linear-gradient(top, #fcf8e3 0, #f8efc0 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fcf8e3), to(#f8efc0)); background-image: linear-gradient(to bottom, #fcf8e3 0, #f8efc0 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0); border-color: #f5e79e } .alert-danger { background-image: -webkit-linear-gradient(top, #f2dede 0, #e7c3c3 100%); background-image: -o-linear-gradient(top, #f2dede 0, #e7c3c3 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f2dede), to(#e7c3c3)); background-image: linear-gradient(to bottom, #f2dede 0, #e7c3c3 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0); border-color: #dca7a7 } .progress { background-image: -webkit-linear-gradient(top, #ebebeb 0, #f5f5f5 100%); background-image: -o-linear-gradient(top, #ebebeb 0, #f5f5f5 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ebebeb), to(#f5f5f5)); background-image: linear-gradient(to bottom, #ebebeb 0, #f5f5f5 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0) } .progress-bar { background-image: -webkit-linear-gradient(top, #337ab7 0, #286090 100%); background-image: -o-linear-gradient(top, #337ab7 0, #286090 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#286090)); background-image: linear-gradient(to bottom, #337ab7 0, #286090 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0) } .progress-bar-success { background-image: -webkit-linear-gradient(top, #5cb85c 0, #449d44 100%); background-image: -o-linear-gradient(top, #5cb85c 0, #449d44 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #5cb85c), to(#449d44)); background-image: linear-gradient(to bottom, #5cb85c 0, #449d44 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0) } .progress-bar-info { background-image: -webkit-linear-gradient(top, #5bc0de 0, #31b0d5 100%); background-image: -o-linear-gradient(top, #5bc0de 0, #31b0d5 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #5bc0de), to(#31b0d5)); background-image: linear-gradient(to bottom, #5bc0de 0, #31b0d5 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0) } .progress-bar-warning { background-image: -webkit-linear-gradient(top, #f0ad4e 0, #ec971f 100%); background-image: -o-linear-gradient(top, #f0ad4e 0, #ec971f 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f0ad4e), to(#ec971f)); background-image: linear-gradient(to bottom, #f0ad4e 0, #ec971f 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0) } .progress-bar-danger { background-image: -webkit-linear-gradient(top, #d9534f 0, #c9302c 100%); background-image: -o-linear-gradient(top, #d9534f 0, #c9302c 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #d9534f), to(#c9302c)); background-image: linear-gradient(to bottom, #d9534f 0, #c9302c 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0) } .progress-bar-striped { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent) } .list-group { border-radius: 4px; -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075) } .list-group-item.active, .list-group-item.active:hover, .list-group-item.active:focus { text-shadow: 0 -1px 0 #286090; background-image: -webkit-linear-gradient(top, #337ab7 0, #2b669a 100%); background-image: -o-linear-gradient(top, #337ab7 0, #2b669a 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#2b669a)); background-image: linear-gradient(to bottom, #337ab7 0, #2b669a 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0); border-color: #2b669a } .list-group-item.active .badge, .list-group-item.active:hover .badge, .list-group-item.active:focus .badge { text-shadow: none } .panel { -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) } .panel-default > .panel-heading { background-image: -webkit-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%); background-image: -o-linear-gradient(top, #f5f5f5 0, #e8e8e8 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f5f5f5), to(#e8e8e8)); background-image: linear-gradient(to bottom, #f5f5f5 0, #e8e8e8 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0) } .panel-primary > .panel-heading { background-image: -webkit-linear-gradient(top, #337ab7 0, #2e6da4 100%); background-image: -o-linear-gradient(top, #337ab7 0, #2e6da4 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #337ab7), to(#2e6da4)); background-image: linear-gradient(to bottom, #337ab7 0, #2e6da4 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0) } .panel-success > .panel-heading { background-image: -webkit-linear-gradient(top, #dff0d8 0, #d0e9c6 100%); background-image: -o-linear-gradient(top, #dff0d8 0, #d0e9c6 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #dff0d8), to(#d0e9c6)); background-image: linear-gradient(to bottom, #dff0d8 0, #d0e9c6 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0) } .panel-info > .panel-heading { background-image: -webkit-linear-gradient(top, #d9edf7 0, #c4e3f3 100%); background-image: -o-linear-gradient(top, #d9edf7 0, #c4e3f3 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #d9edf7), to(#c4e3f3)); background-image: linear-gradient(to bottom, #d9edf7 0, #c4e3f3 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0) } .panel-warning > .panel-heading { background-image: -webkit-linear-gradient(top, #fcf8e3 0, #faf2cc 100%); background-image: -o-linear-gradient(top, #fcf8e3 0, #faf2cc 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fcf8e3), to(#faf2cc)); background-image: linear-gradient(to bottom, #fcf8e3 0, #faf2cc 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0) } .panel-danger > .panel-heading { background-image: -webkit-linear-gradient(top, #f2dede 0, #ebcccc 100%); background-image: -o-linear-gradient(top, #f2dede 0, #ebcccc 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f2dede), to(#ebcccc)); background-image: linear-gradient(to bottom, #f2dede 0, #ebcccc 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0) } .well { background-image: -webkit-linear-gradient(top, #e8e8e8 0, #f5f5f5 100%); background-image: -o-linear-gradient(top, #e8e8e8 0, #f5f5f5 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #e8e8e8), to(#f5f5f5)); background-image: linear-gradient(to bottom, #e8e8e8 0, #f5f5f5 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0); border-color: #dcdcdc; -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1) }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-openapi/src/main/java/com/ctrip/framework/apollo/openapi/dto/NamespaceGrayDelReleaseDTO.java
package com.ctrip.framework.apollo.openapi.dto; import java.util.Set; public class NamespaceGrayDelReleaseDTO extends NamespaceReleaseDTO { private Set<String> grayDelKeys; public Set<String> getGrayDelKeys() { return grayDelKeys; } public void setGrayDelKeys(Set<String> grayDelKeys) { this.grayDelKeys = grayDelKeys; } }
package com.ctrip.framework.apollo.openapi.dto; import java.util.Set; public class NamespaceGrayDelReleaseDTO extends NamespaceReleaseDTO { private Set<String> grayDelKeys; public Set<String> getGrayDelKeys() { return grayDelKeys; } public void setGrayDelKeys(Set<String> grayDelKeys) { this.grayDelKeys = grayDelKeys; } }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/SsoHeartbeatController.java
package com.ctrip.framework.apollo.portal.controller; import com.ctrip.framework.apollo.portal.spi.SsoHeartbeatHandler; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * Since sso auth information has a limited expiry time, so we need to do sso heartbeat to keep the * information refreshed when unavailable * * @author Jason Song([email protected]) */ @Controller @RequestMapping("/sso_heartbeat") public class SsoHeartbeatController { private final SsoHeartbeatHandler handler; public SsoHeartbeatController(final SsoHeartbeatHandler handler) { this.handler = handler; } @GetMapping public void heartbeat(HttpServletRequest request, HttpServletResponse response) { handler.doHeartbeat(request, response); } }
package com.ctrip.framework.apollo.portal.controller; import com.ctrip.framework.apollo.portal.spi.SsoHeartbeatHandler; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * Since sso auth information has a limited expiry time, so we need to do sso heartbeat to keep the * information refreshed when unavailable * * @author Jason Song([email protected]) */ @Controller @RequestMapping("/sso_heartbeat") public class SsoHeartbeatController { private final SsoHeartbeatHandler handler; public SsoHeartbeatController(final SsoHeartbeatHandler handler) { this.handler = handler; } @GetMapping public void heartbeat(HttpServletRequest request, HttpServletResponse response) { handler.doHeartbeat(request, response); } }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-core/src/test/resources/properties/server.properties
idc=SHAJQ env=DEV subenv=Dev123 bigdata=true tooling=true pci=true
idc=SHAJQ env=DEV subenv=Dev123 bigdata=true tooling=true pci=true
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-openapi/src/test/java/com/ctrip/framework/apollo/openapi/client/ApolloOpenApiClientTest.java
package com.ctrip.framework.apollo.openapi.client; import static org.junit.Assert.*; import org.junit.Test; public class ApolloOpenApiClientTest { @Test public void testCreate() { String someUrl = "http://someUrl"; String someToken = "someToken"; ApolloOpenApiClient client = ApolloOpenApiClient.newBuilder().withPortalUrl(someUrl).withToken(someToken).build(); assertEquals(someUrl, client.getPortalUrl()); assertEquals(someToken, client.getToken()); } @Test(expected = IllegalArgumentException.class) public void testCreateWithInvalidUrl() { String someInvalidUrl = "someInvalidUrl"; String someToken = "someToken"; ApolloOpenApiClient.newBuilder().withPortalUrl(someInvalidUrl).withToken(someToken).build(); } }
package com.ctrip.framework.apollo.openapi.client; import static org.junit.Assert.*; import org.junit.Test; public class ApolloOpenApiClientTest { @Test public void testCreate() { String someUrl = "http://someUrl"; String someToken = "someToken"; ApolloOpenApiClient client = ApolloOpenApiClient.newBuilder().withPortalUrl(someUrl).withToken(someToken).build(); assertEquals(someUrl, client.getPortalUrl()); assertEquals(someToken, client.getToken()); } @Test(expected = IllegalArgumentException.class) public void testCreateWithInvalidUrl() { String someInvalidUrl = "someInvalidUrl"; String someToken = "someToken"; ApolloOpenApiClient.newBuilder().withPortalUrl(someInvalidUrl).withToken(someToken).build(); } }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/RetryableRestTemplateTest.java
package com.ctrip.framework.apollo.portal; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.isNull; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import com.ctrip.framework.apollo.common.exception.ServiceException; import com.ctrip.framework.apollo.core.dto.ServiceDTO; import com.ctrip.framework.apollo.portal.component.AdminServiceAddressLocator; import com.ctrip.framework.apollo.portal.component.RetryableRestTemplate; import com.ctrip.framework.apollo.portal.component.config.PortalConfig; import com.ctrip.framework.apollo.portal.environment.Env; import com.ctrip.framework.apollo.portal.environment.PortalMetaDomainService; import com.google.common.collect.Maps; import com.google.gson.Gson; import java.net.SocketTimeoutException; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; import org.apache.http.HttpHost; import org.apache.http.conn.ConnectTimeoutException; import org.apache.http.conn.HttpHostConnectException; import org.junit.Before; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.InjectMocks; import org.mockito.Mock; import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.web.client.ResourceAccessException; import org.springframework.web.client.RestTemplate; public class RetryableRestTemplateTest extends AbstractUnitTest { @Mock private AdminServiceAddressLocator serviceAddressLocator; @Mock private RestTemplate restTemplate; @Mock private PortalMetaDomainService portalMetaDomainService; @Mock private PortalConfig portalConfig; @InjectMocks private RetryableRestTemplate retryableRestTemplate; private static final Gson GSON = new Gson(); private String path = "app"; private String serviceOne = "http://10.0.0.1"; private String serviceTwo = "http://10.0.0.2"; private String serviceThree = "http://10.0.0.3"; private ResourceAccessException socketTimeoutException = new ResourceAccessException(""); private ResourceAccessException httpHostConnectException = new ResourceAccessException(""); private ResourceAccessException connectTimeoutException = new ResourceAccessException(""); private Object request = new Object(); private Object result = new Object(); private Class<?> requestType = request.getClass(); @Before public void init() { socketTimeoutException.initCause(new SocketTimeoutException()); httpHostConnectException .initCause(new HttpHostConnectException(new ConnectTimeoutException(), new HttpHost(serviceOne, 80))); connectTimeoutException.initCause(new ConnectTimeoutException()); } @Test(expected = ServiceException.class) public void testNoAdminServer() { when(serviceAddressLocator.getServiceList(any())).thenReturn(Collections.emptyList()); retryableRestTemplate.get(Env.DEV, path, Object.class); } @Test(expected = ServiceException.class) public void testAllServerDown() { when(serviceAddressLocator.getServiceList(any())) .thenReturn(Arrays .asList(mockService(serviceOne), mockService(serviceTwo), mockService(serviceThree))); when(restTemplate .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class))).thenThrow(socketTimeoutException); when(restTemplate .exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class))).thenThrow(httpHostConnectException); when(restTemplate .exchange(eq(serviceThree + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class))).thenThrow(connectTimeoutException); retryableRestTemplate.get(Env.DEV, path, Object.class); verify(restTemplate, times(1)) .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class)); verify(restTemplate, times(1)) .exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class)); verify(restTemplate, times(1)) .exchange(eq(serviceThree + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class)); } @Test public void testOneServerDown() { ResponseEntity someEntity = mock(ResponseEntity.class); when(someEntity.getBody()).thenReturn(result); when(serviceAddressLocator.getServiceList(any())) .thenReturn(Arrays .asList(mockService(serviceOne), mockService(serviceTwo), mockService(serviceThree))); when(restTemplate .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class))).thenThrow(socketTimeoutException); when(restTemplate .exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class))).thenReturn(someEntity); when(restTemplate .exchange(eq(serviceThree + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class))).thenThrow(connectTimeoutException); Object actualResult = retryableRestTemplate.get(Env.DEV, path, Object.class); verify(restTemplate, times(1)) .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class)); verify(restTemplate, times(1)) .exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class)); verify(restTemplate, never()) .exchange(eq(serviceThree + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class)); assertEquals(result, actualResult); } @Test public void testPostSocketTimeoutNotRetry() { ResponseEntity someEntity = mock(ResponseEntity.class); when(someEntity.getBody()).thenReturn(result); when(serviceAddressLocator.getServiceList(any())) .thenReturn(Arrays .asList(mockService(serviceOne), mockService(serviceTwo), mockService(serviceThree))); when(restTemplate .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class), eq(Object.class))).thenThrow(socketTimeoutException); when(restTemplate .exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class), eq(Object.class))).thenReturn(someEntity); Throwable exception = null; Object actualResult = null; try { actualResult = retryableRestTemplate.post(Env.DEV, path, request, Object.class); } catch (Throwable ex) { exception = ex; } assertNull(actualResult); assertSame(socketTimeoutException, exception); verify(restTemplate, times(1)) .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class), eq(Object.class)); verify(restTemplate, never()) .exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class), eq(Object.class)); } @Test public void testDelete() { ResponseEntity someEntity = mock(ResponseEntity.class); when(serviceAddressLocator.getServiceList(any())) .thenReturn(Arrays .asList(mockService(serviceOne), mockService(serviceTwo), mockService(serviceThree))); when(restTemplate .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.DELETE), any(HttpEntity.class), (Class<Object>) isNull())).thenReturn(someEntity); retryableRestTemplate.delete(Env.DEV, path); verify(restTemplate) .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.DELETE), any(HttpEntity.class), (Class<Object>) isNull()); } @Test public void testPut() { ResponseEntity someEntity = mock(ResponseEntity.class); when(serviceAddressLocator.getServiceList(any())) .thenReturn(Arrays .asList(mockService(serviceOne), mockService(serviceTwo), mockService(serviceThree))); when(restTemplate .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.PUT), any(HttpEntity.class), (Class<Object>) isNull())).thenReturn(someEntity); retryableRestTemplate.put(Env.DEV, path, request); ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class); verify(restTemplate) .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.PUT), argumentCaptor.capture(), (Class<Object>) isNull()); assertEquals(request, argumentCaptor.getValue().getBody()); } @Test public void testPostObjectWithNoAccessToken() { Env someEnv = Env.DEV; ResponseEntity someEntity = mock(ResponseEntity.class); when(serviceAddressLocator.getServiceList(someEnv)) .thenReturn(Collections.singletonList(mockService(serviceOne))); when(restTemplate .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class), eq(requestType))).thenReturn(someEntity); when(someEntity.getBody()).thenReturn(result); Object actualResult = retryableRestTemplate.post(someEnv, path, request, requestType); assertEquals(result, actualResult); ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class); verify(restTemplate, times(1)) .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), argumentCaptor.capture(), eq(requestType)); HttpEntity entity = argumentCaptor.getValue(); HttpHeaders headers = entity.getHeaders(); assertSame(request, entity.getBody()); assertTrue(headers.isEmpty()); } @Test public void testPostObjectWithAccessToken() { Env someEnv = Env.DEV; String someToken = "someToken"; ResponseEntity someEntity = mock(ResponseEntity.class); when(portalConfig.getAdminServiceAccessTokens()) .thenReturn(mockAdminServiceTokens(someEnv, someToken)); when(serviceAddressLocator.getServiceList(someEnv)) .thenReturn(Collections.singletonList(mockService(serviceOne))); when(restTemplate .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class), eq(requestType))).thenReturn(someEntity); when(someEntity.getBody()).thenReturn(result); Object actualResult = retryableRestTemplate.post(someEnv, path, request, requestType); assertEquals(result, actualResult); ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class); verify(restTemplate, times(1)) .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), argumentCaptor.capture(), eq(requestType)); HttpEntity entity = argumentCaptor.getValue(); HttpHeaders headers = entity.getHeaders(); List<String> headerValue = headers.get(HttpHeaders.AUTHORIZATION); assertSame(request, entity.getBody()); assertEquals(1, headers.size()); assertEquals(1, headerValue.size()); assertEquals(someToken, headerValue.get(0)); } @Test public void testPostObjectWithNoAccessTokenForEnv() { Env someEnv = Env.DEV; Env anotherEnv = Env.PRO; String someToken = "someToken"; ResponseEntity someEntity = mock(ResponseEntity.class); when(portalConfig.getAdminServiceAccessTokens()) .thenReturn(mockAdminServiceTokens(someEnv, someToken)); when(serviceAddressLocator.getServiceList(someEnv)) .thenReturn(Collections.singletonList(mockService(serviceOne))); when(serviceAddressLocator.getServiceList(anotherEnv)) .thenReturn(Collections.singletonList(mockService(serviceTwo))); when(restTemplate .exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class), eq(requestType))).thenReturn(someEntity); when(someEntity.getBody()).thenReturn(result); Object actualResult = retryableRestTemplate.post(anotherEnv, path, request, requestType); assertEquals(result, actualResult); ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class); verify(restTemplate, times(1)) .exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.POST), argumentCaptor.capture(), eq(requestType)); HttpEntity entity = argumentCaptor.getValue(); HttpHeaders headers = entity.getHeaders(); assertSame(request, entity.getBody()); assertTrue(headers.isEmpty()); } @Test public void testPostEntityWithNoAccessToken() { Env someEnv = Env.DEV; String originalHeader = "someHeader"; String originalValue = "someValue"; HttpHeaders originalHeaders = new HttpHeaders(); originalHeaders.add(originalHeader, originalValue); HttpEntity<Object> requestEntity = new HttpEntity<>(request, originalHeaders); ResponseEntity someEntity = mock(ResponseEntity.class); when(serviceAddressLocator.getServiceList(someEnv)) .thenReturn(Collections.singletonList(mockService(serviceOne))); when(restTemplate .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class), eq(requestType))).thenReturn(someEntity); when(someEntity.getBody()).thenReturn(result); Object actualResult = retryableRestTemplate.post(someEnv, path, requestEntity, requestType); assertEquals(result, actualResult); ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class); verify(restTemplate, times(1)) .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), argumentCaptor.capture(), eq(requestType)); HttpEntity entity = argumentCaptor.getValue(); assertSame(requestEntity, entity); assertSame(request, entity.getBody()); assertEquals(originalHeaders, entity.getHeaders()); } @Test public void testPostEntityWithAccessToken() { Env someEnv = Env.DEV; String someToken = "someToken"; String originalHeader = "someHeader"; String originalValue = "someValue"; HttpHeaders originalHeaders = new HttpHeaders(); originalHeaders.add(originalHeader, originalValue); HttpEntity<Object> requestEntity = new HttpEntity<>(request, originalHeaders); ResponseEntity someEntity = mock(ResponseEntity.class); when(portalConfig.getAdminServiceAccessTokens()) .thenReturn(mockAdminServiceTokens(someEnv, someToken)); when(serviceAddressLocator.getServiceList(someEnv)) .thenReturn(Collections.singletonList(mockService(serviceOne))); when(restTemplate .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class), eq(requestType))).thenReturn(someEntity); when(someEntity.getBody()).thenReturn(result); Object actualResult = retryableRestTemplate.post(someEnv, path, requestEntity, requestType); assertEquals(result, actualResult); ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class); verify(restTemplate, times(1)) .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), argumentCaptor.capture(), eq(requestType)); HttpEntity entity = argumentCaptor.getValue(); HttpHeaders headers = entity.getHeaders(); assertSame(request, entity.getBody()); assertEquals(2, headers.size()); assertEquals(originalValue, headers.get(originalHeader).get(0)); assertEquals(someToken, headers.get(HttpHeaders.AUTHORIZATION).get(0)); } @Test public void testGetEntityWithNoAccessToken() { Env someEnv = Env.DEV; ParameterizedTypeReference requestType = mock(ParameterizedTypeReference.class); ResponseEntity someEntity = mock(ResponseEntity.class); when(serviceAddressLocator.getServiceList(someEnv)) .thenReturn(Collections.singletonList(mockService(serviceOne))); when(restTemplate .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(requestType))).thenReturn(someEntity); ResponseEntity actualResult = retryableRestTemplate.get(someEnv, path, requestType); assertEquals(someEntity, actualResult); ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class); verify(restTemplate, times(1)) .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), argumentCaptor.capture(), eq(requestType)); HttpHeaders headers = argumentCaptor.getValue().getHeaders(); assertTrue(headers.isEmpty()); } @Test public void testGetEntityWithAccessToken() { Env someEnv = Env.DEV; String someToken = "someToken"; ParameterizedTypeReference requestType = mock(ParameterizedTypeReference.class); ResponseEntity someEntity = mock(ResponseEntity.class); when(portalConfig.getAdminServiceAccessTokens()) .thenReturn(mockAdminServiceTokens(someEnv, someToken)); when(serviceAddressLocator.getServiceList(someEnv)) .thenReturn(Collections.singletonList(mockService(serviceOne))); when(restTemplate .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(requestType))).thenReturn(someEntity); ResponseEntity actualResult = retryableRestTemplate.get(someEnv, path, requestType); assertEquals(someEntity, actualResult); ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class); verify(restTemplate, times(1)) .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), argumentCaptor.capture(), eq(requestType)); HttpHeaders headers = argumentCaptor.getValue().getHeaders(); List<String> headerValue = headers.get(HttpHeaders.AUTHORIZATION); assertEquals(1, headers.size()); assertEquals(1, headerValue.size()); assertEquals(someToken, headerValue.get(0)); } @Test public void testGetEntityWithNoAccessTokenForEnv() { Env someEnv = Env.DEV; Env anotherEnv = Env.PRO; String someToken = "someToken"; ParameterizedTypeReference requestType = mock(ParameterizedTypeReference.class); ResponseEntity someEntity = mock(ResponseEntity.class); when(portalConfig.getAdminServiceAccessTokens()) .thenReturn(mockAdminServiceTokens(someEnv, someToken)); when(serviceAddressLocator.getServiceList(someEnv)) .thenReturn(Collections.singletonList(mockService(serviceOne))); when(serviceAddressLocator.getServiceList(anotherEnv)) .thenReturn(Collections.singletonList(mockService(serviceTwo))); when(restTemplate .exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(requestType))).thenReturn(someEntity); ResponseEntity actualResult = retryableRestTemplate.get(anotherEnv, path, requestType); assertEquals(someEntity, actualResult); ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class); verify(restTemplate, times(1)) .exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), argumentCaptor.capture(), eq(requestType)); HttpHeaders headers = argumentCaptor.getValue().getHeaders(); assertTrue(headers.isEmpty()); } private String mockAdminServiceTokens(Env env, String token) { Map<String, String> tokenMap = Maps.newHashMap(); tokenMap.put(env.getName(), token); return GSON.toJson(tokenMap); } private ServiceDTO mockService(String homeUrl) { ServiceDTO serviceDTO = new ServiceDTO(); serviceDTO.setHomepageUrl(homeUrl); return serviceDTO; } }
package com.ctrip.framework.apollo.portal; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.isNull; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import com.ctrip.framework.apollo.common.exception.ServiceException; import com.ctrip.framework.apollo.core.dto.ServiceDTO; import com.ctrip.framework.apollo.portal.component.AdminServiceAddressLocator; import com.ctrip.framework.apollo.portal.component.RetryableRestTemplate; import com.ctrip.framework.apollo.portal.component.config.PortalConfig; import com.ctrip.framework.apollo.portal.environment.Env; import com.ctrip.framework.apollo.portal.environment.PortalMetaDomainService; import com.google.common.collect.Maps; import com.google.gson.Gson; import java.net.SocketTimeoutException; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; import org.apache.http.HttpHost; import org.apache.http.conn.ConnectTimeoutException; import org.apache.http.conn.HttpHostConnectException; import org.junit.Before; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.InjectMocks; import org.mockito.Mock; import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.web.client.ResourceAccessException; import org.springframework.web.client.RestTemplate; public class RetryableRestTemplateTest extends AbstractUnitTest { @Mock private AdminServiceAddressLocator serviceAddressLocator; @Mock private RestTemplate restTemplate; @Mock private PortalMetaDomainService portalMetaDomainService; @Mock private PortalConfig portalConfig; @InjectMocks private RetryableRestTemplate retryableRestTemplate; private static final Gson GSON = new Gson(); private String path = "app"; private String serviceOne = "http://10.0.0.1"; private String serviceTwo = "http://10.0.0.2"; private String serviceThree = "http://10.0.0.3"; private ResourceAccessException socketTimeoutException = new ResourceAccessException(""); private ResourceAccessException httpHostConnectException = new ResourceAccessException(""); private ResourceAccessException connectTimeoutException = new ResourceAccessException(""); private Object request = new Object(); private Object result = new Object(); private Class<?> requestType = request.getClass(); @Before public void init() { socketTimeoutException.initCause(new SocketTimeoutException()); httpHostConnectException .initCause(new HttpHostConnectException(new ConnectTimeoutException(), new HttpHost(serviceOne, 80))); connectTimeoutException.initCause(new ConnectTimeoutException()); } @Test(expected = ServiceException.class) public void testNoAdminServer() { when(serviceAddressLocator.getServiceList(any())).thenReturn(Collections.emptyList()); retryableRestTemplate.get(Env.DEV, path, Object.class); } @Test(expected = ServiceException.class) public void testAllServerDown() { when(serviceAddressLocator.getServiceList(any())) .thenReturn(Arrays .asList(mockService(serviceOne), mockService(serviceTwo), mockService(serviceThree))); when(restTemplate .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class))).thenThrow(socketTimeoutException); when(restTemplate .exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class))).thenThrow(httpHostConnectException); when(restTemplate .exchange(eq(serviceThree + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class))).thenThrow(connectTimeoutException); retryableRestTemplate.get(Env.DEV, path, Object.class); verify(restTemplate, times(1)) .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class)); verify(restTemplate, times(1)) .exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class)); verify(restTemplate, times(1)) .exchange(eq(serviceThree + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class)); } @Test public void testOneServerDown() { ResponseEntity someEntity = mock(ResponseEntity.class); when(someEntity.getBody()).thenReturn(result); when(serviceAddressLocator.getServiceList(any())) .thenReturn(Arrays .asList(mockService(serviceOne), mockService(serviceTwo), mockService(serviceThree))); when(restTemplate .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class))).thenThrow(socketTimeoutException); when(restTemplate .exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class))).thenReturn(someEntity); when(restTemplate .exchange(eq(serviceThree + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class))).thenThrow(connectTimeoutException); Object actualResult = retryableRestTemplate.get(Env.DEV, path, Object.class); verify(restTemplate, times(1)) .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class)); verify(restTemplate, times(1)) .exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class)); verify(restTemplate, never()) .exchange(eq(serviceThree + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(Object.class)); assertEquals(result, actualResult); } @Test public void testPostSocketTimeoutNotRetry() { ResponseEntity someEntity = mock(ResponseEntity.class); when(someEntity.getBody()).thenReturn(result); when(serviceAddressLocator.getServiceList(any())) .thenReturn(Arrays .asList(mockService(serviceOne), mockService(serviceTwo), mockService(serviceThree))); when(restTemplate .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class), eq(Object.class))).thenThrow(socketTimeoutException); when(restTemplate .exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class), eq(Object.class))).thenReturn(someEntity); Throwable exception = null; Object actualResult = null; try { actualResult = retryableRestTemplate.post(Env.DEV, path, request, Object.class); } catch (Throwable ex) { exception = ex; } assertNull(actualResult); assertSame(socketTimeoutException, exception); verify(restTemplate, times(1)) .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class), eq(Object.class)); verify(restTemplate, never()) .exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class), eq(Object.class)); } @Test public void testDelete() { ResponseEntity someEntity = mock(ResponseEntity.class); when(serviceAddressLocator.getServiceList(any())) .thenReturn(Arrays .asList(mockService(serviceOne), mockService(serviceTwo), mockService(serviceThree))); when(restTemplate .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.DELETE), any(HttpEntity.class), (Class<Object>) isNull())).thenReturn(someEntity); retryableRestTemplate.delete(Env.DEV, path); verify(restTemplate) .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.DELETE), any(HttpEntity.class), (Class<Object>) isNull()); } @Test public void testPut() { ResponseEntity someEntity = mock(ResponseEntity.class); when(serviceAddressLocator.getServiceList(any())) .thenReturn(Arrays .asList(mockService(serviceOne), mockService(serviceTwo), mockService(serviceThree))); when(restTemplate .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.PUT), any(HttpEntity.class), (Class<Object>) isNull())).thenReturn(someEntity); retryableRestTemplate.put(Env.DEV, path, request); ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class); verify(restTemplate) .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.PUT), argumentCaptor.capture(), (Class<Object>) isNull()); assertEquals(request, argumentCaptor.getValue().getBody()); } @Test public void testPostObjectWithNoAccessToken() { Env someEnv = Env.DEV; ResponseEntity someEntity = mock(ResponseEntity.class); when(serviceAddressLocator.getServiceList(someEnv)) .thenReturn(Collections.singletonList(mockService(serviceOne))); when(restTemplate .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class), eq(requestType))).thenReturn(someEntity); when(someEntity.getBody()).thenReturn(result); Object actualResult = retryableRestTemplate.post(someEnv, path, request, requestType); assertEquals(result, actualResult); ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class); verify(restTemplate, times(1)) .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), argumentCaptor.capture(), eq(requestType)); HttpEntity entity = argumentCaptor.getValue(); HttpHeaders headers = entity.getHeaders(); assertSame(request, entity.getBody()); assertTrue(headers.isEmpty()); } @Test public void testPostObjectWithAccessToken() { Env someEnv = Env.DEV; String someToken = "someToken"; ResponseEntity someEntity = mock(ResponseEntity.class); when(portalConfig.getAdminServiceAccessTokens()) .thenReturn(mockAdminServiceTokens(someEnv, someToken)); when(serviceAddressLocator.getServiceList(someEnv)) .thenReturn(Collections.singletonList(mockService(serviceOne))); when(restTemplate .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class), eq(requestType))).thenReturn(someEntity); when(someEntity.getBody()).thenReturn(result); Object actualResult = retryableRestTemplate.post(someEnv, path, request, requestType); assertEquals(result, actualResult); ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class); verify(restTemplate, times(1)) .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), argumentCaptor.capture(), eq(requestType)); HttpEntity entity = argumentCaptor.getValue(); HttpHeaders headers = entity.getHeaders(); List<String> headerValue = headers.get(HttpHeaders.AUTHORIZATION); assertSame(request, entity.getBody()); assertEquals(1, headers.size()); assertEquals(1, headerValue.size()); assertEquals(someToken, headerValue.get(0)); } @Test public void testPostObjectWithNoAccessTokenForEnv() { Env someEnv = Env.DEV; Env anotherEnv = Env.PRO; String someToken = "someToken"; ResponseEntity someEntity = mock(ResponseEntity.class); when(portalConfig.getAdminServiceAccessTokens()) .thenReturn(mockAdminServiceTokens(someEnv, someToken)); when(serviceAddressLocator.getServiceList(someEnv)) .thenReturn(Collections.singletonList(mockService(serviceOne))); when(serviceAddressLocator.getServiceList(anotherEnv)) .thenReturn(Collections.singletonList(mockService(serviceTwo))); when(restTemplate .exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class), eq(requestType))).thenReturn(someEntity); when(someEntity.getBody()).thenReturn(result); Object actualResult = retryableRestTemplate.post(anotherEnv, path, request, requestType); assertEquals(result, actualResult); ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class); verify(restTemplate, times(1)) .exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.POST), argumentCaptor.capture(), eq(requestType)); HttpEntity entity = argumentCaptor.getValue(); HttpHeaders headers = entity.getHeaders(); assertSame(request, entity.getBody()); assertTrue(headers.isEmpty()); } @Test public void testPostEntityWithNoAccessToken() { Env someEnv = Env.DEV; String originalHeader = "someHeader"; String originalValue = "someValue"; HttpHeaders originalHeaders = new HttpHeaders(); originalHeaders.add(originalHeader, originalValue); HttpEntity<Object> requestEntity = new HttpEntity<>(request, originalHeaders); ResponseEntity someEntity = mock(ResponseEntity.class); when(serviceAddressLocator.getServiceList(someEnv)) .thenReturn(Collections.singletonList(mockService(serviceOne))); when(restTemplate .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class), eq(requestType))).thenReturn(someEntity); when(someEntity.getBody()).thenReturn(result); Object actualResult = retryableRestTemplate.post(someEnv, path, requestEntity, requestType); assertEquals(result, actualResult); ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class); verify(restTemplate, times(1)) .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), argumentCaptor.capture(), eq(requestType)); HttpEntity entity = argumentCaptor.getValue(); assertSame(requestEntity, entity); assertSame(request, entity.getBody()); assertEquals(originalHeaders, entity.getHeaders()); } @Test public void testPostEntityWithAccessToken() { Env someEnv = Env.DEV; String someToken = "someToken"; String originalHeader = "someHeader"; String originalValue = "someValue"; HttpHeaders originalHeaders = new HttpHeaders(); originalHeaders.add(originalHeader, originalValue); HttpEntity<Object> requestEntity = new HttpEntity<>(request, originalHeaders); ResponseEntity someEntity = mock(ResponseEntity.class); when(portalConfig.getAdminServiceAccessTokens()) .thenReturn(mockAdminServiceTokens(someEnv, someToken)); when(serviceAddressLocator.getServiceList(someEnv)) .thenReturn(Collections.singletonList(mockService(serviceOne))); when(restTemplate .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), any(HttpEntity.class), eq(requestType))).thenReturn(someEntity); when(someEntity.getBody()).thenReturn(result); Object actualResult = retryableRestTemplate.post(someEnv, path, requestEntity, requestType); assertEquals(result, actualResult); ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class); verify(restTemplate, times(1)) .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.POST), argumentCaptor.capture(), eq(requestType)); HttpEntity entity = argumentCaptor.getValue(); HttpHeaders headers = entity.getHeaders(); assertSame(request, entity.getBody()); assertEquals(2, headers.size()); assertEquals(originalValue, headers.get(originalHeader).get(0)); assertEquals(someToken, headers.get(HttpHeaders.AUTHORIZATION).get(0)); } @Test public void testGetEntityWithNoAccessToken() { Env someEnv = Env.DEV; ParameterizedTypeReference requestType = mock(ParameterizedTypeReference.class); ResponseEntity someEntity = mock(ResponseEntity.class); when(serviceAddressLocator.getServiceList(someEnv)) .thenReturn(Collections.singletonList(mockService(serviceOne))); when(restTemplate .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(requestType))).thenReturn(someEntity); ResponseEntity actualResult = retryableRestTemplate.get(someEnv, path, requestType); assertEquals(someEntity, actualResult); ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class); verify(restTemplate, times(1)) .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), argumentCaptor.capture(), eq(requestType)); HttpHeaders headers = argumentCaptor.getValue().getHeaders(); assertTrue(headers.isEmpty()); } @Test public void testGetEntityWithAccessToken() { Env someEnv = Env.DEV; String someToken = "someToken"; ParameterizedTypeReference requestType = mock(ParameterizedTypeReference.class); ResponseEntity someEntity = mock(ResponseEntity.class); when(portalConfig.getAdminServiceAccessTokens()) .thenReturn(mockAdminServiceTokens(someEnv, someToken)); when(serviceAddressLocator.getServiceList(someEnv)) .thenReturn(Collections.singletonList(mockService(serviceOne))); when(restTemplate .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(requestType))).thenReturn(someEntity); ResponseEntity actualResult = retryableRestTemplate.get(someEnv, path, requestType); assertEquals(someEntity, actualResult); ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class); verify(restTemplate, times(1)) .exchange(eq(serviceOne + "/" + path), eq(HttpMethod.GET), argumentCaptor.capture(), eq(requestType)); HttpHeaders headers = argumentCaptor.getValue().getHeaders(); List<String> headerValue = headers.get(HttpHeaders.AUTHORIZATION); assertEquals(1, headers.size()); assertEquals(1, headerValue.size()); assertEquals(someToken, headerValue.get(0)); } @Test public void testGetEntityWithNoAccessTokenForEnv() { Env someEnv = Env.DEV; Env anotherEnv = Env.PRO; String someToken = "someToken"; ParameterizedTypeReference requestType = mock(ParameterizedTypeReference.class); ResponseEntity someEntity = mock(ResponseEntity.class); when(portalConfig.getAdminServiceAccessTokens()) .thenReturn(mockAdminServiceTokens(someEnv, someToken)); when(serviceAddressLocator.getServiceList(someEnv)) .thenReturn(Collections.singletonList(mockService(serviceOne))); when(serviceAddressLocator.getServiceList(anotherEnv)) .thenReturn(Collections.singletonList(mockService(serviceTwo))); when(restTemplate .exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), any(HttpEntity.class), eq(requestType))).thenReturn(someEntity); ResponseEntity actualResult = retryableRestTemplate.get(anotherEnv, path, requestType); assertEquals(someEntity, actualResult); ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class); verify(restTemplate, times(1)) .exchange(eq(serviceTwo + "/" + path), eq(HttpMethod.GET), argumentCaptor.capture(), eq(requestType)); HttpHeaders headers = argumentCaptor.getValue().getHeaders(); assertTrue(headers.isEmpty()); } private String mockAdminServiceTokens(Env env, String token) { Map<String, String> tokenMap = Maps.newHashMap(); tokenMap.put(env.getName(), token); return GSON.toJson(tokenMap); } private ServiceDTO mockService(String homeUrl) { ServiceDTO serviceDTO = new ServiceDTO(); serviceDTO.setHomepageUrl(homeUrl); return serviceDTO; } }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./.git/logs/refs/remotes/origin/HEAD
0000000000000000000000000000000000000000 6657a58831a544606f78177b61d92bb959ccce94 jupyter <[email protected]> 1704839356 +0000 clone: from https://github.com/apolloconfig/apollo.git
0000000000000000000000000000000000000000 6657a58831a544606f78177b61d92bb959ccce94 jupyter <[email protected]> 1704839356 +0000 clone: from https://github.com/apolloconfig/apollo.git
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./scripts/helm/apollo-service/values.yaml
configdb: name: apollo-configdb # apolloconfigdb host host: "" port: 3306 dbName: ApolloConfigDB # apolloconfigdb user name userName: "" # apolloconfigdb password password: "" connectionStringProperties: characterEncoding=utf8 service: # whether to create a Service for this host or not enabled: false fullNameOverride: "" port: 3306 type: ClusterIP configService: name: apollo-configservice fullNameOverride: "" replicaCount: 2 containerPort: 8080 image: repository: apolloconfig/apollo-configservice tag: "" pullPolicy: IfNotPresent imagePullSecrets: [] service: fullNameOverride: "" port: 8080 targetPort: 8080 type: ClusterIP ingress: enabled: false annotations: { } hosts: - host: "" paths: [ ] tls: [ ] liveness: initialDelaySeconds: 100 periodSeconds: 10 readiness: initialDelaySeconds: 30 periodSeconds: 5 config: # spring profiles to activate profiles: "github,kubernetes" # override apollo.config-service.url: config service url to be accessed by apollo-client configServiceUrlOverride: "" # override apollo.admin-service.url: admin service url to be accessed by apollo-portal adminServiceUrlOverride: "" # specify the context path, e.g. /apollo contextPath: "" # environment variables passed to the container, e.g. JAVA_OPTS env: {} strategy: {} resources: {} nodeSelector: {} tolerations: [] affinity: {} adminService: name: apollo-adminservice fullNameOverride: "" replicaCount: 2 containerPort: 8090 image: repository: apolloconfig/apollo-adminservice tag: "" pullPolicy: IfNotPresent imagePullSecrets: [] service: fullNameOverride: "" port: 8090 targetPort: 8090 type: ClusterIP ingress: enabled: false annotations: { } hosts: - host: "" paths: [ ] tls: [ ] liveness: initialDelaySeconds: 100 periodSeconds: 10 readiness: initialDelaySeconds: 30 periodSeconds: 5 config: # spring profiles to activate profiles: "github,kubernetes" # specify the context path, e.g. /apollo contextPath: "" # environment variables passed to the container, e.g. JAVA_OPTS env: {} strategy: {} resources: {} nodeSelector: {} tolerations: [] affinity: {}
configdb: name: apollo-configdb # apolloconfigdb host host: "" port: 3306 dbName: ApolloConfigDB # apolloconfigdb user name userName: "" # apolloconfigdb password password: "" connectionStringProperties: characterEncoding=utf8 service: # whether to create a Service for this host or not enabled: false fullNameOverride: "" port: 3306 type: ClusterIP configService: name: apollo-configservice fullNameOverride: "" replicaCount: 2 containerPort: 8080 image: repository: apolloconfig/apollo-configservice tag: "" pullPolicy: IfNotPresent imagePullSecrets: [] service: fullNameOverride: "" port: 8080 targetPort: 8080 type: ClusterIP ingress: enabled: false annotations: { } hosts: - host: "" paths: [ ] tls: [ ] liveness: initialDelaySeconds: 100 periodSeconds: 10 readiness: initialDelaySeconds: 30 periodSeconds: 5 config: # spring profiles to activate profiles: "github,kubernetes" # override apollo.config-service.url: config service url to be accessed by apollo-client configServiceUrlOverride: "" # override apollo.admin-service.url: admin service url to be accessed by apollo-portal adminServiceUrlOverride: "" # specify the context path, e.g. /apollo contextPath: "" # environment variables passed to the container, e.g. JAVA_OPTS env: {} strategy: {} resources: {} nodeSelector: {} tolerations: [] affinity: {} adminService: name: apollo-adminservice fullNameOverride: "" replicaCount: 2 containerPort: 8090 image: repository: apolloconfig/apollo-adminservice tag: "" pullPolicy: IfNotPresent imagePullSecrets: [] service: fullNameOverride: "" port: 8090 targetPort: 8090 type: ClusterIP ingress: enabled: false annotations: { } hosts: - host: "" paths: [ ] tls: [ ] liveness: initialDelaySeconds: 100 periodSeconds: 10 readiness: initialDelaySeconds: 30 periodSeconds: 5 config: # spring profiles to activate profiles: "github,kubernetes" # specify the context path, e.g. /apollo contextPath: "" # environment variables passed to the container, e.g. JAVA_OPTS env: {} strategy: {} resources: {} nodeSelector: {} tolerations: [] affinity: {}
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-portal/src/main/resources/static/vendor/jquery-plugin/textareafullscreen.css
.tx-editor-wrapper { position: relative; } .tx-editor-wrapper .tx-editor.expanded { position: fixed; top: 0; left: 0; width: 80%; height: 80%; z-index: 500; } .tx-editor-wrapper .tx-editor { height: 140px; } .tx-editor-wrapper .tx-editor .tx-icon { position: absolute; right: 5px; top: 5px; width: 18px; height: 16px; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAQCAYAAAAbBi9cAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABV0RVh0Q3JlYXRpb24gVGltZQA4LzE2LzEzspl6ugAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAB7SURBVDiN7ZOxCsAgDESvxXyhi5P/Fif/0i6NGJH2KIUufVOUJB45s6lqw0DOGQylFHfeqSqCYEGMESJCF6aUAAC1Vt9IRPolixtDG1DVxjLnhtVL8yAvlZy8Nuy/0T1L19g1cY3Mavupd9bPWL5T9ERJV2SBrcfn238A3whjoYEPESwAAAAASUVORK5CYII='); cursor: pointer; z-index: 3; } .tx-editor-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, 0.7); z-index: 2; opacity: 0; }
.tx-editor-wrapper { position: relative; } .tx-editor-wrapper .tx-editor.expanded { position: fixed; top: 0; left: 0; width: 80%; height: 80%; z-index: 500; } .tx-editor-wrapper .tx-editor { height: 140px; } .tx-editor-wrapper .tx-editor .tx-icon { position: absolute; right: 5px; top: 5px; width: 18px; height: 16px; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAQCAYAAAAbBi9cAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABV0RVh0Q3JlYXRpb24gVGltZQA4LzE2LzEzspl6ugAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAB7SURBVDiN7ZOxCsAgDESvxXyhi5P/Fif/0i6NGJH2KIUufVOUJB45s6lqw0DOGQylFHfeqSqCYEGMESJCF6aUAAC1Vt9IRPolixtDG1DVxjLnhtVL8yAvlZy8Nuy/0T1L19g1cY3Mavupd9bPWL5T9ERJV2SBrcfn238A3whjoYEPESwAAAAASUVORK5CYII='); cursor: pointer; z-index: 3; } .tx-editor-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, 0.7); z-index: 2; opacity: 0; }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-biz/pom.xml
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <groupId>com.ctrip.framework.apollo</groupId> <artifactId>apollo</artifactId> <version>${revision}</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>apollo-biz</artifactId> <name>Apollo Biz</name> <packaging>jar</packaging> <properties> <github.path>${project.artifactId}</github.path> </properties> <dependencies> <dependency> <groupId>com.ctrip.framework.apollo</groupId> <artifactId>apollo-common</artifactId> </dependency> <!-- eureka --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> </dependency> <!-- end of eureka --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-consul-discovery</artifactId> </dependency> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <scope>test</scope> </dependency> </dependencies> </project>
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <groupId>com.ctrip.framework.apollo</groupId> <artifactId>apollo</artifactId> <version>${revision}</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>apollo-biz</artifactId> <name>Apollo Biz</name> <packaging>jar</packaging> <properties> <github.path>${project.artifactId}</github.path> </properties> <dependencies> <dependency> <groupId>com.ctrip.framework.apollo</groupId> <artifactId>apollo-common</artifactId> </dependency> <!-- eureka --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> </dependency> <!-- end of eureka --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-consul-discovery</artifactId> </dependency> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <scope>test</scope> </dependency> </dependencies> </project>
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-core/src/main/java/com/ctrip/framework/foundation/spi/provider/ServerProvider.java
package com.ctrip.framework.foundation.spi.provider; import java.io.IOException; import java.io.InputStream; /** * Provider for server related properties */ public interface ServerProvider extends Provider { /** * @return current environment or {@code null} if not set */ String getEnvType(); /** * @return whether current environment is set or not */ boolean isEnvTypeSet(); /** * @return current data center or {@code null} if not set */ String getDataCenter(); /** * @return whether data center is set or not */ boolean isDataCenterSet(); /** * Initialize server provider with the specified input stream * * @throws IOException */ void initialize(InputStream in) throws IOException; }
package com.ctrip.framework.foundation.spi.provider; import java.io.IOException; import java.io.InputStream; /** * Provider for server related properties */ public interface ServerProvider extends Provider { /** * @return current environment or {@code null} if not set */ String getEnvType(); /** * @return whether current environment is set or not */ boolean isEnvTypeSet(); /** * @return current data center or {@code null} if not set */ String getDataCenter(); /** * @return whether data center is set or not */ boolean isDataCenterSet(); /** * Initialize server provider with the specified input stream * * @throws IOException */ void initialize(InputStream in) throws IOException; }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/message/MessageSender.java
package com.ctrip.framework.apollo.biz.message; /** * @author Jason Song([email protected]) */ public interface MessageSender { void sendMessage(String message, String channel); }
package com.ctrip.framework.apollo.biz.message; /** * @author Jason Song([email protected]) */ public interface MessageSender { void sendMessage(String message, String channel); }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-portal/src/main/resources/static/img/hide_sidebar.png
PNG  IHDRX IDATx^Or33ˑ|cN0i1 lNx2K q`ka,E狖mUԟ[wUe}YUb?; 0؀M`t@   F372BI4FqC)# Dn 72BI4FqC)# Dn 72BI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A= G +7BI|0ZD2AǓ1!HAm$c9<IAߐ<KO@2ART $N䐘Rߌ (HҌ*dr$I5T  SI&dzi֦vI_Vd~,D[Dcv>w<eg;Tdm^:`"/XQ9-)EI.H ZӭVDۖQvU$oO|jI_56誟T ۭ;+jyJI0sT ڟ󣘒d!X=apr IrUm8 r\c/~S=}.o5iY5XS]~0VjeNmkXqvpN7$d٣JWzvU>Ȅ^W%[ Anaq^"bATJi3 ! D8]Q  JM wG6nѶp/:l>ڻ )B$6ɫ]7}I٦i?ĀDL7BZ޲1\ q-J b.jk$"W3qE-i;3!Aћi?X+fԷ[ܔݡXCk n<b]';jmoN$dF1J0|+-I=y/_ߛ 6O h״VXؓ_~D&CϘ\i Q$8/EٮlPO˻rB/iL6J)Fk%+b^_ !$p]?iG-u V[u ě$HTZ9A,Z8Z[JP2)%5OK1Xvy}9ӂ|G2Ʉ::,HfEFٓ|lkXynp%ĕʙ ALt%A\ɡ DIWĕʙ ALt%A\ɡ DIWĕʙ ALt%A\ɡ DIWĕʙ ALt%A\ɡ DIWĕʙ HA34wH[&N=LDFˊ+&e~DPY1D\i?M)Jcfr̙R~l Oy7|*ЂbGW|?v|qd|&\uh纐FQ _ {=;GOxV]z9eD|uI'-ogP퉼oFٴQ9;2_B@fAލL31f(DBGS?BR)prHL": W*6-H m!`{ ]cuGMy'FGTAʎwKf=4ƟBi6^xK&-zh/̩*f'ړ{u#Ղ,nOq%RY^HuFK^V`{Xj/ј[oSU>@dC&SW MC|dEVF#L$*\Hޓ0F)h 4iq5  H   H   H   H   H   H   H   H   H   H   H   OTlIENDB`
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-configservice/src/main/resources/application-nacos-discovery.properties
apollo.eureka.server.enabled=false eureka.client.enabled=false spring.cloud.discovery.enabled=false #nacos enabled nacos.discovery.register.enabled=true nacos.discovery.auto-register=true nacos.discovery.register.service-name=apollo-configservice
apollo.eureka.server.enabled=false eureka.client.enabled=false spring.cloud.discovery.enabled=false #nacos enabled nacos.discovery.register.enabled=true nacos.discovery.auto-register=true nacos.discovery.register.service-name=apollo-configservice
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-portal/src/main/resources/static/delete_app_cluster_namespace.html
<!doctype html> <html ng-app="delete_app_cluster_namespace"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="icon" href="img/config.png"> <!-- styles --> <link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="vendor/angular/angular-toastr-1.4.1.min.css"> <link rel="stylesheet" type="text/css" media='all' href="vendor/angular/loading-bar.min.css"> <link rel="stylesheet" type="text/css" href="styles/common-style.css"> <link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css"> <title>{{'Delete.Title' | translate }}</title> </head> <body> <apollonav></apollonav> <div class="container-fluid" ng-controller="DeleteAppClusterNamespaceController"> <div class="col-md-10 col-md-offset-1 panel"> <section class="panel-body" ng-show="isRootUser"> <!-- delete app --> <section class="row"> <h5>{{'Delete.DeleteApp' | translate }} <small> {{'Delete.DeleteAppTips' | translate }} </small> </h5> <hr> <form class="form-horizontal"> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Common.AppId' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="app.appId"> <small> {{'Delete.AppIdTips' | translate }}</small> </div> <div class="col-sm-1"> <button class="btn btn-info" ng-click="getAppInfo()">{{'Common.Search' | translate }}</button> </div> </div> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> {{'Delete.AppInfo' | translate }}</label> <div class="col-sm-5"> <h5 ng-show="app.info" ng-bind="app.info"></h5> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-9"> <button type="submit" class="btn btn-primary" ng-disabled="deleteAppBtnDisabled" ng-click="deleteApp()"> {{'Delete.DeleteApp' | translate }} </button> </div> </div> </form> </section> <!-- delete cluster --> <section class="row"> <h5>{{'Delete.DeleteCluster' | translate }} <small> {{'Delete.DeleteClusterTips' | translate }} </small> </h5> <hr> <form class="form-horizontal"> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Common.AppId' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="cluster.appId"> </div> </div> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Delete.EnvName' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="cluster.env"> </div> </div> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Common.ClusterName' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="cluster.name"> <small>{{'Delete.ClusterNameTips' | translate }}</small> </div> <div class="col-sm-1"> <button class="btn btn-info" ng-click="getClusterInfo()">{{'Common.Search' | translate }}</button> </div> </div> <div class="form-group" viv clform-group> <label class="col-sm-2 control-label"> {{'Delete.ClusterInfo' | translate }}</label> <div class="col-sm-5"> <h5 ng-show="cluster.info" ng-bind="cluster.info"></h5> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-9"> <button type="submit" class="btn btn-primary" ng-disabled="deleteClusterBtnDisabled" ng-click="deleteCluster()"> {{'Delete.DeleteCluster' | translate }} </button> </div> </div> </form> </section> <!-- delete app namespace --> <section class="row"> <h5>{{'Delete.DeleteNamespace' | translate }} <small>{{'Delete.DeleteNamespaceTips' | translate }}</small> </h5> <small> {{'Delete.DeleteNamespaceTips2' | translate }} </small> <hr> <form class="form-horizontal"> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Common.AppId' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="appNamespace.appId"> </div> </div> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Delete.AppNamespaceName' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="appNamespace.name"> <small>{{'Delete.AppNamespaceNameTips' | translate }}</small> </div> <div class="col-sm-1"> <button class="btn btn-info" ng-click="getAppNamespaceInfo()">{{'Common.Search' | translate }}</button> </div> </div> <div class="form-group" viv clform-group> <label class="col-sm-2 control-label"> {{'Delete.AppNamespaceInfo' | translate }}</label> <div class="col-sm-5"> <h5 ng-show="appNamespace.info" ng-bind="appNamespace.info"></h5> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-9"> <button type="submit" class="btn btn-primary" ng-disabled="deleteAppNamespaceBtnDisabled" ng-click="deleteAppNamespace()"> {{'Delete.DeleteNamespace' | translate }} </button> </div> </div> </form> </section> </section> <section class="panel-body text-center" ng-if="!isRootUser"> <h4>{{'Common.IsRootUser' | translate }}</h4> </section> </div> </div> <div ng-include="'views/common/footer.html'"></div> <!-- jquery.js --> <script src="vendor/jquery.min.js" type="text/javascript"></script> <!--angular--> <script src="vendor/angular/angular.min.js"></script> <script src="vendor/angular/angular-route.min.js"></script> <script src="vendor/angular/angular-resource.min.js"></script> <script src="vendor/angular/angular-toastr-1.4.1.tpls.min.js"></script> <script src="vendor/angular/loading-bar.min.js"></script> <script src="vendor/angular/angular-cookies.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate-loader-static-files.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate-storage-cookie.min.js"></script> <!--valdr--> <script src="vendor/valdr/valdr.min.js" type="text/javascript"></script> <script src="vendor/valdr/valdr-message.min.js" type="text/javascript"></script> <!-- bootstrap.js --> <script src="vendor/bootstrap/js/bootstrap.min.js" type="text/javascript"></script> <script src="vendor/lodash.min.js"></script> <script src="vendor/select2/select2.min.js" type="text/javascript"></script> <!--biz--> <!--must import--> <script type="application/javascript" src="scripts/app.js"></script> <script type="application/javascript" src="scripts/services/AppService.js"></script> <script type="application/javascript" src="scripts/services/EnvService.js"></script> <script type="application/javascript" src="scripts/services/UserService.js"></script> <script type="application/javascript" src="scripts/services/CommonService.js"></script> <script type="application/javascript" src="scripts/services/PermissionService.js"></script> <script type="application/javascript" src="scripts/services/ClusterService.js"></script> <script type="application/javascript" src="scripts/services/NamespaceService.js"></script> <script type="application/javascript" src="scripts/AppUtils.js"></script> <script type="application/javascript" src="scripts/PageCommon.js"></script> <script type="application/javascript" src="scripts/directive/directive.js"></script> <script type="application/javascript" src="scripts/valdr.js"></script> <script type="application/javascript" src="scripts/controller/DeleteAppClusterNamespaceController.js"></script> </body> </html>
<!doctype html> <html ng-app="delete_app_cluster_namespace"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="icon" href="img/config.png"> <!-- styles --> <link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="vendor/angular/angular-toastr-1.4.1.min.css"> <link rel="stylesheet" type="text/css" media='all' href="vendor/angular/loading-bar.min.css"> <link rel="stylesheet" type="text/css" href="styles/common-style.css"> <link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css"> <title>{{'Delete.Title' | translate }}</title> </head> <body> <apollonav></apollonav> <div class="container-fluid" ng-controller="DeleteAppClusterNamespaceController"> <div class="col-md-10 col-md-offset-1 panel"> <section class="panel-body" ng-show="isRootUser"> <!-- delete app --> <section class="row"> <h5>{{'Delete.DeleteApp' | translate }} <small> {{'Delete.DeleteAppTips' | translate }} </small> </h5> <hr> <form class="form-horizontal"> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Common.AppId' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="app.appId"> <small> {{'Delete.AppIdTips' | translate }}</small> </div> <div class="col-sm-1"> <button class="btn btn-info" ng-click="getAppInfo()">{{'Common.Search' | translate }}</button> </div> </div> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> {{'Delete.AppInfo' | translate }}</label> <div class="col-sm-5"> <h5 ng-show="app.info" ng-bind="app.info"></h5> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-9"> <button type="submit" class="btn btn-primary" ng-disabled="deleteAppBtnDisabled" ng-click="deleteApp()"> {{'Delete.DeleteApp' | translate }} </button> </div> </div> </form> </section> <!-- delete cluster --> <section class="row"> <h5>{{'Delete.DeleteCluster' | translate }} <small> {{'Delete.DeleteClusterTips' | translate }} </small> </h5> <hr> <form class="form-horizontal"> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Common.AppId' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="cluster.appId"> </div> </div> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Delete.EnvName' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="cluster.env"> </div> </div> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Common.ClusterName' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="cluster.name"> <small>{{'Delete.ClusterNameTips' | translate }}</small> </div> <div class="col-sm-1"> <button class="btn btn-info" ng-click="getClusterInfo()">{{'Common.Search' | translate }}</button> </div> </div> <div class="form-group" viv clform-group> <label class="col-sm-2 control-label"> {{'Delete.ClusterInfo' | translate }}</label> <div class="col-sm-5"> <h5 ng-show="cluster.info" ng-bind="cluster.info"></h5> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-9"> <button type="submit" class="btn btn-primary" ng-disabled="deleteClusterBtnDisabled" ng-click="deleteCluster()"> {{'Delete.DeleteCluster' | translate }} </button> </div> </div> </form> </section> <!-- delete app namespace --> <section class="row"> <h5>{{'Delete.DeleteNamespace' | translate }} <small>{{'Delete.DeleteNamespaceTips' | translate }}</small> </h5> <small> {{'Delete.DeleteNamespaceTips2' | translate }} </small> <hr> <form class="form-horizontal"> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Common.AppId' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="appNamespace.appId"> </div> </div> <div class="form-group" valdr-form-group> <label class="col-sm-2 control-label"> <apollorequiredfield></apollorequiredfield> {{'Delete.AppNamespaceName' | translate }} </label> <div class="col-sm-5"> <input type="text" class="form-control" ng-model="appNamespace.name"> <small>{{'Delete.AppNamespaceNameTips' | translate }}</small> </div> <div class="col-sm-1"> <button class="btn btn-info" ng-click="getAppNamespaceInfo()">{{'Common.Search' | translate }}</button> </div> </div> <div class="form-group" viv clform-group> <label class="col-sm-2 control-label"> {{'Delete.AppNamespaceInfo' | translate }}</label> <div class="col-sm-5"> <h5 ng-show="appNamespace.info" ng-bind="appNamespace.info"></h5> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-9"> <button type="submit" class="btn btn-primary" ng-disabled="deleteAppNamespaceBtnDisabled" ng-click="deleteAppNamespace()"> {{'Delete.DeleteNamespace' | translate }} </button> </div> </div> </form> </section> </section> <section class="panel-body text-center" ng-if="!isRootUser"> <h4>{{'Common.IsRootUser' | translate }}</h4> </section> </div> </div> <div ng-include="'views/common/footer.html'"></div> <!-- jquery.js --> <script src="vendor/jquery.min.js" type="text/javascript"></script> <!--angular--> <script src="vendor/angular/angular.min.js"></script> <script src="vendor/angular/angular-route.min.js"></script> <script src="vendor/angular/angular-resource.min.js"></script> <script src="vendor/angular/angular-toastr-1.4.1.tpls.min.js"></script> <script src="vendor/angular/loading-bar.min.js"></script> <script src="vendor/angular/angular-cookies.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate-loader-static-files.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate-storage-cookie.min.js"></script> <!--valdr--> <script src="vendor/valdr/valdr.min.js" type="text/javascript"></script> <script src="vendor/valdr/valdr-message.min.js" type="text/javascript"></script> <!-- bootstrap.js --> <script src="vendor/bootstrap/js/bootstrap.min.js" type="text/javascript"></script> <script src="vendor/lodash.min.js"></script> <script src="vendor/select2/select2.min.js" type="text/javascript"></script> <!--biz--> <!--must import--> <script type="application/javascript" src="scripts/app.js"></script> <script type="application/javascript" src="scripts/services/AppService.js"></script> <script type="application/javascript" src="scripts/services/EnvService.js"></script> <script type="application/javascript" src="scripts/services/UserService.js"></script> <script type="application/javascript" src="scripts/services/CommonService.js"></script> <script type="application/javascript" src="scripts/services/PermissionService.js"></script> <script type="application/javascript" src="scripts/services/ClusterService.js"></script> <script type="application/javascript" src="scripts/services/NamespaceService.js"></script> <script type="application/javascript" src="scripts/AppUtils.js"></script> <script type="application/javascript" src="scripts/PageCommon.js"></script> <script type="application/javascript" src="scripts/directive/directive.js"></script> <script type="application/javascript" src="scripts/valdr.js"></script> <script type="application/javascript" src="scripts/controller/DeleteAppClusterNamespaceController.js"></script> </body> </html>
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-client/src/main/java/com/ctrip/framework/apollo/spring/annotation/ApolloAnnotationProcessor.java
package com.ctrip.framework.apollo.spring.annotation; import com.ctrip.framework.apollo.Config; import com.ctrip.framework.apollo.ConfigChangeListener; import com.ctrip.framework.apollo.ConfigService; import com.ctrip.framework.apollo.build.ApolloInjector; import com.ctrip.framework.apollo.model.ConfigChangeEvent; import com.ctrip.framework.apollo.spring.property.PlaceholderHelper; import com.ctrip.framework.apollo.spring.property.SpringValue; import com.ctrip.framework.apollo.spring.property.SpringValueRegistry; import com.ctrip.framework.apollo.spring.util.SpringInjector; import com.ctrip.framework.apollo.util.ConfigUtil; import com.google.common.base.Preconditions; import com.google.gson.Gson; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.lang.reflect.Type; import java.util.Set; import com.google.common.collect.Sets; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.context.EnvironmentAware; import org.springframework.core.annotation.AnnotationUtils; import org.springframework.core.env.Environment; import org.springframework.util.ReflectionUtils; /** * Apollo Annotation Processor for Spring Application * * @author Jason Song([email protected]) */ public class ApolloAnnotationProcessor extends ApolloProcessor implements BeanFactoryAware, EnvironmentAware { private static final Logger logger = LoggerFactory.getLogger(ApolloAnnotationProcessor.class); private static final Gson GSON = new Gson(); private final ConfigUtil configUtil; private final PlaceholderHelper placeholderHelper; private final SpringValueRegistry springValueRegistry; /** * resolve the expression. */ private ConfigurableBeanFactory configurableBeanFactory; private Environment environment; public ApolloAnnotationProcessor() { configUtil = ApolloInjector.getInstance(ConfigUtil.class); placeholderHelper = SpringInjector.getInstance(PlaceholderHelper.class); springValueRegistry = SpringInjector.getInstance(SpringValueRegistry.class); } @Override protected void processField(Object bean, String beanName, Field field) { this.processApolloConfig(bean, field); this.processApolloJsonValue(bean, beanName, field); } @Override protected void processMethod(final Object bean, String beanName, final Method method) { this.processApolloConfigChangeListener(bean, method); this.processApolloJsonValue(bean, beanName, method); } private void processApolloConfig(Object bean, Field field) { ApolloConfig annotation = AnnotationUtils.getAnnotation(field, ApolloConfig.class); if (annotation == null) { return; } Preconditions.checkArgument(Config.class.isAssignableFrom(field.getType()), "Invalid type: %s for field: %s, should be Config", field.getType(), field); final String namespace = annotation.value(); final String resolvedNamespace = this.environment.resolveRequiredPlaceholders(namespace); Config config = ConfigService.getConfig(resolvedNamespace); ReflectionUtils.makeAccessible(field); ReflectionUtils.setField(field, bean, config); } private void processApolloConfigChangeListener(final Object bean, final Method method) { ApolloConfigChangeListener annotation = AnnotationUtils .findAnnotation(method, ApolloConfigChangeListener.class); if (annotation == null) { return; } Class<?>[] parameterTypes = method.getParameterTypes(); Preconditions.checkArgument(parameterTypes.length == 1, "Invalid number of parameters: %s for method: %s, should be 1", parameterTypes.length, method); Preconditions.checkArgument(ConfigChangeEvent.class.isAssignableFrom(parameterTypes[0]), "Invalid parameter type: %s for method: %s, should be ConfigChangeEvent", parameterTypes[0], method); ReflectionUtils.makeAccessible(method); String[] namespaces = annotation.value(); String[] annotatedInterestedKeys = annotation.interestedKeys(); String[] annotatedInterestedKeyPrefixes = annotation.interestedKeyPrefixes(); ConfigChangeListener configChangeListener = new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { ReflectionUtils.invokeMethod(method, bean, changeEvent); } }; Set<String> interestedKeys = annotatedInterestedKeys.length > 0 ? Sets.newHashSet(annotatedInterestedKeys) : null; Set<String> interestedKeyPrefixes = annotatedInterestedKeyPrefixes.length > 0 ? Sets.newHashSet(annotatedInterestedKeyPrefixes) : null; for (String namespace : namespaces) { final String resolvedNamespace = this.environment.resolveRequiredPlaceholders(namespace); Config config = ConfigService.getConfig(resolvedNamespace); if (interestedKeys == null && interestedKeyPrefixes == null) { config.addChangeListener(configChangeListener); } else { config.addChangeListener(configChangeListener, interestedKeys, interestedKeyPrefixes); } } } private void processApolloJsonValue(Object bean, String beanName, Field field) { ApolloJsonValue apolloJsonValue = AnnotationUtils.getAnnotation(field, ApolloJsonValue.class); if (apolloJsonValue == null) { return; } String placeholder = apolloJsonValue.value(); Object propertyValue = placeholderHelper .resolvePropertyValue(this.configurableBeanFactory, beanName, placeholder); // propertyValue will never be null, as @ApolloJsonValue will not allow that if (!(propertyValue instanceof String)) { return; } boolean accessible = field.isAccessible(); field.setAccessible(true); ReflectionUtils .setField(field, bean, parseJsonValue((String) propertyValue, field.getGenericType())); field.setAccessible(accessible); if (configUtil.isAutoUpdateInjectedSpringPropertiesEnabled()) { Set<String> keys = placeholderHelper.extractPlaceholderKeys(placeholder); for (String key : keys) { SpringValue springValue = new SpringValue(key, placeholder, bean, beanName, field, true); springValueRegistry.register(this.configurableBeanFactory, key, springValue); logger.debug("Monitoring {}", springValue); } } } private void processApolloJsonValue(Object bean, String beanName, Method method) { ApolloJsonValue apolloJsonValue = AnnotationUtils.getAnnotation(method, ApolloJsonValue.class); if (apolloJsonValue == null) { return; } String placeHolder = apolloJsonValue.value(); Object propertyValue = placeholderHelper .resolvePropertyValue(this.configurableBeanFactory, beanName, placeHolder); // propertyValue will never be null, as @ApolloJsonValue will not allow that if (!(propertyValue instanceof String)) { return; } Type[] types = method.getGenericParameterTypes(); Preconditions.checkArgument(types.length == 1, "Ignore @Value setter {}.{}, expecting 1 parameter, actual {} parameters", bean.getClass().getName(), method.getName(), method.getParameterTypes().length); boolean accessible = method.isAccessible(); method.setAccessible(true); ReflectionUtils.invokeMethod(method, bean, parseJsonValue((String) propertyValue, types[0])); method.setAccessible(accessible); if (configUtil.isAutoUpdateInjectedSpringPropertiesEnabled()) { Set<String> keys = placeholderHelper.extractPlaceholderKeys(placeHolder); for (String key : keys) { SpringValue springValue = new SpringValue(key, apolloJsonValue.value(), bean, beanName, method, true); springValueRegistry.register(this.configurableBeanFactory, key, springValue); logger.debug("Monitoring {}", springValue); } } } private Object parseJsonValue(String json, Type targetType) { try { return GSON.fromJson(json, targetType); } catch (Throwable ex) { logger.error("Parsing json '{}' to type {} failed!", json, targetType, ex); throw ex; } } @Override public void setBeanFactory(BeanFactory beanFactory) throws BeansException { this.configurableBeanFactory = (ConfigurableBeanFactory) beanFactory; } @Override public void setEnvironment(Environment environment) { this.environment = environment; } }
package com.ctrip.framework.apollo.spring.annotation; import com.ctrip.framework.apollo.Config; import com.ctrip.framework.apollo.ConfigChangeListener; import com.ctrip.framework.apollo.ConfigService; import com.ctrip.framework.apollo.build.ApolloInjector; import com.ctrip.framework.apollo.model.ConfigChangeEvent; import com.ctrip.framework.apollo.spring.property.PlaceholderHelper; import com.ctrip.framework.apollo.spring.property.SpringValue; import com.ctrip.framework.apollo.spring.property.SpringValueRegistry; import com.ctrip.framework.apollo.spring.util.SpringInjector; import com.ctrip.framework.apollo.util.ConfigUtil; import com.google.common.base.Preconditions; import com.google.gson.Gson; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.lang.reflect.Type; import java.util.Set; import com.google.common.collect.Sets; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.context.EnvironmentAware; import org.springframework.core.annotation.AnnotationUtils; import org.springframework.core.env.Environment; import org.springframework.util.ReflectionUtils; /** * Apollo Annotation Processor for Spring Application * * @author Jason Song([email protected]) */ public class ApolloAnnotationProcessor extends ApolloProcessor implements BeanFactoryAware, EnvironmentAware { private static final Logger logger = LoggerFactory.getLogger(ApolloAnnotationProcessor.class); private static final Gson GSON = new Gson(); private final ConfigUtil configUtil; private final PlaceholderHelper placeholderHelper; private final SpringValueRegistry springValueRegistry; /** * resolve the expression. */ private ConfigurableBeanFactory configurableBeanFactory; private Environment environment; public ApolloAnnotationProcessor() { configUtil = ApolloInjector.getInstance(ConfigUtil.class); placeholderHelper = SpringInjector.getInstance(PlaceholderHelper.class); springValueRegistry = SpringInjector.getInstance(SpringValueRegistry.class); } @Override protected void processField(Object bean, String beanName, Field field) { this.processApolloConfig(bean, field); this.processApolloJsonValue(bean, beanName, field); } @Override protected void processMethod(final Object bean, String beanName, final Method method) { this.processApolloConfigChangeListener(bean, method); this.processApolloJsonValue(bean, beanName, method); } private void processApolloConfig(Object bean, Field field) { ApolloConfig annotation = AnnotationUtils.getAnnotation(field, ApolloConfig.class); if (annotation == null) { return; } Preconditions.checkArgument(Config.class.isAssignableFrom(field.getType()), "Invalid type: %s for field: %s, should be Config", field.getType(), field); final String namespace = annotation.value(); final String resolvedNamespace = this.environment.resolveRequiredPlaceholders(namespace); Config config = ConfigService.getConfig(resolvedNamespace); ReflectionUtils.makeAccessible(field); ReflectionUtils.setField(field, bean, config); } private void processApolloConfigChangeListener(final Object bean, final Method method) { ApolloConfigChangeListener annotation = AnnotationUtils .findAnnotation(method, ApolloConfigChangeListener.class); if (annotation == null) { return; } Class<?>[] parameterTypes = method.getParameterTypes(); Preconditions.checkArgument(parameterTypes.length == 1, "Invalid number of parameters: %s for method: %s, should be 1", parameterTypes.length, method); Preconditions.checkArgument(ConfigChangeEvent.class.isAssignableFrom(parameterTypes[0]), "Invalid parameter type: %s for method: %s, should be ConfigChangeEvent", parameterTypes[0], method); ReflectionUtils.makeAccessible(method); String[] namespaces = annotation.value(); String[] annotatedInterestedKeys = annotation.interestedKeys(); String[] annotatedInterestedKeyPrefixes = annotation.interestedKeyPrefixes(); ConfigChangeListener configChangeListener = new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { ReflectionUtils.invokeMethod(method, bean, changeEvent); } }; Set<String> interestedKeys = annotatedInterestedKeys.length > 0 ? Sets.newHashSet(annotatedInterestedKeys) : null; Set<String> interestedKeyPrefixes = annotatedInterestedKeyPrefixes.length > 0 ? Sets.newHashSet(annotatedInterestedKeyPrefixes) : null; for (String namespace : namespaces) { final String resolvedNamespace = this.environment.resolveRequiredPlaceholders(namespace); Config config = ConfigService.getConfig(resolvedNamespace); if (interestedKeys == null && interestedKeyPrefixes == null) { config.addChangeListener(configChangeListener); } else { config.addChangeListener(configChangeListener, interestedKeys, interestedKeyPrefixes); } } } private void processApolloJsonValue(Object bean, String beanName, Field field) { ApolloJsonValue apolloJsonValue = AnnotationUtils.getAnnotation(field, ApolloJsonValue.class); if (apolloJsonValue == null) { return; } String placeholder = apolloJsonValue.value(); Object propertyValue = placeholderHelper .resolvePropertyValue(this.configurableBeanFactory, beanName, placeholder); // propertyValue will never be null, as @ApolloJsonValue will not allow that if (!(propertyValue instanceof String)) { return; } boolean accessible = field.isAccessible(); field.setAccessible(true); ReflectionUtils .setField(field, bean, parseJsonValue((String) propertyValue, field.getGenericType())); field.setAccessible(accessible); if (configUtil.isAutoUpdateInjectedSpringPropertiesEnabled()) { Set<String> keys = placeholderHelper.extractPlaceholderKeys(placeholder); for (String key : keys) { SpringValue springValue = new SpringValue(key, placeholder, bean, beanName, field, true); springValueRegistry.register(this.configurableBeanFactory, key, springValue); logger.debug("Monitoring {}", springValue); } } } private void processApolloJsonValue(Object bean, String beanName, Method method) { ApolloJsonValue apolloJsonValue = AnnotationUtils.getAnnotation(method, ApolloJsonValue.class); if (apolloJsonValue == null) { return; } String placeHolder = apolloJsonValue.value(); Object propertyValue = placeholderHelper .resolvePropertyValue(this.configurableBeanFactory, beanName, placeHolder); // propertyValue will never be null, as @ApolloJsonValue will not allow that if (!(propertyValue instanceof String)) { return; } Type[] types = method.getGenericParameterTypes(); Preconditions.checkArgument(types.length == 1, "Ignore @Value setter {}.{}, expecting 1 parameter, actual {} parameters", bean.getClass().getName(), method.getName(), method.getParameterTypes().length); boolean accessible = method.isAccessible(); method.setAccessible(true); ReflectionUtils.invokeMethod(method, bean, parseJsonValue((String) propertyValue, types[0])); method.setAccessible(accessible); if (configUtil.isAutoUpdateInjectedSpringPropertiesEnabled()) { Set<String> keys = placeholderHelper.extractPlaceholderKeys(placeHolder); for (String key : keys) { SpringValue springValue = new SpringValue(key, apolloJsonValue.value(), bean, beanName, method, true); springValueRegistry.register(this.configurableBeanFactory, key, springValue); logger.debug("Monitoring {}", springValue); } } } private Object parseJsonValue(String json, Type targetType) { try { return GSON.fromJson(json, targetType); } catch (Throwable ex) { logger.error("Parsing json '{}' to type {} failed!", json, targetType, ex); throw ex; } } @Override public void setBeanFactory(BeanFactory beanFactory) throws BeansException { this.configurableBeanFactory = (ConfigurableBeanFactory) beanFactory; } @Override public void setEnvironment(Environment environment) { this.environment = environment; } }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-client/src/main/resources/META-INF/spring.handlers
http\://www.ctrip.com/schema/apollo=com.ctrip.framework.apollo.spring.config.NamespaceHandler
http\://www.ctrip.com/schema/apollo=com.ctrip.framework.apollo.spring.config.NamespaceHandler
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-client/src/main/java/com/ctrip/framework/apollo/util/OrderedProperties.java
package com.ctrip.framework.apollo.util; import java.util.Collections; import java.util.Enumeration; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.Map; import java.util.Map.Entry; import java.util.Properties; import java.util.Set; /** * An OrderedProperties instance will keep appearance order in config file. * * <strong> * Warnings: 1. It should be noticed that stream APIs or JDk1.8 APIs( listed in * https://github.com/ctripcorp/apollo/pull/2861) are not implemented here. 2. {@link Properties} * implementation are different between JDK1.8 and later JDKs. At least, {@link Properties} have an * individual implementation in JDK10. Hence, there should be an individual putAll method here. * </strong> * * @author [email protected] */ public class OrderedProperties extends Properties { private static final long serialVersionUID = -1741073539526213291L; private final Set<String> propertyNames; public OrderedProperties() { propertyNames = Collections.synchronizedSet(new LinkedHashSet<String>()); } @Override public synchronized Object put(Object key, Object value) { addPropertyName(key); return super.put(key, value); } private void addPropertyName(Object key) { if (key instanceof String) { propertyNames.add((String) key); } } @Override public Set<String> stringPropertyNames() { return propertyNames; } @Override public Enumeration<?> propertyNames() { return Collections.enumeration(propertyNames); } @Override public synchronized Enumeration<Object> keys() { return new Enumeration<Object>() { private final Iterator<String> i = propertyNames.iterator(); @Override public boolean hasMoreElements() { return i.hasNext(); } @Override public Object nextElement() { return i.next(); } }; } @Override public Set<Object> keySet() { return new LinkedHashSet<Object>(propertyNames); } @Override public Set<Entry<Object, Object>> entrySet() { Set<Entry<Object, Object>> original = super.entrySet(); LinkedHashMap<Object, Entry<Object, Object>> entryMap = new LinkedHashMap<>(); for (String propertyName : propertyNames) { entryMap.put(propertyName, null); } for (Entry<Object, Object> entry : original) { entryMap.put(entry.getKey(), entry); } return new LinkedHashSet<>(entryMap.values()); } @Override public synchronized void putAll(Map<?, ?> t) { super.putAll(t); for (Object name : t.keySet()) { addPropertyName(name); } } @Override public synchronized void clear() { super.clear(); this.propertyNames.clear(); } @Override public synchronized Object remove(Object key) { if (key instanceof String) { this.propertyNames.remove(key); } return super.remove(key); } }
package com.ctrip.framework.apollo.util; import java.util.Collections; import java.util.Enumeration; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.Map; import java.util.Map.Entry; import java.util.Properties; import java.util.Set; /** * An OrderedProperties instance will keep appearance order in config file. * * <strong> * Warnings: 1. It should be noticed that stream APIs or JDk1.8 APIs( listed in * https://github.com/ctripcorp/apollo/pull/2861) are not implemented here. 2. {@link Properties} * implementation are different between JDK1.8 and later JDKs. At least, {@link Properties} have an * individual implementation in JDK10. Hence, there should be an individual putAll method here. * </strong> * * @author [email protected] */ public class OrderedProperties extends Properties { private static final long serialVersionUID = -1741073539526213291L; private final Set<String> propertyNames; public OrderedProperties() { propertyNames = Collections.synchronizedSet(new LinkedHashSet<String>()); } @Override public synchronized Object put(Object key, Object value) { addPropertyName(key); return super.put(key, value); } private void addPropertyName(Object key) { if (key instanceof String) { propertyNames.add((String) key); } } @Override public Set<String> stringPropertyNames() { return propertyNames; } @Override public Enumeration<?> propertyNames() { return Collections.enumeration(propertyNames); } @Override public synchronized Enumeration<Object> keys() { return new Enumeration<Object>() { private final Iterator<String> i = propertyNames.iterator(); @Override public boolean hasMoreElements() { return i.hasNext(); } @Override public Object nextElement() { return i.next(); } }; } @Override public Set<Object> keySet() { return new LinkedHashSet<Object>(propertyNames); } @Override public Set<Entry<Object, Object>> entrySet() { Set<Entry<Object, Object>> original = super.entrySet(); LinkedHashMap<Object, Entry<Object, Object>> entryMap = new LinkedHashMap<>(); for (String propertyName : propertyNames) { entryMap.put(propertyName, null); } for (Entry<Object, Object> entry : original) { entryMap.put(entry.getKey(), entry); } return new LinkedHashSet<>(entryMap.values()); } @Override public synchronized void putAll(Map<?, ?> t) { super.putAll(t); for (Object name : t.keySet()) { addPropertyName(name); } } @Override public synchronized void clear() { super.clear(); this.propertyNames.clear(); } @Override public synchronized Object remove(Object key) { if (key instanceof String) { this.propertyNames.remove(key); } return super.remove(key); } }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/javaConfigDemo/AnnotationApplication.java
package com.ctrip.framework.apollo.demo.spring.javaConfigDemo; import com.ctrip.framework.apollo.demo.spring.common.bean.AnnotatedBean; import com.google.common.base.Charsets; import com.google.common.base.Strings; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; /** * @author Jason Song([email protected]) */ public class AnnotationApplication { public static void main(String[] args) throws IOException { ApplicationContext context = new AnnotationConfigApplicationContext("com.ctrip.framework.apollo.demo.spring.common"); AnnotatedBean annotatedBean = context.getBean(AnnotatedBean.class); System.out.println("AnnotationApplication Demo. Input any key except quit to print the values. Input quit to exit."); while (true) { System.out.print("> "); String input = new BufferedReader(new InputStreamReader(System.in, Charsets.UTF_8)).readLine(); if (!Strings.isNullOrEmpty(input) && input.trim().equalsIgnoreCase("quit")) { System.exit(0); } System.out.println(annotatedBean.toString()); } } }
package com.ctrip.framework.apollo.demo.spring.javaConfigDemo; import com.ctrip.framework.apollo.demo.spring.common.bean.AnnotatedBean; import com.google.common.base.Charsets; import com.google.common.base.Strings; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; /** * @author Jason Song([email protected]) */ public class AnnotationApplication { public static void main(String[] args) throws IOException { ApplicationContext context = new AnnotationConfigApplicationContext("com.ctrip.framework.apollo.demo.spring.common"); AnnotatedBean annotatedBean = context.getBean(AnnotatedBean.class); System.out.println("AnnotationApplication Demo. Input any key except quit to print the values. Input quit to exit."); while (true) { System.out.print("> "); String input = new BufferedReader(new InputStreamReader(System.in, Charsets.UTF_8)).readLine(); if (!Strings.isNullOrEmpty(input) && input.trim().equalsIgnoreCase("quit")) { System.exit(0); } System.out.println(annotatedBean.toString()); } } }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./scripts/helm/apollo-portal/templates/NOTES.txt
Portal url for current release: {{- if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "apollo.portal.fullName" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "apollo.portal.fullName" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "apollo.portal.serviceName" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") echo http://$SERVICE_IP:{{ .Values.service.port }} {{- else if contains "ClusterIP" .Values.service.type }} export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ include "apollo.portal.fullName" . }}" -o jsonpath="{.items[0].metadata.name}") echo "Visit http://127.0.0.1:8070 to use your application" kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8070:8070 {{- end }} {{- if .Values.ingress.enabled }} Ingress: {{- range $host := .Values.ingress.hosts }} {{- range .paths }} http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} {{- end }} {{- end }} {{- end }}
Portal url for current release: {{- if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "apollo.portal.fullName" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "apollo.portal.fullName" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "apollo.portal.serviceName" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") echo http://$SERVICE_IP:{{ .Values.service.port }} {{- else if contains "ClusterIP" .Values.service.type }} export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ include "apollo.portal.fullName" . }}" -o jsonpath="{.items[0].metadata.name}") echo "Visit http://127.0.0.1:8070 to use your application" kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8070:8070 {{- end }} {{- if .Values.ingress.enabled }} Ingress: {{- range $host := .Values.ingress.hosts }} {{- range .paths }} http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} {{- end }} {{- end }} {{- end }}
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-client/src/test/java/com/ctrip/framework/apollo/internals/DefaultConfigTest.java
package com.ctrip.framework.apollo.internals; import static org.awaitility.Awaitility.await; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import com.ctrip.framework.apollo.enums.ConfigSourceType; import com.ctrip.framework.apollo.util.OrderedProperties; import com.ctrip.framework.apollo.util.factory.PropertiesFactory; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import java.io.File; import java.util.Calendar; import java.util.Date; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.Collections; import java.util.List; import java.util.concurrent.TimeUnit; import com.google.common.base.Function; import com.google.common.base.Splitter; import com.google.common.collect.Lists; import org.awaitility.core.ThrowingRunnable; import org.junit.After; import org.junit.Before; import org.junit.Test; import com.ctrip.framework.apollo.Config; import com.ctrip.framework.apollo.ConfigChangeListener; import com.ctrip.framework.apollo.build.MockInjector; import com.ctrip.framework.apollo.core.utils.ClassLoaderUtil; import com.ctrip.framework.apollo.enums.PropertyChangeType; import com.ctrip.framework.apollo.model.ConfigChange; import com.ctrip.framework.apollo.model.ConfigChangeEvent; import com.ctrip.framework.apollo.util.ConfigUtil; import com.google.common.base.Charsets; import com.google.common.base.Joiner; import com.google.common.collect.ImmutableMap; import com.google.common.io.Files; import com.google.common.util.concurrent.SettableFuture; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; /** * @author Jason Song([email protected]) */ public class DefaultConfigTest { private File someResourceDir; private String someNamespace; private ConfigRepository configRepository; private Properties someProperties; private ConfigSourceType someSourceType; private PropertiesFactory propertiesFactory; @Before public void setUp() throws Exception { MockInjector.setInstance(ConfigUtil.class, new MockConfigUtil()); propertiesFactory = mock(PropertiesFactory.class); when(propertiesFactory.getPropertiesInstance()).thenAnswer(new Answer<Properties>() { @Override public Properties answer(InvocationOnMock invocation) { return new Properties(); } }); MockInjector.setInstance(PropertiesFactory.class, propertiesFactory); someResourceDir = new File(ClassLoaderUtil.getClassPath() + "/META-INF/config"); someResourceDir.mkdirs(); someNamespace = "someName"; configRepository = mock(ConfigRepository.class); } @After public void tearDown() throws Exception { MockInjector.reset(); recursiveDelete(someResourceDir); } //helper method to clean created files private void recursiveDelete(File file) { if (!file.exists()) { return; } if (file.isDirectory()) { for (File f : file.listFiles()) { recursiveDelete(f); } } file.delete(); } @Test public void testGetPropertyWithAllPropertyHierarchy() throws Exception { String someKey = "someKey"; String someSystemPropertyValue = "system-property-value"; String anotherKey = "anotherKey"; String someLocalFileValue = "local-file-value"; String lastKey = "lastKey"; String someResourceValue = "resource-value"; //set up system property System.setProperty(someKey, someSystemPropertyValue); //set up config repo someProperties = new Properties(); someProperties.setProperty(someKey, someLocalFileValue); someProperties.setProperty(anotherKey, someLocalFileValue); when(configRepository.getConfig()).thenReturn(someProperties); someSourceType = ConfigSourceType.LOCAL; when(configRepository.getSourceType()).thenReturn(someSourceType); //set up resource file File resourceFile = new File(someResourceDir, someNamespace + ".properties"); Files.write(someKey + "=" + someResourceValue, resourceFile, Charsets.UTF_8); Files.append(System.getProperty("line.separator"), resourceFile, Charsets.UTF_8); Files.append(anotherKey + "=" + someResourceValue, resourceFile, Charsets.UTF_8); Files.append(System.getProperty("line.separator"), resourceFile, Charsets.UTF_8); Files.append(lastKey + "=" + someResourceValue, resourceFile, Charsets.UTF_8); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); String someKeyValue = defaultConfig.getProperty(someKey, null); String anotherKeyValue = defaultConfig.getProperty(anotherKey, null); String lastKeyValue = defaultConfig.getProperty(lastKey, null); //clean up System.clearProperty(someKey); assertEquals(someSystemPropertyValue, someKeyValue); assertEquals(someLocalFileValue, anotherKeyValue); assertEquals(someResourceValue, lastKeyValue); assertEquals(someSourceType, defaultConfig.getSourceType()); } @Test public void testGetIntProperty() throws Exception { String someStringKey = "someStringKey"; String someStringValue = "someStringValue"; String someKey = "someKey"; Integer someValue = 2; Integer someDefaultValue = -1; //set up config repo someProperties = new Properties(); someProperties.setProperty(someStringKey, someStringValue); someProperties.setProperty(someKey, String.valueOf(someValue)); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); assertEquals(someDefaultValue, defaultConfig.getIntProperty(someStringKey, someDefaultValue)); } @Test public void testGetIntPropertyMultipleTimesWithCache() throws Exception { String someKey = "someKey"; Integer someValue = 2; Integer someDefaultValue = -1; //set up config repo someProperties = mock(Properties.class); when(someProperties.getProperty(someKey)).thenReturn(String.valueOf(someValue)); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); verify(someProperties, times(1)).getProperty(someKey); } @Test public void testGetIntPropertyMultipleTimesWithPropertyChanges() throws Exception { String someKey = "someKey"; Integer someValue = 2; Integer anotherValue = 3; Integer someDefaultValue = -1; //set up config repo someProperties = new Properties(); someProperties.setProperty(someKey, String.valueOf(someValue)); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); Properties anotherProperties = new Properties(); anotherProperties.setProperty(someKey, String.valueOf(anotherValue)); defaultConfig.onRepositoryChange(someNamespace, anotherProperties); assertEquals(anotherValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); } @Test public void testGetIntPropertyMultipleTimesWithSmallCache() throws Exception { String someKey = "someKey"; Integer someValue = 2; String anotherKey = "anotherKey"; Integer anotherValue = 3; Integer someDefaultValue = -1; MockInjector.setInstance(ConfigUtil.class, new MockConfigUtilWithSmallCache()); //set up config repo someProperties = mock(Properties.class); when(someProperties.getProperty(someKey)).thenReturn(String.valueOf(someValue)); when(someProperties.getProperty(anotherKey)).thenReturn(String.valueOf(anotherValue)); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); verify(someProperties, times(1)).getProperty(someKey); assertEquals(anotherValue, defaultConfig.getIntProperty(anotherKey, someDefaultValue)); assertEquals(anotherValue, defaultConfig.getIntProperty(anotherKey, someDefaultValue)); verify(someProperties, times(1)).getProperty(anotherKey); assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); verify(someProperties, times(2)).getProperty(someKey); } @Test public void testGetIntPropertyMultipleTimesWithShortExpireTime() throws Exception { final String someKey = "someKey"; final Integer someValue = 2; final Integer someDefaultValue = -1; MockInjector.setInstance(ConfigUtil.class, new MockConfigUtilWithShortExpireTime()); //set up config repo someProperties = mock(Properties.class); when(someProperties.getProperty(someKey)).thenReturn(String.valueOf(someValue)); when(configRepository.getConfig()).thenReturn(someProperties); final DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); verify(someProperties, times(1)).getProperty(someKey); await().atMost(500, TimeUnit.MILLISECONDS).untilAsserted(new ThrowingRunnable() { @Override public void run() throws Throwable { assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); verify(someProperties, times(2)).getProperty(someKey); } }); } @Test public void testGetLongProperty() throws Exception { String someStringKey = "someStringKey"; String someStringValue = "someStringValue"; String someKey = "someKey"; Long someValue = 2L; Long someDefaultValue = -1L; //set up config repo someProperties = new Properties(); someProperties.setProperty(someStringKey, someStringValue); someProperties.setProperty(someKey, String.valueOf(someValue)); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someValue, defaultConfig.getLongProperty(someKey, someDefaultValue)); assertEquals(someDefaultValue, defaultConfig.getLongProperty(someStringKey, someDefaultValue)); } @Test public void testGetShortProperty() throws Exception { String someStringKey = "someStringKey"; String someStringValue = "someStringValue"; String someKey = "someKey"; Short someValue = 2; Short someDefaultValue = -1; //set up config repo someProperties = new Properties(); someProperties.setProperty(someStringKey, someStringValue); someProperties.setProperty(someKey, String.valueOf(someValue)); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someValue, defaultConfig.getShortProperty(someKey, someDefaultValue)); assertEquals(someDefaultValue, defaultConfig.getShortProperty(someStringKey, someDefaultValue)); } @Test public void testGetFloatProperty() throws Exception { String someStringKey = "someStringKey"; String someStringValue = "someStringValue"; String someKey = "someKey"; Float someValue = 2.20f; Float someDefaultValue = -1f; //set up config repo someProperties = new Properties(); someProperties.setProperty(someStringKey, someStringValue); someProperties.setProperty(someKey, String.valueOf(someValue)); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someValue, defaultConfig.getFloatProperty(someKey, someDefaultValue), 0.001); assertEquals(someDefaultValue, defaultConfig.getFloatProperty(someStringKey, someDefaultValue), 0.001); } @Test public void testGetDoubleProperty() throws Exception { String someStringKey = "someStringKey"; String someStringValue = "someStringValue"; String someKey = "someKey"; Double someValue = 2.20d; Double someDefaultValue = -1d; //set up config repo someProperties = new Properties(); someProperties.setProperty(someStringKey, someStringValue); someProperties.setProperty(someKey, String.valueOf(someValue)); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someValue, defaultConfig.getDoubleProperty(someKey, someDefaultValue), 0.001); assertEquals(someDefaultValue, defaultConfig.getDoubleProperty(someStringKey, someDefaultValue), 0.001); } @Test public void testGetByteProperty() throws Exception { String someStringKey = "someStringKey"; String someStringValue = "someStringValue"; String someKey = "someKey"; Byte someValue = 10; Byte someDefaultValue = -1; //set up config repo someProperties = new Properties(); someProperties.setProperty(someStringKey, someStringValue); someProperties.setProperty(someKey, String.valueOf(someValue)); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someValue, defaultConfig.getByteProperty(someKey, someDefaultValue)); assertEquals(someDefaultValue, defaultConfig.getByteProperty(someStringKey, someDefaultValue)); } @Test public void testGetBooleanProperty() throws Exception { String someStringKey = "someStringKey"; String someStringValue = "someStringValue"; String someKey = "someKey"; Boolean someValue = true; Boolean someDefaultValue = false; //set up config repo someProperties = new Properties(); someProperties.setProperty(someStringKey, someStringValue); someProperties.setProperty(someKey, String.valueOf(someValue)); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someValue, defaultConfig.getBooleanProperty(someKey, someDefaultValue)); assertEquals(someDefaultValue, defaultConfig.getBooleanProperty(someStringKey, someDefaultValue)); } @Test public void testGetArrayProperty() throws Exception { String someKey = "someKey"; String someDelimiter = ","; String someInvalidDelimiter = "{"; String[] values = new String[]{"a", "b", "c"}; String someValue = Joiner.on(someDelimiter).join(values); String[] someDefaultValue = new String[]{"1", "2"}; //set up config repo someProperties = new Properties(); someProperties.setProperty(someKey, someValue); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertArrayEquals(values, defaultConfig.getArrayProperty(someKey, someDelimiter, someDefaultValue)); assertArrayEquals(someDefaultValue, defaultConfig.getArrayProperty(someKey, someInvalidDelimiter, someDefaultValue)); } @Test public void testGetArrayPropertyMultipleTimesWithCache() throws Exception { String someKey = "someKey"; String someDelimiter = ","; String someInvalidDelimiter = "{"; String[] values = new String[]{"a", "b", "c"}; String someValue = Joiner.on(someDelimiter).join(values); String[] someDefaultValue = new String[]{"1", "2"}; //set up config repo someProperties = mock(Properties.class); when(someProperties.getProperty(someKey)).thenReturn(someValue); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertArrayEquals(values, defaultConfig.getArrayProperty(someKey, someDelimiter, someDefaultValue)); assertArrayEquals(values, defaultConfig.getArrayProperty(someKey, someDelimiter, someDefaultValue)); verify(someProperties, times(1)).getProperty(someKey); assertArrayEquals(someDefaultValue, defaultConfig.getArrayProperty(someKey, someInvalidDelimiter, someDefaultValue)); assertArrayEquals(someDefaultValue, defaultConfig.getArrayProperty(someKey, someInvalidDelimiter, someDefaultValue)); verify(someProperties, times(3)).getProperty(someKey); } @Test public void testGetArrayPropertyMultipleTimesWithCacheAndValueChanges() throws Exception { String someKey = "someKey"; String someDelimiter = ","; String[] values = new String[]{"a", "b", "c"}; String[] anotherValues = new String[]{"b", "c", "d"}; String someValue = Joiner.on(someDelimiter).join(values); String anotherValue = Joiner.on(someDelimiter).join(anotherValues); String[] someDefaultValue = new String[]{"1", "2"}; //set up config repo someProperties = new Properties(); someProperties.setProperty(someKey, someValue); when(configRepository.getConfig()).thenReturn(someProperties); Properties anotherProperties = new Properties(); anotherProperties.setProperty(someKey, anotherValue); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertArrayEquals(values, defaultConfig.getArrayProperty(someKey, someDelimiter, someDefaultValue)); defaultConfig.onRepositoryChange(someNamespace, anotherProperties); assertArrayEquals(anotherValues, defaultConfig.getArrayProperty(someKey, someDelimiter, someDefaultValue)); } @Test public void testGetDatePropertyWithFormat() throws Exception { Date someDefaultValue = new Date(); Date shortDate = assembleDate(2016, 9, 28, 0, 0, 0, 0); Date mediumDate = assembleDate(2016, 9, 28, 15, 10, 10, 0); Date longDate = assembleDate(2016, 9, 28, 15, 10, 10, 123); //set up config repo someProperties = new Properties(); someProperties.setProperty("shortDateProperty", "2016-09-28"); someProperties.setProperty("mediumDateProperty", "2016-09-28 15:10:10"); someProperties.setProperty("longDateProperty", "2016-09-28 15:10:10.123"); someProperties.setProperty("stringProperty", "someString"); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); checkDatePropertyWithFormat(defaultConfig, shortDate, "shortDateProperty", "yyyy-MM-dd", someDefaultValue); checkDatePropertyWithFormat(defaultConfig, mediumDate, "mediumDateProperty", "yyyy-MM-dd HH:mm:ss", someDefaultValue); checkDatePropertyWithFormat(defaultConfig, shortDate, "mediumDateProperty", "yyyy-MM-dd", someDefaultValue); checkDatePropertyWithFormat(defaultConfig, longDate, "longDateProperty", "yyyy-MM-dd HH:mm:ss.SSS", someDefaultValue); checkDatePropertyWithFormat(defaultConfig, mediumDate, "longDateProperty", "yyyy-MM-dd HH:mm:ss", someDefaultValue); checkDatePropertyWithFormat(defaultConfig, shortDate, "longDateProperty", "yyyy-MM-dd", someDefaultValue); checkDatePropertyWithFormat(defaultConfig, someDefaultValue, "stringProperty", "yyyy-MM-dd", someDefaultValue); } @Test public void testGetDatePropertyWithNoFormat() throws Exception { Date someDefaultValue = new Date(); Date shortDate = assembleDate(2016, 9, 28, 0, 0, 0, 0); Date mediumDate = assembleDate(2016, 9, 28, 15, 10, 10, 0); Date longDate = assembleDate(2016, 9, 28, 15, 10, 10, 123); //set up config repo someProperties = new Properties(); someProperties.setProperty("shortDateProperty", "2016-09-28"); someProperties.setProperty("mediumDateProperty", "2016-09-28 15:10:10"); someProperties.setProperty("longDateProperty", "2016-09-28 15:10:10.123"); someProperties.setProperty("stringProperty", "someString"); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); checkDatePropertyWithoutFormat(defaultConfig, shortDate, "shortDateProperty", someDefaultValue); checkDatePropertyWithoutFormat(defaultConfig, mediumDate, "mediumDateProperty", someDefaultValue); checkDatePropertyWithoutFormat(defaultConfig, longDate, "longDateProperty", someDefaultValue); checkDatePropertyWithoutFormat(defaultConfig, someDefaultValue, "stringProperty", someDefaultValue); } @Test public void testGetEnumProperty() throws Exception { SomeEnum someDefaultValue = SomeEnum.defaultValue; //set up config repo someProperties = new Properties(); someProperties.setProperty("enumProperty", "someValue"); someProperties.setProperty("stringProperty", "someString"); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(SomeEnum.someValue, defaultConfig.getEnumProperty("enumProperty", SomeEnum.class, someDefaultValue)); assertEquals(someDefaultValue, defaultConfig.getEnumProperty("stringProperty", SomeEnum.class, someDefaultValue)); } @Test public void testGetDurationProperty() throws Exception { long someDefaultValue = 1000; long result = 2 * 24 * 3600 * 1000 + 3 * 3600 * 1000 + 4 * 60 * 1000 + 5 * 1000 + 123; //set up config repo someProperties = new Properties(); someProperties.setProperty("durationProperty", "2D3H4m5S123ms"); someProperties.setProperty("stringProperty", "someString"); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(result, defaultConfig.getDurationProperty("durationProperty", someDefaultValue)); assertEquals(someDefaultValue, defaultConfig.getDurationProperty("stringProperty", someDefaultValue)); } @Test public void testOnRepositoryChange() throws Exception { String someKey = "someKey"; String someSystemPropertyValue = "system-property-value"; String anotherKey = "anotherKey"; String someLocalFileValue = "local-file-value"; String keyToBeDeleted = "keyToBeDeleted"; String keyToBeDeletedValue = "keyToBeDeletedValue"; String yetAnotherKey = "yetAnotherKey"; String yetAnotherValue = "yetAnotherValue"; String yetAnotherResourceValue = "yetAnotherResourceValue"; //set up system property System.setProperty(someKey, someSystemPropertyValue); //set up config repo someProperties = new Properties(); someProperties.putAll(ImmutableMap .of(someKey, someLocalFileValue, anotherKey, someLocalFileValue, keyToBeDeleted, keyToBeDeletedValue, yetAnotherKey, yetAnotherValue)); when(configRepository.getConfig()).thenReturn(someProperties); someSourceType = ConfigSourceType.LOCAL; when(configRepository.getSourceType()).thenReturn(someSourceType); //set up resource file File resourceFile = new File(someResourceDir, someNamespace + ".properties"); Files.append(yetAnotherKey + "=" + yetAnotherResourceValue, resourceFile, Charsets.UTF_8); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someSourceType, defaultConfig.getSourceType()); final SettableFuture<ConfigChangeEvent> configChangeFuture = SettableFuture.create(); ConfigChangeListener someListener = new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { configChangeFuture.set(changeEvent); } }; defaultConfig.addChangeListener(someListener); Properties newProperties = new Properties(); String someKeyNewValue = "new-some-value"; String anotherKeyNewValue = "another-new-value"; String newKey = "newKey"; String newValue = "newValue"; newProperties.putAll(ImmutableMap .of(someKey, someKeyNewValue, anotherKey, anotherKeyNewValue, newKey, newValue)); ConfigSourceType anotherSourceType = ConfigSourceType.REMOTE; when(configRepository.getSourceType()).thenReturn(anotherSourceType); defaultConfig.onRepositoryChange(someNamespace, newProperties); ConfigChangeEvent changeEvent = configChangeFuture.get(500, TimeUnit.MILLISECONDS); //clean up System.clearProperty(someKey); assertEquals(someNamespace, changeEvent.getNamespace()); assertEquals(4, changeEvent.changedKeys().size()); ConfigChange anotherKeyChange = changeEvent.getChange(anotherKey); assertEquals(someLocalFileValue, anotherKeyChange.getOldValue()); assertEquals(anotherKeyNewValue, anotherKeyChange.getNewValue()); assertEquals(PropertyChangeType.MODIFIED, anotherKeyChange.getChangeType()); ConfigChange yetAnotherKeyChange = changeEvent.getChange(yetAnotherKey); assertEquals(yetAnotherValue, yetAnotherKeyChange.getOldValue()); assertEquals(yetAnotherResourceValue, yetAnotherKeyChange.getNewValue()); assertEquals(PropertyChangeType.MODIFIED, yetAnotherKeyChange.getChangeType()); ConfigChange keyToBeDeletedChange = changeEvent.getChange(keyToBeDeleted); assertEquals(keyToBeDeletedValue, keyToBeDeletedChange.getOldValue()); assertEquals(null, keyToBeDeletedChange.getNewValue()); assertEquals(PropertyChangeType.DELETED, keyToBeDeletedChange.getChangeType()); ConfigChange newKeyChange = changeEvent.getChange(newKey); assertEquals(null, newKeyChange.getOldValue()); assertEquals(newValue, newKeyChange.getNewValue()); assertEquals(PropertyChangeType.ADDED, newKeyChange.getChangeType()); assertEquals(anotherSourceType, defaultConfig.getSourceType()); } @Test public void testFireConfigChangeWithInterestedKeys() throws Exception { String someKeyChanged = "someKeyChanged"; String anotherKeyChanged = "anotherKeyChanged"; String someKeyNotChanged = "someKeyNotChanged"; String someNamespace = "someNamespace"; Map<String, ConfigChange> changes = Maps.newHashMap(); changes.put(someKeyChanged, mock(ConfigChange.class)); changes.put(anotherKeyChanged, mock(ConfigChange.class)); ConfigChangeEvent someChangeEvent = new ConfigChangeEvent(someNamespace, changes); final SettableFuture<ConfigChangeEvent> interestedInAllKeysFuture = SettableFuture.create(); ConfigChangeListener interestedInAllKeys = new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { interestedInAllKeysFuture.set(changeEvent); } }; final SettableFuture<ConfigChangeEvent> interestedInSomeKeyFuture = SettableFuture.create(); ConfigChangeListener interestedInSomeKey = new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { interestedInSomeKeyFuture.set(changeEvent); } }; final SettableFuture<ConfigChangeEvent> interestedInSomeKeyNotChangedFuture = SettableFuture.create(); ConfigChangeListener interestedInSomeKeyNotChanged = new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { interestedInSomeKeyNotChangedFuture.set(changeEvent); } }; DefaultConfig config = new DefaultConfig(someNamespace, mock(ConfigRepository.class)); config.addChangeListener(interestedInAllKeys); config.addChangeListener(interestedInSomeKey, Sets.newHashSet(someKeyChanged)); config.addChangeListener(interestedInSomeKeyNotChanged, Sets.newHashSet(someKeyNotChanged)); config.fireConfigChange(someChangeEvent); ConfigChangeEvent changeEvent = interestedInAllKeysFuture.get(500, TimeUnit.MILLISECONDS); assertEquals(someChangeEvent, changeEvent); assertEquals(someChangeEvent, interestedInSomeKeyFuture.get(500, TimeUnit.MILLISECONDS)); assertFalse(interestedInSomeKeyNotChangedFuture.isDone()); } @Test public void testRemoveChangeListener() throws Exception { String someNamespace = "someNamespace"; final ConfigChangeEvent someConfigChangeEvent = mock(ConfigChangeEvent.class); ConfigChangeEvent anotherConfigChangeEvent = mock(ConfigChangeEvent.class); final SettableFuture<ConfigChangeEvent> someListenerFuture1 = SettableFuture.create(); final SettableFuture<ConfigChangeEvent> someListenerFuture2 = SettableFuture.create(); ConfigChangeListener someListener = new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { if (someConfigChangeEvent == changeEvent) { someListenerFuture1.set(changeEvent); } else { someListenerFuture2.set(changeEvent); } } }; final SettableFuture<ConfigChangeEvent> anotherListenerFuture1 = SettableFuture.create(); final SettableFuture<ConfigChangeEvent> anotherListenerFuture2 = SettableFuture.create(); ConfigChangeListener anotherListener = new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { if (someConfigChangeEvent == changeEvent) { anotherListenerFuture1.set(changeEvent); } else { anotherListenerFuture2.set(changeEvent); } } }; ConfigChangeListener yetAnotherListener = mock(ConfigChangeListener.class); DefaultConfig config = new DefaultConfig(someNamespace, mock(ConfigRepository.class)); config.addChangeListener(someListener); config.addChangeListener(anotherListener); config.fireConfigChange(someConfigChangeEvent); assertEquals(someConfigChangeEvent, someListenerFuture1.get(500, TimeUnit.MILLISECONDS)); assertEquals(someConfigChangeEvent, anotherListenerFuture1.get(500, TimeUnit.MILLISECONDS)); assertFalse(config.removeChangeListener(yetAnotherListener)); assertTrue(config.removeChangeListener(someListener)); config.fireConfigChange(anotherConfigChangeEvent); assertEquals(anotherConfigChangeEvent, anotherListenerFuture2.get(500, TimeUnit.MILLISECONDS)); TimeUnit.MILLISECONDS.sleep(100); assertFalse(someListenerFuture2.isDone()); } @Test public void testGetPropertyNames() { String someKeyPrefix = "someKey"; String someValuePrefix = "someValue"; //set up config repo someProperties = new Properties(); for (int i = 0; i < 10; i++) { someProperties.setProperty(someKeyPrefix + i, someValuePrefix + i); } when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); Set<String> propertyNames = defaultConfig.getPropertyNames(); assertEquals(10, propertyNames.size()); assertEquals(someProperties.stringPropertyNames(), propertyNames); } @Test public void testGetPropertyNamesWithOrderedProperties() { String someKeyPrefix = "someKey"; String someValuePrefix = "someValue"; when(propertiesFactory.getPropertiesInstance()).thenAnswer(new Answer<Properties>() { @Override public Properties answer(InvocationOnMock invocation) { return new OrderedProperties(); } }); //set up config repo someProperties = new OrderedProperties(); for (int i = 0; i < 10; i++) { someProperties.setProperty(someKeyPrefix + i, someValuePrefix + i); } when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); Set<String> propertyNames = defaultConfig.getPropertyNames(); assertEquals(10, propertyNames.size()); assertEquals(someProperties.stringPropertyNames(), propertyNames); } @Test public void testGetPropertyNamesWithNullProp() { when(configRepository.getConfig()).thenReturn(null); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); Set<String> propertyNames = defaultConfig.getPropertyNames(); assertEquals(Collections.emptySet(), propertyNames); } @Test public void testGetPropertyWithFunction() throws Exception { String someKey = "someKey"; String someValue = "a,b,c"; String someNullKey = "someNullKey"; //set up config repo someProperties = new Properties(); someProperties.setProperty(someKey, someValue); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(defaultConfig.getProperty(someKey, new Function<String, List<String>>() { @Override public List<String> apply(String s) { return Splitter.on(",").trimResults().omitEmptyStrings().splitToList(s); } }, Lists.<String>newArrayList()), Lists.newArrayList("a", "b", "c")); assertEquals(defaultConfig.getProperty(someNullKey, new Function<String, List<String>>() { @Override public List<String> apply(String s) { return Splitter.on(",").trimResults().omitEmptyStrings().splitToList(s); } }, Lists.<String>newArrayList()), Lists.newArrayList()); } @Test public void testLoadFromRepositoryFailedAndThenRecovered() { String someKey = "someKey"; String someValue = "someValue"; String someDefaultValue = "someDefaultValue"; ConfigSourceType someSourceType = ConfigSourceType.REMOTE; when(configRepository.getConfig()).thenThrow(mock(RuntimeException.class)); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); verify(configRepository, times(1)).addChangeListener(defaultConfig); assertEquals(ConfigSourceType.NONE, defaultConfig.getSourceType()); assertEquals(someDefaultValue, defaultConfig.getProperty(someKey, someDefaultValue)); someProperties = new Properties(); someProperties.setProperty(someKey, someValue); when(configRepository.getSourceType()).thenReturn(someSourceType); defaultConfig.onRepositoryChange(someNamespace, someProperties); assertEquals(someSourceType, defaultConfig.getSourceType()); assertEquals(someValue, defaultConfig.getProperty(someKey, someDefaultValue)); } private void checkDatePropertyWithFormat(Config config, Date expected, String propertyName, String format, Date defaultValue) { assertEquals(expected, config.getDateProperty(propertyName, format, defaultValue)); } private void checkDatePropertyWithoutFormat(Config config, Date expected, String propertyName, Date defaultValue) { assertEquals(expected, config.getDateProperty(propertyName, defaultValue)); } private Date assembleDate(int year, int month, int day, int hour, int minute, int second, int millisecond) { Calendar date = Calendar.getInstance(); date.set(year, month - 1, day, hour, minute, second); //Month in Calendar is 0 based date.set(Calendar.MILLISECOND, millisecond); return date.getTime(); } private enum SomeEnum { someValue, defaultValue } public static class MockConfigUtil extends ConfigUtil { @Override public long getMaxConfigCacheSize() { return 10; } @Override public long getConfigCacheExpireTime() { return 1; } @Override public TimeUnit getConfigCacheExpireTimeUnit() { return TimeUnit.MINUTES; } } public static class MockConfigUtilWithSmallCache extends MockConfigUtil { @Override public long getMaxConfigCacheSize() { return 1; } } public static class MockConfigUtilWithShortExpireTime extends MockConfigUtil { @Override public long getConfigCacheExpireTime() { return 50; } @Override public TimeUnit getConfigCacheExpireTimeUnit() { return TimeUnit.MILLISECONDS; } } }
package com.ctrip.framework.apollo.internals; import static org.awaitility.Awaitility.await; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import com.ctrip.framework.apollo.enums.ConfigSourceType; import com.ctrip.framework.apollo.util.OrderedProperties; import com.ctrip.framework.apollo.util.factory.PropertiesFactory; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import java.io.File; import java.util.Calendar; import java.util.Date; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.Collections; import java.util.List; import java.util.concurrent.TimeUnit; import com.google.common.base.Function; import com.google.common.base.Splitter; import com.google.common.collect.Lists; import org.awaitility.core.ThrowingRunnable; import org.junit.After; import org.junit.Before; import org.junit.Test; import com.ctrip.framework.apollo.Config; import com.ctrip.framework.apollo.ConfigChangeListener; import com.ctrip.framework.apollo.build.MockInjector; import com.ctrip.framework.apollo.core.utils.ClassLoaderUtil; import com.ctrip.framework.apollo.enums.PropertyChangeType; import com.ctrip.framework.apollo.model.ConfigChange; import com.ctrip.framework.apollo.model.ConfigChangeEvent; import com.ctrip.framework.apollo.util.ConfigUtil; import com.google.common.base.Charsets; import com.google.common.base.Joiner; import com.google.common.collect.ImmutableMap; import com.google.common.io.Files; import com.google.common.util.concurrent.SettableFuture; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; /** * @author Jason Song([email protected]) */ public class DefaultConfigTest { private File someResourceDir; private String someNamespace; private ConfigRepository configRepository; private Properties someProperties; private ConfigSourceType someSourceType; private PropertiesFactory propertiesFactory; @Before public void setUp() throws Exception { MockInjector.setInstance(ConfigUtil.class, new MockConfigUtil()); propertiesFactory = mock(PropertiesFactory.class); when(propertiesFactory.getPropertiesInstance()).thenAnswer(new Answer<Properties>() { @Override public Properties answer(InvocationOnMock invocation) { return new Properties(); } }); MockInjector.setInstance(PropertiesFactory.class, propertiesFactory); someResourceDir = new File(ClassLoaderUtil.getClassPath() + "/META-INF/config"); someResourceDir.mkdirs(); someNamespace = "someName"; configRepository = mock(ConfigRepository.class); } @After public void tearDown() throws Exception { MockInjector.reset(); recursiveDelete(someResourceDir); } //helper method to clean created files private void recursiveDelete(File file) { if (!file.exists()) { return; } if (file.isDirectory()) { for (File f : file.listFiles()) { recursiveDelete(f); } } file.delete(); } @Test public void testGetPropertyWithAllPropertyHierarchy() throws Exception { String someKey = "someKey"; String someSystemPropertyValue = "system-property-value"; String anotherKey = "anotherKey"; String someLocalFileValue = "local-file-value"; String lastKey = "lastKey"; String someResourceValue = "resource-value"; //set up system property System.setProperty(someKey, someSystemPropertyValue); //set up config repo someProperties = new Properties(); someProperties.setProperty(someKey, someLocalFileValue); someProperties.setProperty(anotherKey, someLocalFileValue); when(configRepository.getConfig()).thenReturn(someProperties); someSourceType = ConfigSourceType.LOCAL; when(configRepository.getSourceType()).thenReturn(someSourceType); //set up resource file File resourceFile = new File(someResourceDir, someNamespace + ".properties"); Files.write(someKey + "=" + someResourceValue, resourceFile, Charsets.UTF_8); Files.append(System.getProperty("line.separator"), resourceFile, Charsets.UTF_8); Files.append(anotherKey + "=" + someResourceValue, resourceFile, Charsets.UTF_8); Files.append(System.getProperty("line.separator"), resourceFile, Charsets.UTF_8); Files.append(lastKey + "=" + someResourceValue, resourceFile, Charsets.UTF_8); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); String someKeyValue = defaultConfig.getProperty(someKey, null); String anotherKeyValue = defaultConfig.getProperty(anotherKey, null); String lastKeyValue = defaultConfig.getProperty(lastKey, null); //clean up System.clearProperty(someKey); assertEquals(someSystemPropertyValue, someKeyValue); assertEquals(someLocalFileValue, anotherKeyValue); assertEquals(someResourceValue, lastKeyValue); assertEquals(someSourceType, defaultConfig.getSourceType()); } @Test public void testGetIntProperty() throws Exception { String someStringKey = "someStringKey"; String someStringValue = "someStringValue"; String someKey = "someKey"; Integer someValue = 2; Integer someDefaultValue = -1; //set up config repo someProperties = new Properties(); someProperties.setProperty(someStringKey, someStringValue); someProperties.setProperty(someKey, String.valueOf(someValue)); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); assertEquals(someDefaultValue, defaultConfig.getIntProperty(someStringKey, someDefaultValue)); } @Test public void testGetIntPropertyMultipleTimesWithCache() throws Exception { String someKey = "someKey"; Integer someValue = 2; Integer someDefaultValue = -1; //set up config repo someProperties = mock(Properties.class); when(someProperties.getProperty(someKey)).thenReturn(String.valueOf(someValue)); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); verify(someProperties, times(1)).getProperty(someKey); } @Test public void testGetIntPropertyMultipleTimesWithPropertyChanges() throws Exception { String someKey = "someKey"; Integer someValue = 2; Integer anotherValue = 3; Integer someDefaultValue = -1; //set up config repo someProperties = new Properties(); someProperties.setProperty(someKey, String.valueOf(someValue)); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); Properties anotherProperties = new Properties(); anotherProperties.setProperty(someKey, String.valueOf(anotherValue)); defaultConfig.onRepositoryChange(someNamespace, anotherProperties); assertEquals(anotherValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); } @Test public void testGetIntPropertyMultipleTimesWithSmallCache() throws Exception { String someKey = "someKey"; Integer someValue = 2; String anotherKey = "anotherKey"; Integer anotherValue = 3; Integer someDefaultValue = -1; MockInjector.setInstance(ConfigUtil.class, new MockConfigUtilWithSmallCache()); //set up config repo someProperties = mock(Properties.class); when(someProperties.getProperty(someKey)).thenReturn(String.valueOf(someValue)); when(someProperties.getProperty(anotherKey)).thenReturn(String.valueOf(anotherValue)); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); verify(someProperties, times(1)).getProperty(someKey); assertEquals(anotherValue, defaultConfig.getIntProperty(anotherKey, someDefaultValue)); assertEquals(anotherValue, defaultConfig.getIntProperty(anotherKey, someDefaultValue)); verify(someProperties, times(1)).getProperty(anotherKey); assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); verify(someProperties, times(2)).getProperty(someKey); } @Test public void testGetIntPropertyMultipleTimesWithShortExpireTime() throws Exception { final String someKey = "someKey"; final Integer someValue = 2; final Integer someDefaultValue = -1; MockInjector.setInstance(ConfigUtil.class, new MockConfigUtilWithShortExpireTime()); //set up config repo someProperties = mock(Properties.class); when(someProperties.getProperty(someKey)).thenReturn(String.valueOf(someValue)); when(configRepository.getConfig()).thenReturn(someProperties); final DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); verify(someProperties, times(1)).getProperty(someKey); await().atMost(500, TimeUnit.MILLISECONDS).untilAsserted(new ThrowingRunnable() { @Override public void run() throws Throwable { assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); assertEquals(someValue, defaultConfig.getIntProperty(someKey, someDefaultValue)); verify(someProperties, times(2)).getProperty(someKey); } }); } @Test public void testGetLongProperty() throws Exception { String someStringKey = "someStringKey"; String someStringValue = "someStringValue"; String someKey = "someKey"; Long someValue = 2L; Long someDefaultValue = -1L; //set up config repo someProperties = new Properties(); someProperties.setProperty(someStringKey, someStringValue); someProperties.setProperty(someKey, String.valueOf(someValue)); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someValue, defaultConfig.getLongProperty(someKey, someDefaultValue)); assertEquals(someDefaultValue, defaultConfig.getLongProperty(someStringKey, someDefaultValue)); } @Test public void testGetShortProperty() throws Exception { String someStringKey = "someStringKey"; String someStringValue = "someStringValue"; String someKey = "someKey"; Short someValue = 2; Short someDefaultValue = -1; //set up config repo someProperties = new Properties(); someProperties.setProperty(someStringKey, someStringValue); someProperties.setProperty(someKey, String.valueOf(someValue)); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someValue, defaultConfig.getShortProperty(someKey, someDefaultValue)); assertEquals(someDefaultValue, defaultConfig.getShortProperty(someStringKey, someDefaultValue)); } @Test public void testGetFloatProperty() throws Exception { String someStringKey = "someStringKey"; String someStringValue = "someStringValue"; String someKey = "someKey"; Float someValue = 2.20f; Float someDefaultValue = -1f; //set up config repo someProperties = new Properties(); someProperties.setProperty(someStringKey, someStringValue); someProperties.setProperty(someKey, String.valueOf(someValue)); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someValue, defaultConfig.getFloatProperty(someKey, someDefaultValue), 0.001); assertEquals(someDefaultValue, defaultConfig.getFloatProperty(someStringKey, someDefaultValue), 0.001); } @Test public void testGetDoubleProperty() throws Exception { String someStringKey = "someStringKey"; String someStringValue = "someStringValue"; String someKey = "someKey"; Double someValue = 2.20d; Double someDefaultValue = -1d; //set up config repo someProperties = new Properties(); someProperties.setProperty(someStringKey, someStringValue); someProperties.setProperty(someKey, String.valueOf(someValue)); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someValue, defaultConfig.getDoubleProperty(someKey, someDefaultValue), 0.001); assertEquals(someDefaultValue, defaultConfig.getDoubleProperty(someStringKey, someDefaultValue), 0.001); } @Test public void testGetByteProperty() throws Exception { String someStringKey = "someStringKey"; String someStringValue = "someStringValue"; String someKey = "someKey"; Byte someValue = 10; Byte someDefaultValue = -1; //set up config repo someProperties = new Properties(); someProperties.setProperty(someStringKey, someStringValue); someProperties.setProperty(someKey, String.valueOf(someValue)); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someValue, defaultConfig.getByteProperty(someKey, someDefaultValue)); assertEquals(someDefaultValue, defaultConfig.getByteProperty(someStringKey, someDefaultValue)); } @Test public void testGetBooleanProperty() throws Exception { String someStringKey = "someStringKey"; String someStringValue = "someStringValue"; String someKey = "someKey"; Boolean someValue = true; Boolean someDefaultValue = false; //set up config repo someProperties = new Properties(); someProperties.setProperty(someStringKey, someStringValue); someProperties.setProperty(someKey, String.valueOf(someValue)); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someValue, defaultConfig.getBooleanProperty(someKey, someDefaultValue)); assertEquals(someDefaultValue, defaultConfig.getBooleanProperty(someStringKey, someDefaultValue)); } @Test public void testGetArrayProperty() throws Exception { String someKey = "someKey"; String someDelimiter = ","; String someInvalidDelimiter = "{"; String[] values = new String[]{"a", "b", "c"}; String someValue = Joiner.on(someDelimiter).join(values); String[] someDefaultValue = new String[]{"1", "2"}; //set up config repo someProperties = new Properties(); someProperties.setProperty(someKey, someValue); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertArrayEquals(values, defaultConfig.getArrayProperty(someKey, someDelimiter, someDefaultValue)); assertArrayEquals(someDefaultValue, defaultConfig.getArrayProperty(someKey, someInvalidDelimiter, someDefaultValue)); } @Test public void testGetArrayPropertyMultipleTimesWithCache() throws Exception { String someKey = "someKey"; String someDelimiter = ","; String someInvalidDelimiter = "{"; String[] values = new String[]{"a", "b", "c"}; String someValue = Joiner.on(someDelimiter).join(values); String[] someDefaultValue = new String[]{"1", "2"}; //set up config repo someProperties = mock(Properties.class); when(someProperties.getProperty(someKey)).thenReturn(someValue); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertArrayEquals(values, defaultConfig.getArrayProperty(someKey, someDelimiter, someDefaultValue)); assertArrayEquals(values, defaultConfig.getArrayProperty(someKey, someDelimiter, someDefaultValue)); verify(someProperties, times(1)).getProperty(someKey); assertArrayEquals(someDefaultValue, defaultConfig.getArrayProperty(someKey, someInvalidDelimiter, someDefaultValue)); assertArrayEquals(someDefaultValue, defaultConfig.getArrayProperty(someKey, someInvalidDelimiter, someDefaultValue)); verify(someProperties, times(3)).getProperty(someKey); } @Test public void testGetArrayPropertyMultipleTimesWithCacheAndValueChanges() throws Exception { String someKey = "someKey"; String someDelimiter = ","; String[] values = new String[]{"a", "b", "c"}; String[] anotherValues = new String[]{"b", "c", "d"}; String someValue = Joiner.on(someDelimiter).join(values); String anotherValue = Joiner.on(someDelimiter).join(anotherValues); String[] someDefaultValue = new String[]{"1", "2"}; //set up config repo someProperties = new Properties(); someProperties.setProperty(someKey, someValue); when(configRepository.getConfig()).thenReturn(someProperties); Properties anotherProperties = new Properties(); anotherProperties.setProperty(someKey, anotherValue); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertArrayEquals(values, defaultConfig.getArrayProperty(someKey, someDelimiter, someDefaultValue)); defaultConfig.onRepositoryChange(someNamespace, anotherProperties); assertArrayEquals(anotherValues, defaultConfig.getArrayProperty(someKey, someDelimiter, someDefaultValue)); } @Test public void testGetDatePropertyWithFormat() throws Exception { Date someDefaultValue = new Date(); Date shortDate = assembleDate(2016, 9, 28, 0, 0, 0, 0); Date mediumDate = assembleDate(2016, 9, 28, 15, 10, 10, 0); Date longDate = assembleDate(2016, 9, 28, 15, 10, 10, 123); //set up config repo someProperties = new Properties(); someProperties.setProperty("shortDateProperty", "2016-09-28"); someProperties.setProperty("mediumDateProperty", "2016-09-28 15:10:10"); someProperties.setProperty("longDateProperty", "2016-09-28 15:10:10.123"); someProperties.setProperty("stringProperty", "someString"); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); checkDatePropertyWithFormat(defaultConfig, shortDate, "shortDateProperty", "yyyy-MM-dd", someDefaultValue); checkDatePropertyWithFormat(defaultConfig, mediumDate, "mediumDateProperty", "yyyy-MM-dd HH:mm:ss", someDefaultValue); checkDatePropertyWithFormat(defaultConfig, shortDate, "mediumDateProperty", "yyyy-MM-dd", someDefaultValue); checkDatePropertyWithFormat(defaultConfig, longDate, "longDateProperty", "yyyy-MM-dd HH:mm:ss.SSS", someDefaultValue); checkDatePropertyWithFormat(defaultConfig, mediumDate, "longDateProperty", "yyyy-MM-dd HH:mm:ss", someDefaultValue); checkDatePropertyWithFormat(defaultConfig, shortDate, "longDateProperty", "yyyy-MM-dd", someDefaultValue); checkDatePropertyWithFormat(defaultConfig, someDefaultValue, "stringProperty", "yyyy-MM-dd", someDefaultValue); } @Test public void testGetDatePropertyWithNoFormat() throws Exception { Date someDefaultValue = new Date(); Date shortDate = assembleDate(2016, 9, 28, 0, 0, 0, 0); Date mediumDate = assembleDate(2016, 9, 28, 15, 10, 10, 0); Date longDate = assembleDate(2016, 9, 28, 15, 10, 10, 123); //set up config repo someProperties = new Properties(); someProperties.setProperty("shortDateProperty", "2016-09-28"); someProperties.setProperty("mediumDateProperty", "2016-09-28 15:10:10"); someProperties.setProperty("longDateProperty", "2016-09-28 15:10:10.123"); someProperties.setProperty("stringProperty", "someString"); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); checkDatePropertyWithoutFormat(defaultConfig, shortDate, "shortDateProperty", someDefaultValue); checkDatePropertyWithoutFormat(defaultConfig, mediumDate, "mediumDateProperty", someDefaultValue); checkDatePropertyWithoutFormat(defaultConfig, longDate, "longDateProperty", someDefaultValue); checkDatePropertyWithoutFormat(defaultConfig, someDefaultValue, "stringProperty", someDefaultValue); } @Test public void testGetEnumProperty() throws Exception { SomeEnum someDefaultValue = SomeEnum.defaultValue; //set up config repo someProperties = new Properties(); someProperties.setProperty("enumProperty", "someValue"); someProperties.setProperty("stringProperty", "someString"); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(SomeEnum.someValue, defaultConfig.getEnumProperty("enumProperty", SomeEnum.class, someDefaultValue)); assertEquals(someDefaultValue, defaultConfig.getEnumProperty("stringProperty", SomeEnum.class, someDefaultValue)); } @Test public void testGetDurationProperty() throws Exception { long someDefaultValue = 1000; long result = 2 * 24 * 3600 * 1000 + 3 * 3600 * 1000 + 4 * 60 * 1000 + 5 * 1000 + 123; //set up config repo someProperties = new Properties(); someProperties.setProperty("durationProperty", "2D3H4m5S123ms"); someProperties.setProperty("stringProperty", "someString"); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(result, defaultConfig.getDurationProperty("durationProperty", someDefaultValue)); assertEquals(someDefaultValue, defaultConfig.getDurationProperty("stringProperty", someDefaultValue)); } @Test public void testOnRepositoryChange() throws Exception { String someKey = "someKey"; String someSystemPropertyValue = "system-property-value"; String anotherKey = "anotherKey"; String someLocalFileValue = "local-file-value"; String keyToBeDeleted = "keyToBeDeleted"; String keyToBeDeletedValue = "keyToBeDeletedValue"; String yetAnotherKey = "yetAnotherKey"; String yetAnotherValue = "yetAnotherValue"; String yetAnotherResourceValue = "yetAnotherResourceValue"; //set up system property System.setProperty(someKey, someSystemPropertyValue); //set up config repo someProperties = new Properties(); someProperties.putAll(ImmutableMap .of(someKey, someLocalFileValue, anotherKey, someLocalFileValue, keyToBeDeleted, keyToBeDeletedValue, yetAnotherKey, yetAnotherValue)); when(configRepository.getConfig()).thenReturn(someProperties); someSourceType = ConfigSourceType.LOCAL; when(configRepository.getSourceType()).thenReturn(someSourceType); //set up resource file File resourceFile = new File(someResourceDir, someNamespace + ".properties"); Files.append(yetAnotherKey + "=" + yetAnotherResourceValue, resourceFile, Charsets.UTF_8); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(someSourceType, defaultConfig.getSourceType()); final SettableFuture<ConfigChangeEvent> configChangeFuture = SettableFuture.create(); ConfigChangeListener someListener = new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { configChangeFuture.set(changeEvent); } }; defaultConfig.addChangeListener(someListener); Properties newProperties = new Properties(); String someKeyNewValue = "new-some-value"; String anotherKeyNewValue = "another-new-value"; String newKey = "newKey"; String newValue = "newValue"; newProperties.putAll(ImmutableMap .of(someKey, someKeyNewValue, anotherKey, anotherKeyNewValue, newKey, newValue)); ConfigSourceType anotherSourceType = ConfigSourceType.REMOTE; when(configRepository.getSourceType()).thenReturn(anotherSourceType); defaultConfig.onRepositoryChange(someNamespace, newProperties); ConfigChangeEvent changeEvent = configChangeFuture.get(500, TimeUnit.MILLISECONDS); //clean up System.clearProperty(someKey); assertEquals(someNamespace, changeEvent.getNamespace()); assertEquals(4, changeEvent.changedKeys().size()); ConfigChange anotherKeyChange = changeEvent.getChange(anotherKey); assertEquals(someLocalFileValue, anotherKeyChange.getOldValue()); assertEquals(anotherKeyNewValue, anotherKeyChange.getNewValue()); assertEquals(PropertyChangeType.MODIFIED, anotherKeyChange.getChangeType()); ConfigChange yetAnotherKeyChange = changeEvent.getChange(yetAnotherKey); assertEquals(yetAnotherValue, yetAnotherKeyChange.getOldValue()); assertEquals(yetAnotherResourceValue, yetAnotherKeyChange.getNewValue()); assertEquals(PropertyChangeType.MODIFIED, yetAnotherKeyChange.getChangeType()); ConfigChange keyToBeDeletedChange = changeEvent.getChange(keyToBeDeleted); assertEquals(keyToBeDeletedValue, keyToBeDeletedChange.getOldValue()); assertEquals(null, keyToBeDeletedChange.getNewValue()); assertEquals(PropertyChangeType.DELETED, keyToBeDeletedChange.getChangeType()); ConfigChange newKeyChange = changeEvent.getChange(newKey); assertEquals(null, newKeyChange.getOldValue()); assertEquals(newValue, newKeyChange.getNewValue()); assertEquals(PropertyChangeType.ADDED, newKeyChange.getChangeType()); assertEquals(anotherSourceType, defaultConfig.getSourceType()); } @Test public void testFireConfigChangeWithInterestedKeys() throws Exception { String someKeyChanged = "someKeyChanged"; String anotherKeyChanged = "anotherKeyChanged"; String someKeyNotChanged = "someKeyNotChanged"; String someNamespace = "someNamespace"; Map<String, ConfigChange> changes = Maps.newHashMap(); changes.put(someKeyChanged, mock(ConfigChange.class)); changes.put(anotherKeyChanged, mock(ConfigChange.class)); ConfigChangeEvent someChangeEvent = new ConfigChangeEvent(someNamespace, changes); final SettableFuture<ConfigChangeEvent> interestedInAllKeysFuture = SettableFuture.create(); ConfigChangeListener interestedInAllKeys = new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { interestedInAllKeysFuture.set(changeEvent); } }; final SettableFuture<ConfigChangeEvent> interestedInSomeKeyFuture = SettableFuture.create(); ConfigChangeListener interestedInSomeKey = new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { interestedInSomeKeyFuture.set(changeEvent); } }; final SettableFuture<ConfigChangeEvent> interestedInSomeKeyNotChangedFuture = SettableFuture.create(); ConfigChangeListener interestedInSomeKeyNotChanged = new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { interestedInSomeKeyNotChangedFuture.set(changeEvent); } }; DefaultConfig config = new DefaultConfig(someNamespace, mock(ConfigRepository.class)); config.addChangeListener(interestedInAllKeys); config.addChangeListener(interestedInSomeKey, Sets.newHashSet(someKeyChanged)); config.addChangeListener(interestedInSomeKeyNotChanged, Sets.newHashSet(someKeyNotChanged)); config.fireConfigChange(someChangeEvent); ConfigChangeEvent changeEvent = interestedInAllKeysFuture.get(500, TimeUnit.MILLISECONDS); assertEquals(someChangeEvent, changeEvent); assertEquals(someChangeEvent, interestedInSomeKeyFuture.get(500, TimeUnit.MILLISECONDS)); assertFalse(interestedInSomeKeyNotChangedFuture.isDone()); } @Test public void testRemoveChangeListener() throws Exception { String someNamespace = "someNamespace"; final ConfigChangeEvent someConfigChangeEvent = mock(ConfigChangeEvent.class); ConfigChangeEvent anotherConfigChangeEvent = mock(ConfigChangeEvent.class); final SettableFuture<ConfigChangeEvent> someListenerFuture1 = SettableFuture.create(); final SettableFuture<ConfigChangeEvent> someListenerFuture2 = SettableFuture.create(); ConfigChangeListener someListener = new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { if (someConfigChangeEvent == changeEvent) { someListenerFuture1.set(changeEvent); } else { someListenerFuture2.set(changeEvent); } } }; final SettableFuture<ConfigChangeEvent> anotherListenerFuture1 = SettableFuture.create(); final SettableFuture<ConfigChangeEvent> anotherListenerFuture2 = SettableFuture.create(); ConfigChangeListener anotherListener = new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { if (someConfigChangeEvent == changeEvent) { anotherListenerFuture1.set(changeEvent); } else { anotherListenerFuture2.set(changeEvent); } } }; ConfigChangeListener yetAnotherListener = mock(ConfigChangeListener.class); DefaultConfig config = new DefaultConfig(someNamespace, mock(ConfigRepository.class)); config.addChangeListener(someListener); config.addChangeListener(anotherListener); config.fireConfigChange(someConfigChangeEvent); assertEquals(someConfigChangeEvent, someListenerFuture1.get(500, TimeUnit.MILLISECONDS)); assertEquals(someConfigChangeEvent, anotherListenerFuture1.get(500, TimeUnit.MILLISECONDS)); assertFalse(config.removeChangeListener(yetAnotherListener)); assertTrue(config.removeChangeListener(someListener)); config.fireConfigChange(anotherConfigChangeEvent); assertEquals(anotherConfigChangeEvent, anotherListenerFuture2.get(500, TimeUnit.MILLISECONDS)); TimeUnit.MILLISECONDS.sleep(100); assertFalse(someListenerFuture2.isDone()); } @Test public void testGetPropertyNames() { String someKeyPrefix = "someKey"; String someValuePrefix = "someValue"; //set up config repo someProperties = new Properties(); for (int i = 0; i < 10; i++) { someProperties.setProperty(someKeyPrefix + i, someValuePrefix + i); } when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); Set<String> propertyNames = defaultConfig.getPropertyNames(); assertEquals(10, propertyNames.size()); assertEquals(someProperties.stringPropertyNames(), propertyNames); } @Test public void testGetPropertyNamesWithOrderedProperties() { String someKeyPrefix = "someKey"; String someValuePrefix = "someValue"; when(propertiesFactory.getPropertiesInstance()).thenAnswer(new Answer<Properties>() { @Override public Properties answer(InvocationOnMock invocation) { return new OrderedProperties(); } }); //set up config repo someProperties = new OrderedProperties(); for (int i = 0; i < 10; i++) { someProperties.setProperty(someKeyPrefix + i, someValuePrefix + i); } when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); Set<String> propertyNames = defaultConfig.getPropertyNames(); assertEquals(10, propertyNames.size()); assertEquals(someProperties.stringPropertyNames(), propertyNames); } @Test public void testGetPropertyNamesWithNullProp() { when(configRepository.getConfig()).thenReturn(null); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); Set<String> propertyNames = defaultConfig.getPropertyNames(); assertEquals(Collections.emptySet(), propertyNames); } @Test public void testGetPropertyWithFunction() throws Exception { String someKey = "someKey"; String someValue = "a,b,c"; String someNullKey = "someNullKey"; //set up config repo someProperties = new Properties(); someProperties.setProperty(someKey, someValue); when(configRepository.getConfig()).thenReturn(someProperties); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); assertEquals(defaultConfig.getProperty(someKey, new Function<String, List<String>>() { @Override public List<String> apply(String s) { return Splitter.on(",").trimResults().omitEmptyStrings().splitToList(s); } }, Lists.<String>newArrayList()), Lists.newArrayList("a", "b", "c")); assertEquals(defaultConfig.getProperty(someNullKey, new Function<String, List<String>>() { @Override public List<String> apply(String s) { return Splitter.on(",").trimResults().omitEmptyStrings().splitToList(s); } }, Lists.<String>newArrayList()), Lists.newArrayList()); } @Test public void testLoadFromRepositoryFailedAndThenRecovered() { String someKey = "someKey"; String someValue = "someValue"; String someDefaultValue = "someDefaultValue"; ConfigSourceType someSourceType = ConfigSourceType.REMOTE; when(configRepository.getConfig()).thenThrow(mock(RuntimeException.class)); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); verify(configRepository, times(1)).addChangeListener(defaultConfig); assertEquals(ConfigSourceType.NONE, defaultConfig.getSourceType()); assertEquals(someDefaultValue, defaultConfig.getProperty(someKey, someDefaultValue)); someProperties = new Properties(); someProperties.setProperty(someKey, someValue); when(configRepository.getSourceType()).thenReturn(someSourceType); defaultConfig.onRepositoryChange(someNamespace, someProperties); assertEquals(someSourceType, defaultConfig.getSourceType()); assertEquals(someValue, defaultConfig.getProperty(someKey, someDefaultValue)); } private void checkDatePropertyWithFormat(Config config, Date expected, String propertyName, String format, Date defaultValue) { assertEquals(expected, config.getDateProperty(propertyName, format, defaultValue)); } private void checkDatePropertyWithoutFormat(Config config, Date expected, String propertyName, Date defaultValue) { assertEquals(expected, config.getDateProperty(propertyName, defaultValue)); } private Date assembleDate(int year, int month, int day, int hour, int minute, int second, int millisecond) { Calendar date = Calendar.getInstance(); date.set(year, month - 1, day, hour, minute, second); //Month in Calendar is 0 based date.set(Calendar.MILLISECOND, millisecond); return date.getTime(); } private enum SomeEnum { someValue, defaultValue } public static class MockConfigUtil extends ConfigUtil { @Override public long getMaxConfigCacheSize() { return 10; } @Override public long getConfigCacheExpireTime() { return 1; } @Override public TimeUnit getConfigCacheExpireTimeUnit() { return TimeUnit.MINUTES; } } public static class MockConfigUtilWithSmallCache extends MockConfigUtil { @Override public long getMaxConfigCacheSize() { return 1; } } public static class MockConfigUtilWithShortExpireTime extends MockConfigUtil { @Override public long getConfigCacheExpireTime() { return 50; } @Override public TimeUnit getConfigCacheExpireTimeUnit() { return TimeUnit.MILLISECONDS; } } }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-mockserver/src/test/java/com/ctrip/framework/apollo/mockserver/ApolloMockServerSpringIntegrationTest.java
package com.ctrip.framework.apollo.mockserver; import com.ctrip.framework.apollo.enums.PropertyChangeType; import com.ctrip.framework.apollo.mockserver.ApolloMockServerSpringIntegrationTest.TestConfiguration; import com.ctrip.framework.apollo.model.ConfigChangeEvent; import com.ctrip.framework.apollo.spring.annotation.ApolloConfigChangeListener; import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig; import com.google.common.util.concurrent.SettableFuture; import org.junit.ClassRule; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import static org.junit.Assert.assertEquals; /** * Create by zhangzheng on 8/16/18 Email:[email protected] */ @RunWith(SpringJUnit4ClassRunner.class) @SpringBootTest(classes = TestConfiguration.class) public class ApolloMockServerSpringIntegrationTest { private static final String otherNamespace = "otherNamespace"; @ClassRule public static EmbeddedApollo embeddedApollo = new EmbeddedApollo(); @Autowired private TestBean testBean; @Autowired private TestInterestedKeyPrefixesBean testInterestedKeyPrefixesBean; @Test @DirtiesContext public void testPropertyInject() { assertEquals("value1", testBean.key1); assertEquals("value2", testBean.key2); } @Test @DirtiesContext public void testListenerTriggeredByAdd() throws InterruptedException, ExecutionException, TimeoutException { embeddedApollo.addOrModifyProperty(otherNamespace, "someKey", "someValue"); ConfigChangeEvent changeEvent = testBean.futureData.get(5000, TimeUnit.MILLISECONDS); assertEquals(otherNamespace, changeEvent.getNamespace()); assertEquals("someValue", changeEvent.getChange("someKey").getNewValue()); } @Test @DirtiesContext public void testListenerTriggeredByDel() throws InterruptedException, ExecutionException, TimeoutException { embeddedApollo.deleteProperty(otherNamespace, "key1"); ConfigChangeEvent changeEvent = testBean.futureData.get(5000, TimeUnit.MILLISECONDS); assertEquals(otherNamespace, changeEvent.getNamespace()); assertEquals(PropertyChangeType.DELETED, changeEvent.getChange("key1").getChangeType()); } @Test @DirtiesContext public void shouldNotifyOnInterestedPatterns() throws Exception { embeddedApollo.addOrModifyProperty(otherNamespace, "server.port", "8080"); embeddedApollo.addOrModifyProperty(otherNamespace, "server.path", "/apollo"); embeddedApollo.addOrModifyProperty(otherNamespace, "spring.application.name", "whatever"); ConfigChangeEvent changeEvent = testInterestedKeyPrefixesBean.futureData.get(5000, TimeUnit.MILLISECONDS); assertEquals(otherNamespace, changeEvent.getNamespace()); assertEquals("8080", changeEvent.getChange("server.port").getNewValue()); assertEquals("/apollo", changeEvent.getChange("server.path").getNewValue()); } @Test(expected = TimeoutException.class) @DirtiesContext public void shouldNotNotifyOnUninterestedPatterns() throws Exception { embeddedApollo.addOrModifyProperty(otherNamespace, "spring.application.name", "apollo"); testInterestedKeyPrefixesBean.futureData.get(5000, TimeUnit.MILLISECONDS); } @EnableApolloConfig @Configuration static class TestConfiguration { @Bean public TestBean testBean() { return new TestBean(); } @Bean public TestInterestedKeyPrefixesBean testInterestedKeyPrefixesBean() { return new TestInterestedKeyPrefixesBean(); } } private static class TestBean { @Value("${key1:default}") private String key1; @Value("${key2:default}") private String key2; private SettableFuture<ConfigChangeEvent> futureData = SettableFuture.create(); @ApolloConfigChangeListener(otherNamespace) private void onChange(ConfigChangeEvent changeEvent) { futureData.set(changeEvent); } } private static class TestInterestedKeyPrefixesBean { private SettableFuture<ConfigChangeEvent> futureData = SettableFuture.create(); @ApolloConfigChangeListener(value = otherNamespace, interestedKeyPrefixes = "server.") private void onChange(ConfigChangeEvent changeEvent) { futureData.set(changeEvent); } } }
package com.ctrip.framework.apollo.mockserver; import com.ctrip.framework.apollo.enums.PropertyChangeType; import com.ctrip.framework.apollo.mockserver.ApolloMockServerSpringIntegrationTest.TestConfiguration; import com.ctrip.framework.apollo.model.ConfigChangeEvent; import com.ctrip.framework.apollo.spring.annotation.ApolloConfigChangeListener; import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig; import com.google.common.util.concurrent.SettableFuture; import org.junit.ClassRule; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import static org.junit.Assert.assertEquals; /** * Create by zhangzheng on 8/16/18 Email:[email protected] */ @RunWith(SpringJUnit4ClassRunner.class) @SpringBootTest(classes = TestConfiguration.class) public class ApolloMockServerSpringIntegrationTest { private static final String otherNamespace = "otherNamespace"; @ClassRule public static EmbeddedApollo embeddedApollo = new EmbeddedApollo(); @Autowired private TestBean testBean; @Autowired private TestInterestedKeyPrefixesBean testInterestedKeyPrefixesBean; @Test @DirtiesContext public void testPropertyInject() { assertEquals("value1", testBean.key1); assertEquals("value2", testBean.key2); } @Test @DirtiesContext public void testListenerTriggeredByAdd() throws InterruptedException, ExecutionException, TimeoutException { embeddedApollo.addOrModifyProperty(otherNamespace, "someKey", "someValue"); ConfigChangeEvent changeEvent = testBean.futureData.get(5000, TimeUnit.MILLISECONDS); assertEquals(otherNamespace, changeEvent.getNamespace()); assertEquals("someValue", changeEvent.getChange("someKey").getNewValue()); } @Test @DirtiesContext public void testListenerTriggeredByDel() throws InterruptedException, ExecutionException, TimeoutException { embeddedApollo.deleteProperty(otherNamespace, "key1"); ConfigChangeEvent changeEvent = testBean.futureData.get(5000, TimeUnit.MILLISECONDS); assertEquals(otherNamespace, changeEvent.getNamespace()); assertEquals(PropertyChangeType.DELETED, changeEvent.getChange("key1").getChangeType()); } @Test @DirtiesContext public void shouldNotifyOnInterestedPatterns() throws Exception { embeddedApollo.addOrModifyProperty(otherNamespace, "server.port", "8080"); embeddedApollo.addOrModifyProperty(otherNamespace, "server.path", "/apollo"); embeddedApollo.addOrModifyProperty(otherNamespace, "spring.application.name", "whatever"); ConfigChangeEvent changeEvent = testInterestedKeyPrefixesBean.futureData.get(5000, TimeUnit.MILLISECONDS); assertEquals(otherNamespace, changeEvent.getNamespace()); assertEquals("8080", changeEvent.getChange("server.port").getNewValue()); assertEquals("/apollo", changeEvent.getChange("server.path").getNewValue()); } @Test(expected = TimeoutException.class) @DirtiesContext public void shouldNotNotifyOnUninterestedPatterns() throws Exception { embeddedApollo.addOrModifyProperty(otherNamespace, "spring.application.name", "apollo"); testInterestedKeyPrefixesBean.futureData.get(5000, TimeUnit.MILLISECONDS); } @EnableApolloConfig @Configuration static class TestConfiguration { @Bean public TestBean testBean() { return new TestBean(); } @Bean public TestInterestedKeyPrefixesBean testInterestedKeyPrefixesBean() { return new TestInterestedKeyPrefixesBean(); } } private static class TestBean { @Value("${key1:default}") private String key1; @Value("${key2:default}") private String key2; private SettableFuture<ConfigChangeEvent> futureData = SettableFuture.create(); @ApolloConfigChangeListener(otherNamespace) private void onChange(ConfigChangeEvent changeEvent) { futureData.set(changeEvent); } } private static class TestInterestedKeyPrefixesBean { private SettableFuture<ConfigChangeEvent> futureData = SettableFuture.create(); @ApolloConfigChangeListener(value = otherNamespace, interestedKeyPrefixes = "server.") private void onChange(ConfigChangeEvent changeEvent) { futureData.set(changeEvent); } } }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-openapi/src/main/java/com/ctrip/framework/apollo/openapi/dto/NamespaceReleaseDTO.java
package com.ctrip.framework.apollo.openapi.dto; public class NamespaceReleaseDTO { private String releaseTitle; private String releaseComment; private String releasedBy; private boolean isEmergencyPublish; public String getReleaseTitle() { return releaseTitle; } public void setReleaseTitle(String releaseTitle) { this.releaseTitle = releaseTitle; } public String getReleaseComment() { return releaseComment; } public void setReleaseComment(String releaseComment) { this.releaseComment = releaseComment; } public String getReleasedBy() { return releasedBy; } public void setReleasedBy(String releasedBy) { this.releasedBy = releasedBy; } public boolean isEmergencyPublish() { return isEmergencyPublish; } public void setEmergencyPublish(boolean emergencyPublish) { isEmergencyPublish = emergencyPublish; } }
package com.ctrip.framework.apollo.openapi.dto; public class NamespaceReleaseDTO { private String releaseTitle; private String releaseComment; private String releasedBy; private boolean isEmergencyPublish; public String getReleaseTitle() { return releaseTitle; } public void setReleaseTitle(String releaseTitle) { this.releaseTitle = releaseTitle; } public String getReleaseComment() { return releaseComment; } public void setReleaseComment(String releaseComment) { this.releaseComment = releaseComment; } public String getReleasedBy() { return releasedBy; } public void setReleasedBy(String releasedBy) { this.releasedBy = releasedBy; } public boolean isEmergencyPublish() { return isEmergencyPublish; } public void setEmergencyPublish(boolean emergencyPublish) { isEmergencyPublish = emergencyPublish; } }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/ConfigsExportService.java
package com.ctrip.framework.apollo.portal.service; import com.ctrip.framework.apollo.common.dto.ClusterDTO; import com.ctrip.framework.apollo.common.entity.App; import com.ctrip.framework.apollo.core.enums.ConfigFileFormat; import com.ctrip.framework.apollo.portal.component.PermissionValidator; import com.ctrip.framework.apollo.portal.component.PortalSettings; import com.ctrip.framework.apollo.portal.entity.bo.ConfigBO; import com.ctrip.framework.apollo.portal.entity.bo.NamespaceBO; import com.ctrip.framework.apollo.portal.environment.Env; import com.ctrip.framework.apollo.portal.util.ConfigFileUtils; import java.io.IOException; import java.io.OutputStream; import java.util.Collection; import java.util.List; import java.util.function.BiFunction; import java.util.function.BinaryOperator; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; @Service public class ConfigsExportService { private static final Logger logger = LoggerFactory.getLogger(ConfigsExportService.class); private final AppService appService; private final ClusterService clusterService; private final NamespaceService namespaceService; private final PortalSettings portalSettings; private final PermissionValidator permissionValidator; public ConfigsExportService( AppService appService, ClusterService clusterService, final @Lazy NamespaceService namespaceService, PortalSettings portalSettings, PermissionValidator permissionValidator) { this.appService = appService; this.clusterService = clusterService; this.namespaceService = namespaceService; this.portalSettings = portalSettings; this.permissionValidator = permissionValidator; } /** * write multiple namespace to a zip. use {@link Stream#reduce(Object, BiFunction, * BinaryOperator)} to forbid concurrent write. * * @param configBOStream namespace's stream * @param outputStream receive zip file output stream * @throws IOException if happen write problem */ private static void writeAsZipOutputStream( Stream<ConfigBO> configBOStream, OutputStream outputStream) throws IOException { try (final ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream)) { final Consumer<ConfigBO> configBOConsumer = configBO -> { try { // TODO, Stream.reduce will cause some problems. Is There other way to speed up the // downloading? synchronized (zipOutputStream) { write2ZipOutputStream(zipOutputStream, configBO); } } catch (IOException e) { logger.error("Write error. {}", configBO); throw new IllegalStateException(e); } }; configBOStream.forEach(configBOConsumer); } } /** * write {@link ConfigBO} as file to {@link ZipOutputStream}. Watch out the concurrent problem! * zip output stream is same like cannot write concurrently! the name of file is determined by * {@link ConfigFileUtils#toFilename(String, String, String, ConfigFileFormat)}. the path of file * is determined by {@link ConfigFileUtils#toFilePath(String, String, Env, String)}. * * @param zipOutputStream zip file output stream * @param configBO a namespace represent * @return zip file output stream same as parameter zipOutputStream */ private static ZipOutputStream write2ZipOutputStream( final ZipOutputStream zipOutputStream, final ConfigBO configBO) throws IOException { final Env env = configBO.getEnv(); final String ownerName = configBO.getOwnerName(); final String appId = configBO.getAppId(); final String clusterName = configBO.getClusterName(); final String namespace = configBO.getNamespace(); final String configFileContent = configBO.getConfigFileContent(); final ConfigFileFormat configFileFormat = configBO.getFormat(); final String configFilename = ConfigFileUtils.toFilename(appId, clusterName, namespace, configFileFormat); final String filePath = ConfigFileUtils.toFilePath(ownerName, appId, env, configFilename); final ZipEntry zipEntry = new ZipEntry(filePath); try { zipOutputStream.putNextEntry(zipEntry); zipOutputStream.write(configFileContent.getBytes()); zipOutputStream.closeEntry(); } catch (IOException e) { logger.error("config export failed. {}", configBO); throw new IOException("config export failed", e); } return zipOutputStream; } /** @return the namespaces current user exists */ private Stream<ConfigBO> makeStreamBy( final Env env, final String ownerName, final String appId, final String clusterName) { final List<NamespaceBO> namespaceBOS = namespaceService.findNamespaceBOs(appId, env, clusterName); final Function<NamespaceBO, ConfigBO> function = namespaceBO -> new ConfigBO(env, ownerName, appId, clusterName, namespaceBO); return namespaceBOS.parallelStream().map(function); } private Stream<ConfigBO> makeStreamBy(final Env env, final String ownerName, final String appId) { final List<ClusterDTO> clusterDTOS = clusterService.findClusters(env, appId); final Function<ClusterDTO, Stream<ConfigBO>> function = clusterDTO -> this.makeStreamBy(env, ownerName, appId, clusterDTO.getName()); return clusterDTOS.parallelStream().flatMap(function); } private Stream<ConfigBO> makeStreamBy(final Env env, final List<App> apps) { final Function<App, Stream<ConfigBO>> function = app -> this.makeStreamBy(env, app.getOwnerName(), app.getAppId()); return apps.parallelStream().flatMap(function); } private Stream<ConfigBO> makeStreamBy(final Collection<Env> envs) { // get all apps final List<App> apps = appService.findAll(); // permission check final Predicate<App> isAppAdmin = app -> { try { return permissionValidator.isAppAdmin(app.getAppId()); } catch (Exception e) { logger.error("app = {}", app); logger.error(app.getAppId()); } return false; }; // app admin permission filter final List<App> appsExistPermission = apps.stream().filter(isAppAdmin).collect(Collectors.toList()); return envs.parallelStream().flatMap(env -> this.makeStreamBy(env, appsExistPermission)); } /** * Export all projects which current user own them. Permission check by {@link * PermissionValidator#isAppAdmin(java.lang.String)} * * @param outputStream network file download stream to user * @throws IOException if happen write problem */ public void exportAllTo(OutputStream outputStream) throws IOException { final List<Env> activeEnvs = portalSettings.getActiveEnvs(); final Stream<ConfigBO> configBOStream = this.makeStreamBy(activeEnvs); writeAsZipOutputStream(configBOStream, outputStream); } }
package com.ctrip.framework.apollo.portal.service; import com.ctrip.framework.apollo.common.dto.ClusterDTO; import com.ctrip.framework.apollo.common.entity.App; import com.ctrip.framework.apollo.core.enums.ConfigFileFormat; import com.ctrip.framework.apollo.portal.component.PermissionValidator; import com.ctrip.framework.apollo.portal.component.PortalSettings; import com.ctrip.framework.apollo.portal.entity.bo.ConfigBO; import com.ctrip.framework.apollo.portal.entity.bo.NamespaceBO; import com.ctrip.framework.apollo.portal.environment.Env; import com.ctrip.framework.apollo.portal.util.ConfigFileUtils; import java.io.IOException; import java.io.OutputStream; import java.util.Collection; import java.util.List; import java.util.function.BiFunction; import java.util.function.BinaryOperator; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; @Service public class ConfigsExportService { private static final Logger logger = LoggerFactory.getLogger(ConfigsExportService.class); private final AppService appService; private final ClusterService clusterService; private final NamespaceService namespaceService; private final PortalSettings portalSettings; private final PermissionValidator permissionValidator; public ConfigsExportService( AppService appService, ClusterService clusterService, final @Lazy NamespaceService namespaceService, PortalSettings portalSettings, PermissionValidator permissionValidator) { this.appService = appService; this.clusterService = clusterService; this.namespaceService = namespaceService; this.portalSettings = portalSettings; this.permissionValidator = permissionValidator; } /** * write multiple namespace to a zip. use {@link Stream#reduce(Object, BiFunction, * BinaryOperator)} to forbid concurrent write. * * @param configBOStream namespace's stream * @param outputStream receive zip file output stream * @throws IOException if happen write problem */ private static void writeAsZipOutputStream( Stream<ConfigBO> configBOStream, OutputStream outputStream) throws IOException { try (final ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream)) { final Consumer<ConfigBO> configBOConsumer = configBO -> { try { // TODO, Stream.reduce will cause some problems. Is There other way to speed up the // downloading? synchronized (zipOutputStream) { write2ZipOutputStream(zipOutputStream, configBO); } } catch (IOException e) { logger.error("Write error. {}", configBO); throw new IllegalStateException(e); } }; configBOStream.forEach(configBOConsumer); } } /** * write {@link ConfigBO} as file to {@link ZipOutputStream}. Watch out the concurrent problem! * zip output stream is same like cannot write concurrently! the name of file is determined by * {@link ConfigFileUtils#toFilename(String, String, String, ConfigFileFormat)}. the path of file * is determined by {@link ConfigFileUtils#toFilePath(String, String, Env, String)}. * * @param zipOutputStream zip file output stream * @param configBO a namespace represent * @return zip file output stream same as parameter zipOutputStream */ private static ZipOutputStream write2ZipOutputStream( final ZipOutputStream zipOutputStream, final ConfigBO configBO) throws IOException { final Env env = configBO.getEnv(); final String ownerName = configBO.getOwnerName(); final String appId = configBO.getAppId(); final String clusterName = configBO.getClusterName(); final String namespace = configBO.getNamespace(); final String configFileContent = configBO.getConfigFileContent(); final ConfigFileFormat configFileFormat = configBO.getFormat(); final String configFilename = ConfigFileUtils.toFilename(appId, clusterName, namespace, configFileFormat); final String filePath = ConfigFileUtils.toFilePath(ownerName, appId, env, configFilename); final ZipEntry zipEntry = new ZipEntry(filePath); try { zipOutputStream.putNextEntry(zipEntry); zipOutputStream.write(configFileContent.getBytes()); zipOutputStream.closeEntry(); } catch (IOException e) { logger.error("config export failed. {}", configBO); throw new IOException("config export failed", e); } return zipOutputStream; } /** @return the namespaces current user exists */ private Stream<ConfigBO> makeStreamBy( final Env env, final String ownerName, final String appId, final String clusterName) { final List<NamespaceBO> namespaceBOS = namespaceService.findNamespaceBOs(appId, env, clusterName); final Function<NamespaceBO, ConfigBO> function = namespaceBO -> new ConfigBO(env, ownerName, appId, clusterName, namespaceBO); return namespaceBOS.parallelStream().map(function); } private Stream<ConfigBO> makeStreamBy(final Env env, final String ownerName, final String appId) { final List<ClusterDTO> clusterDTOS = clusterService.findClusters(env, appId); final Function<ClusterDTO, Stream<ConfigBO>> function = clusterDTO -> this.makeStreamBy(env, ownerName, appId, clusterDTO.getName()); return clusterDTOS.parallelStream().flatMap(function); } private Stream<ConfigBO> makeStreamBy(final Env env, final List<App> apps) { final Function<App, Stream<ConfigBO>> function = app -> this.makeStreamBy(env, app.getOwnerName(), app.getAppId()); return apps.parallelStream().flatMap(function); } private Stream<ConfigBO> makeStreamBy(final Collection<Env> envs) { // get all apps final List<App> apps = appService.findAll(); // permission check final Predicate<App> isAppAdmin = app -> { try { return permissionValidator.isAppAdmin(app.getAppId()); } catch (Exception e) { logger.error("app = {}", app); logger.error(app.getAppId()); } return false; }; // app admin permission filter final List<App> appsExistPermission = apps.stream().filter(isAppAdmin).collect(Collectors.toList()); return envs.parallelStream().flatMap(env -> this.makeStreamBy(env, appsExistPermission)); } /** * Export all projects which current user own them. Permission check by {@link * PermissionValidator#isAppAdmin(java.lang.String)} * * @param outputStream network file download stream to user * @throws IOException if happen write problem */ public void exportAllTo(OutputStream outputStream) throws IOException { final List<Env> activeEnvs = portalSettings.getActiveEnvs(); final Stream<ConfigBO> configBOStream = this.makeStreamBy(activeEnvs); writeAsZipOutputStream(configBOStream, outputStream); } }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-portal/src/main/resources/static/vendor/angular/ui-bootstrap-tpls-0.13.0.min.js
/* * angular-ui-bootstrap * http://angular-ui.github.io/bootstrap/ * Version: 0.13.0 - 2015-05-02 * License: MIT */ angular.module("ui.bootstrap", ["ui.bootstrap.tpls", "ui.bootstrap.collapse", "ui.bootstrap.accordion", "ui.bootstrap.alert", "ui.bootstrap.bindHtml", "ui.bootstrap.buttons", "ui.bootstrap.carousel", "ui.bootstrap.dateparser", "ui.bootstrap.position", "ui.bootstrap.datepicker", "ui.bootstrap.dropdown", "ui.bootstrap.modal", "ui.bootstrap.pagination", "ui.bootstrap.tooltip", "ui.bootstrap.popover", "ui.bootstrap.progressbar", "ui.bootstrap.rating", "ui.bootstrap.tabs", "ui.bootstrap.timepicker", "ui.bootstrap.transition", "ui.bootstrap.typeahead"]), angular.module("ui.bootstrap.tpls", ["template/accordion/accordion-group.html", "template/accordion/accordion.html", "template/alert/alert.html", "template/carousel/carousel.html", "template/carousel/slide.html", "template/datepicker/datepicker.html", "template/datepicker/day.html", "template/datepicker/month.html", "template/datepicker/popup.html", "template/datepicker/year.html", "template/modal/backdrop.html", "template/modal/window.html", "template/pagination/pager.html", "template/pagination/pagination.html", "template/tooltip/tooltip-html-popup.html", "template/tooltip/tooltip-html-unsafe-popup.html", "template/tooltip/tooltip-popup.html", "template/tooltip/tooltip-template-popup.html", "template/popover/popover-template.html", "template/popover/popover.html", "template/progressbar/bar.html", "template/progressbar/progress.html", "template/progressbar/progressbar.html", "template/rating/rating.html", "template/tabs/tab.html", "template/tabs/tabset.html", "template/timepicker/timepicker.html", "template/typeahead/typeahead-match.html", "template/typeahead/typeahead-popup.html"]), angular.module("ui.bootstrap.collapse", []).directive("collapse", ["$animate", function (a) { return { link: function (b, c, d) { function e() { c.removeClass("collapse").addClass("collapsing"), a.addClass(c, "in", {to: {height: c[0].scrollHeight + "px"}}).then(f) } function f() { c.removeClass("collapsing"), c.css({height: "auto"}) } function g() { c.css({height: c[0].scrollHeight + "px"}).removeClass("collapse").addClass("collapsing"), a.removeClass(c, "in", {to: {height: "0"}}).then(h) } function h() { c.css({height: "0"}), c.removeClass("collapsing"), c.addClass("collapse") } b.$watch(d.collapse, function (a) { a ? g() : e() }) } } }]), angular.module("ui.bootstrap.accordion", ["ui.bootstrap.collapse"]).constant("accordionConfig", {closeOthers: !0}).controller("AccordionController", ["$scope", "$attrs", "accordionConfig", function (a, b, c) { this.groups = [], this.closeOthers = function (d) { var e = angular.isDefined(b.closeOthers) ? a.$eval(b.closeOthers) : c.closeOthers; e && angular.forEach(this.groups, function (a) { a !== d && (a.isOpen = !1) }) }, this.addGroup = function (a) { var b = this; this.groups.push(a), a.$on("$destroy", function () { b.removeGroup(a) }) }, this.removeGroup = function (a) { var b = this.groups.indexOf(a); -1 !== b && this.groups.splice(b, 1) } }]).directive("accordion", function () { return { restrict: "EA", controller: "AccordionController", transclude: !0, replace: !1, templateUrl: "template/accordion/accordion.html" } }).directive("accordionGroup", function () { return { require: "^accordion", restrict: "EA", transclude: !0, replace: !0, templateUrl: "template/accordion/accordion-group.html", scope: {heading: "@", isOpen: "=?", isDisabled: "=?"}, controller: function () { this.setHeading = function (a) { this.heading = a } }, link: function (a, b, c, d) { d.addGroup(a), a.$watch("isOpen", function (b) { b && d.closeOthers(a) }), a.toggleOpen = function () { a.isDisabled || (a.isOpen = !a.isOpen) } } } }).directive("accordionHeading", function () { return { restrict: "EA", transclude: !0, template: "", replace: !0, require: "^accordionGroup", link: function (a, b, c, d, e) { d.setHeading(e(a, angular.noop)) } } }).directive("accordionTransclude", function () { return { require: "^accordionGroup", link: function (a, b, c, d) { a.$watch(function () { return d[c.accordionTransclude] }, function (a) { a && (b.html(""), b.append(a)) }) } } }), angular.module("ui.bootstrap.alert", []).controller("AlertController", ["$scope", "$attrs", function (a, b) { a.closeable = "close" in b, this.close = a.close }]).directive("alert", function () { return { restrict: "EA", controller: "AlertController", templateUrl: "template/alert/alert.html", transclude: !0, replace: !0, scope: {type: "@", close: "&"} } }).directive("dismissOnTimeout", ["$timeout", function (a) { return { require: "alert", link: function (b, c, d, e) { a(function () { e.close() }, parseInt(d.dismissOnTimeout, 10)) } } }]), angular.module("ui.bootstrap.bindHtml", []).directive("bindHtmlUnsafe", function () { return function (a, b, c) { b.addClass("ng-binding").data("$binding", c.bindHtmlUnsafe), a.$watch(c.bindHtmlUnsafe, function (a) { b.html(a || "") }) } }), angular.module("ui.bootstrap.buttons", []).constant("buttonConfig", { activeClass: "active", toggleEvent: "click" }).controller("ButtonsController", ["buttonConfig", function (a) { this.activeClass = a.activeClass || "active", this.toggleEvent = a.toggleEvent || "click" }]).directive("btnRadio", function () { return { require: ["btnRadio", "ngModel"], controller: "ButtonsController", link: function (a, b, c, d) { var e = d[0], f = d[1]; f.$render = function () { b.toggleClass(e.activeClass, angular.equals(f.$modelValue, a.$eval(c.btnRadio))) }, b.bind(e.toggleEvent, function () { var d = b.hasClass(e.activeClass); (!d || angular.isDefined(c.uncheckable)) && a.$apply(function () { f.$setViewValue(d ? null : a.$eval(c.btnRadio)), f.$render() }) }) } } }).directive("btnCheckbox", function () { return { require: ["btnCheckbox", "ngModel"], controller: "ButtonsController", link: function (a, b, c, d) { function e() { return g(c.btnCheckboxTrue, !0) } function f() { return g(c.btnCheckboxFalse, !1) } function g(b, c) { var d = a.$eval(b); return angular.isDefined(d) ? d : c } var h = d[0], i = d[1]; i.$render = function () { b.toggleClass(h.activeClass, angular.equals(i.$modelValue, e())) }, b.bind(h.toggleEvent, function () { a.$apply(function () { i.$setViewValue(b.hasClass(h.activeClass) ? f() : e()), i.$render() }) }) } } }), angular.module("ui.bootstrap.carousel", []).controller("CarouselController", ["$scope", "$interval", "$animate", function (a, b, c) { function d(a) { if (angular.isUndefined(k[a].index))return k[a]; { var b; k.length } for (b = 0; b < k.length; ++b)if (k[b].index == a)return k[b] } function e() { f(); var c = +a.interval; !isNaN(c) && c > 0 && (h = b(g, c)) } function f() { h && (b.cancel(h), h = null) } function g() { var b = +a.interval; i && !isNaN(b) && b > 0 ? a.next() : a.pause() } var h, i, j = this, k = j.slides = a.slides = [], l = -1; j.currentSlide = null; var m = !1; j.select = a.select = function (b, d) { function f() { m || (angular.extend(b, {direction: d, active: !0}), angular.extend(j.currentSlide || {}, { direction: d, active: !1 }), c.enabled() && !a.noTransition && b.$element && (a.$currentTransition = !0, b.$element.one("$animate:close", function () { a.$currentTransition = null })), j.currentSlide = b, l = g, e()) } var g = j.indexOfSlide(b); void 0 === d && (d = g > j.getCurrentIndex() ? "next" : "prev"), b && b !== j.currentSlide && f() }, a.$on("$destroy", function () { m = !0 }), j.getCurrentIndex = function () { return j.currentSlide && angular.isDefined(j.currentSlide.index) ? +j.currentSlide.index : l }, j.indexOfSlide = function (a) { return angular.isDefined(a.index) ? +a.index : k.indexOf(a) }, a.next = function () { var b = (j.getCurrentIndex() + 1) % k.length; return a.$currentTransition ? void 0 : j.select(d(b), "next") }, a.prev = function () { var b = j.getCurrentIndex() - 1 < 0 ? k.length - 1 : j.getCurrentIndex() - 1; return a.$currentTransition ? void 0 : j.select(d(b), "prev") }, a.isActive = function (a) { return j.currentSlide === a }, a.$watch("interval", e), a.$on("$destroy", f), a.play = function () { i || (i = !0, e()) }, a.pause = function () { a.noPause || (i = !1, f()) }, j.addSlide = function (b, c) { b.$element = c, k.push(b), 1 === k.length || b.active ? (j.select(k[k.length - 1]), 1 == k.length && a.play()) : b.active = !1 }, j.removeSlide = function (a) { angular.isDefined(a.index) && k.sort(function (a, b) { return +a.index > +b.index }); var b = k.indexOf(a); k.splice(b, 1), k.length > 0 && a.active ? j.select(b >= k.length ? k[b - 1] : k[b]) : l > b && l-- } }]).directive("carousel", [function () { return { restrict: "EA", transclude: !0, replace: !0, controller: "CarouselController", require: "carousel", templateUrl: "template/carousel/carousel.html", scope: {interval: "=", noTransition: "=", noPause: "="} } }]).directive("slide", function () { return { require: "^carousel", restrict: "EA", transclude: !0, replace: !0, templateUrl: "template/carousel/slide.html", scope: {active: "=?", index: "=?"}, link: function (a, b, c, d) { d.addSlide(a, b), a.$on("$destroy", function () { d.removeSlide(a) }), a.$watch("active", function (b) { b && d.select(a) }) } } }).animation(".item", ["$animate", function (a) { return { beforeAddClass: function (b, c, d) { if ("active" == c && b.parent() && !b.parent().scope().noTransition) { var e = !1, f = b.isolateScope().direction, g = "next" == f ? "left" : "right"; return b.addClass(f), a.addClass(b, g).then(function () { e || b.removeClass(g + " " + f), d() }), function () { e = !0 } } d() }, beforeRemoveClass: function (b, c, d) { if ("active" == c && b.parent() && !b.parent().scope().noTransition) { var e = !1, f = b.isolateScope().direction, g = "next" == f ? "left" : "right"; return a.addClass(b, g).then(function () { e || b.removeClass(g), d() }), function () { e = !0 } } d() } } }]), angular.module("ui.bootstrap.dateparser", []).service("dateParser", ["$locale", "orderByFilter", function (a, b) { function c(a) { var c = [], d = a.split(""); return angular.forEach(f, function (b, e) { var f = a.indexOf(e); if (f > -1) { a = a.split(""), d[f] = "(" + b.regex + ")", a[f] = "$"; for (var g = f + 1, h = f + e.length; h > g; g++)d[g] = "", a[g] = "$"; a = a.join(""), c.push({index: f, apply: b.apply}) } }), {regex: new RegExp("^" + d.join("") + "$"), map: b(c, "index")} } function d(a, b, c) { return 1 > c ? !1 : 1 === b && c > 28 ? 29 === c && (a % 4 === 0 && a % 100 !== 0 || a % 400 === 0) : 3 === b || 5 === b || 8 === b || 10 === b ? 31 > c : !0 } var e = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g; this.parsers = {}; var f = { yyyy: { regex: "\\d{4}", apply: function (a) { this.year = +a } }, yy: { regex: "\\d{2}", apply: function (a) { this.year = +a + 2e3 } }, y: { regex: "\\d{1,4}", apply: function (a) { this.year = +a } }, MMMM: { regex: a.DATETIME_FORMATS.MONTH.join("|"), apply: function (b) { this.month = a.DATETIME_FORMATS.MONTH.indexOf(b) } }, MMM: { regex: a.DATETIME_FORMATS.SHORTMONTH.join("|"), apply: function (b) { this.month = a.DATETIME_FORMATS.SHORTMONTH.indexOf(b) } }, MM: { regex: "0[1-9]|1[0-2]", apply: function (a) { this.month = a - 1 } }, M: { regex: "[1-9]|1[0-2]", apply: function (a) { this.month = a - 1 } }, dd: { regex: "[0-2][0-9]{1}|3[0-1]{1}", apply: function (a) { this.date = +a } }, d: { regex: "[1-2]?[0-9]{1}|3[0-1]{1}", apply: function (a) { this.date = +a } }, EEEE: {regex: a.DATETIME_FORMATS.DAY.join("|")}, EEE: {regex: a.DATETIME_FORMATS.SHORTDAY.join("|")}, HH: { regex: "(?:0|1)[0-9]|2[0-3]", apply: function (a) { this.hours = +a } }, H: { regex: "1?[0-9]|2[0-3]", apply: function (a) { this.hours = +a } }, mm: { regex: "[0-5][0-9]", apply: function (a) { this.minutes = +a } }, m: { regex: "[0-9]|[1-5][0-9]", apply: function (a) { this.minutes = +a } }, sss: { regex: "[0-9][0-9][0-9]", apply: function (a) { this.milliseconds = +a } }, ss: { regex: "[0-5][0-9]", apply: function (a) { this.seconds = +a } }, s: { regex: "[0-9]|[1-5][0-9]", apply: function (a) { this.seconds = +a } } }; this.parse = function (b, f, g) { if (!angular.isString(b) || !f)return b; f = a.DATETIME_FORMATS[f] || f, f = f.replace(e, "\\$&"), this.parsers[f] || (this.parsers[f] = c(f)); var h = this.parsers[f], i = h.regex, j = h.map, k = b.match(i); if (k && k.length) { var l, m; l = g ? { year: g.getFullYear(), month: g.getMonth(), date: g.getDate(), hours: g.getHours(), minutes: g.getMinutes(), seconds: g.getSeconds(), milliseconds: g.getMilliseconds() } : {year: 1900, month: 0, date: 1, hours: 0, minutes: 0, seconds: 0, milliseconds: 0}; for (var n = 1, o = k.length; o > n; n++) { var p = j[n - 1]; p.apply && p.apply.call(l, k[n]) } return d(l.year, l.month, l.date) && (m = new Date(l.year, l.month, l.date, l.hours, l.minutes, l.seconds, l.milliseconds || 0)), m } } }]), angular.module("ui.bootstrap.position", []).factory("$position", ["$document", "$window", function (a, b) { function c(a, c) { return a.currentStyle ? a.currentStyle[c] : b.getComputedStyle ? b.getComputedStyle(a)[c] : a.style[c] } function d(a) { return "static" === (c(a, "position") || "static") } var e = function (b) { for (var c = a[0], e = b.offsetParent || c; e && e !== c && d(e);)e = e.offsetParent; return e || c }; return { position: function (b) { var c = this.offset(b), d = {top: 0, left: 0}, f = e(b[0]); f != a[0] && (d = this.offset(angular.element(f)), d.top += f.clientTop - f.scrollTop, d.left += f.clientLeft - f.scrollLeft); var g = b[0].getBoundingClientRect(); return { width: g.width || b.prop("offsetWidth"), height: g.height || b.prop("offsetHeight"), top: c.top - d.top, left: c.left - d.left } }, offset: function (c) { var d = c[0].getBoundingClientRect(); return { width: d.width || c.prop("offsetWidth"), height: d.height || c.prop("offsetHeight"), top: d.top + (b.pageYOffset || a[0].documentElement.scrollTop), left: d.left + (b.pageXOffset || a[0].documentElement.scrollLeft) } }, positionElements: function (a, b, c, d) { var e, f, g, h, i = c.split("-"), j = i[0], k = i[1] || "center"; e = d ? this.offset(a) : this.position(a), f = b.prop("offsetWidth"), g = b.prop("offsetHeight"); var l = { center: function () { return e.left + e.width / 2 - f / 2 }, left: function () { return e.left }, right: function () { return e.left + e.width } }, m = { center: function () { return e.top + e.height / 2 - g / 2 }, top: function () { return e.top }, bottom: function () { return e.top + e.height } }; switch (j) { case"right": h = {top: m[k](), left: l[j]()}; break; case"left": h = {top: m[k](), left: e.left - f}; break; case"bottom": h = {top: m[j](), left: l[k]()}; break; default: h = {top: e.top - g, left: l[k]()} } return h } } }]), angular.module("ui.bootstrap.datepicker", ["ui.bootstrap.dateparser", "ui.bootstrap.position"]).constant("datepickerConfig", { formatDay: "dd", formatMonth: "MMMM", formatYear: "yyyy", formatDayHeader: "EEE", formatDayTitle: "MMMM yyyy", formatMonthTitle: "yyyy", datepickerMode: "day", minMode: "day", maxMode: "year", showWeeks: !0, startingDay: 0, yearRange: 20, minDate: null, maxDate: null, shortcutPropagation: !1 }).controller("DatepickerController", ["$scope", "$attrs", "$parse", "$interpolate", "$timeout", "$log", "dateFilter", "datepickerConfig", function (a, b, c, d, e, f, g, h) { var i = this, j = {$setViewValue: angular.noop}; this.modes = ["day", "month", "year"], angular.forEach(["formatDay", "formatMonth", "formatYear", "formatDayHeader", "formatDayTitle", "formatMonthTitle", "minMode", "maxMode", "showWeeks", "startingDay", "yearRange", "shortcutPropagation"], function (c, e) { i[c] = angular.isDefined(b[c]) ? 8 > e ? d(b[c])(a.$parent) : a.$parent.$eval(b[c]) : h[c] }), angular.forEach(["minDate", "maxDate"], function (d) { b[d] ? a.$parent.$watch(c(b[d]), function (a) { i[d] = a ? new Date(a) : null, i.refreshView() }) : i[d] = h[d] ? new Date(h[d]) : null }), a.datepickerMode = a.datepickerMode || h.datepickerMode, a.maxMode = i.maxMode, a.uniqueId = "datepicker-" + a.$id + "-" + Math.floor(1e4 * Math.random()), angular.isDefined(b.initDate) ? (this.activeDate = a.$parent.$eval(b.initDate) || new Date, a.$parent.$watch(b.initDate, function (a) { a && (j.$isEmpty(j.$modelValue) || j.$invalid) && (i.activeDate = a, i.refreshView()) })) : this.activeDate = new Date, a.isActive = function (b) { return 0 === i.compare(b.date, i.activeDate) ? (a.activeDateId = b.uid, !0) : !1 }, this.init = function (a) { j = a, j.$render = function () { i.render() } }, this.render = function () { if (j.$viewValue) { var a = new Date(j.$viewValue), b = !isNaN(a); b ? this.activeDate = a : f.error('Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.'), j.$setValidity("date", b) } this.refreshView() }, this.refreshView = function () { if (this.element) { this._refreshView(); var a = j.$viewValue ? new Date(j.$viewValue) : null; j.$setValidity("date-disabled", !a || this.element && !this.isDisabled(a)) } }, this.createDateObject = function (a, b) { var c = j.$viewValue ? new Date(j.$viewValue) : null; return { date: a, label: g(a, b), selected: c && 0 === this.compare(a, c), disabled: this.isDisabled(a), current: 0 === this.compare(a, new Date), customClass: this.customClass(a) } }, this.isDisabled = function (c) { return this.minDate && this.compare(c, this.minDate) < 0 || this.maxDate && this.compare(c, this.maxDate) > 0 || b.dateDisabled && a.dateDisabled({ date: c, mode: a.datepickerMode }) }, this.customClass = function (b) { return a.customClass({date: b, mode: a.datepickerMode}) }, this.split = function (a, b) { for (var c = []; a.length > 0;)c.push(a.splice(0, b)); return c }, a.select = function (b) { if (a.datepickerMode === i.minMode) { var c = j.$viewValue ? new Date(j.$viewValue) : new Date(0, 0, 0, 0, 0, 0, 0); c.setFullYear(b.getFullYear(), b.getMonth(), b.getDate()), j.$setViewValue(c), j.$render() } else i.activeDate = b, a.datepickerMode = i.modes[i.modes.indexOf(a.datepickerMode) - 1] }, a.move = function (a) { var b = i.activeDate.getFullYear() + a * (i.step.years || 0), c = i.activeDate.getMonth() + a * (i.step.months || 0); i.activeDate.setFullYear(b, c, 1), i.refreshView() }, a.toggleMode = function (b) { b = b || 1, a.datepickerMode === i.maxMode && 1 === b || a.datepickerMode === i.minMode && -1 === b || (a.datepickerMode = i.modes[i.modes.indexOf(a.datepickerMode) + b]) }, a.keys = { 13: "enter", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home", 37: "left", 38: "up", 39: "right", 40: "down" }; var k = function () { e(function () { i.element[0].focus() }, 0, !1) }; a.$on("datepicker.focus", k), a.keydown = function (b) { var c = a.keys[b.which]; if (c && !b.shiftKey && !b.altKey)if (b.preventDefault(), i.shortcutPropagation || b.stopPropagation(), "enter" === c || "space" === c) { if (i.isDisabled(i.activeDate))return; a.select(i.activeDate), k() } else!b.ctrlKey || "up" !== c && "down" !== c ? (i.handleKeyDown(c, b), i.refreshView()) : (a.toggleMode("up" === c ? 1 : -1), k()) } }]).directive("datepicker", function () { return { restrict: "EA", replace: !0, templateUrl: "template/datepicker/datepicker.html", scope: {datepickerMode: "=?", dateDisabled: "&", customClass: "&", shortcutPropagation: "&?"}, require: ["datepicker", "?^ngModel"], controller: "DatepickerController", link: function (a, b, c, d) { var e = d[0], f = d[1]; f && e.init(f) } } }).directive("daypicker", ["dateFilter", function (a) { return { restrict: "EA", replace: !0, templateUrl: "template/datepicker/day.html", require: "^datepicker", link: function (b, c, d, e) { function f(a, b) { return 1 !== b || a % 4 !== 0 || a % 100 === 0 && a % 400 !== 0 ? i[b] : 29 } function g(a, b) { var c = new Array(b), d = new Date(a), e = 0; for (d.setHours(12); b > e;)c[e++] = new Date(d), d.setDate(d.getDate() + 1); return c } function h(a) { var b = new Date(a); b.setDate(b.getDate() + 4 - (b.getDay() || 7)); var c = b.getTime(); return b.setMonth(0), b.setDate(1), Math.floor(Math.round((c - b) / 864e5) / 7) + 1 } b.showWeeks = e.showWeeks, e.step = {months: 1}, e.element = c; var i = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; e._refreshView = function () { var c = e.activeDate.getFullYear(), d = e.activeDate.getMonth(), f = new Date(c, d, 1), i = e.startingDay - f.getDay(), j = i > 0 ? 7 - i : -i, k = new Date(f); j > 0 && k.setDate(-j + 1); for (var l = g(k, 42), m = 0; 42 > m; m++)l[m] = angular.extend(e.createDateObject(l[m], e.formatDay), { secondary: l[m].getMonth() !== d, uid: b.uniqueId + "-" + m }); b.labels = new Array(7); for (var n = 0; 7 > n; n++)b.labels[n] = { abbr: a(l[n].date, e.formatDayHeader), full: a(l[n].date, "EEEE") }; if (b.title = a(e.activeDate, e.formatDayTitle), b.rows = e.split(l, 7), b.showWeeks) { b.weekNumbers = []; for (var o = (11 - e.startingDay) % 7, p = b.rows.length, q = 0; p > q; q++)b.weekNumbers.push(h(b.rows[q][o].date)) } }, e.compare = function (a, b) { return new Date(a.getFullYear(), a.getMonth(), a.getDate()) - new Date(b.getFullYear(), b.getMonth(), b.getDate()) }, e.handleKeyDown = function (a) { var b = e.activeDate.getDate(); if ("left" === a)b -= 1; else if ("up" === a)b -= 7; else if ("right" === a)b += 1; else if ("down" === a)b += 7; else if ("pageup" === a || "pagedown" === a) { var c = e.activeDate.getMonth() + ("pageup" === a ? -1 : 1); e.activeDate.setMonth(c, 1), b = Math.min(f(e.activeDate.getFullYear(), e.activeDate.getMonth()), b) } else"home" === a ? b = 1 : "end" === a && (b = f(e.activeDate.getFullYear(), e.activeDate.getMonth())); e.activeDate.setDate(b) }, e.refreshView() } } }]).directive("monthpicker", ["dateFilter", function (a) { return { restrict: "EA", replace: !0, templateUrl: "template/datepicker/month.html", require: "^datepicker", link: function (b, c, d, e) { e.step = {years: 1}, e.element = c, e._refreshView = function () { for (var c = new Array(12), d = e.activeDate.getFullYear(), f = 0; 12 > f; f++)c[f] = angular.extend(e.createDateObject(new Date(d, f, 1), e.formatMonth), {uid: b.uniqueId + "-" + f}); b.title = a(e.activeDate, e.formatMonthTitle), b.rows = e.split(c, 3) }, e.compare = function (a, b) { return new Date(a.getFullYear(), a.getMonth()) - new Date(b.getFullYear(), b.getMonth()) }, e.handleKeyDown = function (a) { var b = e.activeDate.getMonth(); if ("left" === a)b -= 1; else if ("up" === a)b -= 3; else if ("right" === a)b += 1; else if ("down" === a)b += 3; else if ("pageup" === a || "pagedown" === a) { var c = e.activeDate.getFullYear() + ("pageup" === a ? -1 : 1); e.activeDate.setFullYear(c) } else"home" === a ? b = 0 : "end" === a && (b = 11); e.activeDate.setMonth(b) }, e.refreshView() } } }]).directive("yearpicker", ["dateFilter", function () { return { restrict: "EA", replace: !0, templateUrl: "template/datepicker/year.html", require: "^datepicker", link: function (a, b, c, d) { function e(a) { return parseInt((a - 1) / f, 10) * f + 1 } var f = d.yearRange; d.step = {years: f}, d.element = b, d._refreshView = function () { for (var b = new Array(f), c = 0, g = e(d.activeDate.getFullYear()); f > c; c++)b[c] = angular.extend(d.createDateObject(new Date(g + c, 0, 1), d.formatYear), {uid: a.uniqueId + "-" + c}); a.title = [b[0].label, b[f - 1].label].join(" - "), a.rows = d.split(b, 5) }, d.compare = function (a, b) { return a.getFullYear() - b.getFullYear() }, d.handleKeyDown = function (a) { var b = d.activeDate.getFullYear(); "left" === a ? b -= 1 : "up" === a ? b -= 5 : "right" === a ? b += 1 : "down" === a ? b += 5 : "pageup" === a || "pagedown" === a ? b += ("pageup" === a ? -1 : 1) * d.step.years : "home" === a ? b = e(d.activeDate.getFullYear()) : "end" === a && (b = e(d.activeDate.getFullYear()) + f - 1), d.activeDate.setFullYear(b) }, d.refreshView() } } }]).constant("datepickerPopupConfig", { datepickerPopup: "yyyy-MM-dd", html5Types: {date: "yyyy-MM-dd", "datetime-local": "yyyy-MM-ddTHH:mm:ss.sss", month: "yyyy-MM"}, currentText: "Today", clearText: "Clear", closeText: "Done", closeOnDateSelection: !0, appendToBody: !1, showButtonBar: !0 }).directive("datepickerPopup", ["$compile", "$parse", "$document", "$position", "dateFilter", "dateParser", "datepickerPopupConfig", function (a, b, c, d, e, f, g) { return { restrict: "EA", require: "ngModel", scope: {isOpen: "=?", currentText: "@", clearText: "@", closeText: "@", dateDisabled: "&", customClass: "&"}, link: function (h, i, j, k) { function l(a) { return a.replace(/([A-Z])/g, function (a) { return "-" + a.toLowerCase() }) } function m(a) { if (angular.isNumber(a) && (a = new Date(a)), a) { if (angular.isDate(a) && !isNaN(a))return a; if (angular.isString(a)) { var b = f.parse(a, o, h.date) || new Date(a); return isNaN(b) ? void 0 : b } return void 0 } return null } function n(a, b) { var c = a || b; if (angular.isNumber(c) && (c = new Date(c)), c) { if (angular.isDate(c) && !isNaN(c))return !0; if (angular.isString(c)) { var d = f.parse(c, o) || new Date(c); return !isNaN(d) } return !1 } return !0 } var o, p = angular.isDefined(j.closeOnDateSelection) ? h.$parent.$eval(j.closeOnDateSelection) : g.closeOnDateSelection, q = angular.isDefined(j.datepickerAppendToBody) ? h.$parent.$eval(j.datepickerAppendToBody) : g.appendToBody; h.showButtonBar = angular.isDefined(j.showButtonBar) ? h.$parent.$eval(j.showButtonBar) : g.showButtonBar, h.getText = function (a) { return h[a + "Text"] || g[a + "Text"] }; var r = !1; if (g.html5Types[j.type] ? (o = g.html5Types[j.type], r = !0) : (o = j.datepickerPopup || g.datepickerPopup, j.$observe("datepickerPopup", function (a) { var b = a || g.datepickerPopup; if (b !== o && (o = b, k.$modelValue = null, !o))throw new Error("datepickerPopup must have a date format specified.") })), !o)throw new Error("datepickerPopup must have a date format specified."); if (r && j.datepickerPopup)throw new Error("HTML5 date input types do not support custom formats."); var s = angular.element("<div datepicker-popup-wrap><div datepicker></div></div>"); s.attr({"ng-model": "date", "ng-change": "dateSelection()"}); var t = angular.element(s.children()[0]); if (r && "month" == j.type && (t.attr("datepicker-mode", '"month"'), t.attr("min-mode", "month")), j.datepickerOptions) { var u = h.$parent.$eval(j.datepickerOptions); u.initDate && (h.initDate = u.initDate, t.attr("init-date", "initDate"), delete u.initDate), angular.forEach(u, function (a, b) { t.attr(l(b), a) }) } h.watchData = {}, angular.forEach(["minDate", "maxDate", "datepickerMode", "initDate", "shortcutPropagation"], function (a) { if (j[a]) { var c = b(j[a]); if (h.$parent.$watch(c, function (b) { h.watchData[a] = b }), t.attr(l(a), "watchData." + a), "datepickerMode" === a) { var d = c.assign; h.$watch("watchData." + a, function (a, b) { a !== b && d(h.$parent, a) }) } } }), j.dateDisabled && t.attr("date-disabled", "dateDisabled({ date: date, mode: mode })"), j.showWeeks && t.attr("show-weeks", j.showWeeks), j.customClass && t.attr("custom-class", "customClass({ date: date, mode: mode })"), r ? k.$formatters.push(function (a) { return h.date = a, a }) : (k.$$parserName = "date", k.$validators.date = n, k.$parsers.unshift(m), k.$formatters.push(function (a) { return h.date = a, k.$isEmpty(a) ? a : e(a, o) })), h.dateSelection = function (a) { angular.isDefined(a) && (h.date = a); var b = h.date ? e(h.date, o) : ""; i.val(b), k.$setViewValue(b), p && (h.isOpen = !1, i[0].focus()) }, k.$viewChangeListeners.push(function () { h.date = f.parse(k.$viewValue, o, h.date) || new Date(k.$viewValue) }); var v = function (a) { h.isOpen && a.target !== i[0] && h.$apply(function () { h.isOpen = !1 }) }, w = function (a) { h.keydown(a) }; i.bind("keydown", w), h.keydown = function (a) { 27 === a.which ? (a.preventDefault(), h.isOpen && a.stopPropagation(), h.close()) : 40 !== a.which || h.isOpen || (h.isOpen = !0) }, h.$watch("isOpen", function (a) { a ? (h.$broadcast("datepicker.focus"), h.position = q ? d.offset(i) : d.position(i), h.position.top = h.position.top + i.prop("offsetHeight"), c.bind("click", v)) : c.unbind("click", v) }), h.select = function (a) { if ("today" === a) { var b = new Date; angular.isDate(h.date) ? (a = new Date(h.date), a.setFullYear(b.getFullYear(), b.getMonth(), b.getDate())) : a = new Date(b.setHours(0, 0, 0, 0)) } h.dateSelection(a) }, h.close = function () { h.isOpen = !1, i[0].focus() }; var x = a(s)(h); s.remove(), q ? c.find("body").append(x) : i.after(x), h.$on("$destroy", function () { x.remove(), i.unbind("keydown", w), c.unbind("click", v) }) } } }]).directive("datepickerPopupWrap", function () { return { restrict: "EA", replace: !0, transclude: !0, templateUrl: "template/datepicker/popup.html", link: function (a, b) { b.bind("click", function (a) { a.preventDefault(), a.stopPropagation() }) } } }), angular.module("ui.bootstrap.dropdown", ["ui.bootstrap.position"]).constant("dropdownConfig", {openClass: "open"}).service("dropdownService", ["$document", "$rootScope", function (a, b) { var c = null; this.open = function (b) { c || (a.bind("click", d), a.bind("keydown", e)), c && c !== b && (c.isOpen = !1), c = b }, this.close = function (b) { c === b && (c = null, a.unbind("click", d), a.unbind("keydown", e)) }; var d = function (a) { if (c && (!a || "disabled" !== c.getAutoClose())) { var d = c.getToggleElement(); if (!(a && d && d[0].contains(a.target))) { var e = c.getElement(); a && "outsideClick" === c.getAutoClose() && e && e[0].contains(a.target) || (c.isOpen = !1, b.$$phase || c.$apply()) } } }, e = function (a) { 27 === a.which && (c.focusToggleElement(), d()) } }]).controller("DropdownController", ["$scope", "$attrs", "$parse", "dropdownConfig", "dropdownService", "$animate", "$position", "$document", function (a, b, c, d, e, f, g, h) { var i, j = this, k = a.$new(), l = d.openClass, m = angular.noop, n = b.onToggle ? c(b.onToggle) : angular.noop, o = !1; this.init = function (d) { j.$element = d, b.isOpen && (i = c(b.isOpen), m = i.assign, a.$watch(i, function (a) { k.isOpen = !!a })), o = angular.isDefined(b.dropdownAppendToBody), o && j.dropdownMenu && (h.find("body").append(j.dropdownMenu), d.on("$destroy", function () { j.dropdownMenu.remove() })) }, this.toggle = function (a) { return k.isOpen = arguments.length ? !!a : !k.isOpen }, this.isOpen = function () { return k.isOpen }, k.getToggleElement = function () { return j.toggleElement }, k.getAutoClose = function () { return b.autoClose || "always" }, k.getElement = function () { return j.$element }, k.focusToggleElement = function () { j.toggleElement && j.toggleElement[0].focus() }, k.$watch("isOpen", function (b, c) { if (o && j.dropdownMenu) { var d = g.positionElements(j.$element, j.dropdownMenu, "bottom-left", !0); j.dropdownMenu.css({top: d.top + "px", left: d.left + "px", display: b ? "block" : "none"}) } f[b ? "addClass" : "removeClass"](j.$element, l), b ? (k.focusToggleElement(), e.open(k)) : e.close(k), m(a, b), angular.isDefined(b) && b !== c && n(a, {open: !!b}) }), a.$on("$locationChangeSuccess", function () { k.isOpen = !1 }), a.$on("$destroy", function () { k.$destroy() }) }]).directive("dropdown", function () { return { controller: "DropdownController", link: function (a, b, c, d) { d.init(b) } } }).directive("dropdownMenu", function () { return { restrict: "AC", require: "?^dropdown", link: function (a, b, c, d) { d && (d.dropdownMenu = b) } } }).directive("dropdownToggle", function () { return { require: "?^dropdown", link: function (a, b, c, d) { if (d) { d.toggleElement = b; var e = function (e) { e.preventDefault(), b.hasClass("disabled") || c.disabled || a.$apply(function () { d.toggle() }) }; b.bind("click", e), b.attr({ "aria-haspopup": !0, "aria-expanded": !1 }), a.$watch(d.isOpen, function (a) { b.attr("aria-expanded", !!a) }), a.$on("$destroy", function () { b.unbind("click", e) }) } } } }), angular.module("ui.bootstrap.modal", []).factory("$$stackedMap", function () { return { createNew: function () { var a = []; return { add: function (b, c) { a.push({key: b, value: c}) }, get: function (b) { for (var c = 0; c < a.length; c++)if (b == a[c].key)return a[c] }, keys: function () { for (var b = [], c = 0; c < a.length; c++)b.push(a[c].key); return b }, top: function () { return a[a.length - 1] }, remove: function (b) { for (var c = -1, d = 0; d < a.length; d++)if (b == a[d].key) { c = d; break } return a.splice(c, 1)[0] }, removeTop: function () { return a.splice(a.length - 1, 1)[0] }, length: function () { return a.length } } } } }).directive("modalBackdrop", ["$timeout", function (a) { function b(b) { b.animate = !1, a(function () { b.animate = !0 }) } return { restrict: "EA", replace: !0, templateUrl: "template/modal/backdrop.html", compile: function (a, c) { return a.addClass(c.backdropClass), b } } }]).directive("modalWindow", ["$modalStack", "$q", function (a, b) { return { restrict: "EA", scope: {index: "@", animate: "="}, replace: !0, transclude: !0, templateUrl: function (a, b) { return b.templateUrl || "template/modal/window.html" }, link: function (c, d, e) { d.addClass(e.windowClass || ""), c.size = e.size, c.close = function (b) { var c = a.getTop(); c && c.value.backdrop && "static" != c.value.backdrop && b.target === b.currentTarget && (b.preventDefault(), b.stopPropagation(), a.dismiss(c.key, "backdrop click")) }, c.$isRendered = !0; var f = b.defer(); e.$observe("modalRender", function (a) { "true" == a && f.resolve() }), f.promise.then(function () { c.animate = !0; var b = d[0].querySelectorAll("[autofocus]"); b.length ? b[0].focus() : d[0].focus(); var e = a.getTop(); e && a.modalRendered(e.key) }) } } }]).directive("modalAnimationClass", [function () { return { compile: function (a, b) { b.modalAnimation && a.addClass(b.modalAnimationClass) } } }]).directive("modalTransclude", function () { return { link: function (a, b, c, d, e) { e(a.$parent, function (a) { b.empty(), b.append(a) }) } } }).factory("$modalStack", ["$animate", "$timeout", "$document", "$compile", "$rootScope", "$$stackedMap", function (a, b, c, d, e, f) { function g() { for (var a = -1, b = o.keys(), c = 0; c < b.length; c++)o.get(b[c]).value.backdrop && (a = c); return a } function h(a) { var b = c.find("body").eq(0), d = o.get(a).value; o.remove(a), j(d.modalDomEl, d.modalScope, function () { b.toggleClass(n, o.length() > 0), i() }) } function i() { if (l && -1 == g()) { var a = m; j(l, m, function () { a = null }), l = void 0, m = void 0 } } function j(c, d, f) { function g() { g.done || (g.done = !0, c.remove(), d.$destroy(), f && f()) } d.animate = !1, c.attr("modal-animation") && a.enabled() ? c.one("$animate:close", function () { e.$evalAsync(g) }) : b(g) } function k(a, b, c) { return !a.value.modalScope.$broadcast("modal.closing", b, c).defaultPrevented } var l, m, n = "modal-open", o = f.createNew(), p = {}; return e.$watch(g, function (a) { m && (m.index = a) }), c.bind("keydown", function (a) { var b; 27 === a.which && (b = o.top(), b && b.value.keyboard && (a.preventDefault(), e.$apply(function () { p.dismiss(b.key, "escape key press") }))) }), p.open = function (a, b) { var f = c[0].activeElement; o.add(a, { deferred: b.deferred, renderDeferred: b.renderDeferred, modalScope: b.scope, backdrop: b.backdrop, keyboard: b.keyboard }); var h = c.find("body").eq(0), i = g(); if (i >= 0 && !l) { m = e.$new(!0), m.index = i; var j = angular.element('<div modal-backdrop="modal-backdrop"></div>'); j.attr("backdrop-class", b.backdropClass), b.animation && j.attr("modal-animation", "true"), l = d(j)(m), h.append(l) } var k = angular.element('<div modal-window="modal-window"></div>'); k.attr({ "template-url": b.windowTemplateUrl, "window-class": b.windowClass, size: b.size, index: o.length() - 1, animate: "animate" }).html(b.content), b.animation && k.attr("modal-animation", "true"); var p = d(k)(b.scope); o.top().value.modalDomEl = p, o.top().value.modalOpener = f, h.append(p), h.addClass(n) }, p.close = function (a, b) { var c = o.get(a); return c && k(c, b, !0) ? (c.value.deferred.resolve(b), h(a), c.value.modalOpener.focus(), !0) : !c }, p.dismiss = function (a, b) { var c = o.get(a); return c && k(c, b, !1) ? (c.value.deferred.reject(b), h(a), c.value.modalOpener.focus(), !0) : !c }, p.dismissAll = function (a) { for (var b = this.getTop(); b && this.dismiss(b.key, a);)b = this.getTop() }, p.getTop = function () { return o.top() }, p.modalRendered = function (a) { var b = o.get(a); b && b.value.renderDeferred.resolve() }, p }]).provider("$modal", function () { var a = { options: {animation: !0, backdrop: !0, keyboard: !0}, $get: ["$injector", "$rootScope", "$q", "$templateRequest", "$controller", "$modalStack", function (b, c, d, e, f, g) { function h(a) { return a.template ? d.when(a.template) : e(angular.isFunction(a.templateUrl) ? a.templateUrl() : a.templateUrl) } function i(a) { var c = []; return angular.forEach(a, function (a) { (angular.isFunction(a) || angular.isArray(a)) && c.push(d.when(b.invoke(a))) }), c } var j = {}; return j.open = function (b) { var e = d.defer(), j = d.defer(), k = d.defer(), l = { result: e.promise, opened: j.promise, rendered: k.promise, close: function (a) { return g.close(l, a) }, dismiss: function (a) { return g.dismiss(l, a) } }; if (b = angular.extend({}, a.options, b), b.resolve = b.resolve || {}, !b.template && !b.templateUrl)throw new Error("One of template or templateUrl options is required."); var m = d.all([h(b)].concat(i(b.resolve))); return m.then(function (a) { var d = (b.scope || c).$new(); d.$close = l.close, d.$dismiss = l.dismiss; var h, i = {}, j = 1; b.controller && (i.$scope = d, i.$modalInstance = l, angular.forEach(b.resolve, function (b, c) { i[c] = a[j++] }), h = f(b.controller, i), b.controllerAs && (d[b.controllerAs] = h)), g.open(l, { scope: d, deferred: e, renderDeferred: k, content: a[0], animation: b.animation, backdrop: b.backdrop, keyboard: b.keyboard, backdropClass: b.backdropClass, windowClass: b.windowClass, windowTemplateUrl: b.windowTemplateUrl, size: b.size }) }, function (a) { e.reject(a) }), m.then(function () { j.resolve(!0) }, function (a) { j.reject(a) }), l }, j }] }; return a }), angular.module("ui.bootstrap.pagination", []).controller("PaginationController", ["$scope", "$attrs", "$parse", function (a, b, c) { var d = this, e = {$setViewValue: angular.noop}, f = b.numPages ? c(b.numPages).assign : angular.noop; this.init = function (g, h) { e = g, this.config = h, e.$render = function () { d.render() }, b.itemsPerPage ? a.$parent.$watch(c(b.itemsPerPage), function (b) { d.itemsPerPage = parseInt(b, 10), a.totalPages = d.calculateTotalPages() }) : this.itemsPerPage = h.itemsPerPage, a.$watch("totalItems", function () { a.totalPages = d.calculateTotalPages() }), a.$watch("totalPages", function (b) { f(a.$parent, b), a.page > b ? a.selectPage(b) : e.$render() }) }, this.calculateTotalPages = function () { var b = this.itemsPerPage < 1 ? 1 : Math.ceil(a.totalItems / this.itemsPerPage); return Math.max(b || 0, 1) }, this.render = function () { a.page = parseInt(e.$viewValue, 10) || 1 }, a.selectPage = function (b, c) { a.page !== b && b > 0 && b <= a.totalPages && (c && c.target && c.target.blur(), e.$setViewValue(b), e.$render()) }, a.getText = function (b) { return a[b + "Text"] || d.config[b + "Text"] }, a.noPrevious = function () { return 1 === a.page }, a.noNext = function () { return a.page === a.totalPages } }]).constant("paginationConfig", { itemsPerPage: 10, boundaryLinks: !1, directionLinks: !0, firstText: "First", previousText: "Previous", nextText: "Next", lastText: "Last", rotate: !0 }).directive("pagination", ["$parse", "paginationConfig", function (a, b) { return { restrict: "EA", scope: {totalItems: "=", firstText: "@", previousText: "@", nextText: "@", lastText: "@"}, require: ["pagination", "?ngModel"], controller: "PaginationController", templateUrl: "template/pagination/pagination.html", replace: !0, link: function (c, d, e, f) { function g(a, b, c) { return {number: a, text: b, active: c} } function h(a, b) { var c = [], d = 1, e = b, f = angular.isDefined(k) && b > k; f && (l ? (d = Math.max(a - Math.floor(k / 2), 1), e = d + k - 1, e > b && (e = b, d = e - k + 1)) : (d = (Math.ceil(a / k) - 1) * k + 1, e = Math.min(d + k - 1, b))); for (var h = d; e >= h; h++) { var i = g(h, h, h === a); c.push(i) } if (f && !l) { if (d > 1) { var j = g(d - 1, "...", !1); c.unshift(j) } if (b > e) { var m = g(e + 1, "...", !1); c.push(m) } } return c } var i = f[0], j = f[1]; if (j) { var k = angular.isDefined(e.maxSize) ? c.$parent.$eval(e.maxSize) : b.maxSize, l = angular.isDefined(e.rotate) ? c.$parent.$eval(e.rotate) : b.rotate; c.boundaryLinks = angular.isDefined(e.boundaryLinks) ? c.$parent.$eval(e.boundaryLinks) : b.boundaryLinks, c.directionLinks = angular.isDefined(e.directionLinks) ? c.$parent.$eval(e.directionLinks) : b.directionLinks, i.init(j, b), e.maxSize && c.$parent.$watch(a(e.maxSize), function (a) { k = parseInt(a, 10), i.render() }); var m = i.render; i.render = function () { m(), c.page > 0 && c.page <= c.totalPages && (c.pages = h(c.page, c.totalPages)) } } } } }]).constant("pagerConfig", { itemsPerPage: 10, previousText: "« Previous", nextText: "Next »", align: !0 }).directive("pager", ["pagerConfig", function (a) { return { restrict: "EA", scope: {totalItems: "=", previousText: "@", nextText: "@"}, require: ["pager", "?ngModel"], controller: "PaginationController", templateUrl: "template/pagination/pager.html", replace: !0, link: function (b, c, d, e) { var f = e[0], g = e[1]; g && (b.align = angular.isDefined(d.align) ? b.$parent.$eval(d.align) : a.align, f.init(g, a)) } } }]), angular.module("ui.bootstrap.tooltip", ["ui.bootstrap.position", "ui.bootstrap.bindHtml"]).provider("$tooltip", function () { function a(a) { var b = /[A-Z]/g, c = "-"; return a.replace(b, function (a, b) { return (b ? c : "") + a.toLowerCase() }) } var b = {placement: "top", animation: !0, popupDelay: 0, useContentExp: !1}, c = { mouseenter: "mouseleave", click: "click", focus: "blur" }, d = {}; this.options = function (a) { angular.extend(d, a) }, this.setTriggers = function (a) { angular.extend(c, a) }, this.$get = ["$window", "$compile", "$timeout", "$document", "$position", "$interpolate", function (e, f, g, h, i, j) { return function (e, k, l, m) { function n(a) { var b = a || m.trigger || l, d = c[b] || b; return {show: b, hide: d} } m = angular.extend({}, b, d, m); var o = a(e), p = j.startSymbol(), q = j.endSymbol(), r = "<div " + o + '-popup title="' + p + "title" + q + '" ' + (m.useContentExp ? 'content-exp="contentExp()" ' : 'content="' + p + "content" + q + '" ') + 'placement="' + p + "placement" + q + '" popup-class="' + p + "popupClass" + q + '" animation="animation" is-open="isOpen"origin-scope="origScope" ></div>'; return { restrict: "EA", compile: function () { var a = f(r); return function (b, c, d) { function f() { E.isOpen ? l() : j() } function j() { (!D || b.$eval(d[k + "Enable"])) && (s(), E.popupDelay ? A || (A = g(o, E.popupDelay, !1), A.then(function (a) { a() })) : o()()) } function l() { b.$apply(function () { p() }) } function o() { return A = null, z && (g.cancel(z), z = null), (m.useContentExp ? E.contentExp() : E.content) ? (q(), x.css({ top: 0, left: 0, display: "block" }), E.$digest(), F(), E.isOpen = !0, E.$apply(), F) : angular.noop } function p() { E.isOpen = !1, g.cancel(A), A = null, E.animation ? z || (z = g(r, 500)) : r() } function q() { x && r(), y = E.$new(), x = a(y, function (a) { B ? h.find("body").append(a) : c.after(a) }), y.$watch(function () { g(F, 0, !1) }), m.useContentExp && y.$watch("contentExp()", function (a) { !a && E.isOpen && p() }) } function r() { z = null, x && (x.remove(), x = null), y && (y.$destroy(), y = null) } function s() { t(), u(), v() } function t() { E.popupClass = d[k + "Class"] } function u() { var a = d[k + "Placement"]; E.placement = angular.isDefined(a) ? a : m.placement } function v() { var a = d[k + "PopupDelay"], b = parseInt(a, 10); E.popupDelay = isNaN(b) ? m.popupDelay : b } function w() { var a = d[k + "Trigger"]; G(), C = n(a), C.show === C.hide ? c.bind(C.show, f) : (c.bind(C.show, j), c.bind(C.hide, l)) } var x, y, z, A, B = angular.isDefined(m.appendToBody) ? m.appendToBody : !1, C = n(void 0), D = angular.isDefined(d[k + "Enable"]), E = b.$new(!0), F = function () { if (x) { var a = i.positionElements(c, x, E.placement, B); a.top += "px", a.left += "px", x.css(a) } }; E.origScope = b, E.isOpen = !1, E.contentExp = function () { return b.$eval(d[e]) }, m.useContentExp || d.$observe(e, function (a) { E.content = a, !a && E.isOpen && p() }), d.$observe("disabled", function (a) { a && E.isOpen && p() }), d.$observe(k + "Title", function (a) { E.title = a }); var G = function () { c.unbind(C.show, j), c.unbind(C.hide, l) }; w(); var H = b.$eval(d[k + "Animation"]); E.animation = angular.isDefined(H) ? !!H : m.animation; var I = b.$eval(d[k + "AppendToBody"]); B = angular.isDefined(I) ? I : B, B && b.$on("$locationChangeSuccess", function () { E.isOpen && p() }), b.$on("$destroy", function () { g.cancel(z), g.cancel(A), G(), r(), E = null }) } } } } }] }).directive("tooltipTemplateTransclude", ["$animate", "$sce", "$compile", "$templateRequest", function (a, b, c, d) { return { link: function (e, f, g) { var h, i, j, k = e.$eval(g.tooltipTemplateTranscludeScope), l = 0, m = function () { i && (i.remove(), i = null), h && (h.$destroy(), h = null), j && (a.leave(j).then(function () { i = null }), i = j, j = null) }; e.$watch(b.parseAsResourceUrl(g.tooltipTemplateTransclude), function (b) { var g = ++l; b ? (d(b, !0).then(function (d) { if (g === l) { var e = k.$new(), i = d, n = c(i)(e, function (b) { m(), a.enter(b, f) }); h = e, j = n, h.$emit("$includeContentLoaded", b) } }, function () { g === l && (m(), e.$emit("$includeContentError", b)) }), e.$emit("$includeContentRequested", b)) : m() }), e.$on("$destroy", m) } } }]).directive("tooltipClasses", function () { return { restrict: "A", link: function (a, b, c) { a.placement && b.addClass(a.placement), a.popupClass && b.addClass(a.popupClass), a.animation() && b.addClass(c.tooltipAnimationClass) } } }).directive("tooltipPopup", function () { return { restrict: "EA", replace: !0, scope: {content: "@", placement: "@", popupClass: "@", animation: "&", isOpen: "&"}, templateUrl: "template/tooltip/tooltip-popup.html" } }).directive("tooltip", ["$tooltip", function (a) { return a("tooltip", "tooltip", "mouseenter") }]).directive("tooltipTemplatePopup", function () { return { restrict: "EA", replace: !0, scope: {contentExp: "&", placement: "@", popupClass: "@", animation: "&", isOpen: "&", originScope: "&"}, templateUrl: "template/tooltip/tooltip-template-popup.html" } }).directive("tooltipTemplate", ["$tooltip", function (a) { return a("tooltipTemplate", "tooltip", "mouseenter", {useContentExp: !0}) }]).directive("tooltipHtmlPopup", function () { return { restrict: "EA", replace: !0, scope: {contentExp: "&", placement: "@", popupClass: "@", animation: "&", isOpen: "&"}, templateUrl: "template/tooltip/tooltip-html-popup.html" } }).directive("tooltipHtml", ["$tooltip", function (a) { return a("tooltipHtml", "tooltip", "mouseenter", {useContentExp: !0}) }]).directive("tooltipHtmlUnsafePopup", function () { return { restrict: "EA", replace: !0, scope: {content: "@", placement: "@", popupClass: "@", animation: "&", isOpen: "&"}, templateUrl: "template/tooltip/tooltip-html-unsafe-popup.html" } }).value("tooltipHtmlUnsafeSuppressDeprecated", !1).directive("tooltipHtmlUnsafe", ["$tooltip", "tooltipHtmlUnsafeSuppressDeprecated", "$log", function (a, b, c) { return b || c.warn("tooltip-html-unsafe is now deprecated. Use tooltip-html or tooltip-template instead."), a("tooltipHtmlUnsafe", "tooltip", "mouseenter") }]), angular.module("ui.bootstrap.popover", ["ui.bootstrap.tooltip"]).directive("popoverTemplatePopup", function () { return { restrict: "EA", replace: !0, scope: { title: "@", contentExp: "&", placement: "@", popupClass: "@", animation: "&", isOpen: "&", originScope: "&" }, templateUrl: "template/popover/popover-template.html" } }).directive("popoverTemplate", ["$tooltip", function (a) { return a("popoverTemplate", "popover", "click", {useContentExp: !0}) }]).directive("popoverPopup", function () { return { restrict: "EA", replace: !0, scope: {title: "@", content: "@", placement: "@", popupClass: "@", animation: "&", isOpen: "&"}, templateUrl: "template/popover/popover.html" } }).directive("popover", ["$tooltip", function (a) { return a("popover", "popover", "click") }]), angular.module("ui.bootstrap.progressbar", []).constant("progressConfig", { animate: !0, max: 100 }).controller("ProgressController", ["$scope", "$attrs", "progressConfig", function (a, b, c) { var d = this, e = angular.isDefined(b.animate) ? a.$parent.$eval(b.animate) : c.animate; this.bars = [], a.max = angular.isDefined(a.max) ? a.max : c.max, this.addBar = function (b, c) { e || c.css({transition: "none"}), this.bars.push(b), b.$watch("value", function (c) { b.percent = +(100 * c / a.max).toFixed(2) }), b.$on("$destroy", function () { c = null, d.removeBar(b) }) }, this.removeBar = function (a) { this.bars.splice(this.bars.indexOf(a), 1) } }]).directive("progress", function () { return { restrict: "EA", replace: !0, transclude: !0, controller: "ProgressController", require: "progress", scope: {}, templateUrl: "template/progressbar/progress.html" } }).directive("bar", function () { return { restrict: "EA", replace: !0, transclude: !0, require: "^progress", scope: {value: "=", max: "=?", type: "@"}, templateUrl: "template/progressbar/bar.html", link: function (a, b, c, d) { d.addBar(a, b) } } }).directive("progressbar", function () { return { restrict: "EA", replace: !0, transclude: !0, controller: "ProgressController", scope: {value: "=", max: "=?", type: "@"}, templateUrl: "template/progressbar/progressbar.html", link: function (a, b, c, d) { d.addBar(a, angular.element(b.children()[0])) } } }), angular.module("ui.bootstrap.rating", []).constant("ratingConfig", { max: 5, stateOn: null, stateOff: null }).controller("RatingController", ["$scope", "$attrs", "ratingConfig", function (a, b, c) { var d = {$setViewValue: angular.noop}; this.init = function (e) { d = e, d.$render = this.render, d.$formatters.push(function (a) { return angular.isNumber(a) && a << 0 !== a && (a = Math.round(a)), a }), this.stateOn = angular.isDefined(b.stateOn) ? a.$parent.$eval(b.stateOn) : c.stateOn, this.stateOff = angular.isDefined(b.stateOff) ? a.$parent.$eval(b.stateOff) : c.stateOff; var f = angular.isDefined(b.ratingStates) ? a.$parent.$eval(b.ratingStates) : new Array(angular.isDefined(b.max) ? a.$parent.$eval(b.max) : c.max); a.range = this.buildTemplateObjects(f) }, this.buildTemplateObjects = function (a) { for (var b = 0, c = a.length; c > b; b++)a[b] = angular.extend({index: b}, { stateOn: this.stateOn, stateOff: this.stateOff }, a[b]); return a }, a.rate = function (b) { !a.readonly && b >= 0 && b <= a.range.length && (d.$setViewValue(b), d.$render()) }, a.enter = function (b) { a.readonly || (a.value = b), a.onHover({value: b}) }, a.reset = function () { a.value = d.$viewValue, a.onLeave() }, a.onKeydown = function (b) { /(37|38|39|40)/.test(b.which) && (b.preventDefault(), b.stopPropagation(), a.rate(a.value + (38 === b.which || 39 === b.which ? 1 : -1))) }, this.render = function () { a.value = d.$viewValue } }]).directive("rating", function () { return { restrict: "EA", require: ["rating", "ngModel"], scope: {readonly: "=?", onHover: "&", onLeave: "&"}, controller: "RatingController", templateUrl: "template/rating/rating.html", replace: !0, link: function (a, b, c, d) { var e = d[0], f = d[1]; e.init(f) } } }), angular.module("ui.bootstrap.tabs", []).controller("TabsetController", ["$scope", function (a) { var b = this, c = b.tabs = a.tabs = []; b.select = function (a) { angular.forEach(c, function (b) { b.active && b !== a && (b.active = !1, b.onDeselect()) }), a.active = !0, a.onSelect() }, b.addTab = function (a) { c.push(a), 1 === c.length && a.active !== !1 ? a.active = !0 : a.active ? b.select(a) : a.active = !1 }, b.removeTab = function (a) { var e = c.indexOf(a); if (a.active && c.length > 1 && !d) { var f = e == c.length - 1 ? e - 1 : e + 1; b.select(c[f]) } c.splice(e, 1) }; var d; a.$on("$destroy", function () { d = !0 }) }]).directive("tabset", function () { return { restrict: "EA", transclude: !0, replace: !0, scope: {type: "@"}, controller: "TabsetController", templateUrl: "template/tabs/tabset.html", link: function (a, b, c) { a.vertical = angular.isDefined(c.vertical) ? a.$parent.$eval(c.vertical) : !1, a.justified = angular.isDefined(c.justified) ? a.$parent.$eval(c.justified) : !1 } } }).directive("tab", ["$parse", "$log", function (a, b) { return { require: "^tabset", restrict: "EA", replace: !0, templateUrl: "template/tabs/tab.html", transclude: !0, scope: {active: "=?", heading: "@", onSelect: "&select", onDeselect: "&deselect"}, controller: function () { }, compile: function (c, d, e) { return function (c, d, f, g) { c.$watch("active", function (a) { a && g.select(c) }), c.disabled = !1, f.disable && c.$parent.$watch(a(f.disable), function (a) { c.disabled = !!a }), f.disabled && (b.warn('Use of "disabled" attribute has been deprecated, please use "disable"'), c.$parent.$watch(a(f.disabled), function (a) { c.disabled = !!a })), c.select = function () { c.disabled || (c.active = !0) }, g.addTab(c), c.$on("$destroy", function () { g.removeTab(c) }), c.$transcludeFn = e } } } }]).directive("tabHeadingTransclude", [function () { return { restrict: "A", require: "^tab", link: function (a, b) { a.$watch("headingElement", function (a) { a && (b.html(""), b.append(a)) }) } } }]).directive("tabContentTransclude", function () { function a(a) { return a.tagName && (a.hasAttribute("tab-heading") || a.hasAttribute("data-tab-heading") || "tab-heading" === a.tagName.toLowerCase() || "data-tab-heading" === a.tagName.toLowerCase()) } return { restrict: "A", require: "^tabset", link: function (b, c, d) { var e = b.$eval(d.tabContentTransclude); e.$transcludeFn(e.$parent, function (b) { angular.forEach(b, function (b) { a(b) ? e.headingElement = b : c.append(b) }) }) } } }), angular.module("ui.bootstrap.timepicker", []).constant("timepickerConfig", { hourStep: 1, minuteStep: 1, showMeridian: !0, meridians: null, readonlyInput: !1, mousewheel: !0, arrowkeys: !0 }).controller("TimepickerController", ["$scope", "$attrs", "$parse", "$log", "$locale", "timepickerConfig", function (a, b, c, d, e, f) { function g() { var b = parseInt(a.hours, 10), c = a.showMeridian ? b > 0 && 13 > b : b >= 0 && 24 > b; return c ? (a.showMeridian && (12 === b && (b = 0), a.meridian === p[1] && (b += 12)), b) : void 0 } function h() { var b = parseInt(a.minutes, 10); return b >= 0 && 60 > b ? b : void 0 } function i(a) { return angular.isDefined(a) && a.toString().length < 2 ? "0" + a : a.toString() } function j(a) { k(), o.$setViewValue(new Date(n)), l(a) } function k() { o.$setValidity("time", !0), a.invalidHours = !1, a.invalidMinutes = !1 } function l(b) { var c = n.getHours(), d = n.getMinutes(); a.showMeridian && (c = 0 === c || 12 === c ? 12 : c % 12), a.hours = "h" === b ? c : i(c), "m" !== b && (a.minutes = i(d)), a.meridian = n.getHours() < 12 ? p[0] : p[1] } function m(a) { var b = new Date(n.getTime() + 6e4 * a); n.setHours(b.getHours(), b.getMinutes()), j() } var n = new Date, o = {$setViewValue: angular.noop}, p = angular.isDefined(b.meridians) ? a.$parent.$eval(b.meridians) : f.meridians || e.DATETIME_FORMATS.AMPMS; this.init = function (c, d) { o = c, o.$render = this.render, o.$formatters.unshift(function (a) { return a ? new Date(a) : null }); var e = d.eq(0), g = d.eq(1), h = angular.isDefined(b.mousewheel) ? a.$parent.$eval(b.mousewheel) : f.mousewheel; h && this.setupMousewheelEvents(e, g); var i = angular.isDefined(b.arrowkeys) ? a.$parent.$eval(b.arrowkeys) : f.arrowkeys; i && this.setupArrowkeyEvents(e, g), a.readonlyInput = angular.isDefined(b.readonlyInput) ? a.$parent.$eval(b.readonlyInput) : f.readonlyInput, this.setupInputEvents(e, g) }; var q = f.hourStep; b.hourStep && a.$parent.$watch(c(b.hourStep), function (a) { q = parseInt(a, 10) }); var r = f.minuteStep; b.minuteStep && a.$parent.$watch(c(b.minuteStep), function (a) { r = parseInt(a, 10) }), a.showMeridian = f.showMeridian, b.showMeridian && a.$parent.$watch(c(b.showMeridian), function (b) { if (a.showMeridian = !!b, o.$error.time) { var c = g(), d = h(); angular.isDefined(c) && angular.isDefined(d) && (n.setHours(c), j()) } else l() }), this.setupMousewheelEvents = function (b, c) { var d = function (a) { a.originalEvent && (a = a.originalEvent); var b = a.wheelDelta ? a.wheelDelta : -a.deltaY; return a.detail || b > 0 }; b.bind("mousewheel wheel", function (b) { a.$apply(d(b) ? a.incrementHours() : a.decrementHours()), b.preventDefault() }), c.bind("mousewheel wheel", function (b) { a.$apply(d(b) ? a.incrementMinutes() : a.decrementMinutes()), b.preventDefault() }) }, this.setupArrowkeyEvents = function (b, c) { b.bind("keydown", function (b) { 38 === b.which ? (b.preventDefault(), a.incrementHours(), a.$apply()) : 40 === b.which && (b.preventDefault(), a.decrementHours(), a.$apply()) }), c.bind("keydown", function (b) { 38 === b.which ? (b.preventDefault(), a.incrementMinutes(), a.$apply()) : 40 === b.which && (b.preventDefault(), a.decrementMinutes(), a.$apply()) }) }, this.setupInputEvents = function (b, c) { if (a.readonlyInput)return a.updateHours = angular.noop, void(a.updateMinutes = angular.noop); var d = function (b, c) { o.$setViewValue(null), o.$setValidity("time", !1), angular.isDefined(b) && (a.invalidHours = b), angular.isDefined(c) && (a.invalidMinutes = c) }; a.updateHours = function () { var a = g(); angular.isDefined(a) ? (n.setHours(a), j("h")) : d(!0) }, b.bind("blur", function () { !a.invalidHours && a.hours < 10 && a.$apply(function () { a.hours = i(a.hours) }) }), a.updateMinutes = function () { var a = h(); angular.isDefined(a) ? (n.setMinutes(a), j("m")) : d(void 0, !0) }, c.bind("blur", function () { !a.invalidMinutes && a.minutes < 10 && a.$apply(function () { a.minutes = i(a.minutes) }) }) }, this.render = function () { var a = o.$viewValue; isNaN(a) ? (o.$setValidity("time", !1), d.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')) : (a && (n = a), k(), l()) }, a.incrementHours = function () { m(60 * q) }, a.decrementHours = function () { m(60 * -q) }, a.incrementMinutes = function () { m(r) }, a.decrementMinutes = function () { m(-r) }, a.toggleMeridian = function () { m(720 * (n.getHours() < 12 ? 1 : -1)) } }]).directive("timepicker", function () { return { restrict: "EA", require: ["timepicker", "?^ngModel"], controller: "TimepickerController", replace: !0, scope: {}, templateUrl: "template/timepicker/timepicker.html", link: function (a, b, c, d) { var e = d[0], f = d[1]; f && e.init(f, b.find("input")) } } }), angular.module("ui.bootstrap.transition", []).value("$transitionSuppressDeprecated", !1).factory("$transition", ["$q", "$timeout", "$rootScope", "$log", "$transitionSuppressDeprecated", function (a, b, c, d, e) { function f(a) { for (var b in a)if (void 0 !== h.style[b])return a[b] } e || d.warn("$transition is now deprecated. Use $animate from ngAnimate instead."); var g = function (d, e, f) { f = f || {}; var h = a.defer(), i = g[f.animation ? "animationEndEventName" : "transitionEndEventName"], j = function () { c.$apply(function () { d.unbind(i, j), h.resolve(d) }) }; return i && d.bind(i, j), b(function () { angular.isString(e) ? d.addClass(e) : angular.isFunction(e) ? e(d) : angular.isObject(e) && d.css(e), i || h.resolve(d) }), h.promise.cancel = function () { i && d.unbind(i, j), h.reject("Transition cancelled") }, h.promise }, h = document.createElement("trans"), i = { WebkitTransition: "webkitTransitionEnd", MozTransition: "transitionend", OTransition: "oTransitionEnd", transition: "transitionend" }, j = { WebkitTransition: "webkitAnimationEnd", MozTransition: "animationend", OTransition: "oAnimationEnd", transition: "animationend" }; return g.transitionEndEventName = f(i), g.animationEndEventName = f(j), g }]), angular.module("ui.bootstrap.typeahead", ["ui.bootstrap.position", "ui.bootstrap.bindHtml"]).factory("typeaheadParser", ["$parse", function (a) { var b = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/; return { parse: function (c) { var d = c.match(b); if (!d)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "' + c + '".'); return {itemName: d[3], source: a(d[4]), viewMapper: a(d[2] || d[1]), modelMapper: a(d[1])} } } }]).directive("typeahead", ["$compile", "$parse", "$q", "$timeout", "$document", "$position", "typeaheadParser", function (a, b, c, d, e, f, g) { var h = [9, 13, 27, 38, 40]; return { require: "ngModel", link: function (i, j, k, l) { var m, n = i.$eval(k.typeaheadMinLength) || 1, o = i.$eval(k.typeaheadWaitMs) || 0, p = i.$eval(k.typeaheadEditable) !== !1, q = b(k.typeaheadLoading).assign || angular.noop, r = b(k.typeaheadOnSelect), s = k.typeaheadInputFormatter ? b(k.typeaheadInputFormatter) : void 0, t = k.typeaheadAppendToBody ? i.$eval(k.typeaheadAppendToBody) : !1, u = i.$eval(k.typeaheadFocusFirst) !== !1, v = b(k.ngModel).assign, w = g.parse(k.typeahead), x = i.$new(); i.$on("$destroy", function () { x.$destroy() }); var y = "typeahead-" + x.$id + "-" + Math.floor(1e4 * Math.random()); j.attr({"aria-autocomplete": "list", "aria-expanded": !1, "aria-owns": y}); var z = angular.element("<div typeahead-popup></div>"); z.attr({ id: y, matches: "matches", active: "activeIdx", select: "select(activeIdx)", query: "query", position: "position" }), angular.isDefined(k.typeaheadTemplateUrl) && z.attr("template-url", k.typeaheadTemplateUrl); var A = function () { x.matches = [], x.activeIdx = -1, j.attr("aria-expanded", !1) }, B = function (a) { return y + "-option-" + a }; x.$watch("activeIdx", function (a) { 0 > a ? j.removeAttr("aria-activedescendant") : j.attr("aria-activedescendant", B(a)) }); var C = function (a) { var b = {$viewValue: a}; q(i, !0), c.when(w.source(i, b)).then(function (c) { var d = a === l.$viewValue; if (d && m)if (c && c.length > 0) { x.activeIdx = u ? 0 : -1, x.matches.length = 0; for (var e = 0; e < c.length; e++)b[w.itemName] = c[e], x.matches.push({ id: B(e), label: w.viewMapper(x, b), model: c[e] }); x.query = a, x.position = t ? f.offset(j) : f.position(j), x.position.top = x.position.top + j.prop("offsetHeight"), j.attr("aria-expanded", !0) } else A(); d && q(i, !1) }, function () { A(), q(i, !1) }) }; A(), x.query = void 0; var D, E = function (a) { D = d(function () { C(a) }, o) }, F = function () { D && d.cancel(D) }; l.$parsers.unshift(function (a) { return m = !0, a && a.length >= n ? o > 0 ? (F(), E(a)) : C(a) : (q(i, !1), F(), A()), p ? a : a ? void l.$setValidity("editable", !1) : (l.$setValidity("editable", !0), a) }), l.$formatters.push(function (a) { var b, c, d = {}; return p || l.$setValidity("editable", !0), s ? (d.$model = a, s(i, d)) : (d[w.itemName] = a, b = w.viewMapper(i, d), d[w.itemName] = void 0, c = w.viewMapper(i, d), b !== c ? b : a) }), x.select = function (a) { var b, c, e = {}; e[w.itemName] = c = x.matches[a].model, b = w.modelMapper(i, e), v(i, b), l.$setValidity("editable", !0), l.$setValidity("parse", !0), r(i, { $item: c, $model: b, $label: w.viewMapper(i, e) }), A(), d(function () { j[0].focus() }, 0, !1) }, j.bind("keydown", function (a) { 0 !== x.matches.length && -1 !== h.indexOf(a.which) && (-1 != x.activeIdx || 13 !== a.which && 9 !== a.which) && (a.preventDefault(), 40 === a.which ? (x.activeIdx = (x.activeIdx + 1) % x.matches.length, x.$digest()) : 38 === a.which ? (x.activeIdx = (x.activeIdx > 0 ? x.activeIdx : x.matches.length) - 1, x.$digest()) : 13 === a.which || 9 === a.which ? x.$apply(function () { x.select(x.activeIdx) }) : 27 === a.which && (a.stopPropagation(), A(), x.$digest())) }), j.bind("blur", function () { m = !1 }); var G = function (a) { j[0] !== a.target && (A(), x.$digest()) }; e.bind("click", G), i.$on("$destroy", function () { e.unbind("click", G), t && H.remove(), z.remove() }); var H = a(z)(x); t ? e.find("body").append(H) : j.after(H) } } }]).directive("typeaheadPopup", function () { return { restrict: "EA", scope: {matches: "=", query: "=", active: "=", position: "=", select: "&"}, replace: !0, templateUrl: "template/typeahead/typeahead-popup.html", link: function (a, b, c) { a.templateUrl = c.templateUrl, a.isOpen = function () { return a.matches.length > 0 }, a.isActive = function (b) { return a.active == b }, a.selectActive = function (b) { a.active = b }, a.selectMatch = function (b) { a.select({activeIdx: b}) } } } }).directive("typeaheadMatch", ["$templateRequest", "$compile", "$parse", function (a, b, c) { return { restrict: "EA", scope: {index: "=", match: "=", query: "="}, link: function (d, e, f) { var g = c(f.templateUrl)(d.$parent) || "template/typeahead/typeahead-match.html"; a(g).then(function (a) { b(a.trim())(d, function (a) { e.replaceWith(a) }) }) } } }]).filter("typeaheadHighlight", function () { function a(a) { return a.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1") } return function (b, c) { return c ? ("" + b).replace(new RegExp(a(c), "gi"), "<strong>$&</strong>") : b } }), angular.module("template/accordion/accordion-group.html", []).run(["$templateCache", function (a) { a.put("template/accordion/accordion-group.html", '<div class="panel panel-default">\n <div class="panel-heading">\n <h4 class="panel-title">\n <a href="javascript:void(0)" tabindex="0" class="accordion-toggle" ng-click="toggleOpen()" accordion-transclude="heading"><span ng-class="{\'text-muted\': isDisabled}">{{heading}}</span></a>\n </h4>\n </div>\n <div class="panel-collapse collapse" collapse="!isOpen">\n <div class="panel-body" ng-transclude></div>\n </div>\n</div>\n') }]), angular.module("template/accordion/accordion.html", []).run(["$templateCache", function (a) { a.put("template/accordion/accordion.html", '<div class="panel-group" ng-transclude></div>') }]), angular.module("template/alert/alert.html", []).run(["$templateCache", function (a) { a.put("template/alert/alert.html", '<div class="alert" ng-class="[\'alert-\' + (type || \'warning\'), closeable ? \'alert-dismissable\' : null]" role="alert">\n <button ng-show="closeable" type="button" class="close" ng-click="close()">\n <span aria-hidden="true">&times;</span>\n <span class="sr-only">Close</span>\n </button>\n <div ng-transclude></div>\n</div>\n') }]), angular.module("template/carousel/carousel.html", []).run(["$templateCache", function (a) { a.put("template/carousel/carousel.html", '<div ng-mouseenter="pause()" ng-mouseleave="play()" class="carousel" ng-swipe-right="prev()" ng-swipe-left="next()">\n <ol class="carousel-indicators" ng-show="slides.length > 1">\n <li ng-repeat="slide in slides | orderBy:\'index\' track by $index" ng-class="{active: isActive(slide)}" ng-click="select(slide)"></li>\n </ol>\n <div class="carousel-inner" ng-transclude></div>\n <a class="left carousel-control" ng-click="prev()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-left"></span></a>\n <a class="right carousel-control" ng-click="next()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-right"></span></a>\n</div>\n') }]), angular.module("template/carousel/slide.html", []).run(["$templateCache", function (a) { a.put("template/carousel/slide.html", '<div ng-class="{\n \'active\': active\n }" class="item text-center" ng-transclude></div>\n') }]), angular.module("template/datepicker/datepicker.html", []).run(["$templateCache", function (a) { a.put("template/datepicker/datepicker.html", '<div ng-switch="datepickerMode" role="application" ng-keydown="keydown($event)">\n <daypicker ng-switch-when="day" tabindex="0"></daypicker>\n <monthpicker ng-switch-when="month" tabindex="0"></monthpicker>\n <yearpicker ng-switch-when="year" tabindex="0"></yearpicker>\n</div>') }]), angular.module("template/datepicker/day.html", []).run(["$templateCache", function (a) { a.put("template/datepicker/day.html", '<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="{{5 + showWeeks}}"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n <tr>\n <th ng-show="showWeeks" class="text-center"></th>\n <th ng-repeat="label in labels track by $index" class="text-center"><small aria-label="{{label.full}}">{{label.abbr}}</small></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-show="showWeeks" class="text-center h6"><em>{{ weekNumbers[$index] }}</em></td>\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}" ng-class="dt.customClass">\n <button type="button" style="width:100%;" class="btn btn-default btn-sm" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-muted\': dt.secondary, \'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n') }]), angular.module("template/datepicker/month.html", []).run(["$templateCache", function (a) { a.put("template/datepicker/month.html", '<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n') }]), angular.module("template/datepicker/popup.html", []).run(["$templateCache", function (a) { a.put("template/datepicker/popup.html", '<ul class="dropdown-menu" ng-style="{display: (isOpen && \'block\') || \'none\', top: position.top+\'px\', left: position.left+\'px\'}" ng-keydown="keydown($event)">\n <li ng-transclude></li>\n <li ng-if="showButtonBar" style="padding:10px 9px 2px">\n <span class="btn-group pull-left">\n <button type="button" class="btn btn-sm btn-info" ng-click="select(\'today\')">{{ getText(\'current\') }}</button>\n <button type="button" class="btn btn-sm btn-danger" ng-click="select(null)">{{ getText(\'clear\') }}</button>\n </span>\n <button type="button" class="btn btn-sm btn-success pull-right" ng-click="close()">{{ getText(\'close\') }}</button>\n </li>\n</ul>\n') }]), angular.module("template/datepicker/year.html", []).run(["$templateCache", function (a) { a.put("template/datepicker/year.html", '<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="3"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n') }]), angular.module("template/modal/backdrop.html", []).run(["$templateCache", function (a) { a.put("template/modal/backdrop.html", '<div class="modal-backdrop"\n modal-animation-class="fade"\n ng-class="{in: animate}"\n ng-style="{\'z-index\': 1040 + (index && 1 || 0) + index*10}"\n></div>\n') }]), angular.module("template/modal/window.html", []).run(["$templateCache", function (a) { a.put("template/modal/window.html", '<div modal-render="{{$isRendered}}" tabindex="-1" role="dialog" class="modal"\n modal-animation-class="fade"\n ng-class="{in: animate}" ng-style="{\'z-index\': 1050 + index*10, display: \'block\'}" ng-click="close($event)">\n <div class="modal-dialog" ng-class="size ? \'modal-\' + size : \'\'"><div class="modal-content" modal-transclude></div></div>\n</div>\n') }]), angular.module("template/pagination/pager.html", []).run(["$templateCache", function (a) { a.put("template/pagination/pager.html", '<ul class="pager">\n <li ng-class="{disabled: noPrevious(), previous: align}"><a href ng-click="selectPage(page - 1, $event)">{{getText(\'previous\')}}</a></li>\n <li ng-class="{disabled: noNext(), next: align}"><a href ng-click="selectPage(page + 1, $event)">{{getText(\'next\')}}</a></li>\n</ul>') }]), angular.module("template/pagination/pagination.html", []).run(["$templateCache", function (a) { a.put("template/pagination/pagination.html", '<ul class="pagination">\n <li ng-if="boundaryLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(1, $event)">{{getText(\'first\')}}</a></li>\n <li ng-if="directionLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(page - 1, $event)">{{getText(\'previous\')}}</a></li>\n <li ng-repeat="page in pages track by $index" ng-class="{active: page.active}"><a href ng-click="selectPage(page.number, $event)">{{page.text}}</a></li>\n <li ng-if="directionLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(page + 1, $event)">{{getText(\'next\')}}</a></li>\n <li ng-if="boundaryLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(totalPages, $event)">{{getText(\'last\')}}</a></li>\n</ul>') }]), angular.module("template/tooltip/tooltip-html-popup.html", []).run(["$templateCache", function (a) { a.put("template/tooltip/tooltip-html-popup.html", '<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind-html="contentExp()"></div>\n</div>\n') }]), angular.module("template/tooltip/tooltip-html-unsafe-popup.html", []).run(["$templateCache", function (a) { a.put("template/tooltip/tooltip-html-unsafe-popup.html", '<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" bind-html-unsafe="content"></div>\n</div>\n') }]), angular.module("template/tooltip/tooltip-popup.html", []).run(["$templateCache", function (a) { a.put("template/tooltip/tooltip-popup.html", '<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind="content"></div>\n</div>\n') }]), angular.module("template/tooltip/tooltip-template-popup.html", []).run(["$templateCache", function (a) { a.put("template/tooltip/tooltip-template-popup.html", '<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner"\n tooltip-template-transclude="contentExp()"\n tooltip-template-transclude-scope="originScope()"></div>\n</div>\n') }]), angular.module("template/popover/popover-template.html", []).run(["$templateCache", function (a) { a.put("template/popover/popover-template.html", '<div class="popover"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-if="title"></h3>\n <div class="popover-content"\n tooltip-template-transclude="contentExp()"\n tooltip-template-transclude-scope="originScope()"></div>\n </div>\n</div>\n') }]), angular.module("template/popover/popover-window.html", []).run(["$templateCache", function (a) { a.put("template/popover/popover-window.html", '<div class="popover {{placement}}" ng-class="{ in: isOpen, fade: animation }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-show="title"></h3>\n <div class="popover-content" tooltip-template-transclude></div>\n </div>\n</div>\n') }]), angular.module("template/popover/popover.html", []).run(["$templateCache", function (a) { a.put("template/popover/popover.html", '<div class="popover"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-if="title"></h3>\n <div class="popover-content" ng-bind="content"></div>\n </div>\n</div>\n') }]), angular.module("template/progressbar/bar.html", []).run(["$templateCache", function (a) { a.put("template/progressbar/bar.html", '<div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>\n') }]), angular.module("template/progressbar/progress.html", []).run(["$templateCache", function (a) { a.put("template/progressbar/progress.html", '<div class="progress" ng-transclude></div>') }]), angular.module("template/progressbar/progressbar.html", []).run(["$templateCache", function (a) { a.put("template/progressbar/progressbar.html", '<div class="progress">\n <div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>\n</div>\n') }]), angular.module("template/rating/rating.html", []).run(["$templateCache", function (a) { a.put("template/rating/rating.html", '<span ng-mouseleave="reset()" ng-keydown="onKeydown($event)" tabindex="0" role="slider" aria-valuemin="0" aria-valuemax="{{range.length}}" aria-valuenow="{{value}}">\n <i ng-repeat="r in range track by $index" ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" class="glyphicon" ng-class="$index < value && (r.stateOn || \'glyphicon-star\') || (r.stateOff || \'glyphicon-star-empty\')">\n <span class="sr-only">({{ $index < value ? \'*\' : \' \' }})</span>\n </i>\n</span>') }]), angular.module("template/tabs/tab.html", []).run(["$templateCache", function (a) { a.put("template/tabs/tab.html", '<li ng-class="{active: active, disabled: disabled}">\n <a href ng-click="select()" tab-heading-transclude>{{heading}}</a>\n</li>\n') }]), angular.module("template/tabs/tabset.html", []).run(["$templateCache", function (a) { a.put("template/tabs/tabset.html", '<div>\n <ul class="nav nav-{{type || \'tabs\'}}" ng-class="{\'nav-stacked\': vertical, \'nav-justified\': justified}" ng-transclude></ul>\n <div class="tab-content">\n <div class="tab-pane" \n ng-repeat="tab in tabs" \n ng-class="{active: tab.active}"\n tab-content-transclude="tab">\n </div>\n </div>\n</div>\n') }]), angular.module("template/timepicker/timepicker.html", []).run(["$templateCache", function (a) { a.put("template/timepicker/timepicker.html", '<table>\n <tbody>\n <tr class="text-center">\n <td><a ng-click="incrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td>&nbsp;</td>\n <td><a ng-click="incrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n <tr>\n <td class="form-group" ng-class="{\'has-error\': invalidHours}">\n <input style="width:50px;" type="text" ng-model="hours" ng-change="updateHours()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2">\n </td>\n <td>:</td>\n <td class="form-group" ng-class="{\'has-error\': invalidMinutes}">\n <input style="width:50px;" type="text" ng-model="minutes" ng-change="updateMinutes()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2">\n </td>\n <td ng-show="showMeridian"><button type="button" class="btn btn-default text-center" ng-click="toggleMeridian()">{{meridian}}</button></td>\n </tr>\n <tr class="text-center">\n <td><a ng-click="decrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td>&nbsp;</td>\n <td><a ng-click="decrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n </tbody>\n</table>\n') }]), angular.module("template/typeahead/typeahead-match.html", []).run(["$templateCache", function (a) { a.put("template/typeahead/typeahead-match.html", '<a tabindex="-1" bind-html-unsafe="match.label | typeaheadHighlight:query"></a>') }]), angular.module("template/typeahead/typeahead-popup.html", []).run(["$templateCache", function (a) { a.put("template/typeahead/typeahead-popup.html", '<ul class="dropdown-menu" ng-show="isOpen()" ng-style="{top: position.top+\'px\', left: position.left+\'px\'}" style="display: block;" role="listbox" aria-hidden="{{!isOpen()}}">\n <li ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index)" role="option" id="{{match.id}}">\n <div typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>\n </li>\n</ul>\n') }]), !angular.$$csp() && angular.element(document).find("head").prepend('<style type="text/css">.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}</style>');
/* * angular-ui-bootstrap * http://angular-ui.github.io/bootstrap/ * Version: 0.13.0 - 2015-05-02 * License: MIT */ angular.module("ui.bootstrap", ["ui.bootstrap.tpls", "ui.bootstrap.collapse", "ui.bootstrap.accordion", "ui.bootstrap.alert", "ui.bootstrap.bindHtml", "ui.bootstrap.buttons", "ui.bootstrap.carousel", "ui.bootstrap.dateparser", "ui.bootstrap.position", "ui.bootstrap.datepicker", "ui.bootstrap.dropdown", "ui.bootstrap.modal", "ui.bootstrap.pagination", "ui.bootstrap.tooltip", "ui.bootstrap.popover", "ui.bootstrap.progressbar", "ui.bootstrap.rating", "ui.bootstrap.tabs", "ui.bootstrap.timepicker", "ui.bootstrap.transition", "ui.bootstrap.typeahead"]), angular.module("ui.bootstrap.tpls", ["template/accordion/accordion-group.html", "template/accordion/accordion.html", "template/alert/alert.html", "template/carousel/carousel.html", "template/carousel/slide.html", "template/datepicker/datepicker.html", "template/datepicker/day.html", "template/datepicker/month.html", "template/datepicker/popup.html", "template/datepicker/year.html", "template/modal/backdrop.html", "template/modal/window.html", "template/pagination/pager.html", "template/pagination/pagination.html", "template/tooltip/tooltip-html-popup.html", "template/tooltip/tooltip-html-unsafe-popup.html", "template/tooltip/tooltip-popup.html", "template/tooltip/tooltip-template-popup.html", "template/popover/popover-template.html", "template/popover/popover.html", "template/progressbar/bar.html", "template/progressbar/progress.html", "template/progressbar/progressbar.html", "template/rating/rating.html", "template/tabs/tab.html", "template/tabs/tabset.html", "template/timepicker/timepicker.html", "template/typeahead/typeahead-match.html", "template/typeahead/typeahead-popup.html"]), angular.module("ui.bootstrap.collapse", []).directive("collapse", ["$animate", function (a) { return { link: function (b, c, d) { function e() { c.removeClass("collapse").addClass("collapsing"), a.addClass(c, "in", {to: {height: c[0].scrollHeight + "px"}}).then(f) } function f() { c.removeClass("collapsing"), c.css({height: "auto"}) } function g() { c.css({height: c[0].scrollHeight + "px"}).removeClass("collapse").addClass("collapsing"), a.removeClass(c, "in", {to: {height: "0"}}).then(h) } function h() { c.css({height: "0"}), c.removeClass("collapsing"), c.addClass("collapse") } b.$watch(d.collapse, function (a) { a ? g() : e() }) } } }]), angular.module("ui.bootstrap.accordion", ["ui.bootstrap.collapse"]).constant("accordionConfig", {closeOthers: !0}).controller("AccordionController", ["$scope", "$attrs", "accordionConfig", function (a, b, c) { this.groups = [], this.closeOthers = function (d) { var e = angular.isDefined(b.closeOthers) ? a.$eval(b.closeOthers) : c.closeOthers; e && angular.forEach(this.groups, function (a) { a !== d && (a.isOpen = !1) }) }, this.addGroup = function (a) { var b = this; this.groups.push(a), a.$on("$destroy", function () { b.removeGroup(a) }) }, this.removeGroup = function (a) { var b = this.groups.indexOf(a); -1 !== b && this.groups.splice(b, 1) } }]).directive("accordion", function () { return { restrict: "EA", controller: "AccordionController", transclude: !0, replace: !1, templateUrl: "template/accordion/accordion.html" } }).directive("accordionGroup", function () { return { require: "^accordion", restrict: "EA", transclude: !0, replace: !0, templateUrl: "template/accordion/accordion-group.html", scope: {heading: "@", isOpen: "=?", isDisabled: "=?"}, controller: function () { this.setHeading = function (a) { this.heading = a } }, link: function (a, b, c, d) { d.addGroup(a), a.$watch("isOpen", function (b) { b && d.closeOthers(a) }), a.toggleOpen = function () { a.isDisabled || (a.isOpen = !a.isOpen) } } } }).directive("accordionHeading", function () { return { restrict: "EA", transclude: !0, template: "", replace: !0, require: "^accordionGroup", link: function (a, b, c, d, e) { d.setHeading(e(a, angular.noop)) } } }).directive("accordionTransclude", function () { return { require: "^accordionGroup", link: function (a, b, c, d) { a.$watch(function () { return d[c.accordionTransclude] }, function (a) { a && (b.html(""), b.append(a)) }) } } }), angular.module("ui.bootstrap.alert", []).controller("AlertController", ["$scope", "$attrs", function (a, b) { a.closeable = "close" in b, this.close = a.close }]).directive("alert", function () { return { restrict: "EA", controller: "AlertController", templateUrl: "template/alert/alert.html", transclude: !0, replace: !0, scope: {type: "@", close: "&"} } }).directive("dismissOnTimeout", ["$timeout", function (a) { return { require: "alert", link: function (b, c, d, e) { a(function () { e.close() }, parseInt(d.dismissOnTimeout, 10)) } } }]), angular.module("ui.bootstrap.bindHtml", []).directive("bindHtmlUnsafe", function () { return function (a, b, c) { b.addClass("ng-binding").data("$binding", c.bindHtmlUnsafe), a.$watch(c.bindHtmlUnsafe, function (a) { b.html(a || "") }) } }), angular.module("ui.bootstrap.buttons", []).constant("buttonConfig", { activeClass: "active", toggleEvent: "click" }).controller("ButtonsController", ["buttonConfig", function (a) { this.activeClass = a.activeClass || "active", this.toggleEvent = a.toggleEvent || "click" }]).directive("btnRadio", function () { return { require: ["btnRadio", "ngModel"], controller: "ButtonsController", link: function (a, b, c, d) { var e = d[0], f = d[1]; f.$render = function () { b.toggleClass(e.activeClass, angular.equals(f.$modelValue, a.$eval(c.btnRadio))) }, b.bind(e.toggleEvent, function () { var d = b.hasClass(e.activeClass); (!d || angular.isDefined(c.uncheckable)) && a.$apply(function () { f.$setViewValue(d ? null : a.$eval(c.btnRadio)), f.$render() }) }) } } }).directive("btnCheckbox", function () { return { require: ["btnCheckbox", "ngModel"], controller: "ButtonsController", link: function (a, b, c, d) { function e() { return g(c.btnCheckboxTrue, !0) } function f() { return g(c.btnCheckboxFalse, !1) } function g(b, c) { var d = a.$eval(b); return angular.isDefined(d) ? d : c } var h = d[0], i = d[1]; i.$render = function () { b.toggleClass(h.activeClass, angular.equals(i.$modelValue, e())) }, b.bind(h.toggleEvent, function () { a.$apply(function () { i.$setViewValue(b.hasClass(h.activeClass) ? f() : e()), i.$render() }) }) } } }), angular.module("ui.bootstrap.carousel", []).controller("CarouselController", ["$scope", "$interval", "$animate", function (a, b, c) { function d(a) { if (angular.isUndefined(k[a].index))return k[a]; { var b; k.length } for (b = 0; b < k.length; ++b)if (k[b].index == a)return k[b] } function e() { f(); var c = +a.interval; !isNaN(c) && c > 0 && (h = b(g, c)) } function f() { h && (b.cancel(h), h = null) } function g() { var b = +a.interval; i && !isNaN(b) && b > 0 ? a.next() : a.pause() } var h, i, j = this, k = j.slides = a.slides = [], l = -1; j.currentSlide = null; var m = !1; j.select = a.select = function (b, d) { function f() { m || (angular.extend(b, {direction: d, active: !0}), angular.extend(j.currentSlide || {}, { direction: d, active: !1 }), c.enabled() && !a.noTransition && b.$element && (a.$currentTransition = !0, b.$element.one("$animate:close", function () { a.$currentTransition = null })), j.currentSlide = b, l = g, e()) } var g = j.indexOfSlide(b); void 0 === d && (d = g > j.getCurrentIndex() ? "next" : "prev"), b && b !== j.currentSlide && f() }, a.$on("$destroy", function () { m = !0 }), j.getCurrentIndex = function () { return j.currentSlide && angular.isDefined(j.currentSlide.index) ? +j.currentSlide.index : l }, j.indexOfSlide = function (a) { return angular.isDefined(a.index) ? +a.index : k.indexOf(a) }, a.next = function () { var b = (j.getCurrentIndex() + 1) % k.length; return a.$currentTransition ? void 0 : j.select(d(b), "next") }, a.prev = function () { var b = j.getCurrentIndex() - 1 < 0 ? k.length - 1 : j.getCurrentIndex() - 1; return a.$currentTransition ? void 0 : j.select(d(b), "prev") }, a.isActive = function (a) { return j.currentSlide === a }, a.$watch("interval", e), a.$on("$destroy", f), a.play = function () { i || (i = !0, e()) }, a.pause = function () { a.noPause || (i = !1, f()) }, j.addSlide = function (b, c) { b.$element = c, k.push(b), 1 === k.length || b.active ? (j.select(k[k.length - 1]), 1 == k.length && a.play()) : b.active = !1 }, j.removeSlide = function (a) { angular.isDefined(a.index) && k.sort(function (a, b) { return +a.index > +b.index }); var b = k.indexOf(a); k.splice(b, 1), k.length > 0 && a.active ? j.select(b >= k.length ? k[b - 1] : k[b]) : l > b && l-- } }]).directive("carousel", [function () { return { restrict: "EA", transclude: !0, replace: !0, controller: "CarouselController", require: "carousel", templateUrl: "template/carousel/carousel.html", scope: {interval: "=", noTransition: "=", noPause: "="} } }]).directive("slide", function () { return { require: "^carousel", restrict: "EA", transclude: !0, replace: !0, templateUrl: "template/carousel/slide.html", scope: {active: "=?", index: "=?"}, link: function (a, b, c, d) { d.addSlide(a, b), a.$on("$destroy", function () { d.removeSlide(a) }), a.$watch("active", function (b) { b && d.select(a) }) } } }).animation(".item", ["$animate", function (a) { return { beforeAddClass: function (b, c, d) { if ("active" == c && b.parent() && !b.parent().scope().noTransition) { var e = !1, f = b.isolateScope().direction, g = "next" == f ? "left" : "right"; return b.addClass(f), a.addClass(b, g).then(function () { e || b.removeClass(g + " " + f), d() }), function () { e = !0 } } d() }, beforeRemoveClass: function (b, c, d) { if ("active" == c && b.parent() && !b.parent().scope().noTransition) { var e = !1, f = b.isolateScope().direction, g = "next" == f ? "left" : "right"; return a.addClass(b, g).then(function () { e || b.removeClass(g), d() }), function () { e = !0 } } d() } } }]), angular.module("ui.bootstrap.dateparser", []).service("dateParser", ["$locale", "orderByFilter", function (a, b) { function c(a) { var c = [], d = a.split(""); return angular.forEach(f, function (b, e) { var f = a.indexOf(e); if (f > -1) { a = a.split(""), d[f] = "(" + b.regex + ")", a[f] = "$"; for (var g = f + 1, h = f + e.length; h > g; g++)d[g] = "", a[g] = "$"; a = a.join(""), c.push({index: f, apply: b.apply}) } }), {regex: new RegExp("^" + d.join("") + "$"), map: b(c, "index")} } function d(a, b, c) { return 1 > c ? !1 : 1 === b && c > 28 ? 29 === c && (a % 4 === 0 && a % 100 !== 0 || a % 400 === 0) : 3 === b || 5 === b || 8 === b || 10 === b ? 31 > c : !0 } var e = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g; this.parsers = {}; var f = { yyyy: { regex: "\\d{4}", apply: function (a) { this.year = +a } }, yy: { regex: "\\d{2}", apply: function (a) { this.year = +a + 2e3 } }, y: { regex: "\\d{1,4}", apply: function (a) { this.year = +a } }, MMMM: { regex: a.DATETIME_FORMATS.MONTH.join("|"), apply: function (b) { this.month = a.DATETIME_FORMATS.MONTH.indexOf(b) } }, MMM: { regex: a.DATETIME_FORMATS.SHORTMONTH.join("|"), apply: function (b) { this.month = a.DATETIME_FORMATS.SHORTMONTH.indexOf(b) } }, MM: { regex: "0[1-9]|1[0-2]", apply: function (a) { this.month = a - 1 } }, M: { regex: "[1-9]|1[0-2]", apply: function (a) { this.month = a - 1 } }, dd: { regex: "[0-2][0-9]{1}|3[0-1]{1}", apply: function (a) { this.date = +a } }, d: { regex: "[1-2]?[0-9]{1}|3[0-1]{1}", apply: function (a) { this.date = +a } }, EEEE: {regex: a.DATETIME_FORMATS.DAY.join("|")}, EEE: {regex: a.DATETIME_FORMATS.SHORTDAY.join("|")}, HH: { regex: "(?:0|1)[0-9]|2[0-3]", apply: function (a) { this.hours = +a } }, H: { regex: "1?[0-9]|2[0-3]", apply: function (a) { this.hours = +a } }, mm: { regex: "[0-5][0-9]", apply: function (a) { this.minutes = +a } }, m: { regex: "[0-9]|[1-5][0-9]", apply: function (a) { this.minutes = +a } }, sss: { regex: "[0-9][0-9][0-9]", apply: function (a) { this.milliseconds = +a } }, ss: { regex: "[0-5][0-9]", apply: function (a) { this.seconds = +a } }, s: { regex: "[0-9]|[1-5][0-9]", apply: function (a) { this.seconds = +a } } }; this.parse = function (b, f, g) { if (!angular.isString(b) || !f)return b; f = a.DATETIME_FORMATS[f] || f, f = f.replace(e, "\\$&"), this.parsers[f] || (this.parsers[f] = c(f)); var h = this.parsers[f], i = h.regex, j = h.map, k = b.match(i); if (k && k.length) { var l, m; l = g ? { year: g.getFullYear(), month: g.getMonth(), date: g.getDate(), hours: g.getHours(), minutes: g.getMinutes(), seconds: g.getSeconds(), milliseconds: g.getMilliseconds() } : {year: 1900, month: 0, date: 1, hours: 0, minutes: 0, seconds: 0, milliseconds: 0}; for (var n = 1, o = k.length; o > n; n++) { var p = j[n - 1]; p.apply && p.apply.call(l, k[n]) } return d(l.year, l.month, l.date) && (m = new Date(l.year, l.month, l.date, l.hours, l.minutes, l.seconds, l.milliseconds || 0)), m } } }]), angular.module("ui.bootstrap.position", []).factory("$position", ["$document", "$window", function (a, b) { function c(a, c) { return a.currentStyle ? a.currentStyle[c] : b.getComputedStyle ? b.getComputedStyle(a)[c] : a.style[c] } function d(a) { return "static" === (c(a, "position") || "static") } var e = function (b) { for (var c = a[0], e = b.offsetParent || c; e && e !== c && d(e);)e = e.offsetParent; return e || c }; return { position: function (b) { var c = this.offset(b), d = {top: 0, left: 0}, f = e(b[0]); f != a[0] && (d = this.offset(angular.element(f)), d.top += f.clientTop - f.scrollTop, d.left += f.clientLeft - f.scrollLeft); var g = b[0].getBoundingClientRect(); return { width: g.width || b.prop("offsetWidth"), height: g.height || b.prop("offsetHeight"), top: c.top - d.top, left: c.left - d.left } }, offset: function (c) { var d = c[0].getBoundingClientRect(); return { width: d.width || c.prop("offsetWidth"), height: d.height || c.prop("offsetHeight"), top: d.top + (b.pageYOffset || a[0].documentElement.scrollTop), left: d.left + (b.pageXOffset || a[0].documentElement.scrollLeft) } }, positionElements: function (a, b, c, d) { var e, f, g, h, i = c.split("-"), j = i[0], k = i[1] || "center"; e = d ? this.offset(a) : this.position(a), f = b.prop("offsetWidth"), g = b.prop("offsetHeight"); var l = { center: function () { return e.left + e.width / 2 - f / 2 }, left: function () { return e.left }, right: function () { return e.left + e.width } }, m = { center: function () { return e.top + e.height / 2 - g / 2 }, top: function () { return e.top }, bottom: function () { return e.top + e.height } }; switch (j) { case"right": h = {top: m[k](), left: l[j]()}; break; case"left": h = {top: m[k](), left: e.left - f}; break; case"bottom": h = {top: m[j](), left: l[k]()}; break; default: h = {top: e.top - g, left: l[k]()} } return h } } }]), angular.module("ui.bootstrap.datepicker", ["ui.bootstrap.dateparser", "ui.bootstrap.position"]).constant("datepickerConfig", { formatDay: "dd", formatMonth: "MMMM", formatYear: "yyyy", formatDayHeader: "EEE", formatDayTitle: "MMMM yyyy", formatMonthTitle: "yyyy", datepickerMode: "day", minMode: "day", maxMode: "year", showWeeks: !0, startingDay: 0, yearRange: 20, minDate: null, maxDate: null, shortcutPropagation: !1 }).controller("DatepickerController", ["$scope", "$attrs", "$parse", "$interpolate", "$timeout", "$log", "dateFilter", "datepickerConfig", function (a, b, c, d, e, f, g, h) { var i = this, j = {$setViewValue: angular.noop}; this.modes = ["day", "month", "year"], angular.forEach(["formatDay", "formatMonth", "formatYear", "formatDayHeader", "formatDayTitle", "formatMonthTitle", "minMode", "maxMode", "showWeeks", "startingDay", "yearRange", "shortcutPropagation"], function (c, e) { i[c] = angular.isDefined(b[c]) ? 8 > e ? d(b[c])(a.$parent) : a.$parent.$eval(b[c]) : h[c] }), angular.forEach(["minDate", "maxDate"], function (d) { b[d] ? a.$parent.$watch(c(b[d]), function (a) { i[d] = a ? new Date(a) : null, i.refreshView() }) : i[d] = h[d] ? new Date(h[d]) : null }), a.datepickerMode = a.datepickerMode || h.datepickerMode, a.maxMode = i.maxMode, a.uniqueId = "datepicker-" + a.$id + "-" + Math.floor(1e4 * Math.random()), angular.isDefined(b.initDate) ? (this.activeDate = a.$parent.$eval(b.initDate) || new Date, a.$parent.$watch(b.initDate, function (a) { a && (j.$isEmpty(j.$modelValue) || j.$invalid) && (i.activeDate = a, i.refreshView()) })) : this.activeDate = new Date, a.isActive = function (b) { return 0 === i.compare(b.date, i.activeDate) ? (a.activeDateId = b.uid, !0) : !1 }, this.init = function (a) { j = a, j.$render = function () { i.render() } }, this.render = function () { if (j.$viewValue) { var a = new Date(j.$viewValue), b = !isNaN(a); b ? this.activeDate = a : f.error('Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.'), j.$setValidity("date", b) } this.refreshView() }, this.refreshView = function () { if (this.element) { this._refreshView(); var a = j.$viewValue ? new Date(j.$viewValue) : null; j.$setValidity("date-disabled", !a || this.element && !this.isDisabled(a)) } }, this.createDateObject = function (a, b) { var c = j.$viewValue ? new Date(j.$viewValue) : null; return { date: a, label: g(a, b), selected: c && 0 === this.compare(a, c), disabled: this.isDisabled(a), current: 0 === this.compare(a, new Date), customClass: this.customClass(a) } }, this.isDisabled = function (c) { return this.minDate && this.compare(c, this.minDate) < 0 || this.maxDate && this.compare(c, this.maxDate) > 0 || b.dateDisabled && a.dateDisabled({ date: c, mode: a.datepickerMode }) }, this.customClass = function (b) { return a.customClass({date: b, mode: a.datepickerMode}) }, this.split = function (a, b) { for (var c = []; a.length > 0;)c.push(a.splice(0, b)); return c }, a.select = function (b) { if (a.datepickerMode === i.minMode) { var c = j.$viewValue ? new Date(j.$viewValue) : new Date(0, 0, 0, 0, 0, 0, 0); c.setFullYear(b.getFullYear(), b.getMonth(), b.getDate()), j.$setViewValue(c), j.$render() } else i.activeDate = b, a.datepickerMode = i.modes[i.modes.indexOf(a.datepickerMode) - 1] }, a.move = function (a) { var b = i.activeDate.getFullYear() + a * (i.step.years || 0), c = i.activeDate.getMonth() + a * (i.step.months || 0); i.activeDate.setFullYear(b, c, 1), i.refreshView() }, a.toggleMode = function (b) { b = b || 1, a.datepickerMode === i.maxMode && 1 === b || a.datepickerMode === i.minMode && -1 === b || (a.datepickerMode = i.modes[i.modes.indexOf(a.datepickerMode) + b]) }, a.keys = { 13: "enter", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home", 37: "left", 38: "up", 39: "right", 40: "down" }; var k = function () { e(function () { i.element[0].focus() }, 0, !1) }; a.$on("datepicker.focus", k), a.keydown = function (b) { var c = a.keys[b.which]; if (c && !b.shiftKey && !b.altKey)if (b.preventDefault(), i.shortcutPropagation || b.stopPropagation(), "enter" === c || "space" === c) { if (i.isDisabled(i.activeDate))return; a.select(i.activeDate), k() } else!b.ctrlKey || "up" !== c && "down" !== c ? (i.handleKeyDown(c, b), i.refreshView()) : (a.toggleMode("up" === c ? 1 : -1), k()) } }]).directive("datepicker", function () { return { restrict: "EA", replace: !0, templateUrl: "template/datepicker/datepicker.html", scope: {datepickerMode: "=?", dateDisabled: "&", customClass: "&", shortcutPropagation: "&?"}, require: ["datepicker", "?^ngModel"], controller: "DatepickerController", link: function (a, b, c, d) { var e = d[0], f = d[1]; f && e.init(f) } } }).directive("daypicker", ["dateFilter", function (a) { return { restrict: "EA", replace: !0, templateUrl: "template/datepicker/day.html", require: "^datepicker", link: function (b, c, d, e) { function f(a, b) { return 1 !== b || a % 4 !== 0 || a % 100 === 0 && a % 400 !== 0 ? i[b] : 29 } function g(a, b) { var c = new Array(b), d = new Date(a), e = 0; for (d.setHours(12); b > e;)c[e++] = new Date(d), d.setDate(d.getDate() + 1); return c } function h(a) { var b = new Date(a); b.setDate(b.getDate() + 4 - (b.getDay() || 7)); var c = b.getTime(); return b.setMonth(0), b.setDate(1), Math.floor(Math.round((c - b) / 864e5) / 7) + 1 } b.showWeeks = e.showWeeks, e.step = {months: 1}, e.element = c; var i = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; e._refreshView = function () { var c = e.activeDate.getFullYear(), d = e.activeDate.getMonth(), f = new Date(c, d, 1), i = e.startingDay - f.getDay(), j = i > 0 ? 7 - i : -i, k = new Date(f); j > 0 && k.setDate(-j + 1); for (var l = g(k, 42), m = 0; 42 > m; m++)l[m] = angular.extend(e.createDateObject(l[m], e.formatDay), { secondary: l[m].getMonth() !== d, uid: b.uniqueId + "-" + m }); b.labels = new Array(7); for (var n = 0; 7 > n; n++)b.labels[n] = { abbr: a(l[n].date, e.formatDayHeader), full: a(l[n].date, "EEEE") }; if (b.title = a(e.activeDate, e.formatDayTitle), b.rows = e.split(l, 7), b.showWeeks) { b.weekNumbers = []; for (var o = (11 - e.startingDay) % 7, p = b.rows.length, q = 0; p > q; q++)b.weekNumbers.push(h(b.rows[q][o].date)) } }, e.compare = function (a, b) { return new Date(a.getFullYear(), a.getMonth(), a.getDate()) - new Date(b.getFullYear(), b.getMonth(), b.getDate()) }, e.handleKeyDown = function (a) { var b = e.activeDate.getDate(); if ("left" === a)b -= 1; else if ("up" === a)b -= 7; else if ("right" === a)b += 1; else if ("down" === a)b += 7; else if ("pageup" === a || "pagedown" === a) { var c = e.activeDate.getMonth() + ("pageup" === a ? -1 : 1); e.activeDate.setMonth(c, 1), b = Math.min(f(e.activeDate.getFullYear(), e.activeDate.getMonth()), b) } else"home" === a ? b = 1 : "end" === a && (b = f(e.activeDate.getFullYear(), e.activeDate.getMonth())); e.activeDate.setDate(b) }, e.refreshView() } } }]).directive("monthpicker", ["dateFilter", function (a) { return { restrict: "EA", replace: !0, templateUrl: "template/datepicker/month.html", require: "^datepicker", link: function (b, c, d, e) { e.step = {years: 1}, e.element = c, e._refreshView = function () { for (var c = new Array(12), d = e.activeDate.getFullYear(), f = 0; 12 > f; f++)c[f] = angular.extend(e.createDateObject(new Date(d, f, 1), e.formatMonth), {uid: b.uniqueId + "-" + f}); b.title = a(e.activeDate, e.formatMonthTitle), b.rows = e.split(c, 3) }, e.compare = function (a, b) { return new Date(a.getFullYear(), a.getMonth()) - new Date(b.getFullYear(), b.getMonth()) }, e.handleKeyDown = function (a) { var b = e.activeDate.getMonth(); if ("left" === a)b -= 1; else if ("up" === a)b -= 3; else if ("right" === a)b += 1; else if ("down" === a)b += 3; else if ("pageup" === a || "pagedown" === a) { var c = e.activeDate.getFullYear() + ("pageup" === a ? -1 : 1); e.activeDate.setFullYear(c) } else"home" === a ? b = 0 : "end" === a && (b = 11); e.activeDate.setMonth(b) }, e.refreshView() } } }]).directive("yearpicker", ["dateFilter", function () { return { restrict: "EA", replace: !0, templateUrl: "template/datepicker/year.html", require: "^datepicker", link: function (a, b, c, d) { function e(a) { return parseInt((a - 1) / f, 10) * f + 1 } var f = d.yearRange; d.step = {years: f}, d.element = b, d._refreshView = function () { for (var b = new Array(f), c = 0, g = e(d.activeDate.getFullYear()); f > c; c++)b[c] = angular.extend(d.createDateObject(new Date(g + c, 0, 1), d.formatYear), {uid: a.uniqueId + "-" + c}); a.title = [b[0].label, b[f - 1].label].join(" - "), a.rows = d.split(b, 5) }, d.compare = function (a, b) { return a.getFullYear() - b.getFullYear() }, d.handleKeyDown = function (a) { var b = d.activeDate.getFullYear(); "left" === a ? b -= 1 : "up" === a ? b -= 5 : "right" === a ? b += 1 : "down" === a ? b += 5 : "pageup" === a || "pagedown" === a ? b += ("pageup" === a ? -1 : 1) * d.step.years : "home" === a ? b = e(d.activeDate.getFullYear()) : "end" === a && (b = e(d.activeDate.getFullYear()) + f - 1), d.activeDate.setFullYear(b) }, d.refreshView() } } }]).constant("datepickerPopupConfig", { datepickerPopup: "yyyy-MM-dd", html5Types: {date: "yyyy-MM-dd", "datetime-local": "yyyy-MM-ddTHH:mm:ss.sss", month: "yyyy-MM"}, currentText: "Today", clearText: "Clear", closeText: "Done", closeOnDateSelection: !0, appendToBody: !1, showButtonBar: !0 }).directive("datepickerPopup", ["$compile", "$parse", "$document", "$position", "dateFilter", "dateParser", "datepickerPopupConfig", function (a, b, c, d, e, f, g) { return { restrict: "EA", require: "ngModel", scope: {isOpen: "=?", currentText: "@", clearText: "@", closeText: "@", dateDisabled: "&", customClass: "&"}, link: function (h, i, j, k) { function l(a) { return a.replace(/([A-Z])/g, function (a) { return "-" + a.toLowerCase() }) } function m(a) { if (angular.isNumber(a) && (a = new Date(a)), a) { if (angular.isDate(a) && !isNaN(a))return a; if (angular.isString(a)) { var b = f.parse(a, o, h.date) || new Date(a); return isNaN(b) ? void 0 : b } return void 0 } return null } function n(a, b) { var c = a || b; if (angular.isNumber(c) && (c = new Date(c)), c) { if (angular.isDate(c) && !isNaN(c))return !0; if (angular.isString(c)) { var d = f.parse(c, o) || new Date(c); return !isNaN(d) } return !1 } return !0 } var o, p = angular.isDefined(j.closeOnDateSelection) ? h.$parent.$eval(j.closeOnDateSelection) : g.closeOnDateSelection, q = angular.isDefined(j.datepickerAppendToBody) ? h.$parent.$eval(j.datepickerAppendToBody) : g.appendToBody; h.showButtonBar = angular.isDefined(j.showButtonBar) ? h.$parent.$eval(j.showButtonBar) : g.showButtonBar, h.getText = function (a) { return h[a + "Text"] || g[a + "Text"] }; var r = !1; if (g.html5Types[j.type] ? (o = g.html5Types[j.type], r = !0) : (o = j.datepickerPopup || g.datepickerPopup, j.$observe("datepickerPopup", function (a) { var b = a || g.datepickerPopup; if (b !== o && (o = b, k.$modelValue = null, !o))throw new Error("datepickerPopup must have a date format specified.") })), !o)throw new Error("datepickerPopup must have a date format specified."); if (r && j.datepickerPopup)throw new Error("HTML5 date input types do not support custom formats."); var s = angular.element("<div datepicker-popup-wrap><div datepicker></div></div>"); s.attr({"ng-model": "date", "ng-change": "dateSelection()"}); var t = angular.element(s.children()[0]); if (r && "month" == j.type && (t.attr("datepicker-mode", '"month"'), t.attr("min-mode", "month")), j.datepickerOptions) { var u = h.$parent.$eval(j.datepickerOptions); u.initDate && (h.initDate = u.initDate, t.attr("init-date", "initDate"), delete u.initDate), angular.forEach(u, function (a, b) { t.attr(l(b), a) }) } h.watchData = {}, angular.forEach(["minDate", "maxDate", "datepickerMode", "initDate", "shortcutPropagation"], function (a) { if (j[a]) { var c = b(j[a]); if (h.$parent.$watch(c, function (b) { h.watchData[a] = b }), t.attr(l(a), "watchData." + a), "datepickerMode" === a) { var d = c.assign; h.$watch("watchData." + a, function (a, b) { a !== b && d(h.$parent, a) }) } } }), j.dateDisabled && t.attr("date-disabled", "dateDisabled({ date: date, mode: mode })"), j.showWeeks && t.attr("show-weeks", j.showWeeks), j.customClass && t.attr("custom-class", "customClass({ date: date, mode: mode })"), r ? k.$formatters.push(function (a) { return h.date = a, a }) : (k.$$parserName = "date", k.$validators.date = n, k.$parsers.unshift(m), k.$formatters.push(function (a) { return h.date = a, k.$isEmpty(a) ? a : e(a, o) })), h.dateSelection = function (a) { angular.isDefined(a) && (h.date = a); var b = h.date ? e(h.date, o) : ""; i.val(b), k.$setViewValue(b), p && (h.isOpen = !1, i[0].focus()) }, k.$viewChangeListeners.push(function () { h.date = f.parse(k.$viewValue, o, h.date) || new Date(k.$viewValue) }); var v = function (a) { h.isOpen && a.target !== i[0] && h.$apply(function () { h.isOpen = !1 }) }, w = function (a) { h.keydown(a) }; i.bind("keydown", w), h.keydown = function (a) { 27 === a.which ? (a.preventDefault(), h.isOpen && a.stopPropagation(), h.close()) : 40 !== a.which || h.isOpen || (h.isOpen = !0) }, h.$watch("isOpen", function (a) { a ? (h.$broadcast("datepicker.focus"), h.position = q ? d.offset(i) : d.position(i), h.position.top = h.position.top + i.prop("offsetHeight"), c.bind("click", v)) : c.unbind("click", v) }), h.select = function (a) { if ("today" === a) { var b = new Date; angular.isDate(h.date) ? (a = new Date(h.date), a.setFullYear(b.getFullYear(), b.getMonth(), b.getDate())) : a = new Date(b.setHours(0, 0, 0, 0)) } h.dateSelection(a) }, h.close = function () { h.isOpen = !1, i[0].focus() }; var x = a(s)(h); s.remove(), q ? c.find("body").append(x) : i.after(x), h.$on("$destroy", function () { x.remove(), i.unbind("keydown", w), c.unbind("click", v) }) } } }]).directive("datepickerPopupWrap", function () { return { restrict: "EA", replace: !0, transclude: !0, templateUrl: "template/datepicker/popup.html", link: function (a, b) { b.bind("click", function (a) { a.preventDefault(), a.stopPropagation() }) } } }), angular.module("ui.bootstrap.dropdown", ["ui.bootstrap.position"]).constant("dropdownConfig", {openClass: "open"}).service("dropdownService", ["$document", "$rootScope", function (a, b) { var c = null; this.open = function (b) { c || (a.bind("click", d), a.bind("keydown", e)), c && c !== b && (c.isOpen = !1), c = b }, this.close = function (b) { c === b && (c = null, a.unbind("click", d), a.unbind("keydown", e)) }; var d = function (a) { if (c && (!a || "disabled" !== c.getAutoClose())) { var d = c.getToggleElement(); if (!(a && d && d[0].contains(a.target))) { var e = c.getElement(); a && "outsideClick" === c.getAutoClose() && e && e[0].contains(a.target) || (c.isOpen = !1, b.$$phase || c.$apply()) } } }, e = function (a) { 27 === a.which && (c.focusToggleElement(), d()) } }]).controller("DropdownController", ["$scope", "$attrs", "$parse", "dropdownConfig", "dropdownService", "$animate", "$position", "$document", function (a, b, c, d, e, f, g, h) { var i, j = this, k = a.$new(), l = d.openClass, m = angular.noop, n = b.onToggle ? c(b.onToggle) : angular.noop, o = !1; this.init = function (d) { j.$element = d, b.isOpen && (i = c(b.isOpen), m = i.assign, a.$watch(i, function (a) { k.isOpen = !!a })), o = angular.isDefined(b.dropdownAppendToBody), o && j.dropdownMenu && (h.find("body").append(j.dropdownMenu), d.on("$destroy", function () { j.dropdownMenu.remove() })) }, this.toggle = function (a) { return k.isOpen = arguments.length ? !!a : !k.isOpen }, this.isOpen = function () { return k.isOpen }, k.getToggleElement = function () { return j.toggleElement }, k.getAutoClose = function () { return b.autoClose || "always" }, k.getElement = function () { return j.$element }, k.focusToggleElement = function () { j.toggleElement && j.toggleElement[0].focus() }, k.$watch("isOpen", function (b, c) { if (o && j.dropdownMenu) { var d = g.positionElements(j.$element, j.dropdownMenu, "bottom-left", !0); j.dropdownMenu.css({top: d.top + "px", left: d.left + "px", display: b ? "block" : "none"}) } f[b ? "addClass" : "removeClass"](j.$element, l), b ? (k.focusToggleElement(), e.open(k)) : e.close(k), m(a, b), angular.isDefined(b) && b !== c && n(a, {open: !!b}) }), a.$on("$locationChangeSuccess", function () { k.isOpen = !1 }), a.$on("$destroy", function () { k.$destroy() }) }]).directive("dropdown", function () { return { controller: "DropdownController", link: function (a, b, c, d) { d.init(b) } } }).directive("dropdownMenu", function () { return { restrict: "AC", require: "?^dropdown", link: function (a, b, c, d) { d && (d.dropdownMenu = b) } } }).directive("dropdownToggle", function () { return { require: "?^dropdown", link: function (a, b, c, d) { if (d) { d.toggleElement = b; var e = function (e) { e.preventDefault(), b.hasClass("disabled") || c.disabled || a.$apply(function () { d.toggle() }) }; b.bind("click", e), b.attr({ "aria-haspopup": !0, "aria-expanded": !1 }), a.$watch(d.isOpen, function (a) { b.attr("aria-expanded", !!a) }), a.$on("$destroy", function () { b.unbind("click", e) }) } } } }), angular.module("ui.bootstrap.modal", []).factory("$$stackedMap", function () { return { createNew: function () { var a = []; return { add: function (b, c) { a.push({key: b, value: c}) }, get: function (b) { for (var c = 0; c < a.length; c++)if (b == a[c].key)return a[c] }, keys: function () { for (var b = [], c = 0; c < a.length; c++)b.push(a[c].key); return b }, top: function () { return a[a.length - 1] }, remove: function (b) { for (var c = -1, d = 0; d < a.length; d++)if (b == a[d].key) { c = d; break } return a.splice(c, 1)[0] }, removeTop: function () { return a.splice(a.length - 1, 1)[0] }, length: function () { return a.length } } } } }).directive("modalBackdrop", ["$timeout", function (a) { function b(b) { b.animate = !1, a(function () { b.animate = !0 }) } return { restrict: "EA", replace: !0, templateUrl: "template/modal/backdrop.html", compile: function (a, c) { return a.addClass(c.backdropClass), b } } }]).directive("modalWindow", ["$modalStack", "$q", function (a, b) { return { restrict: "EA", scope: {index: "@", animate: "="}, replace: !0, transclude: !0, templateUrl: function (a, b) { return b.templateUrl || "template/modal/window.html" }, link: function (c, d, e) { d.addClass(e.windowClass || ""), c.size = e.size, c.close = function (b) { var c = a.getTop(); c && c.value.backdrop && "static" != c.value.backdrop && b.target === b.currentTarget && (b.preventDefault(), b.stopPropagation(), a.dismiss(c.key, "backdrop click")) }, c.$isRendered = !0; var f = b.defer(); e.$observe("modalRender", function (a) { "true" == a && f.resolve() }), f.promise.then(function () { c.animate = !0; var b = d[0].querySelectorAll("[autofocus]"); b.length ? b[0].focus() : d[0].focus(); var e = a.getTop(); e && a.modalRendered(e.key) }) } } }]).directive("modalAnimationClass", [function () { return { compile: function (a, b) { b.modalAnimation && a.addClass(b.modalAnimationClass) } } }]).directive("modalTransclude", function () { return { link: function (a, b, c, d, e) { e(a.$parent, function (a) { b.empty(), b.append(a) }) } } }).factory("$modalStack", ["$animate", "$timeout", "$document", "$compile", "$rootScope", "$$stackedMap", function (a, b, c, d, e, f) { function g() { for (var a = -1, b = o.keys(), c = 0; c < b.length; c++)o.get(b[c]).value.backdrop && (a = c); return a } function h(a) { var b = c.find("body").eq(0), d = o.get(a).value; o.remove(a), j(d.modalDomEl, d.modalScope, function () { b.toggleClass(n, o.length() > 0), i() }) } function i() { if (l && -1 == g()) { var a = m; j(l, m, function () { a = null }), l = void 0, m = void 0 } } function j(c, d, f) { function g() { g.done || (g.done = !0, c.remove(), d.$destroy(), f && f()) } d.animate = !1, c.attr("modal-animation") && a.enabled() ? c.one("$animate:close", function () { e.$evalAsync(g) }) : b(g) } function k(a, b, c) { return !a.value.modalScope.$broadcast("modal.closing", b, c).defaultPrevented } var l, m, n = "modal-open", o = f.createNew(), p = {}; return e.$watch(g, function (a) { m && (m.index = a) }), c.bind("keydown", function (a) { var b; 27 === a.which && (b = o.top(), b && b.value.keyboard && (a.preventDefault(), e.$apply(function () { p.dismiss(b.key, "escape key press") }))) }), p.open = function (a, b) { var f = c[0].activeElement; o.add(a, { deferred: b.deferred, renderDeferred: b.renderDeferred, modalScope: b.scope, backdrop: b.backdrop, keyboard: b.keyboard }); var h = c.find("body").eq(0), i = g(); if (i >= 0 && !l) { m = e.$new(!0), m.index = i; var j = angular.element('<div modal-backdrop="modal-backdrop"></div>'); j.attr("backdrop-class", b.backdropClass), b.animation && j.attr("modal-animation", "true"), l = d(j)(m), h.append(l) } var k = angular.element('<div modal-window="modal-window"></div>'); k.attr({ "template-url": b.windowTemplateUrl, "window-class": b.windowClass, size: b.size, index: o.length() - 1, animate: "animate" }).html(b.content), b.animation && k.attr("modal-animation", "true"); var p = d(k)(b.scope); o.top().value.modalDomEl = p, o.top().value.modalOpener = f, h.append(p), h.addClass(n) }, p.close = function (a, b) { var c = o.get(a); return c && k(c, b, !0) ? (c.value.deferred.resolve(b), h(a), c.value.modalOpener.focus(), !0) : !c }, p.dismiss = function (a, b) { var c = o.get(a); return c && k(c, b, !1) ? (c.value.deferred.reject(b), h(a), c.value.modalOpener.focus(), !0) : !c }, p.dismissAll = function (a) { for (var b = this.getTop(); b && this.dismiss(b.key, a);)b = this.getTop() }, p.getTop = function () { return o.top() }, p.modalRendered = function (a) { var b = o.get(a); b && b.value.renderDeferred.resolve() }, p }]).provider("$modal", function () { var a = { options: {animation: !0, backdrop: !0, keyboard: !0}, $get: ["$injector", "$rootScope", "$q", "$templateRequest", "$controller", "$modalStack", function (b, c, d, e, f, g) { function h(a) { return a.template ? d.when(a.template) : e(angular.isFunction(a.templateUrl) ? a.templateUrl() : a.templateUrl) } function i(a) { var c = []; return angular.forEach(a, function (a) { (angular.isFunction(a) || angular.isArray(a)) && c.push(d.when(b.invoke(a))) }), c } var j = {}; return j.open = function (b) { var e = d.defer(), j = d.defer(), k = d.defer(), l = { result: e.promise, opened: j.promise, rendered: k.promise, close: function (a) { return g.close(l, a) }, dismiss: function (a) { return g.dismiss(l, a) } }; if (b = angular.extend({}, a.options, b), b.resolve = b.resolve || {}, !b.template && !b.templateUrl)throw new Error("One of template or templateUrl options is required."); var m = d.all([h(b)].concat(i(b.resolve))); return m.then(function (a) { var d = (b.scope || c).$new(); d.$close = l.close, d.$dismiss = l.dismiss; var h, i = {}, j = 1; b.controller && (i.$scope = d, i.$modalInstance = l, angular.forEach(b.resolve, function (b, c) { i[c] = a[j++] }), h = f(b.controller, i), b.controllerAs && (d[b.controllerAs] = h)), g.open(l, { scope: d, deferred: e, renderDeferred: k, content: a[0], animation: b.animation, backdrop: b.backdrop, keyboard: b.keyboard, backdropClass: b.backdropClass, windowClass: b.windowClass, windowTemplateUrl: b.windowTemplateUrl, size: b.size }) }, function (a) { e.reject(a) }), m.then(function () { j.resolve(!0) }, function (a) { j.reject(a) }), l }, j }] }; return a }), angular.module("ui.bootstrap.pagination", []).controller("PaginationController", ["$scope", "$attrs", "$parse", function (a, b, c) { var d = this, e = {$setViewValue: angular.noop}, f = b.numPages ? c(b.numPages).assign : angular.noop; this.init = function (g, h) { e = g, this.config = h, e.$render = function () { d.render() }, b.itemsPerPage ? a.$parent.$watch(c(b.itemsPerPage), function (b) { d.itemsPerPage = parseInt(b, 10), a.totalPages = d.calculateTotalPages() }) : this.itemsPerPage = h.itemsPerPage, a.$watch("totalItems", function () { a.totalPages = d.calculateTotalPages() }), a.$watch("totalPages", function (b) { f(a.$parent, b), a.page > b ? a.selectPage(b) : e.$render() }) }, this.calculateTotalPages = function () { var b = this.itemsPerPage < 1 ? 1 : Math.ceil(a.totalItems / this.itemsPerPage); return Math.max(b || 0, 1) }, this.render = function () { a.page = parseInt(e.$viewValue, 10) || 1 }, a.selectPage = function (b, c) { a.page !== b && b > 0 && b <= a.totalPages && (c && c.target && c.target.blur(), e.$setViewValue(b), e.$render()) }, a.getText = function (b) { return a[b + "Text"] || d.config[b + "Text"] }, a.noPrevious = function () { return 1 === a.page }, a.noNext = function () { return a.page === a.totalPages } }]).constant("paginationConfig", { itemsPerPage: 10, boundaryLinks: !1, directionLinks: !0, firstText: "First", previousText: "Previous", nextText: "Next", lastText: "Last", rotate: !0 }).directive("pagination", ["$parse", "paginationConfig", function (a, b) { return { restrict: "EA", scope: {totalItems: "=", firstText: "@", previousText: "@", nextText: "@", lastText: "@"}, require: ["pagination", "?ngModel"], controller: "PaginationController", templateUrl: "template/pagination/pagination.html", replace: !0, link: function (c, d, e, f) { function g(a, b, c) { return {number: a, text: b, active: c} } function h(a, b) { var c = [], d = 1, e = b, f = angular.isDefined(k) && b > k; f && (l ? (d = Math.max(a - Math.floor(k / 2), 1), e = d + k - 1, e > b && (e = b, d = e - k + 1)) : (d = (Math.ceil(a / k) - 1) * k + 1, e = Math.min(d + k - 1, b))); for (var h = d; e >= h; h++) { var i = g(h, h, h === a); c.push(i) } if (f && !l) { if (d > 1) { var j = g(d - 1, "...", !1); c.unshift(j) } if (b > e) { var m = g(e + 1, "...", !1); c.push(m) } } return c } var i = f[0], j = f[1]; if (j) { var k = angular.isDefined(e.maxSize) ? c.$parent.$eval(e.maxSize) : b.maxSize, l = angular.isDefined(e.rotate) ? c.$parent.$eval(e.rotate) : b.rotate; c.boundaryLinks = angular.isDefined(e.boundaryLinks) ? c.$parent.$eval(e.boundaryLinks) : b.boundaryLinks, c.directionLinks = angular.isDefined(e.directionLinks) ? c.$parent.$eval(e.directionLinks) : b.directionLinks, i.init(j, b), e.maxSize && c.$parent.$watch(a(e.maxSize), function (a) { k = parseInt(a, 10), i.render() }); var m = i.render; i.render = function () { m(), c.page > 0 && c.page <= c.totalPages && (c.pages = h(c.page, c.totalPages)) } } } } }]).constant("pagerConfig", { itemsPerPage: 10, previousText: "« Previous", nextText: "Next »", align: !0 }).directive("pager", ["pagerConfig", function (a) { return { restrict: "EA", scope: {totalItems: "=", previousText: "@", nextText: "@"}, require: ["pager", "?ngModel"], controller: "PaginationController", templateUrl: "template/pagination/pager.html", replace: !0, link: function (b, c, d, e) { var f = e[0], g = e[1]; g && (b.align = angular.isDefined(d.align) ? b.$parent.$eval(d.align) : a.align, f.init(g, a)) } } }]), angular.module("ui.bootstrap.tooltip", ["ui.bootstrap.position", "ui.bootstrap.bindHtml"]).provider("$tooltip", function () { function a(a) { var b = /[A-Z]/g, c = "-"; return a.replace(b, function (a, b) { return (b ? c : "") + a.toLowerCase() }) } var b = {placement: "top", animation: !0, popupDelay: 0, useContentExp: !1}, c = { mouseenter: "mouseleave", click: "click", focus: "blur" }, d = {}; this.options = function (a) { angular.extend(d, a) }, this.setTriggers = function (a) { angular.extend(c, a) }, this.$get = ["$window", "$compile", "$timeout", "$document", "$position", "$interpolate", function (e, f, g, h, i, j) { return function (e, k, l, m) { function n(a) { var b = a || m.trigger || l, d = c[b] || b; return {show: b, hide: d} } m = angular.extend({}, b, d, m); var o = a(e), p = j.startSymbol(), q = j.endSymbol(), r = "<div " + o + '-popup title="' + p + "title" + q + '" ' + (m.useContentExp ? 'content-exp="contentExp()" ' : 'content="' + p + "content" + q + '" ') + 'placement="' + p + "placement" + q + '" popup-class="' + p + "popupClass" + q + '" animation="animation" is-open="isOpen"origin-scope="origScope" ></div>'; return { restrict: "EA", compile: function () { var a = f(r); return function (b, c, d) { function f() { E.isOpen ? l() : j() } function j() { (!D || b.$eval(d[k + "Enable"])) && (s(), E.popupDelay ? A || (A = g(o, E.popupDelay, !1), A.then(function (a) { a() })) : o()()) } function l() { b.$apply(function () { p() }) } function o() { return A = null, z && (g.cancel(z), z = null), (m.useContentExp ? E.contentExp() : E.content) ? (q(), x.css({ top: 0, left: 0, display: "block" }), E.$digest(), F(), E.isOpen = !0, E.$apply(), F) : angular.noop } function p() { E.isOpen = !1, g.cancel(A), A = null, E.animation ? z || (z = g(r, 500)) : r() } function q() { x && r(), y = E.$new(), x = a(y, function (a) { B ? h.find("body").append(a) : c.after(a) }), y.$watch(function () { g(F, 0, !1) }), m.useContentExp && y.$watch("contentExp()", function (a) { !a && E.isOpen && p() }) } function r() { z = null, x && (x.remove(), x = null), y && (y.$destroy(), y = null) } function s() { t(), u(), v() } function t() { E.popupClass = d[k + "Class"] } function u() { var a = d[k + "Placement"]; E.placement = angular.isDefined(a) ? a : m.placement } function v() { var a = d[k + "PopupDelay"], b = parseInt(a, 10); E.popupDelay = isNaN(b) ? m.popupDelay : b } function w() { var a = d[k + "Trigger"]; G(), C = n(a), C.show === C.hide ? c.bind(C.show, f) : (c.bind(C.show, j), c.bind(C.hide, l)) } var x, y, z, A, B = angular.isDefined(m.appendToBody) ? m.appendToBody : !1, C = n(void 0), D = angular.isDefined(d[k + "Enable"]), E = b.$new(!0), F = function () { if (x) { var a = i.positionElements(c, x, E.placement, B); a.top += "px", a.left += "px", x.css(a) } }; E.origScope = b, E.isOpen = !1, E.contentExp = function () { return b.$eval(d[e]) }, m.useContentExp || d.$observe(e, function (a) { E.content = a, !a && E.isOpen && p() }), d.$observe("disabled", function (a) { a && E.isOpen && p() }), d.$observe(k + "Title", function (a) { E.title = a }); var G = function () { c.unbind(C.show, j), c.unbind(C.hide, l) }; w(); var H = b.$eval(d[k + "Animation"]); E.animation = angular.isDefined(H) ? !!H : m.animation; var I = b.$eval(d[k + "AppendToBody"]); B = angular.isDefined(I) ? I : B, B && b.$on("$locationChangeSuccess", function () { E.isOpen && p() }), b.$on("$destroy", function () { g.cancel(z), g.cancel(A), G(), r(), E = null }) } } } } }] }).directive("tooltipTemplateTransclude", ["$animate", "$sce", "$compile", "$templateRequest", function (a, b, c, d) { return { link: function (e, f, g) { var h, i, j, k = e.$eval(g.tooltipTemplateTranscludeScope), l = 0, m = function () { i && (i.remove(), i = null), h && (h.$destroy(), h = null), j && (a.leave(j).then(function () { i = null }), i = j, j = null) }; e.$watch(b.parseAsResourceUrl(g.tooltipTemplateTransclude), function (b) { var g = ++l; b ? (d(b, !0).then(function (d) { if (g === l) { var e = k.$new(), i = d, n = c(i)(e, function (b) { m(), a.enter(b, f) }); h = e, j = n, h.$emit("$includeContentLoaded", b) } }, function () { g === l && (m(), e.$emit("$includeContentError", b)) }), e.$emit("$includeContentRequested", b)) : m() }), e.$on("$destroy", m) } } }]).directive("tooltipClasses", function () { return { restrict: "A", link: function (a, b, c) { a.placement && b.addClass(a.placement), a.popupClass && b.addClass(a.popupClass), a.animation() && b.addClass(c.tooltipAnimationClass) } } }).directive("tooltipPopup", function () { return { restrict: "EA", replace: !0, scope: {content: "@", placement: "@", popupClass: "@", animation: "&", isOpen: "&"}, templateUrl: "template/tooltip/tooltip-popup.html" } }).directive("tooltip", ["$tooltip", function (a) { return a("tooltip", "tooltip", "mouseenter") }]).directive("tooltipTemplatePopup", function () { return { restrict: "EA", replace: !0, scope: {contentExp: "&", placement: "@", popupClass: "@", animation: "&", isOpen: "&", originScope: "&"}, templateUrl: "template/tooltip/tooltip-template-popup.html" } }).directive("tooltipTemplate", ["$tooltip", function (a) { return a("tooltipTemplate", "tooltip", "mouseenter", {useContentExp: !0}) }]).directive("tooltipHtmlPopup", function () { return { restrict: "EA", replace: !0, scope: {contentExp: "&", placement: "@", popupClass: "@", animation: "&", isOpen: "&"}, templateUrl: "template/tooltip/tooltip-html-popup.html" } }).directive("tooltipHtml", ["$tooltip", function (a) { return a("tooltipHtml", "tooltip", "mouseenter", {useContentExp: !0}) }]).directive("tooltipHtmlUnsafePopup", function () { return { restrict: "EA", replace: !0, scope: {content: "@", placement: "@", popupClass: "@", animation: "&", isOpen: "&"}, templateUrl: "template/tooltip/tooltip-html-unsafe-popup.html" } }).value("tooltipHtmlUnsafeSuppressDeprecated", !1).directive("tooltipHtmlUnsafe", ["$tooltip", "tooltipHtmlUnsafeSuppressDeprecated", "$log", function (a, b, c) { return b || c.warn("tooltip-html-unsafe is now deprecated. Use tooltip-html or tooltip-template instead."), a("tooltipHtmlUnsafe", "tooltip", "mouseenter") }]), angular.module("ui.bootstrap.popover", ["ui.bootstrap.tooltip"]).directive("popoverTemplatePopup", function () { return { restrict: "EA", replace: !0, scope: { title: "@", contentExp: "&", placement: "@", popupClass: "@", animation: "&", isOpen: "&", originScope: "&" }, templateUrl: "template/popover/popover-template.html" } }).directive("popoverTemplate", ["$tooltip", function (a) { return a("popoverTemplate", "popover", "click", {useContentExp: !0}) }]).directive("popoverPopup", function () { return { restrict: "EA", replace: !0, scope: {title: "@", content: "@", placement: "@", popupClass: "@", animation: "&", isOpen: "&"}, templateUrl: "template/popover/popover.html" } }).directive("popover", ["$tooltip", function (a) { return a("popover", "popover", "click") }]), angular.module("ui.bootstrap.progressbar", []).constant("progressConfig", { animate: !0, max: 100 }).controller("ProgressController", ["$scope", "$attrs", "progressConfig", function (a, b, c) { var d = this, e = angular.isDefined(b.animate) ? a.$parent.$eval(b.animate) : c.animate; this.bars = [], a.max = angular.isDefined(a.max) ? a.max : c.max, this.addBar = function (b, c) { e || c.css({transition: "none"}), this.bars.push(b), b.$watch("value", function (c) { b.percent = +(100 * c / a.max).toFixed(2) }), b.$on("$destroy", function () { c = null, d.removeBar(b) }) }, this.removeBar = function (a) { this.bars.splice(this.bars.indexOf(a), 1) } }]).directive("progress", function () { return { restrict: "EA", replace: !0, transclude: !0, controller: "ProgressController", require: "progress", scope: {}, templateUrl: "template/progressbar/progress.html" } }).directive("bar", function () { return { restrict: "EA", replace: !0, transclude: !0, require: "^progress", scope: {value: "=", max: "=?", type: "@"}, templateUrl: "template/progressbar/bar.html", link: function (a, b, c, d) { d.addBar(a, b) } } }).directive("progressbar", function () { return { restrict: "EA", replace: !0, transclude: !0, controller: "ProgressController", scope: {value: "=", max: "=?", type: "@"}, templateUrl: "template/progressbar/progressbar.html", link: function (a, b, c, d) { d.addBar(a, angular.element(b.children()[0])) } } }), angular.module("ui.bootstrap.rating", []).constant("ratingConfig", { max: 5, stateOn: null, stateOff: null }).controller("RatingController", ["$scope", "$attrs", "ratingConfig", function (a, b, c) { var d = {$setViewValue: angular.noop}; this.init = function (e) { d = e, d.$render = this.render, d.$formatters.push(function (a) { return angular.isNumber(a) && a << 0 !== a && (a = Math.round(a)), a }), this.stateOn = angular.isDefined(b.stateOn) ? a.$parent.$eval(b.stateOn) : c.stateOn, this.stateOff = angular.isDefined(b.stateOff) ? a.$parent.$eval(b.stateOff) : c.stateOff; var f = angular.isDefined(b.ratingStates) ? a.$parent.$eval(b.ratingStates) : new Array(angular.isDefined(b.max) ? a.$parent.$eval(b.max) : c.max); a.range = this.buildTemplateObjects(f) }, this.buildTemplateObjects = function (a) { for (var b = 0, c = a.length; c > b; b++)a[b] = angular.extend({index: b}, { stateOn: this.stateOn, stateOff: this.stateOff }, a[b]); return a }, a.rate = function (b) { !a.readonly && b >= 0 && b <= a.range.length && (d.$setViewValue(b), d.$render()) }, a.enter = function (b) { a.readonly || (a.value = b), a.onHover({value: b}) }, a.reset = function () { a.value = d.$viewValue, a.onLeave() }, a.onKeydown = function (b) { /(37|38|39|40)/.test(b.which) && (b.preventDefault(), b.stopPropagation(), a.rate(a.value + (38 === b.which || 39 === b.which ? 1 : -1))) }, this.render = function () { a.value = d.$viewValue } }]).directive("rating", function () { return { restrict: "EA", require: ["rating", "ngModel"], scope: {readonly: "=?", onHover: "&", onLeave: "&"}, controller: "RatingController", templateUrl: "template/rating/rating.html", replace: !0, link: function (a, b, c, d) { var e = d[0], f = d[1]; e.init(f) } } }), angular.module("ui.bootstrap.tabs", []).controller("TabsetController", ["$scope", function (a) { var b = this, c = b.tabs = a.tabs = []; b.select = function (a) { angular.forEach(c, function (b) { b.active && b !== a && (b.active = !1, b.onDeselect()) }), a.active = !0, a.onSelect() }, b.addTab = function (a) { c.push(a), 1 === c.length && a.active !== !1 ? a.active = !0 : a.active ? b.select(a) : a.active = !1 }, b.removeTab = function (a) { var e = c.indexOf(a); if (a.active && c.length > 1 && !d) { var f = e == c.length - 1 ? e - 1 : e + 1; b.select(c[f]) } c.splice(e, 1) }; var d; a.$on("$destroy", function () { d = !0 }) }]).directive("tabset", function () { return { restrict: "EA", transclude: !0, replace: !0, scope: {type: "@"}, controller: "TabsetController", templateUrl: "template/tabs/tabset.html", link: function (a, b, c) { a.vertical = angular.isDefined(c.vertical) ? a.$parent.$eval(c.vertical) : !1, a.justified = angular.isDefined(c.justified) ? a.$parent.$eval(c.justified) : !1 } } }).directive("tab", ["$parse", "$log", function (a, b) { return { require: "^tabset", restrict: "EA", replace: !0, templateUrl: "template/tabs/tab.html", transclude: !0, scope: {active: "=?", heading: "@", onSelect: "&select", onDeselect: "&deselect"}, controller: function () { }, compile: function (c, d, e) { return function (c, d, f, g) { c.$watch("active", function (a) { a && g.select(c) }), c.disabled = !1, f.disable && c.$parent.$watch(a(f.disable), function (a) { c.disabled = !!a }), f.disabled && (b.warn('Use of "disabled" attribute has been deprecated, please use "disable"'), c.$parent.$watch(a(f.disabled), function (a) { c.disabled = !!a })), c.select = function () { c.disabled || (c.active = !0) }, g.addTab(c), c.$on("$destroy", function () { g.removeTab(c) }), c.$transcludeFn = e } } } }]).directive("tabHeadingTransclude", [function () { return { restrict: "A", require: "^tab", link: function (a, b) { a.$watch("headingElement", function (a) { a && (b.html(""), b.append(a)) }) } } }]).directive("tabContentTransclude", function () { function a(a) { return a.tagName && (a.hasAttribute("tab-heading") || a.hasAttribute("data-tab-heading") || "tab-heading" === a.tagName.toLowerCase() || "data-tab-heading" === a.tagName.toLowerCase()) } return { restrict: "A", require: "^tabset", link: function (b, c, d) { var e = b.$eval(d.tabContentTransclude); e.$transcludeFn(e.$parent, function (b) { angular.forEach(b, function (b) { a(b) ? e.headingElement = b : c.append(b) }) }) } } }), angular.module("ui.bootstrap.timepicker", []).constant("timepickerConfig", { hourStep: 1, minuteStep: 1, showMeridian: !0, meridians: null, readonlyInput: !1, mousewheel: !0, arrowkeys: !0 }).controller("TimepickerController", ["$scope", "$attrs", "$parse", "$log", "$locale", "timepickerConfig", function (a, b, c, d, e, f) { function g() { var b = parseInt(a.hours, 10), c = a.showMeridian ? b > 0 && 13 > b : b >= 0 && 24 > b; return c ? (a.showMeridian && (12 === b && (b = 0), a.meridian === p[1] && (b += 12)), b) : void 0 } function h() { var b = parseInt(a.minutes, 10); return b >= 0 && 60 > b ? b : void 0 } function i(a) { return angular.isDefined(a) && a.toString().length < 2 ? "0" + a : a.toString() } function j(a) { k(), o.$setViewValue(new Date(n)), l(a) } function k() { o.$setValidity("time", !0), a.invalidHours = !1, a.invalidMinutes = !1 } function l(b) { var c = n.getHours(), d = n.getMinutes(); a.showMeridian && (c = 0 === c || 12 === c ? 12 : c % 12), a.hours = "h" === b ? c : i(c), "m" !== b && (a.minutes = i(d)), a.meridian = n.getHours() < 12 ? p[0] : p[1] } function m(a) { var b = new Date(n.getTime() + 6e4 * a); n.setHours(b.getHours(), b.getMinutes()), j() } var n = new Date, o = {$setViewValue: angular.noop}, p = angular.isDefined(b.meridians) ? a.$parent.$eval(b.meridians) : f.meridians || e.DATETIME_FORMATS.AMPMS; this.init = function (c, d) { o = c, o.$render = this.render, o.$formatters.unshift(function (a) { return a ? new Date(a) : null }); var e = d.eq(0), g = d.eq(1), h = angular.isDefined(b.mousewheel) ? a.$parent.$eval(b.mousewheel) : f.mousewheel; h && this.setupMousewheelEvents(e, g); var i = angular.isDefined(b.arrowkeys) ? a.$parent.$eval(b.arrowkeys) : f.arrowkeys; i && this.setupArrowkeyEvents(e, g), a.readonlyInput = angular.isDefined(b.readonlyInput) ? a.$parent.$eval(b.readonlyInput) : f.readonlyInput, this.setupInputEvents(e, g) }; var q = f.hourStep; b.hourStep && a.$parent.$watch(c(b.hourStep), function (a) { q = parseInt(a, 10) }); var r = f.minuteStep; b.minuteStep && a.$parent.$watch(c(b.minuteStep), function (a) { r = parseInt(a, 10) }), a.showMeridian = f.showMeridian, b.showMeridian && a.$parent.$watch(c(b.showMeridian), function (b) { if (a.showMeridian = !!b, o.$error.time) { var c = g(), d = h(); angular.isDefined(c) && angular.isDefined(d) && (n.setHours(c), j()) } else l() }), this.setupMousewheelEvents = function (b, c) { var d = function (a) { a.originalEvent && (a = a.originalEvent); var b = a.wheelDelta ? a.wheelDelta : -a.deltaY; return a.detail || b > 0 }; b.bind("mousewheel wheel", function (b) { a.$apply(d(b) ? a.incrementHours() : a.decrementHours()), b.preventDefault() }), c.bind("mousewheel wheel", function (b) { a.$apply(d(b) ? a.incrementMinutes() : a.decrementMinutes()), b.preventDefault() }) }, this.setupArrowkeyEvents = function (b, c) { b.bind("keydown", function (b) { 38 === b.which ? (b.preventDefault(), a.incrementHours(), a.$apply()) : 40 === b.which && (b.preventDefault(), a.decrementHours(), a.$apply()) }), c.bind("keydown", function (b) { 38 === b.which ? (b.preventDefault(), a.incrementMinutes(), a.$apply()) : 40 === b.which && (b.preventDefault(), a.decrementMinutes(), a.$apply()) }) }, this.setupInputEvents = function (b, c) { if (a.readonlyInput)return a.updateHours = angular.noop, void(a.updateMinutes = angular.noop); var d = function (b, c) { o.$setViewValue(null), o.$setValidity("time", !1), angular.isDefined(b) && (a.invalidHours = b), angular.isDefined(c) && (a.invalidMinutes = c) }; a.updateHours = function () { var a = g(); angular.isDefined(a) ? (n.setHours(a), j("h")) : d(!0) }, b.bind("blur", function () { !a.invalidHours && a.hours < 10 && a.$apply(function () { a.hours = i(a.hours) }) }), a.updateMinutes = function () { var a = h(); angular.isDefined(a) ? (n.setMinutes(a), j("m")) : d(void 0, !0) }, c.bind("blur", function () { !a.invalidMinutes && a.minutes < 10 && a.$apply(function () { a.minutes = i(a.minutes) }) }) }, this.render = function () { var a = o.$viewValue; isNaN(a) ? (o.$setValidity("time", !1), d.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')) : (a && (n = a), k(), l()) }, a.incrementHours = function () { m(60 * q) }, a.decrementHours = function () { m(60 * -q) }, a.incrementMinutes = function () { m(r) }, a.decrementMinutes = function () { m(-r) }, a.toggleMeridian = function () { m(720 * (n.getHours() < 12 ? 1 : -1)) } }]).directive("timepicker", function () { return { restrict: "EA", require: ["timepicker", "?^ngModel"], controller: "TimepickerController", replace: !0, scope: {}, templateUrl: "template/timepicker/timepicker.html", link: function (a, b, c, d) { var e = d[0], f = d[1]; f && e.init(f, b.find("input")) } } }), angular.module("ui.bootstrap.transition", []).value("$transitionSuppressDeprecated", !1).factory("$transition", ["$q", "$timeout", "$rootScope", "$log", "$transitionSuppressDeprecated", function (a, b, c, d, e) { function f(a) { for (var b in a)if (void 0 !== h.style[b])return a[b] } e || d.warn("$transition is now deprecated. Use $animate from ngAnimate instead."); var g = function (d, e, f) { f = f || {}; var h = a.defer(), i = g[f.animation ? "animationEndEventName" : "transitionEndEventName"], j = function () { c.$apply(function () { d.unbind(i, j), h.resolve(d) }) }; return i && d.bind(i, j), b(function () { angular.isString(e) ? d.addClass(e) : angular.isFunction(e) ? e(d) : angular.isObject(e) && d.css(e), i || h.resolve(d) }), h.promise.cancel = function () { i && d.unbind(i, j), h.reject("Transition cancelled") }, h.promise }, h = document.createElement("trans"), i = { WebkitTransition: "webkitTransitionEnd", MozTransition: "transitionend", OTransition: "oTransitionEnd", transition: "transitionend" }, j = { WebkitTransition: "webkitAnimationEnd", MozTransition: "animationend", OTransition: "oAnimationEnd", transition: "animationend" }; return g.transitionEndEventName = f(i), g.animationEndEventName = f(j), g }]), angular.module("ui.bootstrap.typeahead", ["ui.bootstrap.position", "ui.bootstrap.bindHtml"]).factory("typeaheadParser", ["$parse", function (a) { var b = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/; return { parse: function (c) { var d = c.match(b); if (!d)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "' + c + '".'); return {itemName: d[3], source: a(d[4]), viewMapper: a(d[2] || d[1]), modelMapper: a(d[1])} } } }]).directive("typeahead", ["$compile", "$parse", "$q", "$timeout", "$document", "$position", "typeaheadParser", function (a, b, c, d, e, f, g) { var h = [9, 13, 27, 38, 40]; return { require: "ngModel", link: function (i, j, k, l) { var m, n = i.$eval(k.typeaheadMinLength) || 1, o = i.$eval(k.typeaheadWaitMs) || 0, p = i.$eval(k.typeaheadEditable) !== !1, q = b(k.typeaheadLoading).assign || angular.noop, r = b(k.typeaheadOnSelect), s = k.typeaheadInputFormatter ? b(k.typeaheadInputFormatter) : void 0, t = k.typeaheadAppendToBody ? i.$eval(k.typeaheadAppendToBody) : !1, u = i.$eval(k.typeaheadFocusFirst) !== !1, v = b(k.ngModel).assign, w = g.parse(k.typeahead), x = i.$new(); i.$on("$destroy", function () { x.$destroy() }); var y = "typeahead-" + x.$id + "-" + Math.floor(1e4 * Math.random()); j.attr({"aria-autocomplete": "list", "aria-expanded": !1, "aria-owns": y}); var z = angular.element("<div typeahead-popup></div>"); z.attr({ id: y, matches: "matches", active: "activeIdx", select: "select(activeIdx)", query: "query", position: "position" }), angular.isDefined(k.typeaheadTemplateUrl) && z.attr("template-url", k.typeaheadTemplateUrl); var A = function () { x.matches = [], x.activeIdx = -1, j.attr("aria-expanded", !1) }, B = function (a) { return y + "-option-" + a }; x.$watch("activeIdx", function (a) { 0 > a ? j.removeAttr("aria-activedescendant") : j.attr("aria-activedescendant", B(a)) }); var C = function (a) { var b = {$viewValue: a}; q(i, !0), c.when(w.source(i, b)).then(function (c) { var d = a === l.$viewValue; if (d && m)if (c && c.length > 0) { x.activeIdx = u ? 0 : -1, x.matches.length = 0; for (var e = 0; e < c.length; e++)b[w.itemName] = c[e], x.matches.push({ id: B(e), label: w.viewMapper(x, b), model: c[e] }); x.query = a, x.position = t ? f.offset(j) : f.position(j), x.position.top = x.position.top + j.prop("offsetHeight"), j.attr("aria-expanded", !0) } else A(); d && q(i, !1) }, function () { A(), q(i, !1) }) }; A(), x.query = void 0; var D, E = function (a) { D = d(function () { C(a) }, o) }, F = function () { D && d.cancel(D) }; l.$parsers.unshift(function (a) { return m = !0, a && a.length >= n ? o > 0 ? (F(), E(a)) : C(a) : (q(i, !1), F(), A()), p ? a : a ? void l.$setValidity("editable", !1) : (l.$setValidity("editable", !0), a) }), l.$formatters.push(function (a) { var b, c, d = {}; return p || l.$setValidity("editable", !0), s ? (d.$model = a, s(i, d)) : (d[w.itemName] = a, b = w.viewMapper(i, d), d[w.itemName] = void 0, c = w.viewMapper(i, d), b !== c ? b : a) }), x.select = function (a) { var b, c, e = {}; e[w.itemName] = c = x.matches[a].model, b = w.modelMapper(i, e), v(i, b), l.$setValidity("editable", !0), l.$setValidity("parse", !0), r(i, { $item: c, $model: b, $label: w.viewMapper(i, e) }), A(), d(function () { j[0].focus() }, 0, !1) }, j.bind("keydown", function (a) { 0 !== x.matches.length && -1 !== h.indexOf(a.which) && (-1 != x.activeIdx || 13 !== a.which && 9 !== a.which) && (a.preventDefault(), 40 === a.which ? (x.activeIdx = (x.activeIdx + 1) % x.matches.length, x.$digest()) : 38 === a.which ? (x.activeIdx = (x.activeIdx > 0 ? x.activeIdx : x.matches.length) - 1, x.$digest()) : 13 === a.which || 9 === a.which ? x.$apply(function () { x.select(x.activeIdx) }) : 27 === a.which && (a.stopPropagation(), A(), x.$digest())) }), j.bind("blur", function () { m = !1 }); var G = function (a) { j[0] !== a.target && (A(), x.$digest()) }; e.bind("click", G), i.$on("$destroy", function () { e.unbind("click", G), t && H.remove(), z.remove() }); var H = a(z)(x); t ? e.find("body").append(H) : j.after(H) } } }]).directive("typeaheadPopup", function () { return { restrict: "EA", scope: {matches: "=", query: "=", active: "=", position: "=", select: "&"}, replace: !0, templateUrl: "template/typeahead/typeahead-popup.html", link: function (a, b, c) { a.templateUrl = c.templateUrl, a.isOpen = function () { return a.matches.length > 0 }, a.isActive = function (b) { return a.active == b }, a.selectActive = function (b) { a.active = b }, a.selectMatch = function (b) { a.select({activeIdx: b}) } } } }).directive("typeaheadMatch", ["$templateRequest", "$compile", "$parse", function (a, b, c) { return { restrict: "EA", scope: {index: "=", match: "=", query: "="}, link: function (d, e, f) { var g = c(f.templateUrl)(d.$parent) || "template/typeahead/typeahead-match.html"; a(g).then(function (a) { b(a.trim())(d, function (a) { e.replaceWith(a) }) }) } } }]).filter("typeaheadHighlight", function () { function a(a) { return a.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1") } return function (b, c) { return c ? ("" + b).replace(new RegExp(a(c), "gi"), "<strong>$&</strong>") : b } }), angular.module("template/accordion/accordion-group.html", []).run(["$templateCache", function (a) { a.put("template/accordion/accordion-group.html", '<div class="panel panel-default">\n <div class="panel-heading">\n <h4 class="panel-title">\n <a href="javascript:void(0)" tabindex="0" class="accordion-toggle" ng-click="toggleOpen()" accordion-transclude="heading"><span ng-class="{\'text-muted\': isDisabled}">{{heading}}</span></a>\n </h4>\n </div>\n <div class="panel-collapse collapse" collapse="!isOpen">\n <div class="panel-body" ng-transclude></div>\n </div>\n</div>\n') }]), angular.module("template/accordion/accordion.html", []).run(["$templateCache", function (a) { a.put("template/accordion/accordion.html", '<div class="panel-group" ng-transclude></div>') }]), angular.module("template/alert/alert.html", []).run(["$templateCache", function (a) { a.put("template/alert/alert.html", '<div class="alert" ng-class="[\'alert-\' + (type || \'warning\'), closeable ? \'alert-dismissable\' : null]" role="alert">\n <button ng-show="closeable" type="button" class="close" ng-click="close()">\n <span aria-hidden="true">&times;</span>\n <span class="sr-only">Close</span>\n </button>\n <div ng-transclude></div>\n</div>\n') }]), angular.module("template/carousel/carousel.html", []).run(["$templateCache", function (a) { a.put("template/carousel/carousel.html", '<div ng-mouseenter="pause()" ng-mouseleave="play()" class="carousel" ng-swipe-right="prev()" ng-swipe-left="next()">\n <ol class="carousel-indicators" ng-show="slides.length > 1">\n <li ng-repeat="slide in slides | orderBy:\'index\' track by $index" ng-class="{active: isActive(slide)}" ng-click="select(slide)"></li>\n </ol>\n <div class="carousel-inner" ng-transclude></div>\n <a class="left carousel-control" ng-click="prev()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-left"></span></a>\n <a class="right carousel-control" ng-click="next()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-right"></span></a>\n</div>\n') }]), angular.module("template/carousel/slide.html", []).run(["$templateCache", function (a) { a.put("template/carousel/slide.html", '<div ng-class="{\n \'active\': active\n }" class="item text-center" ng-transclude></div>\n') }]), angular.module("template/datepicker/datepicker.html", []).run(["$templateCache", function (a) { a.put("template/datepicker/datepicker.html", '<div ng-switch="datepickerMode" role="application" ng-keydown="keydown($event)">\n <daypicker ng-switch-when="day" tabindex="0"></daypicker>\n <monthpicker ng-switch-when="month" tabindex="0"></monthpicker>\n <yearpicker ng-switch-when="year" tabindex="0"></yearpicker>\n</div>') }]), angular.module("template/datepicker/day.html", []).run(["$templateCache", function (a) { a.put("template/datepicker/day.html", '<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="{{5 + showWeeks}}"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n <tr>\n <th ng-show="showWeeks" class="text-center"></th>\n <th ng-repeat="label in labels track by $index" class="text-center"><small aria-label="{{label.full}}">{{label.abbr}}</small></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-show="showWeeks" class="text-center h6"><em>{{ weekNumbers[$index] }}</em></td>\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}" ng-class="dt.customClass">\n <button type="button" style="width:100%;" class="btn btn-default btn-sm" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-muted\': dt.secondary, \'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n') }]), angular.module("template/datepicker/month.html", []).run(["$templateCache", function (a) { a.put("template/datepicker/month.html", '<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n') }]), angular.module("template/datepicker/popup.html", []).run(["$templateCache", function (a) { a.put("template/datepicker/popup.html", '<ul class="dropdown-menu" ng-style="{display: (isOpen && \'block\') || \'none\', top: position.top+\'px\', left: position.left+\'px\'}" ng-keydown="keydown($event)">\n <li ng-transclude></li>\n <li ng-if="showButtonBar" style="padding:10px 9px 2px">\n <span class="btn-group pull-left">\n <button type="button" class="btn btn-sm btn-info" ng-click="select(\'today\')">{{ getText(\'current\') }}</button>\n <button type="button" class="btn btn-sm btn-danger" ng-click="select(null)">{{ getText(\'clear\') }}</button>\n </span>\n <button type="button" class="btn btn-sm btn-success pull-right" ng-click="close()">{{ getText(\'close\') }}</button>\n </li>\n</ul>\n') }]), angular.module("template/datepicker/year.html", []).run(["$templateCache", function (a) { a.put("template/datepicker/year.html", '<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="3"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n') }]), angular.module("template/modal/backdrop.html", []).run(["$templateCache", function (a) { a.put("template/modal/backdrop.html", '<div class="modal-backdrop"\n modal-animation-class="fade"\n ng-class="{in: animate}"\n ng-style="{\'z-index\': 1040 + (index && 1 || 0) + index*10}"\n></div>\n') }]), angular.module("template/modal/window.html", []).run(["$templateCache", function (a) { a.put("template/modal/window.html", '<div modal-render="{{$isRendered}}" tabindex="-1" role="dialog" class="modal"\n modal-animation-class="fade"\n ng-class="{in: animate}" ng-style="{\'z-index\': 1050 + index*10, display: \'block\'}" ng-click="close($event)">\n <div class="modal-dialog" ng-class="size ? \'modal-\' + size : \'\'"><div class="modal-content" modal-transclude></div></div>\n</div>\n') }]), angular.module("template/pagination/pager.html", []).run(["$templateCache", function (a) { a.put("template/pagination/pager.html", '<ul class="pager">\n <li ng-class="{disabled: noPrevious(), previous: align}"><a href ng-click="selectPage(page - 1, $event)">{{getText(\'previous\')}}</a></li>\n <li ng-class="{disabled: noNext(), next: align}"><a href ng-click="selectPage(page + 1, $event)">{{getText(\'next\')}}</a></li>\n</ul>') }]), angular.module("template/pagination/pagination.html", []).run(["$templateCache", function (a) { a.put("template/pagination/pagination.html", '<ul class="pagination">\n <li ng-if="boundaryLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(1, $event)">{{getText(\'first\')}}</a></li>\n <li ng-if="directionLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(page - 1, $event)">{{getText(\'previous\')}}</a></li>\n <li ng-repeat="page in pages track by $index" ng-class="{active: page.active}"><a href ng-click="selectPage(page.number, $event)">{{page.text}}</a></li>\n <li ng-if="directionLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(page + 1, $event)">{{getText(\'next\')}}</a></li>\n <li ng-if="boundaryLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(totalPages, $event)">{{getText(\'last\')}}</a></li>\n</ul>') }]), angular.module("template/tooltip/tooltip-html-popup.html", []).run(["$templateCache", function (a) { a.put("template/tooltip/tooltip-html-popup.html", '<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind-html="contentExp()"></div>\n</div>\n') }]), angular.module("template/tooltip/tooltip-html-unsafe-popup.html", []).run(["$templateCache", function (a) { a.put("template/tooltip/tooltip-html-unsafe-popup.html", '<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" bind-html-unsafe="content"></div>\n</div>\n') }]), angular.module("template/tooltip/tooltip-popup.html", []).run(["$templateCache", function (a) { a.put("template/tooltip/tooltip-popup.html", '<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind="content"></div>\n</div>\n') }]), angular.module("template/tooltip/tooltip-template-popup.html", []).run(["$templateCache", function (a) { a.put("template/tooltip/tooltip-template-popup.html", '<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner"\n tooltip-template-transclude="contentExp()"\n tooltip-template-transclude-scope="originScope()"></div>\n</div>\n') }]), angular.module("template/popover/popover-template.html", []).run(["$templateCache", function (a) { a.put("template/popover/popover-template.html", '<div class="popover"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-if="title"></h3>\n <div class="popover-content"\n tooltip-template-transclude="contentExp()"\n tooltip-template-transclude-scope="originScope()"></div>\n </div>\n</div>\n') }]), angular.module("template/popover/popover-window.html", []).run(["$templateCache", function (a) { a.put("template/popover/popover-window.html", '<div class="popover {{placement}}" ng-class="{ in: isOpen, fade: animation }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-show="title"></h3>\n <div class="popover-content" tooltip-template-transclude></div>\n </div>\n</div>\n') }]), angular.module("template/popover/popover.html", []).run(["$templateCache", function (a) { a.put("template/popover/popover.html", '<div class="popover"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-if="title"></h3>\n <div class="popover-content" ng-bind="content"></div>\n </div>\n</div>\n') }]), angular.module("template/progressbar/bar.html", []).run(["$templateCache", function (a) { a.put("template/progressbar/bar.html", '<div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>\n') }]), angular.module("template/progressbar/progress.html", []).run(["$templateCache", function (a) { a.put("template/progressbar/progress.html", '<div class="progress" ng-transclude></div>') }]), angular.module("template/progressbar/progressbar.html", []).run(["$templateCache", function (a) { a.put("template/progressbar/progressbar.html", '<div class="progress">\n <div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>\n</div>\n') }]), angular.module("template/rating/rating.html", []).run(["$templateCache", function (a) { a.put("template/rating/rating.html", '<span ng-mouseleave="reset()" ng-keydown="onKeydown($event)" tabindex="0" role="slider" aria-valuemin="0" aria-valuemax="{{range.length}}" aria-valuenow="{{value}}">\n <i ng-repeat="r in range track by $index" ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" class="glyphicon" ng-class="$index < value && (r.stateOn || \'glyphicon-star\') || (r.stateOff || \'glyphicon-star-empty\')">\n <span class="sr-only">({{ $index < value ? \'*\' : \' \' }})</span>\n </i>\n</span>') }]), angular.module("template/tabs/tab.html", []).run(["$templateCache", function (a) { a.put("template/tabs/tab.html", '<li ng-class="{active: active, disabled: disabled}">\n <a href ng-click="select()" tab-heading-transclude>{{heading}}</a>\n</li>\n') }]), angular.module("template/tabs/tabset.html", []).run(["$templateCache", function (a) { a.put("template/tabs/tabset.html", '<div>\n <ul class="nav nav-{{type || \'tabs\'}}" ng-class="{\'nav-stacked\': vertical, \'nav-justified\': justified}" ng-transclude></ul>\n <div class="tab-content">\n <div class="tab-pane" \n ng-repeat="tab in tabs" \n ng-class="{active: tab.active}"\n tab-content-transclude="tab">\n </div>\n </div>\n</div>\n') }]), angular.module("template/timepicker/timepicker.html", []).run(["$templateCache", function (a) { a.put("template/timepicker/timepicker.html", '<table>\n <tbody>\n <tr class="text-center">\n <td><a ng-click="incrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td>&nbsp;</td>\n <td><a ng-click="incrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n <tr>\n <td class="form-group" ng-class="{\'has-error\': invalidHours}">\n <input style="width:50px;" type="text" ng-model="hours" ng-change="updateHours()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2">\n </td>\n <td>:</td>\n <td class="form-group" ng-class="{\'has-error\': invalidMinutes}">\n <input style="width:50px;" type="text" ng-model="minutes" ng-change="updateMinutes()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2">\n </td>\n <td ng-show="showMeridian"><button type="button" class="btn btn-default text-center" ng-click="toggleMeridian()">{{meridian}}</button></td>\n </tr>\n <tr class="text-center">\n <td><a ng-click="decrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td>&nbsp;</td>\n <td><a ng-click="decrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n </tbody>\n</table>\n') }]), angular.module("template/typeahead/typeahead-match.html", []).run(["$templateCache", function (a) { a.put("template/typeahead/typeahead-match.html", '<a tabindex="-1" bind-html-unsafe="match.label | typeaheadHighlight:query"></a>') }]), angular.module("template/typeahead/typeahead-popup.html", []).run(["$templateCache", function (a) { a.put("template/typeahead/typeahead-popup.html", '<ul class="dropdown-menu" ng-show="isOpen()" ng-style="{top: position.top+\'px\', left: position.left+\'px\'}" style="display: block;" role="listbox" aria-hidden="{{!isOpen()}}">\n <li ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index)" role="option" id="{{match.id}}">\n <div typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>\n </li>\n</ul>\n') }]), !angular.$$csp() && angular.element(document).find("head").prepend('<style type="text/css">.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}</style>');
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-client/src/test/resources/spring/XmlConfigAnnotationTest6.xml
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:apollo="http://www.ctrip.com/schema/apollo" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd"> <apollo:config/> <bean class="com.ctrip.framework.apollo.spring.XMLConfigAnnotationTest.TestApolloConfigChangeListenerWithInterestedKeysBean"/> </beans>
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:apollo="http://www.ctrip.com/schema/apollo" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd"> <apollo:config/> <bean class="com.ctrip.framework.apollo.spring.XMLConfigAnnotationTest.TestApolloConfigChangeListenerWithInterestedKeysBean"/> </beans>
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-common/src/main/java/com/ctrip/framework/apollo/common/exception/BeanUtilsException.java
package com.ctrip.framework.apollo.common.exception; public class BeanUtilsException extends RuntimeException{ public BeanUtilsException(Throwable e){ super(e); } }
package com.ctrip.framework.apollo.common.exception; public class BeanUtilsException extends RuntimeException{ public BeanUtilsException(Throwable e){ super(e); } }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-common/src/main/java/com/ctrip/framework/apollo/common/dto/ItemDTO.java
package com.ctrip.framework.apollo.common.dto; public class ItemDTO extends BaseDTO{ private long id; private long namespaceId; private String key; private String value; private String comment; private int lineNum; public ItemDTO() { } public ItemDTO(String key, String value, String comment, int lineNum) { this.key = key; this.value = value; this.comment = comment; this.lineNum = lineNum; } public long getId() { return id; } public void setId(long id) { this.id = id; } public String getComment() { return comment; } public String getKey() { return key; } public long getNamespaceId() { return namespaceId; } public String getValue() { return value; } public void setComment(String comment) { this.comment = comment; } public void setKey(String key) { this.key = key; } public void setNamespaceId(long namespaceId) { this.namespaceId = namespaceId; } public void setValue(String value) { this.value = value; } public int getLineNum() { return lineNum; } public void setLineNum(int lineNum) { this.lineNum = lineNum; } }
package com.ctrip.framework.apollo.common.dto; public class ItemDTO extends BaseDTO{ private long id; private long namespaceId; private String key; private String value; private String comment; private int lineNum; public ItemDTO() { } public ItemDTO(String key, String value, String comment, int lineNum) { this.key = key; this.value = value; this.comment = comment; this.lineNum = lineNum; } public long getId() { return id; } public void setId(long id) { this.id = id; } public String getComment() { return comment; } public String getKey() { return key; } public long getNamespaceId() { return namespaceId; } public String getValue() { return value; } public void setComment(String comment) { this.comment = comment; } public void setKey(String key) { this.key = key; } public void setNamespaceId(long namespaceId) { this.namespaceId = namespaceId; } public void setValue(String value) { this.value = value; } public int getLineNum() { return lineNum; } public void setLineNum(int lineNum) { this.lineNum = lineNum; } }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./scripts/apollo-on-kubernetes/kubernetes/apollo-env-test-alpha/service-apollo-config-server-test-alpha.yaml
--- # configmap for apollo-config-server-test-alpha kind: ConfigMap apiVersion: v1 metadata: namespace: sre name: configmap-apollo-config-server-test-alpha data: application-github.properties: | spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-test-alpha-env.sre:3306/TestAlphaApolloConfigDB?characterEncoding=utf8 spring.datasource.username = FillInCorrectUser spring.datasource.password = FillInCorrectPassword eureka.service.url = http://statefulset-apollo-config-server-test-alpha-0.service-apollo-meta-server-test-alpha:8080/eureka/,http://statefulset-apollo-config-server-test-alpha-1.service-apollo-meta-server-test-alpha:8080/eureka/,http://statefulset-apollo-config-server-test-alpha-2.service-apollo-meta-server-test-alpha:8080/eureka/ --- kind: Service apiVersion: v1 metadata: namespace: sre name: service-apollo-meta-server-test-alpha labels: app: service-apollo-meta-server-test-alpha spec: ports: - protocol: TCP port: 8080 targetPort: 8080 selector: app: pod-apollo-config-server-test-alpha type: ClusterIP clusterIP: None sessionAffinity: ClientIP --- kind: Service apiVersion: v1 metadata: namespace: sre name: service-apollo-config-server-test-alpha labels: app: service-apollo-config-server-test-alpha spec: ports: - protocol: TCP port: 8080 targetPort: 8080 nodePort: 30003 selector: app: pod-apollo-config-server-test-alpha type: NodePort sessionAffinity: ClientIP --- kind: StatefulSet apiVersion: apps/v1 metadata: namespace: sre name: statefulset-apollo-config-server-test-alpha labels: app: statefulset-apollo-config-server-test-alpha spec: serviceName: service-apollo-meta-server-test-alpha replicas: 3 selector: matchLabels: app: pod-apollo-config-server-test-alpha updateStrategy: type: RollingUpdate template: metadata: labels: app: pod-apollo-config-server-test-alpha spec: affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 podAffinityTerm: labelSelector: matchExpressions: - key: app operator: In values: - pod-apollo-config-server-test-alpha topologyKey: kubernetes.io/hostname volumes: - name: volume-configmap-apollo-config-server-test-alpha configMap: name: configmap-apollo-config-server-test-alpha items: - key: application-github.properties path: application-github.properties containers: - image: apollo-config-server:v1.0.0 securityContext: privileged: true imagePullPolicy: IfNotPresent name: container-apollo-config-server-test-alpha ports: - protocol: TCP containerPort: 8080 volumeMounts: - name: volume-configmap-apollo-config-server-test-alpha mountPath: /apollo-config-server/config/application-github.properties subPath: application-github.properties env: - name: APOLLO_CONFIG_SERVICE_NAME value: "service-apollo-config-server-test-alpha.sre" readinessProbe: tcpSocket: port: 8080 initialDelaySeconds: 10 periodSeconds: 5 livenessProbe: tcpSocket: port: 8080 initialDelaySeconds: 120 periodSeconds: 10 dnsPolicy: ClusterFirst restartPolicy: Always
--- # configmap for apollo-config-server-test-alpha kind: ConfigMap apiVersion: v1 metadata: namespace: sre name: configmap-apollo-config-server-test-alpha data: application-github.properties: | spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-test-alpha-env.sre:3306/TestAlphaApolloConfigDB?characterEncoding=utf8 spring.datasource.username = FillInCorrectUser spring.datasource.password = FillInCorrectPassword eureka.service.url = http://statefulset-apollo-config-server-test-alpha-0.service-apollo-meta-server-test-alpha:8080/eureka/,http://statefulset-apollo-config-server-test-alpha-1.service-apollo-meta-server-test-alpha:8080/eureka/,http://statefulset-apollo-config-server-test-alpha-2.service-apollo-meta-server-test-alpha:8080/eureka/ --- kind: Service apiVersion: v1 metadata: namespace: sre name: service-apollo-meta-server-test-alpha labels: app: service-apollo-meta-server-test-alpha spec: ports: - protocol: TCP port: 8080 targetPort: 8080 selector: app: pod-apollo-config-server-test-alpha type: ClusterIP clusterIP: None sessionAffinity: ClientIP --- kind: Service apiVersion: v1 metadata: namespace: sre name: service-apollo-config-server-test-alpha labels: app: service-apollo-config-server-test-alpha spec: ports: - protocol: TCP port: 8080 targetPort: 8080 nodePort: 30003 selector: app: pod-apollo-config-server-test-alpha type: NodePort sessionAffinity: ClientIP --- kind: StatefulSet apiVersion: apps/v1 metadata: namespace: sre name: statefulset-apollo-config-server-test-alpha labels: app: statefulset-apollo-config-server-test-alpha spec: serviceName: service-apollo-meta-server-test-alpha replicas: 3 selector: matchLabels: app: pod-apollo-config-server-test-alpha updateStrategy: type: RollingUpdate template: metadata: labels: app: pod-apollo-config-server-test-alpha spec: affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 podAffinityTerm: labelSelector: matchExpressions: - key: app operator: In values: - pod-apollo-config-server-test-alpha topologyKey: kubernetes.io/hostname volumes: - name: volume-configmap-apollo-config-server-test-alpha configMap: name: configmap-apollo-config-server-test-alpha items: - key: application-github.properties path: application-github.properties containers: - image: apollo-config-server:v1.0.0 securityContext: privileged: true imagePullPolicy: IfNotPresent name: container-apollo-config-server-test-alpha ports: - protocol: TCP containerPort: 8080 volumeMounts: - name: volume-configmap-apollo-config-server-test-alpha mountPath: /apollo-config-server/config/application-github.properties subPath: application-github.properties env: - name: APOLLO_CONFIG_SERVICE_NAME value: "service-apollo-config-server-test-alpha.sre" readinessProbe: tcpSocket: port: 8080 initialDelaySeconds: 10 periodSeconds: 5 livenessProbe: tcpSocket: port: 8080 initialDelaySeconds: 120 periodSeconds: 10 dnsPolicy: ClusterFirst restartPolicy: Always
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./docs/charts/apollo-service-0.1.2.tgz
)+aHR0cHM6Ly95b3V0dS5iZS96OVV6MWljandyTQo=Helm<o:YŬžW<e]Qw ,6TIiRdɲ'mqM3p82 D1.v.D(ݵn=9:2nwQw;ERh\$# I9s`ַHf_{ݷ<2]_j-1pn.8 c-¼ɹP><@Jt&TM*AC+E]/)ȝ$ 3LUND*ɷvȅ"~G :%#Q`% BM,=RPHj0>=%Ntn0W="W.q9&S<K݇3K4Y*ݳSɿ`3G(w+rr K`ʥsղ9px=ѵ7{ m"g w\x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v`0-NNme7qَc;#7MiiJt@qO/,I&psv6i@prh>`+KrN~`5_eU)VmyV@i崂F_X7muӭFyh$jo-|`Uì(BS@V5|7rhweyܻ:C! R6̿xM2L';ʑ~N\TwP<zdS-dΩFE}wB[r+TsϴcZ?w#T JQ7?CT!! 翓RGwub cWqxK$u^HhzVr,/Z6$mrDb|:[,ip]2o&zN|fkWuo:( p"whKLS5&1ʣb}E ,Qq,9\ygDT zZTfRբJKwjQePe&87*( C)irASRrÆo()8 dqN+b269z7-@}Gմf{I.|t\IuUL]#!4cQ5'[JIʥ T=jz9Ff܏Ai'J?hgnݴ;ӵb.E(Є⽳+DMDz=tߵUeճeF)?[YX\湽Itb* e_3EKԱaR:ae1*];b{lVMpO7o~:pTIGYL. %|yKTo0ʫ%  FT4[ v` jmn2 j +Tn8-c%XuRYeFE`YXOaQXS$~'ned]KkPjɴ맠 %17=dUsKY -qvM$o=ٿ,mXm`[XW2S8UC9U;1.L.\y ^mAV:IQckd]knHTWf*.0n `dEwB銕[!_Qy؄E菝*SYlM"d-j`~Ǵœ1lG:;\o(yg]1?Gg^c[m'yt&sZz}9Z|"MgMR'vx4~ǼTjZ.ꭈvr1Vs7Җ:;-jd-Fϒ-M뿺?KŖ8WVyMC46SkkwqIʲS'4 m]~U(IL3y}d:k1 YN3&_6eu~llMF/ 9eJV2$ֆM4l wM(Em {T,_<~pkBĀnI#S:a\tW~h0 J)Wb"{g{K&(m>Lư@NaQ|G7Egh2~<NL~ W_~Imo  y <*eO꘿1=1ӎ餣_uFĽB^.^#rkU?sA'֫#G\Jl!l3r;l׾۾;^
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-client/src/main/java/com/ctrip/framework/apollo/ConfigFileChangeListener.java
package com.ctrip.framework.apollo; import com.ctrip.framework.apollo.model.ConfigFileChangeEvent; /** * @author Jason Song([email protected]) */ public interface ConfigFileChangeListener { /** * Invoked when there is any config change for the namespace. * @param changeEvent the event for this change */ void onChange(ConfigFileChangeEvent changeEvent); }
package com.ctrip.framework.apollo; import com.ctrip.framework.apollo.model.ConfigFileChangeEvent; /** * @author Jason Song([email protected]) */ public interface ConfigFileChangeListener { /** * Invoked when there is any config change for the namespace. * @param changeEvent the event for this change */ void onChange(ConfigFileChangeEvent changeEvent); }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./.git/logs/refs/heads/master
0000000000000000000000000000000000000000 6657a58831a544606f78177b61d92bb959ccce94 jupyter <[email protected]> 1704839356 +0000 clone: from https://github.com/apolloconfig/apollo.git
0000000000000000000000000000000000000000 6657a58831a544606f78177b61d92bb959ccce94 jupyter <[email protected]> 1704839356 +0000 clone: from https://github.com/apolloconfig/apollo.git
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/service/FavoriteServiceTest.java
package com.ctrip.framework.apollo.portal.service; import com.ctrip.framework.apollo.common.exception.BadRequestException; import com.ctrip.framework.apollo.portal.AbstractIntegrationTest; import com.ctrip.framework.apollo.portal.entity.po.Favorite; import com.ctrip.framework.apollo.portal.repository.FavoriteRepository; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.PageRequest; import org.springframework.test.context.jdbc.Sql; import java.util.List; public class FavoriteServiceTest extends AbstractIntegrationTest { @Autowired private FavoriteService favoriteService; @Autowired private FavoriteRepository favoriteRepository; private String testUser = "apollo"; @Before public void before() { } @Test @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testAddNormalFavorite() { String testApp = "testApp"; Favorite favorite = instanceOfFavorite(testUser, testApp); favoriteService.addFavorite(favorite); List<Favorite> createdFavorites = favoriteService.search(testUser, testApp, PageRequest.of(0, 10)); Assert.assertEquals(1, createdFavorites.size()); Assert.assertEquals(FavoriteService.POSITION_DEFAULT, createdFavorites.get(0).getPosition()); Assert.assertEquals(testUser, createdFavorites.get(0).getUserId()); Assert.assertEquals(testApp, createdFavorites.get(0).getAppId()); } @Test(expected = BadRequestException.class) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testAddFavoriteErrorUser() { String testApp = "testApp"; Favorite favorite = instanceOfFavorite("errorUser", testApp); favoriteService.addFavorite(favorite); } @Test @Sql(scripts = "/sql/favorites/favorites.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testSearchByUserId() { List<Favorite> favorites = favoriteService.search(testUser, null, PageRequest.of(0, 10)); Assert.assertEquals(4, favorites.size()); } @Test @Sql(scripts = "/sql/favorites/favorites.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testSearchByAppId() { List<Favorite> favorites = favoriteService.search(null, "test0621-04", PageRequest.of(0, 10)); Assert.assertEquals(3, favorites.size()); } @Test @Sql(scripts = "/sql/favorites/favorites.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testSearchByAppIdAndUserId() { List<Favorite> favorites = favoriteService.search(testUser, "test0621-04", PageRequest.of(0, 10)); Assert.assertEquals(1, favorites.size()); } @Test(expected = BadRequestException.class) @Sql(scripts = "/sql/favorites/favorites.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testSearchWithErrorParams() { favoriteService.search(null, null, PageRequest.of(0, 10)); } @Test @Sql(scripts = "/sql/favorites/favorites.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testDeleteFavorite() { long legalFavoriteId = 21L; favoriteService.deleteFavorite(legalFavoriteId); Assert.assertNull(favoriteRepository.findById(legalFavoriteId).orElse(null)); } @Test(expected = BadRequestException.class) @Sql(scripts = "/sql/favorites/favorites.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testDeleteFavoriteFail() { long anotherPersonFavoriteId = 23L; favoriteService.deleteFavorite(anotherPersonFavoriteId); Assert.assertNull(favoriteRepository.findById(anotherPersonFavoriteId).orElse(null)); } @Test(expected = BadRequestException.class) @Sql(scripts = "/sql/favorites/favorites.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testAdjustFavoriteError() { long anotherPersonFavoriteId = 23; favoriteService.adjustFavoriteToFirst(anotherPersonFavoriteId); } @Test @Sql(scripts = "/sql/favorites/favorites.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testAdjustFavorite() { long toAdjustFavoriteId = 20; favoriteService.adjustFavoriteToFirst(toAdjustFavoriteId); List<Favorite> favorites = favoriteService.search(testUser, null, PageRequest.of(0, 10)); Favorite firstFavorite = favorites.get(0); Favorite secondFavorite = favorites.get(1); Assert.assertEquals(toAdjustFavoriteId, firstFavorite.getId()); Assert.assertEquals(firstFavorite.getPosition() + 1, secondFavorite.getPosition()); } private Favorite instanceOfFavorite(String userId, String appId) { Favorite favorite = new Favorite(); favorite.setAppId(appId); favorite.setUserId(userId); favorite.setDataChangeCreatedBy(userId); favorite.setDataChangeLastModifiedBy(userId); return favorite; } }
package com.ctrip.framework.apollo.portal.service; import com.ctrip.framework.apollo.common.exception.BadRequestException; import com.ctrip.framework.apollo.portal.AbstractIntegrationTest; import com.ctrip.framework.apollo.portal.entity.po.Favorite; import com.ctrip.framework.apollo.portal.repository.FavoriteRepository; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.PageRequest; import org.springframework.test.context.jdbc.Sql; import java.util.List; public class FavoriteServiceTest extends AbstractIntegrationTest { @Autowired private FavoriteService favoriteService; @Autowired private FavoriteRepository favoriteRepository; private String testUser = "apollo"; @Before public void before() { } @Test @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testAddNormalFavorite() { String testApp = "testApp"; Favorite favorite = instanceOfFavorite(testUser, testApp); favoriteService.addFavorite(favorite); List<Favorite> createdFavorites = favoriteService.search(testUser, testApp, PageRequest.of(0, 10)); Assert.assertEquals(1, createdFavorites.size()); Assert.assertEquals(FavoriteService.POSITION_DEFAULT, createdFavorites.get(0).getPosition()); Assert.assertEquals(testUser, createdFavorites.get(0).getUserId()); Assert.assertEquals(testApp, createdFavorites.get(0).getAppId()); } @Test(expected = BadRequestException.class) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testAddFavoriteErrorUser() { String testApp = "testApp"; Favorite favorite = instanceOfFavorite("errorUser", testApp); favoriteService.addFavorite(favorite); } @Test @Sql(scripts = "/sql/favorites/favorites.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testSearchByUserId() { List<Favorite> favorites = favoriteService.search(testUser, null, PageRequest.of(0, 10)); Assert.assertEquals(4, favorites.size()); } @Test @Sql(scripts = "/sql/favorites/favorites.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testSearchByAppId() { List<Favorite> favorites = favoriteService.search(null, "test0621-04", PageRequest.of(0, 10)); Assert.assertEquals(3, favorites.size()); } @Test @Sql(scripts = "/sql/favorites/favorites.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testSearchByAppIdAndUserId() { List<Favorite> favorites = favoriteService.search(testUser, "test0621-04", PageRequest.of(0, 10)); Assert.assertEquals(1, favorites.size()); } @Test(expected = BadRequestException.class) @Sql(scripts = "/sql/favorites/favorites.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testSearchWithErrorParams() { favoriteService.search(null, null, PageRequest.of(0, 10)); } @Test @Sql(scripts = "/sql/favorites/favorites.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testDeleteFavorite() { long legalFavoriteId = 21L; favoriteService.deleteFavorite(legalFavoriteId); Assert.assertNull(favoriteRepository.findById(legalFavoriteId).orElse(null)); } @Test(expected = BadRequestException.class) @Sql(scripts = "/sql/favorites/favorites.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testDeleteFavoriteFail() { long anotherPersonFavoriteId = 23L; favoriteService.deleteFavorite(anotherPersonFavoriteId); Assert.assertNull(favoriteRepository.findById(anotherPersonFavoriteId).orElse(null)); } @Test(expected = BadRequestException.class) @Sql(scripts = "/sql/favorites/favorites.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testAdjustFavoriteError() { long anotherPersonFavoriteId = 23; favoriteService.adjustFavoriteToFirst(anotherPersonFavoriteId); } @Test @Sql(scripts = "/sql/favorites/favorites.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) @Sql(scripts = "/sql/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) public void testAdjustFavorite() { long toAdjustFavoriteId = 20; favoriteService.adjustFavoriteToFirst(toAdjustFavoriteId); List<Favorite> favorites = favoriteService.search(testUser, null, PageRequest.of(0, 10)); Favorite firstFavorite = favorites.get(0); Favorite secondFavorite = favorites.get(1); Assert.assertEquals(toAdjustFavoriteId, firstFavorite.getId()); Assert.assertEquals(firstFavorite.getPosition() + 1, secondFavorite.getPosition()); } private Favorite instanceOfFavorite(String userId, String appId) { Favorite favorite = new Favorite(); favorite.setAppId(appId); favorite.setUserId(userId); favorite.setDataChangeCreatedBy(userId); favorite.setDataChangeLastModifiedBy(userId); return favorite; } }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/AccessKeyService.java
package com.ctrip.framework.apollo.biz.service; import com.ctrip.framework.apollo.biz.entity.AccessKey; import com.ctrip.framework.apollo.biz.entity.Audit; import com.ctrip.framework.apollo.biz.repository.AccessKeyRepository; import com.ctrip.framework.apollo.common.exception.BadRequestException; import java.util.List; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; /** * @author nisiyong */ @Service public class AccessKeyService { private static final int ACCESSKEY_COUNT_LIMIT = 5; private final AccessKeyRepository accessKeyRepository; private final AuditService auditService; public AccessKeyService( AccessKeyRepository accessKeyRepository, AuditService auditService) { this.accessKeyRepository = accessKeyRepository; this.auditService = auditService; } public List<AccessKey> findByAppId(String appId) { return accessKeyRepository.findByAppId(appId); } @Transactional public AccessKey create(String appId, AccessKey entity) { long count = accessKeyRepository.countByAppId(appId); if (count >= ACCESSKEY_COUNT_LIMIT) { throw new BadRequestException("AccessKeys count limit exceeded"); } entity.setId(0L); entity.setAppId(appId); entity.setDataChangeLastModifiedBy(entity.getDataChangeCreatedBy()); AccessKey accessKey = accessKeyRepository.save(entity); auditService.audit(AccessKey.class.getSimpleName(), accessKey.getId(), Audit.OP.INSERT, accessKey.getDataChangeCreatedBy()); return accessKey; } @Transactional public AccessKey update(String appId, AccessKey entity) { long id = entity.getId(); String operator = entity.getDataChangeLastModifiedBy(); AccessKey accessKey = accessKeyRepository.findOneByAppIdAndId(appId, id); if (accessKey == null) { throw new BadRequestException("AccessKey not exist"); } accessKey.setEnabled(entity.isEnabled()); accessKey.setDataChangeLastModifiedBy(operator); accessKeyRepository.save(accessKey); auditService.audit(AccessKey.class.getSimpleName(), id, Audit.OP.UPDATE, operator); return accessKey; } @Transactional public void delete(String appId, long id, String operator) { AccessKey accessKey = accessKeyRepository.findOneByAppIdAndId(appId, id); if (accessKey == null) { throw new BadRequestException("AccessKey not exist"); } if (accessKey.isEnabled()) { throw new BadRequestException("AccessKey should disable first"); } accessKey.setDeleted(Boolean.TRUE); accessKey.setDataChangeLastModifiedBy(operator); accessKeyRepository.save(accessKey); auditService.audit(AccessKey.class.getSimpleName(), id, Audit.OP.DELETE, operator); } }
package com.ctrip.framework.apollo.biz.service; import com.ctrip.framework.apollo.biz.entity.AccessKey; import com.ctrip.framework.apollo.biz.entity.Audit; import com.ctrip.framework.apollo.biz.repository.AccessKeyRepository; import com.ctrip.framework.apollo.common.exception.BadRequestException; import java.util.List; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; /** * @author nisiyong */ @Service public class AccessKeyService { private static final int ACCESSKEY_COUNT_LIMIT = 5; private final AccessKeyRepository accessKeyRepository; private final AuditService auditService; public AccessKeyService( AccessKeyRepository accessKeyRepository, AuditService auditService) { this.accessKeyRepository = accessKeyRepository; this.auditService = auditService; } public List<AccessKey> findByAppId(String appId) { return accessKeyRepository.findByAppId(appId); } @Transactional public AccessKey create(String appId, AccessKey entity) { long count = accessKeyRepository.countByAppId(appId); if (count >= ACCESSKEY_COUNT_LIMIT) { throw new BadRequestException("AccessKeys count limit exceeded"); } entity.setId(0L); entity.setAppId(appId); entity.setDataChangeLastModifiedBy(entity.getDataChangeCreatedBy()); AccessKey accessKey = accessKeyRepository.save(entity); auditService.audit(AccessKey.class.getSimpleName(), accessKey.getId(), Audit.OP.INSERT, accessKey.getDataChangeCreatedBy()); return accessKey; } @Transactional public AccessKey update(String appId, AccessKey entity) { long id = entity.getId(); String operator = entity.getDataChangeLastModifiedBy(); AccessKey accessKey = accessKeyRepository.findOneByAppIdAndId(appId, id); if (accessKey == null) { throw new BadRequestException("AccessKey not exist"); } accessKey.setEnabled(entity.isEnabled()); accessKey.setDataChangeLastModifiedBy(operator); accessKeyRepository.save(accessKey); auditService.audit(AccessKey.class.getSimpleName(), id, Audit.OP.UPDATE, operator); return accessKey; } @Transactional public void delete(String appId, long id, String operator) { AccessKey accessKey = accessKeyRepository.findOneByAppIdAndId(appId, id); if (accessKey == null) { throw new BadRequestException("AccessKey not exist"); } if (accessKey.isEnabled()) { throw new BadRequestException("AccessKey should disable first"); } accessKey.setDeleted(Boolean.TRUE); accessKey.setDataChangeLastModifiedBy(operator); accessKeyRepository.save(accessKey); auditService.audit(AccessKey.class.getSimpleName(), id, Audit.OP.DELETE, operator); } }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ReleaseHistoryController.java
package com.ctrip.framework.apollo.portal.controller; import com.ctrip.framework.apollo.portal.environment.Env; import com.ctrip.framework.apollo.portal.component.PermissionValidator; import com.ctrip.framework.apollo.portal.entity.bo.ReleaseHistoryBO; import com.ctrip.framework.apollo.portal.service.ReleaseHistoryService; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.Collections; import java.util.List; @RestController public class ReleaseHistoryController { private final ReleaseHistoryService releaseHistoryService; private final PermissionValidator permissionValidator; public ReleaseHistoryController(final ReleaseHistoryService releaseHistoryService, final PermissionValidator permissionValidator) { this.releaseHistoryService = releaseHistoryService; this.permissionValidator = permissionValidator; } @GetMapping("/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName}/releases/histories") public List<ReleaseHistoryBO> findReleaseHistoriesByNamespace(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName, @PathVariable String namespaceName, @RequestParam(value = "page", defaultValue = "0") int page, @RequestParam(value = "size", defaultValue = "10") int size) { if (permissionValidator.shouldHideConfigToCurrentUser(appId, env, namespaceName)) { return Collections.emptyList(); } return releaseHistoryService.findNamespaceReleaseHistory(appId, Env.valueOf(env), clusterName ,namespaceName, page, size); } }
package com.ctrip.framework.apollo.portal.controller; import com.ctrip.framework.apollo.portal.environment.Env; import com.ctrip.framework.apollo.portal.component.PermissionValidator; import com.ctrip.framework.apollo.portal.entity.bo.ReleaseHistoryBO; import com.ctrip.framework.apollo.portal.service.ReleaseHistoryService; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.Collections; import java.util.List; @RestController public class ReleaseHistoryController { private final ReleaseHistoryService releaseHistoryService; private final PermissionValidator permissionValidator; public ReleaseHistoryController(final ReleaseHistoryService releaseHistoryService, final PermissionValidator permissionValidator) { this.releaseHistoryService = releaseHistoryService; this.permissionValidator = permissionValidator; } @GetMapping("/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName}/releases/histories") public List<ReleaseHistoryBO> findReleaseHistoriesByNamespace(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName, @PathVariable String namespaceName, @RequestParam(value = "page", defaultValue = "0") int page, @RequestParam(value = "size", defaultValue = "10") int size) { if (permissionValidator.shouldHideConfigToCurrentUser(appId, env, namespaceName)) { return Collections.emptyList(); } return releaseHistoryService.findNamespaceReleaseHistory(appId, Env.valueOf(env), clusterName ,namespaceName, page, size); } }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-client/src/test/resources/spring/yaml/case9.yml
someKey: someValue
someKey: someValue
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/repository/ConsumerAuditRepository.java
package com.ctrip.framework.apollo.openapi.repository; import com.ctrip.framework.apollo.openapi.entity.ConsumerAudit; import org.springframework.data.repository.PagingAndSortingRepository; /** * @author Jason Song([email protected]) */ public interface ConsumerAuditRepository extends PagingAndSortingRepository<ConsumerAudit, Long> { }
package com.ctrip.framework.apollo.openapi.repository; import com.ctrip.framework.apollo.openapi.entity.ConsumerAudit; import org.springframework.data.repository.PagingAndSortingRepository; /** * @author Jason Song([email protected]) */ public interface ConsumerAuditRepository extends PagingAndSortingRepository<ConsumerAudit, Long> { }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/FavoriteController.java
package com.ctrip.framework.apollo.portal.controller; import com.ctrip.framework.apollo.portal.entity.po.Favorite; import com.ctrip.framework.apollo.portal.service.FavoriteService; import org.springframework.data.domain.Pageable; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.List; @RestController public class FavoriteController { private final FavoriteService favoriteService; public FavoriteController(final FavoriteService favoriteService) { this.favoriteService = favoriteService; } @PostMapping("/favorites") public Favorite addFavorite(@RequestBody Favorite favorite) { return favoriteService.addFavorite(favorite); } @GetMapping("/favorites") public List<Favorite> findFavorites(@RequestParam(value = "userId", required = false) String userId, @RequestParam(value = "appId", required = false) String appId, Pageable page) { return favoriteService.search(userId, appId, page); } @DeleteMapping("/favorites/{favoriteId}") public void deleteFavorite(@PathVariable long favoriteId) { favoriteService.deleteFavorite(favoriteId); } @PutMapping("/favorites/{favoriteId}") public void toTop(@PathVariable long favoriteId) { favoriteService.adjustFavoriteToFirst(favoriteId); } }
package com.ctrip.framework.apollo.portal.controller; import com.ctrip.framework.apollo.portal.entity.po.Favorite; import com.ctrip.framework.apollo.portal.service.FavoriteService; import org.springframework.data.domain.Pageable; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.List; @RestController public class FavoriteController { private final FavoriteService favoriteService; public FavoriteController(final FavoriteService favoriteService) { this.favoriteService = favoriteService; } @PostMapping("/favorites") public Favorite addFavorite(@RequestBody Favorite favorite) { return favoriteService.addFavorite(favorite); } @GetMapping("/favorites") public List<Favorite> findFavorites(@RequestParam(value = "userId", required = false) String userId, @RequestParam(value = "appId", required = false) String appId, Pageable page) { return favoriteService.search(userId, appId, page); } @DeleteMapping("/favorites/{favoriteId}") public void deleteFavorite(@PathVariable long favoriteId) { favoriteService.deleteFavorite(favoriteId); } @PutMapping("/favorites/{favoriteId}") public void toTop(@PathVariable long favoriteId) { favoriteService.adjustFavoriteToFirst(favoriteId); } }
-1
apolloconfig/apollo
3,658
update apolloconfig.com domain
## What's the purpose of this PR update apolloconfig.com domain
nobodyiam
2021-05-02T02:26:41Z
2021-05-02T02:31:15Z
a1b19ace8e6eb73e791f89ad30e2210003ba9d33
e1a6cf9cd40300fad156b6b87835c27b5e378f16
update apolloconfig.com domain. ## What's the purpose of this PR update apolloconfig.com domain
./apollo-core/src/test/resources/META-INF/services/com.ctrip.framework.foundation.internals.ServiceBootstrapTest$Interface4
com.ctrip.framework.foundation.internals.ServiceBootstrapTest$Interface1Impl
com.ctrip.framework.foundation.internals.ServiceBootstrapTest$Interface1Impl
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./README.md
<img src="https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/logo/logo-simple.png" alt="apollo-logo" width="40%"> # Apollo - A reliable configuration management system [![Build Status](https://github.com/ctripcorp/apollo/workflows/build/badge.svg)](https://github.com/ctripcorp/apollo/actions) [![GitHub Release](https://img.shields.io/github/release/ctripcorp/apollo.svg)](https://github.com/ctripcorp/apollo/releases) [![Maven Central Repo](https://img.shields.io/maven-central/v/com.ctrip.framework.apollo/apollo.svg)](https://mvnrepository.com/artifact/com.ctrip.framework.apollo/apollo-client) [![codecov.io](https://codecov.io/github/ctripcorp/apollo/coverage.svg?branch=master)](https://codecov.io/github/ctripcorp/apollo?branch=master) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) Apollo(阿波罗)是携程框架部门研发的分布式配置中心,能够集中化管理应用不同环境、不同集群的配置,配置修改后能够实时推送到应用端,并且具备规范的权限、流程治理等特性,适用于微服务配置管理场景。 服务端基于Spring Boot和Spring Cloud开发,打包后可以直接运行,不需要额外安装Tomcat等应用容器。 Java客户端不依赖任何框架,能够运行于所有Java运行时环境,同时对Spring/Spring Boot环境也有较好的支持。 .Net客户端不依赖任何框架,能够运行于所有.Net运行时环境。 更多产品介绍参见[Apollo配置中心介绍](https://ctripcorp.github.io/apollo/#/zh/design/apollo-introduction) 本地快速部署请参见[Quick Start](https://ctripcorp.github.io/apollo/#/zh/deployment/quick-start) 演示环境(Demo): - [106.54.227.205](http://106.54.227.205/) - 账号/密码:apollo/admin > 如访问github速度缓慢,可以访问[gitee镜像](https://gitee.com/nobodyiam/apollo),不定期同步 # Screenshots ![配置界面](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/apollo-home-screenshot.jpg) # Features * **统一管理不同环境、不同集群的配置** * Apollo提供了一个统一界面集中式管理不同环境(environment)、不同集群(cluster)、不同命名空间(namespace)的配置。 * 同一份代码部署在不同的集群,可以有不同的配置,比如zk的地址等 * 通过命名空间(namespace)可以很方便的支持多个不同应用共享同一份配置,同时还允许应用对共享的配置进行覆盖 * 配置界面支持多语言(中文,English) * **配置修改实时生效(热发布)** * 用户在Apollo修改完配置并发布后,客户端能实时(1秒)接收到最新的配置,并通知到应用程序。 * **版本发布管理** * 所有的配置发布都有版本概念,从而可以方便的支持配置的回滚。 * **灰度发布** * 支持配置的灰度发布,比如点了发布后,只对部分应用实例生效,等观察一段时间没问题后再推给所有应用实例。 * **权限管理、发布审核、操作审计** * 应用和配置的管理都有完善的权限管理机制,对配置的管理还分为了编辑和发布两个环节,从而减少人为的错误。 * 所有的操作都有审计日志,可以方便的追踪问题。 * **客户端配置信息监控** * 可以方便的看到配置在被哪些实例使用 * **提供Java和.Net原生客户端** * 提供了Java和.Net的原生客户端,方便应用集成 * 支持Spring Placeholder,Annotation和Spring Boot的ConfigurationProperties,方便应用使用(需要Spring 3.1.1+) * 同时提供了Http接口,非Java和.Net应用也可以方便的使用 * **提供开放平台API** * Apollo自身提供了比较完善的统一配置管理界面,支持多环境、多数据中心配置管理、权限、流程治理等特性。 * 不过Apollo出于通用性考虑,对配置的修改不会做过多限制,只要符合基本的格式就能够保存。 * 在我们的调研中发现,对于有些使用方,它们的配置可能会有比较复杂的格式,如xml, json,需要对格式做校验。 * 还有一些使用方如DAL,不仅有特定的格式,而且对输入的值也需要进行校验后方可保存,如检查数据库、用户名和密码是否匹配。 * 对于这类应用,Apollo支持应用方通过开放接口在Apollo进行配置的修改和发布,并且具备完善的授权和权限控制 * **部署简单** * 配置中心作为基础服务,可用性要求非常高,这就要求Apollo对外部依赖尽可能地少 * 目前唯一的外部依赖是MySQL,所以部署非常简单,只要安装好Java和MySQL就可以让Apollo跑起来 * Apollo还提供了打包脚本,一键就可以生成所有需要的安装包,并且支持自定义运行时参数 # Usage 1. [应用接入指南](https://ctripcorp.github.io/apollo/#/zh/usage/apollo-user-guide) 2. [Java客户端使用指南](https://ctripcorp.github.io/apollo/#/zh/usage/java-sdk-user-guide) 3. [.Net客户端使用指南](https://ctripcorp.github.io/apollo/#/zh/usage/dotnet-sdk-user-guide) 4. [其它语言客户端接入指南](https://ctripcorp.github.io/apollo/#/zh/usage/other-language-client-user-guide) 5. [Apollo开放平台接入指南](https://ctripcorp.github.io/apollo/#/zh/usage/apollo-open-api-platform) 6. [Apollo使用场景和示例代码](https://github.com/ctripcorp/apollo-use-cases) 7. [Apollo实践案例](https://ctripcorp.github.io/apollo/#/zh/usage/apollo-user-practices) 8. [Apollo安全相关最佳实践](https://ctripcorp.github.io/apollo/#/zh/usage/apollo-user-guide?id=_71-%e5%ae%89%e5%85%a8%e7%9b%b8%e5%85%b3) # Design * [Apollo配置中心设计](https://ctripcorp.github.io/apollo/#/zh/design/apollo-design) * [Apollo核心概念之“Namespace”](https://ctripcorp.github.io/apollo/#/zh/design/apollo-core-concept-namespace) * [Apollo配置中心架构剖析](https://mp.weixin.qq.com/s/-hUaQPzfsl9Lm3IqQW3VDQ) * [Apollo源码解析](http://www.iocoder.cn/categories/Apollo/)(据说Apollo非常适合作为初学者第一个通读源码学习的分布式中间件产品) # Development * [Apollo开发指南](https://ctripcorp.github.io/apollo/#/zh/development/apollo-development-guide) * Code Styles * [Eclipse Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/eclipse-java-google-style.xml) * [Intellij Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/intellij-java-google-style.xml) # Deployment * [Quick Start](https://ctripcorp.github.io/apollo/#/zh/deployment/quick-start) * [分布式部署指南](https://ctripcorp.github.io/apollo/#/zh/deployment/distributed-deployment-guide) # Release Notes * [版本发布历史](https://github.com/ctripcorp/apollo/releases) # FAQ * [常见问题回答](https://ctripcorp.github.io/apollo/#/zh/faq/faq) * [部署&开发遇到的常见问题](https://ctripcorp.github.io/apollo/#/zh/faq/common-issues-in-deployment-and-development-phase) # Presentation * [携程开源配置中心Apollo的设计与实现](http://www.itdks.com/dakalive/detail/3420) * [Slides](https://myslide.cn/slides/10168) * [配置中心,让微服务更『智能』](https://2018.qconshanghai.com/presentation/799) * [Slides](https://myslide.cn/slides/10035) # Publication * [开源配置中心Apollo的设计与实现](https://www.infoq.cn/article/open-source-configuration-center-apollo) * [配置中心,让微服务更『智能』](https://mp.weixin.qq.com/s/iDmYJre_ULEIxuliu1EbIQ) # Support <table> <thead> <th>Apollo技术支持②群<br />群号:904287263(未满)</th> <th>Apollo技术支持⑤群<br />群号:914839843(已满)</th> <th>Apollo技术支持④群<br />群号:516773934(已满)</th> <th>Apollo技术支持③群<br />群号:742035428(已满)</th> <th>Apollo技术支持①群<br />群号:375526581(已满)</th> </thead> <tbody> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-2.png" alt="tech-support-qq-2"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-5.png" alt="tech-support-qq-5"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-4.png" alt="tech-support-qq-4"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-3.png" alt="tech-support-qq-3"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-1.png" alt="tech-support-qq-1"></td> </tr> </tbody> </table> # Contribution Please make sure to read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making a pull request. Thanks for all the people who contributed to Apollo! <a href="https://github.com/ctripcorp/apollo/graphs/contributors"><img src="https://opencollective.com/apollo/contributors.svg?width=880&button=false" /></a> # License The project is licensed under the [Apache 2 license](https://github.com/ctripcorp/apollo/blob/master/LICENSE). # Known Users > 按照登记顺序排序,更多接入公司,欢迎在[https://github.com/ctripcorp/apollo/issues/451](https://github.com/ctripcorp/apollo/issues/451)登记(仅供开源用户参考) <table> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ctrip.png" alt="携程"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bluestone.png" alt="青石证券"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sagreen.png" alt="沙绿"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/umetrip.jpg" alt="航旅纵横"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhuanzhuan.png" alt="58转转"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/phone580.png" alt="蜂助手"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hainan-airlines.png" alt="海南航空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cvte.png" alt="CVTE"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mainbo.jpg" alt="明博教育"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/madailicai.png" alt="麻袋理财"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mxnavi.jpg" alt="美行科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fshows.jpg" alt="首展科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/feezu.png" alt="易微行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rencaijia.png" alt="人才加"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/keking.png" alt="凯京集团"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/leoao.png" alt="乐刻运动"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dji.png" alt="大疆"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kkmh.png" alt="快看漫画"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wolaidai.png" alt="我来贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xsrj.png" alt="虚实软件"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yanxuan.png" alt="网易严选"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sjzg.png" alt="视觉中国"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zc360.png" alt="资产360"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ecarx.png" alt="亿咖通"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/5173.png" alt="5173"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hujiang.png" alt="沪江"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/163yun.png" alt="网易云基础服务"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cash-bus.png" alt="现金巴士"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/smartisan.png" alt="锤子科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/toodc.png" alt="头等仓"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/juneyaoair.png" alt="吉祥航空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/263mobile.png" alt="263移动通信"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/toutoujinrong.png" alt="投投金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mytijian.png" alt="每天健康"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maiyabank.png" alt="麦芽金服"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fengunion.png" alt="蜂向科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/geex-logo.png" alt="即科金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/beike.png" alt="贝壳网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/youzan.png" alt="有赞"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yunjihuitong.png" alt="云集汇通"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rhinotech.png" alt="犀牛瀚海科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/nxin.png" alt="农信互联"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mgzf.png" alt="蘑菇租房"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/huli-logo.png" alt="狐狸金服"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mandao.png" alt="漫道集团"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/enmonster.png" alt="怪兽充电"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/nanguazufang.png" alt="南瓜租房"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shitoujinrong.png" alt="石投金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tubatu.png" alt="土巴兔"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/payh_logo.png" alt="平安银行"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xinxindai.png" alt="新新贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chrtc.png" alt="中国华戎科技集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tuya_logo.png" alt="涂鸦智能"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/szlcsc.jpg" alt="立创商城"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hairongyi.png" alt="乐赚金服"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kxqc.png" alt="开心汽车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ppcredit.png" alt="乐赚金服"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/primeton.png" alt="普元信息"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hoskeeper.png" alt="医帮管家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fula.png" alt="付啦信用卡管家"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/uzai.png" alt="悠哉网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/91wutong.png" alt="梧桐诚选"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ppdai.png" alt="拍拍贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xinyongfei.png" alt="信用飞"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dxy.png" alt="丁香园"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ghtech.png" alt="国槐科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/qbb.png" alt="亲宝宝"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/huawei_logo.png" alt="华为视频直播"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/weiboyi.png" alt="微播易"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ofpay.png" alt="欧飞"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mishuo.png" alt="迷说"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yixia.png" alt="一下科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/daocloud.png" alt="DaoCloud"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cnvex.png" alt="汽摩交易所"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/100tal.png" alt="好未来教育集团"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ainirobot.png" alt="猎户星空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhuojian.png" alt="卓健科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/enjoyor.png" alt="银江股份"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tuhu.png" alt="途虎养车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/homedo.png" alt="河姆渡"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xwbank.png" alt="新网银行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ctspcl.png" alt="中旅安信云贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/meiyou.png" alt="美柚"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zkh-logo.png" alt="震坤行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wgss.png" alt="万谷盛世"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/plateno.png" alt="铂涛旅行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lifesense.png" alt="乐心"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/reachmedia.png" alt="亿投传媒"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/guxiansheng.png" alt="股先生"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/caixuetang.png" alt="财学堂"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/4399.png" alt="4399"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/autohome.png" alt="汽车之家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mbcaijing.png" alt="面包财经"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hoopchina.png" alt="虎扑"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sohu-auto.png" alt="搜狐汽车"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/liangfuzhengxin.png" alt="量富征信"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maihaoche.png" alt="卖好车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zyiot.jpg" alt="中移物联网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/biauto.png" alt="易车网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maiyaole.png" alt="一药网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiaoying.png" alt="小影"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/caibeike.png" alt="彩贝壳"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yeelight.png" alt="YEELIGHT"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/itsgmu.png" alt="积目"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/acmedcare.png" alt="极致医疗"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jinhui365.png" alt="金汇金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/900etrip.png" alt="久柏易游"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/24xiaomai.png" alt="小麦铺"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/vvic.png" alt="搜款网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mizlicai.png" alt="米庄理财"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bjt.png" alt="贝吉塔网络科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/weimob.png" alt="微盟"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kada.png" alt="网易卡搭"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kapbook.png" alt="股书"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jumore.png" alt="聚贸"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bimface.png" alt="广联达bimface"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/globalgrow.png" alt="环球易购"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jollychic.png" alt="浙江执御"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/2dfire.jpg" alt="二维火"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shopin.png" alt="上品"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/inspur.png" alt="浪潮集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ngarihealth.png" alt="纳里健康"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/oraro.png" alt="橙红科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dragonpass.png" alt="龙腾出行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lizhi.fm.png" alt="荔枝"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/htd.png" alt="汇通达"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yunrong.png" alt="云融金科"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tszg360.png" alt="天生掌柜"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rongplus.png" alt="容联光辉"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/intellif.png" alt="云天励飞"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jiayundata.png" alt="嘉云数据"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zts.png" alt="中泰证券网络金融部"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/163dun.png" alt="网易易盾"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiangwushuo.png" alt="享物说"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sto.png" alt="申通"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jinhe.png" alt="金和网络"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/2345.png" alt="二三四五"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chtwm.jpg" alt="恒天财富"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/uweixin.png" alt="沐雪微信"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wzeye.png" alt="温州医科大学附属眼视光医院"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/10010pay.png" alt="联通支付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shanshu.png" alt="杉数科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fenlibao.png" alt="分利宝"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hetao101.png" alt="核桃编程"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiaohongshu.png" alt="小红书"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/blissmall.png" alt="幸福西饼"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ky-express.png" alt="跨越速运"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/oyohotels.png" alt="OYO"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/100-me.png" alt="叮咚买菜"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhidaohulian.jpg" alt="智道网联"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xueqiu.jpg" alt="雪球"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/autocloudpro.png" alt="车通云"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dadaabc.png" alt="哒哒英语"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xedaojia.jpg" alt="小E微店"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/daling.png" alt="达令家"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/renliwo.png" alt="人力窝"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mocire.jpg" alt="嘉美在线"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/uepay.png" alt="极易付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wdom.png" alt="智慧开源"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cheshiku.png" alt="车仕库"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/taimeitech.png" alt="太美医疗科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yilianbaihui.png" alt="亿联百汇"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhoupu123.png" alt="舟谱数据"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/frxs.png" alt="芙蓉兴盛"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/beastshop.png" alt="野兽派"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kaishustory.png" alt="凯叔讲故事"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/haodf.png" alt="好大夫在线"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/insyunmi.png" alt="云幂信息技术"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/duiba.png" alt="兑吧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/9ji.png" alt="九机网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sui.png" alt="随手科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/aixiangdao.png" alt="万谷盛世"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yunzhangfang.png" alt="云账房"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yuantutech.png" alt="浙江远图互联"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/qk365.png" alt="青客公寓"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/eastmoney.png" alt="东方财富"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jikexiu.png" alt="极客修"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/meix.png" alt="美市科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zto.png" alt="中通快递"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/e6yun.png" alt="易流科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiaoyuanzhao.png" alt="实习僧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dalingjia.png" alt="达令家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/secoo.png" alt="寺库"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lianlianpay.png" alt="连连支付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhongan.png" alt="众安保险"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/360jinrong.png" alt="360金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/caschina.png" alt="中航服商旅"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ke.png" alt="贝壳"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yeahmobi.png" alt="Yeahmobi易点天下"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/idengyun.png" alt="北京登云美业网络科技有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jinher.png" alt="金和网络"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/komect.png" alt="中移(杭州)信息技术有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/beisen.png" alt="北森"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/log56.png" alt="合肥维天运通"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/meboth.png" alt="北京蜜步科技有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/postop.png" alt="术康"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rfchina.png" alt="富力集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tfxing.png" alt="天府行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/8travelpay.png" alt="八商山"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/centaline.png" alt="中原地产"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zkyda.png" alt="智科云达"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/house730.png" alt="中原730"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/pagoda.png" alt="百果园"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bolome.png" alt="波罗蜜"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xignite.png" alt="Xignite"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/aduer.png" alt="杭州有云科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jojoreading.png" alt="成都书声科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sweetome.png" alt="斯维登集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/vipthink.png" alt="广东快乐种子科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tongxuecool.png" alt="上海盈翼文化传播有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sccfc.png" alt="上海尚诚消费金融股份有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ziroom.png" alt="自如网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jd.png" alt="京东"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rabbitpre.png" alt="兔展智能"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhubei.png" alt="竹贝"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/imile.png" alt="iMile(中东)"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/helloglobal.png" alt="哈罗出行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhaopin.png" alt="智联招聘"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/acadsoc.png" alt="阿卡索"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mojory.png" alt="妙知旅"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chengduoduo.png" alt="程多多"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/baojunev.png" alt="上汽通用五菱"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/leyan.png" alt="乐言科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dushu.png" alt="樊登读书"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zyiz.png" alt="找一找教程网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bppc.png" alt="中油碧辟石油有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shanglv51.png" alt="四川商旅无忧科技服务有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/waijiao365.png" alt="懿鸢网络科技(上海)有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gaoding.jpg" alt="稿定科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ricacorp.png" alt="搵樓 - 利嘉閣"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/t3go.png" alt="南京领行科技股份有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mokahr.jpg" alt="北京希瑞亚斯科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/printrainbow.png" alt="印彩虹印刷公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/milliontech.png" alt="Million Tech"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/guoguokeji.jpg" alt="果果科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/airkunming.png" alt="昆明航空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/5i5j.png" alt="我爱我家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gjzq.png" alt="国金证券"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/enjoymusic.jpg" alt="不亦乐乎"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cnhnb.png" alt="惠农网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/daoklab.jpg" alt="成都道壳"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ausnutria.jpg" alt="澳优乳业"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/deiyoudian.png" alt="河南有态度信息科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ezhiyang.png" alt="智阳第一人力"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shie.png" alt="上海保险交易所"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wsecar.png" alt="万顺叫车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shouqinba.jpg" alt="收钱吧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/baozun.png" alt="宝尊电商"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xbnwl.png" alt="喜百年供应链"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gwwisdom.png" alt="南京观为智慧软件科技有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ztrip.png" alt="在途商旅"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hualala.png" alt="哗啦啦"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xin.png" alt="优信二手车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maycur.png" alt="每刻科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bullyun.png" alt="杭州蛮牛"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bestpay.png" alt="翼支付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mockuai.png" alt="魔筷科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ct108.png" alt="畅唐网络"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jusdaglobal.jpg" alt="准时达"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/izaodao.png" alt="早道网校"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ovopark.jpg" alt="万店掌"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/funstory.jpg" alt="推文科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lemonbox.png" alt="Lemonbox"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/polyt.png" alt="保利票务"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chipwing.png" alt="芯翼科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/czbank.png" alt="浙商银行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/czbyqy.png" alt="易企银科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yundun.jpg" alt="上海云盾"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gaiaworks.jpg" alt="苏州盖雅信息技术有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mengxiang.png" alt="爱库存"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jidouauto.png" alt="极豆车联网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ipalfish.png" alt="伴鱼少儿英语"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/iqboard.png" alt="锐达科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/koolearn.png" alt="新东方在线"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kingcome.png" alt="金康高科"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/soulapp.png" alt="soul"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ezrpro.png" alt="驿氪"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hc360.png" alt="慧聪"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/21cp.png" alt="中塑在线"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/goinglink.jpg" alt="甄云科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/aitrace.jpg" alt="追溯科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/moqipobing.png" alt="玩吧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cassan.png" alt="广州卡桑信息技术有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shuidichou.png" alt="水滴"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kuwo.png" alt="酷我音乐"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mi.png" alt="小米"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mvmyun.png" alt="今典"></td> </tr> </table> # Awards <img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/awards/oschina-2018-award.jpg" width="240px" alt="2018 年度最受欢迎中国开源软件"> # Stargazers over time [![Stargazers over time](https://starcharts.herokuapp.com/ctripcorp/apollo.svg)](https://starcharts.herokuapp.com/ctripcorp/apollo)
<img src="https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/logo/logo-simple.png" alt="apollo-logo" width="40%"> # Apollo - A reliable configuration management system [![Build Status](https://github.com/ctripcorp/apollo/workflows/build/badge.svg)](https://github.com/ctripcorp/apollo/actions) [![GitHub Release](https://img.shields.io/github/release/ctripcorp/apollo.svg)](https://github.com/ctripcorp/apollo/releases) [![Maven Central Repo](https://img.shields.io/maven-central/v/com.ctrip.framework.apollo/apollo.svg)](https://mvnrepository.com/artifact/com.ctrip.framework.apollo/apollo-client) [![codecov.io](https://codecov.io/github/ctripcorp/apollo/coverage.svg?branch=master)](https://codecov.io/github/ctripcorp/apollo?branch=master) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) Apollo is a reliable configuration management system. It can centrally manage the configurations of different applications and different clusters. It is suitable for microservice configuration management scenarios. The server side is developed based on Spring Boot and Spring Cloud, which can simply run without the need to install additional application containers such as Tomcat. The Java SDK does not rely on any framework and can run in all Java runtime environments. It also has good support for Spring/Spring Boot environments. The .Net SDK does not rely on any framework and can run in all .Net runtime environments. For more detials of the product introduction, please refer [Introduction to Apollo Configuration Center](https://ctripcorp.github.io/apollo/#/zh/design/apollo-introduction). For local demo purpose, please refer [Quick Start](https://ctripcorp.github.io/apollo/#/zh/deployment/quick-start). Demo Environment: - [http://106.54.227.205](http://106.54.227.205/) - User/Password: apollo/admin # Screenshots ![Screenshot](https://raw.githubusercontent.com/ctripcorp/apollo/master/docs/en/images/apollo-home-screenshot.jpg) # Features * **Unified management of the configurations of different environments and different clusters** * Apollo provides a unified interface to centrally manage the configurations of different environments, different clusters, and different namespaces * The same codebase could have different configurations when deployed in different clusters * With the namespace concept, it is easy to support multiple applications to share the same configurations, while also allowing them to customize the configurations * Multiple languages is provided in user interface (currently Chinese and English) * **Configuration changes takes effect in real time (hot release)** * After the user modified the configuration and released it in Apollo, the sdk will receive the latest configurations in real time (1 second) and notify the application * **Release version management** * Every configuration releases are versioned, which is friendly to support configuration rollback * **Grayscale release** * Support grayscale configuration release, for example, after clicking release, it will only take effect for some application instances. After a period of observation, we could push the configurations to all application instances if there is no problem * **Authorization management, release approval and operation audit** * Great authorization mechanism is designed for applications and configurations management, and the management of configurations is divided into two operations: editing and publishing, therefore greatly reducing human errors * All operations have audit logs for easy tracking of problems * **Client side configuration information monitoring** * It's very easy to see which instances are using the configurations and what versions they are using * **Rich SDKs available** * Provides native sdks of Java and .Net to facilitate application integration * Support Spring Placeholder, Annotation and Spring Boot ConfigurationProperties for easy application use (requires Spring 3.1.1+) * Http APIs are provided, so non-Java and .Net applications can integrate conveniently * Rich third party sdks are also available, e.g. Golang, Python, NodeJS, PHP, C, etc * **Open platform API** * Apollo itself provides a unified configuration management interface, which supports features such as multi-environment, multi-data center configuration management, permissions, and process governance * However, for the sake of versatility, Apollo will not put too many restrictions on the modification of the configuration, as long as it conforms to the basic format, it can be saved. * In our research, we found that for some users, their configurations may have more complicated formats, such as xml, json, and the format needs to be verified * There are also some users such as DAL, which not only have a specific format, but also need to verify the entered value before saving, such as checking whether the database, username and password match * For this type of application, Apollo allows the application to modify and release configurations through open APIs, which has great authorization and permission control mechanism built in * **Simple deployment** * As an infrastructure service, the configuration center has very high availability requirements, which forces Apollo to rely on external dependencies as little as possible * Currently, the only external dependency is MySQL, so the deployment is very simple. Apollo can run as long as Java and MySQL are installed * Apollo also provides a packaging script, which can generate all required installation packages with just one click, and supports customization of runtime parameters # Usage 1. [Apollo User Guide](https://ctripcorp.github.io/apollo/#/zh/usage/apollo-user-guide) 2. [Java SDK User Guide](https://ctripcorp.github.io/apollo/#/zh/usage/java-sdk-user-guide) 3. [.Net SDK user Guide](https://ctripcorp.github.io/apollo/#/zh/usage/dotnet-sdk-user-guide) 4. [Third Party SDK User Guide](https://ctripcorp.github.io/apollo/#/zh/usage/third-party-sdks-user-guide) 5. [Other Language Client User Guide](https://ctripcorp.github.io/apollo/#/zh/usage/other-language-client-user-guide) 6. [Apollo Open APIs](https://ctripcorp.github.io/apollo/#/zh/usage/apollo-open-api-platform) 7. [Apollo Use Cases](https://github.com/ctripcorp/apollo-use-cases) 8. [Apollo User Practices](https://ctripcorp.github.io/apollo/#/zh/usage/apollo-user-practices) 9. [Apollo Security Best Practices](https://ctripcorp.github.io/apollo/#/zh/usage/apollo-user-guide?id=_71-%e5%ae%89%e5%85%a8%e7%9b%b8%e5%85%b3) # Design * [Apollo Design](https://ctripcorp.github.io/apollo/#/zh/design/apollo-design) * [Apollo Core Concept - Namespace](https://ctripcorp.github.io/apollo/#/zh/design/apollo-core-concept-namespace) * [Apollo Architecture Analysis](https://mp.weixin.qq.com/s/-hUaQPzfsl9Lm3IqQW3VDQ) * [Apollo Source Code Explanation](http://www.iocoder.cn/categories/Apollo/) # Development * [Apollo Development Guide](https://ctripcorp.github.io/apollo/#/zh/development/apollo-development-guide) * Code Styles * [Eclipse Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/eclipse-java-google-style.xml) * [Intellij Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/intellij-java-google-style.xml) # Deployment * [Quick Start](https://ctripcorp.github.io/apollo/#/zh/deployment/quick-start) * [Distributed Deployment Guide](https://ctripcorp.github.io/apollo/#/zh/deployment/distributed-deployment-guide) # Release Notes * [Releases](https://github.com/ctripcorp/apollo/releases) # FAQ * [FAQ](https://ctripcorp.github.io/apollo/#/zh/faq/faq) * [Common Issues in Deployment & Development Phase](https://ctripcorp.github.io/apollo/#/zh/faq/common-issues-in-deployment-and-development-phase) # Presentation * [Design and Implementation Details of Apollo](http://www.itdks.com/dakalive/detail/3420) * [Slides](https://myslide.cn/slides/10168) * [Configuration Center Makes Microservices Smart](https://2018.qconshanghai.com/presentation/799) * [Slides](https://myslide.cn/slides/10035) # Publication * [Design and Implementation Details of Apollo](https://www.infoq.cn/article/open-source-configuration-center-apollo) * [Configuration Center Makes Microservices Smart](https://mp.weixin.qq.com/s/iDmYJre_ULEIxuliu1EbIQ) # Contribution Please make sure to read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making a pull request. Thanks for all the people who contributed to Apollo! <a href="https://github.com/ctripcorp/apollo/graphs/contributors"><img src="https://opencollective.com/apollo/contributors.svg?width=880&button=false" /></a> # License The project is licensed under the [Apache 2 license](https://github.com/ctripcorp/apollo/blob/master/LICENSE). # Known Users > Sorted by registration order,users are welcome to register in [https://github.com/ctripcorp/apollo/issues/451](https://github.com/ctripcorp/apollo/issues/451) (reference purpose only for the community) <table> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ctrip.png" alt="携程"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bluestone.png" alt="青石证券"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sagreen.png" alt="沙绿"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/umetrip.jpg" alt="航旅纵横"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhuanzhuan.png" alt="58转转"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/phone580.png" alt="蜂助手"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hainan-airlines.png" alt="海南航空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cvte.png" alt="CVTE"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mainbo.jpg" alt="明博教育"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/madailicai.png" alt="麻袋理财"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mxnavi.jpg" alt="美行科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fshows.jpg" alt="首展科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/feezu.png" alt="易微行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rencaijia.png" alt="人才加"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/keking.png" alt="凯京集团"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/leoao.png" alt="乐刻运动"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dji.png" alt="大疆"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kkmh.png" alt="快看漫画"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wolaidai.png" alt="我来贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xsrj.png" alt="虚实软件"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yanxuan.png" alt="网易严选"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sjzg.png" alt="视觉中国"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zc360.png" alt="资产360"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ecarx.png" alt="亿咖通"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/5173.png" alt="5173"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hujiang.png" alt="沪江"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/163yun.png" alt="网易云基础服务"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cash-bus.png" alt="现金巴士"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/smartisan.png" alt="锤子科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/toodc.png" alt="头等仓"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/juneyaoair.png" alt="吉祥航空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/263mobile.png" alt="263移动通信"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/toutoujinrong.png" alt="投投金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mytijian.png" alt="每天健康"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maiyabank.png" alt="麦芽金服"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fengunion.png" alt="蜂向科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/geex-logo.png" alt="即科金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/beike.png" alt="贝壳网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/youzan.png" alt="有赞"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yunjihuitong.png" alt="云集汇通"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rhinotech.png" alt="犀牛瀚海科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/nxin.png" alt="农信互联"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mgzf.png" alt="蘑菇租房"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/huli-logo.png" alt="狐狸金服"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mandao.png" alt="漫道集团"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/enmonster.png" alt="怪兽充电"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/nanguazufang.png" alt="南瓜租房"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shitoujinrong.png" alt="石投金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tubatu.png" alt="土巴兔"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/payh_logo.png" alt="平安银行"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xinxindai.png" alt="新新贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chrtc.png" alt="中国华戎科技集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tuya_logo.png" alt="涂鸦智能"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/szlcsc.jpg" alt="立创商城"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hairongyi.png" alt="乐赚金服"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kxqc.png" alt="开心汽车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ppcredit.png" alt="乐赚金服"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/primeton.png" alt="普元信息"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hoskeeper.png" alt="医帮管家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fula.png" alt="付啦信用卡管家"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/uzai.png" alt="悠哉网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/91wutong.png" alt="梧桐诚选"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ppdai.png" alt="拍拍贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xinyongfei.png" alt="信用飞"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dxy.png" alt="丁香园"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ghtech.png" alt="国槐科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/qbb.png" alt="亲宝宝"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/huawei_logo.png" alt="华为视频直播"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/weiboyi.png" alt="微播易"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ofpay.png" alt="欧飞"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mishuo.png" alt="迷说"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yixia.png" alt="一下科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/daocloud.png" alt="DaoCloud"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cnvex.png" alt="汽摩交易所"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/100tal.png" alt="好未来教育集团"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ainirobot.png" alt="猎户星空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhuojian.png" alt="卓健科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/enjoyor.png" alt="银江股份"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tuhu.png" alt="途虎养车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/homedo.png" alt="河姆渡"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xwbank.png" alt="新网银行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ctspcl.png" alt="中旅安信云贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/meiyou.png" alt="美柚"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zkh-logo.png" alt="震坤行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wgss.png" alt="万谷盛世"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/plateno.png" alt="铂涛旅行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lifesense.png" alt="乐心"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/reachmedia.png" alt="亿投传媒"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/guxiansheng.png" alt="股先生"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/caixuetang.png" alt="财学堂"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/4399.png" alt="4399"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/autohome.png" alt="汽车之家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mbcaijing.png" alt="面包财经"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hoopchina.png" alt="虎扑"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sohu-auto.png" alt="搜狐汽车"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/liangfuzhengxin.png" alt="量富征信"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maihaoche.png" alt="卖好车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zyiot.jpg" alt="中移物联网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/biauto.png" alt="易车网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maiyaole.png" alt="一药网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiaoying.png" alt="小影"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/caibeike.png" alt="彩贝壳"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yeelight.png" alt="YEELIGHT"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/itsgmu.png" alt="积目"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/acmedcare.png" alt="极致医疗"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jinhui365.png" alt="金汇金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/900etrip.png" alt="久柏易游"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/24xiaomai.png" alt="小麦铺"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/vvic.png" alt="搜款网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mizlicai.png" alt="米庄理财"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bjt.png" alt="贝吉塔网络科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/weimob.png" alt="微盟"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kada.png" alt="网易卡搭"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kapbook.png" alt="股书"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jumore.png" alt="聚贸"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bimface.png" alt="广联达bimface"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/globalgrow.png" alt="环球易购"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jollychic.png" alt="浙江执御"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/2dfire.jpg" alt="二维火"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shopin.png" alt="上品"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/inspur.png" alt="浪潮集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ngarihealth.png" alt="纳里健康"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/oraro.png" alt="橙红科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dragonpass.png" alt="龙腾出行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lizhi.fm.png" alt="荔枝"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/htd.png" alt="汇通达"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yunrong.png" alt="云融金科"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tszg360.png" alt="天生掌柜"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rongplus.png" alt="容联光辉"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/intellif.png" alt="云天励飞"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jiayundata.png" alt="嘉云数据"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zts.png" alt="中泰证券网络金融部"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/163dun.png" alt="网易易盾"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiangwushuo.png" alt="享物说"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sto.png" alt="申通"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jinhe.png" alt="金和网络"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/2345.png" alt="二三四五"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chtwm.jpg" alt="恒天财富"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/uweixin.png" alt="沐雪微信"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wzeye.png" alt="温州医科大学附属眼视光医院"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/10010pay.png" alt="联通支付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shanshu.png" alt="杉数科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fenlibao.png" alt="分利宝"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hetao101.png" alt="核桃编程"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiaohongshu.png" alt="小红书"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/blissmall.png" alt="幸福西饼"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ky-express.png" alt="跨越速运"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/oyohotels.png" alt="OYO"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/100-me.png" alt="叮咚买菜"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhidaohulian.jpg" alt="智道网联"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xueqiu.jpg" alt="雪球"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/autocloudpro.png" alt="车通云"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dadaabc.png" alt="哒哒英语"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xedaojia.jpg" alt="小E微店"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/daling.png" alt="达令家"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/renliwo.png" alt="人力窝"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mocire.jpg" alt="嘉美在线"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/uepay.png" alt="极易付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wdom.png" alt="智慧开源"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cheshiku.png" alt="车仕库"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/taimeitech.png" alt="太美医疗科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yilianbaihui.png" alt="亿联百汇"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhoupu123.png" alt="舟谱数据"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/frxs.png" alt="芙蓉兴盛"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/beastshop.png" alt="野兽派"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kaishustory.png" alt="凯叔讲故事"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/haodf.png" alt="好大夫在线"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/insyunmi.png" alt="云幂信息技术"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/duiba.png" alt="兑吧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/9ji.png" alt="九机网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sui.png" alt="随手科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/aixiangdao.png" alt="万谷盛世"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yunzhangfang.png" alt="云账房"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yuantutech.png" alt="浙江远图互联"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/qk365.png" alt="青客公寓"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/eastmoney.png" alt="东方财富"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jikexiu.png" alt="极客修"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/meix.png" alt="美市科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zto.png" alt="中通快递"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/e6yun.png" alt="易流科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiaoyuanzhao.png" alt="实习僧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dalingjia.png" alt="达令家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/secoo.png" alt="寺库"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lianlianpay.png" alt="连连支付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhongan.png" alt="众安保险"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/360jinrong.png" alt="360金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/caschina.png" alt="中航服商旅"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ke.png" alt="贝壳"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yeahmobi.png" alt="Yeahmobi易点天下"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/idengyun.png" alt="北京登云美业网络科技有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jinher.png" alt="金和网络"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/komect.png" alt="中移(杭州)信息技术有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/beisen.png" alt="北森"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/log56.png" alt="合肥维天运通"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/meboth.png" alt="北京蜜步科技有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/postop.png" alt="术康"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rfchina.png" alt="富力集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tfxing.png" alt="天府行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/8travelpay.png" alt="八商山"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/centaline.png" alt="中原地产"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zkyda.png" alt="智科云达"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/house730.png" alt="中原730"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/pagoda.png" alt="百果园"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bolome.png" alt="波罗蜜"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xignite.png" alt="Xignite"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/aduer.png" alt="杭州有云科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jojoreading.png" alt="成都书声科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sweetome.png" alt="斯维登集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/vipthink.png" alt="广东快乐种子科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tongxuecool.png" alt="上海盈翼文化传播有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sccfc.png" alt="上海尚诚消费金融股份有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ziroom.png" alt="自如网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jd.png" alt="京东"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rabbitpre.png" alt="兔展智能"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhubei.png" alt="竹贝"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/imile.png" alt="iMile(中东)"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/helloglobal.png" alt="哈罗出行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhaopin.png" alt="智联招聘"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/acadsoc.png" alt="阿卡索"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mojory.png" alt="妙知旅"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chengduoduo.png" alt="程多多"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/baojunev.png" alt="上汽通用五菱"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/leyan.png" alt="乐言科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dushu.png" alt="樊登读书"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zyiz.png" alt="找一找教程网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bppc.png" alt="中油碧辟石油有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shanglv51.png" alt="四川商旅无忧科技服务有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/waijiao365.png" alt="懿鸢网络科技(上海)有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gaoding.jpg" alt="稿定科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ricacorp.png" alt="搵樓 - 利嘉閣"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/t3go.png" alt="南京领行科技股份有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mokahr.jpg" alt="北京希瑞亚斯科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/printrainbow.png" alt="印彩虹印刷公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/milliontech.png" alt="Million Tech"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/guoguokeji.jpg" alt="果果科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/airkunming.png" alt="昆明航空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/5i5j.png" alt="我爱我家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gjzq.png" alt="国金证券"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/enjoymusic.jpg" alt="不亦乐乎"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cnhnb.png" alt="惠农网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/daoklab.jpg" alt="成都道壳"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ausnutria.jpg" alt="澳优乳业"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/deiyoudian.png" alt="河南有态度信息科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ezhiyang.png" alt="智阳第一人力"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shie.png" alt="上海保险交易所"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wsecar.png" alt="万顺叫车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shouqinba.jpg" alt="收钱吧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/baozun.png" alt="宝尊电商"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xbnwl.png" alt="喜百年供应链"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gwwisdom.png" alt="南京观为智慧软件科技有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ztrip.png" alt="在途商旅"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hualala.png" alt="哗啦啦"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xin.png" alt="优信二手车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maycur.png" alt="每刻科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bullyun.png" alt="杭州蛮牛"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bestpay.png" alt="翼支付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mockuai.png" alt="魔筷科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ct108.png" alt="畅唐网络"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jusdaglobal.jpg" alt="准时达"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/izaodao.png" alt="早道网校"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ovopark.jpg" alt="万店掌"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/funstory.jpg" alt="推文科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lemonbox.png" alt="Lemonbox"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/polyt.png" alt="保利票务"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chipwing.png" alt="芯翼科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/czbank.png" alt="浙商银行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/czbyqy.png" alt="易企银科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yundun.jpg" alt="上海云盾"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gaiaworks.jpg" alt="苏州盖雅信息技术有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mengxiang.png" alt="爱库存"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jidouauto.png" alt="极豆车联网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ipalfish.png" alt="伴鱼少儿英语"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/iqboard.png" alt="锐达科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/koolearn.png" alt="新东方在线"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kingcome.png" alt="金康高科"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/soulapp.png" alt="soul"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ezrpro.png" alt="驿氪"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hc360.png" alt="慧聪"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/21cp.png" alt="中塑在线"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/goinglink.jpg" alt="甄云科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/aitrace.jpg" alt="追溯科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/moqipobing.png" alt="玩吧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cassan.png" alt="广州卡桑信息技术有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shuidichou.png" alt="水滴"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kuwo.png" alt="酷我音乐"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mi.png" alt="小米"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mvmyun.png" alt="今典"></td> </tr> </table> # Awards <img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/awards/oschina-2018-award.jpg" width="240px" alt="The most popular Chinese open source software in 2018"> # Stargazers over time [![Stargazers over time](https://starcharts.herokuapp.com/ctripcorp/apollo.svg)](https://starcharts.herokuapp.com/ctripcorp/apollo)
1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./docs/en/README.md
English version documentation of Apollo
<img src="https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/logo/logo-simple.png" alt="apollo-logo" width="40%"> # Introduction Apollo is a reliable configuration management system. It can centrally manage the configurations of different applications and different clusters. It is suitable for microservice configuration management scenarios. The server side is developed based on Spring Boot and Spring Cloud, which can simply run without the need to install additional application containers such as Tomcat. The Java SDK does not rely on any framework and can run in all Java runtime environments. It also has good support for Spring/Spring Boot environments. The .Net SDK does not rely on any framework and can run in all .Net runtime environments. For more detials of the product introduction, please refer [Introduction to Apollo Configuration Center](https://ctripcorp.github.io/apollo/#/zh/design/apollo-introduction). For local demo purpose, please refer [Quick Start](https://ctripcorp.github.io/apollo/#/zh/deployment/quick-start). Demo Environment: - [http://106.54.227.205](http://106.54.227.205/) - User/Password: apollo/admin # Screenshots ![Screenshot](https://raw.githubusercontent.com/ctripcorp/apollo/master/docs/en/images/apollo-home-screenshot.jpg) # Features * **Unified management of the configurations of different environments and different clusters** * Apollo provides a unified interface to centrally manage the configurations of different environments, different clusters, and different namespaces * The same codebase could have different configurations when deployed in different clusters * With the namespace concept, it is easy to support multiple applications to share the same configurations, while also allowing them to customize the configurations * Multiple languages is provided in user interface (currently Chinese and English) * **Configuration changes takes effect in real time (hot release)** * After the user modified the configuration and released it in Apollo, the sdk will receive the latest configurations in real time (1 second) and notify the application * **Release version management** * Every configuration releases are versioned, which is friendly to support configuration rollback * **Grayscale release** * Support grayscale configuration release, for example, after clicking release, it will only take effect for some application instances. After a period of observation, we could push the configurations to all application instances if there is no problem * **Authorization management, release approval and operation audit** * Great authorization mechanism is designed for applications and configurations management, and the management of configurations is divided into two operations: editing and publishing, therefore greatly reducing human errors * All operations have audit logs for easy tracking of problems * **Client side configuration information monitoring** * It's very easy to see which instances are using the configurations and what versions they are using * **Rich SDKs available** * Provides native sdks of Java and .Net to facilitate application integration * Support Spring Placeholder, Annotation and Spring Boot ConfigurationProperties for easy application use (requires Spring 3.1.1+) * Http APIs are provided, so non-Java and .Net applications can integrate conveniently * Rich third party sdks are also available, e.g. Golang, Python, NodeJS, PHP, C, etc * **Open platform API** * Apollo itself provides a unified configuration management interface, which supports features such as multi-environment, multi-data center configuration management, permissions, and process governance * However, for the sake of versatility, Apollo will not put too many restrictions on the modification of the configuration, as long as it conforms to the basic format, it can be saved. * In our research, we found that for some users, their configurations may have more complicated formats, such as xml, json, and the format needs to be verified * There are also some users such as DAL, which not only have a specific format, but also need to verify the entered value before saving, such as checking whether the database, username and password match * For this type of application, Apollo allows the application to modify and release configurations through open APIs, which has great authorization and permission control mechanism built in * **Simple deployment** * As an infrastructure service, the configuration center has very high availability requirements, which forces Apollo to rely on external dependencies as little as possible * Currently, the only external dependency is MySQL, so the deployment is very simple. Apollo can run as long as Java and MySQL are installed * Apollo also provides a packaging script, which can generate all required installation packages with just one click, and supports customization of runtime parameters # Usage 1. [Apollo User Guide](https://ctripcorp.github.io/apollo/#/zh/usage/apollo-user-guide) 2. [Java SDK User Guide](https://ctripcorp.github.io/apollo/#/zh/usage/java-sdk-user-guide) 3. [.Net SDK user Guide](https://ctripcorp.github.io/apollo/#/zh/usage/dotnet-sdk-user-guide) 4. [Third Party SDK User Guide](https://ctripcorp.github.io/apollo/#/zh/usage/third-party-sdks-user-guide) 5. [Other Language Client User Guide](https://ctripcorp.github.io/apollo/#/zh/usage/other-language-client-user-guide) 6. [Apollo Open APIs](https://ctripcorp.github.io/apollo/#/zh/usage/apollo-open-api-platform) 7. [Apollo Use Cases](https://github.com/ctripcorp/apollo-use-cases) 8. [Apollo User Practices](https://ctripcorp.github.io/apollo/#/zh/usage/apollo-user-practices) 9. [Apollo Security Best Practices](https://ctripcorp.github.io/apollo/#/zh/usage/apollo-user-guide?id=_71-%e5%ae%89%e5%85%a8%e7%9b%b8%e5%85%b3) # Design * [Apollo Design](https://ctripcorp.github.io/apollo/#/zh/design/apollo-design) * [Apollo Core Concept - Namespace](https://ctripcorp.github.io/apollo/#/zh/design/apollo-core-concept-namespace) * [Apollo Architecture Analysis](https://mp.weixin.qq.com/s/-hUaQPzfsl9Lm3IqQW3VDQ) * [Apollo Source Code Explanation](http://www.iocoder.cn/categories/Apollo/) # Development * [Apollo Development Guide](https://ctripcorp.github.io/apollo/#/zh/development/apollo-development-guide) * Code Styles * [Eclipse Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/eclipse-java-google-style.xml) * [Intellij Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/intellij-java-google-style.xml) # Deployment * [Quick Start](https://ctripcorp.github.io/apollo/#/zh/deployment/quick-start) * [Distributed Deployment Guide](https://ctripcorp.github.io/apollo/#/zh/deployment/distributed-deployment-guide) # Release Notes * [Releases](https://github.com/ctripcorp/apollo/releases) # FAQ * [FAQ](https://ctripcorp.github.io/apollo/#/zh/faq/faq) * [Common Issues in Deployment & Development Phase](https://ctripcorp.github.io/apollo/#/zh/faq/common-issues-in-deployment-and-development-phase) # Presentation * [Design and Implementation Details of Apollo](http://www.itdks.com/dakalive/detail/3420) * [Slides](https://myslide.cn/slides/10168) * [Configuration Center Makes Microservices Smart](https://2018.qconshanghai.com/presentation/799) * [Slides](https://myslide.cn/slides/10035) # Publication * [Design and Implementation Details of Apollo](https://www.infoq.cn/article/open-source-configuration-center-apollo) * [Configuration Center Makes Microservices Smart](https://mp.weixin.qq.com/s/iDmYJre_ULEIxuliu1EbIQ) # Contribution Please make sure to read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making a pull request. Thanks for all the people who contributed to Apollo! <a href="https://github.com/ctripcorp/apollo/graphs/contributors"><img src="https://opencollective.com/apollo/contributors.svg?width=880&button=false" /></a> # License The project is licensed under the [Apache 2 license](https://github.com/ctripcorp/apollo/blob/master/LICENSE).
1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./docs/en/_sidebar.md
- Getting started - [Quick start](en/quick-start.md) - [Releases](https://github.com/ctripcorp/apollo/releases)
- [**Home**](en/README.md) - [Releases](https://github.com/ctripcorp/apollo/releases)
1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./docs/zh/README.md
<img src="https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/logo/logo-simple.png" alt="apollo-logo" width="40%"> # Introduction Apollo(阿波罗)是携程框架部门研发的分布式配置中心,能够集中化管理应用不同环境、不同集群的配置,配置修改后能够实时推送到应用端,并且具备规范的权限、流程治理等特性,适用于微服务配置管理场景。 服务端基于Spring Boot和Spring Cloud开发,打包后可以直接运行,不需要额外安装Tomcat等应用容器。 Java客户端不依赖任何框架,能够运行于所有Java运行时环境,同时对Spring/Spring Boot环境也有较好的支持。 .Net客户端不依赖任何框架,能够运行于所有.Net运行时环境。 更多产品介绍参见[Apollo配置中心介绍](zh/design/apollo-introduction) 本地快速部署请参见[Quick Start](zh/deployment/quick-start) 演示环境(Demo): - [106.54.227.205](http://106.54.227.205/) - 账号/密码:apollo/admin > 如访问github速度缓慢,可以访问[gitee镜像](https://gitee.com/nobodyiam/apollo),不定期同步 # Screenshots ![配置界面](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/apollo-home-screenshot.jpg) # Features * **统一管理不同环境、不同集群的配置** * Apollo提供了一个统一界面集中式管理不同环境(environment)、不同集群(cluster)、不同命名空间(namespace)的配置。 * 同一份代码部署在不同的集群,可以有不同的配置,比如zk的地址等 * 通过命名空间(namespace)可以很方便的支持多个不同应用共享同一份配置,同时还允许应用对共享的配置进行覆盖 * 配置界面支持多语言(中文,English) * **配置修改实时生效(热发布)** * 用户在Apollo修改完配置并发布后,客户端能实时(1秒)接收到最新的配置,并通知到应用程序。 * **版本发布管理** * 所有的配置发布都有版本概念,从而可以方便的支持配置的回滚。 * **灰度发布** * 支持配置的灰度发布,比如点了发布后,只对部分应用实例生效,等观察一段时间没问题后再推给所有应用实例。 * **权限管理、发布审核、操作审计** * 应用和配置的管理都有完善的权限管理机制,对配置的管理还分为了编辑和发布两个环节,从而减少人为的错误。 * 所有的操作都有审计日志,可以方便的追踪问题。 * **客户端配置信息监控** * 可以方便的看到配置在被哪些实例使用 * **提供Java和.Net原生客户端** * 提供了Java和.Net的原生客户端,方便应用集成 * 支持Spring Placeholder,Annotation和Spring Boot的ConfigurationProperties,方便应用使用(需要Spring 3.1.1+) * 同时提供了Http接口,非Java和.Net应用也可以方便的使用 * **提供开放平台API** * Apollo自身提供了比较完善的统一配置管理界面,支持多环境、多数据中心配置管理、权限、流程治理等特性。 * 不过Apollo出于通用性考虑,对配置的修改不会做过多限制,只要符合基本的格式就能够保存。 * 在我们的调研中发现,对于有些使用方,它们的配置可能会有比较复杂的格式,如xml, json,需要对格式做校验。 * 还有一些使用方如DAL,不仅有特定的格式,而且对输入的值也需要进行校验后方可保存,如检查数据库、用户名和密码是否匹配。 * 对于这类应用,Apollo支持应用方通过开放接口在Apollo进行配置的修改和发布,并且具备完善的授权和权限控制 * **部署简单** * 配置中心作为基础服务,可用性要求非常高,这就要求Apollo对外部依赖尽可能地少 * 目前唯一的外部依赖是MySQL,所以部署非常简单,只要安装好Java和MySQL就可以让Apollo跑起来 * Apollo还提供了打包脚本,一键就可以生成所有需要的安装包,并且支持自定义运行时参数 # Usage 1. [应用接入指南](zh/usage/apollo-user-guide) 2. [Java客户端使用指南](zh/usage/java-sdk-user-guide) 3. [.Net客户端使用指南](zh/usage/dotnet-sdk-user-guide) 4. [其它语言客户端接入指南](zh/usage/other-language-client-user-guide) 5. [Apollo开放平台接入指南](zh/usage/apollo-open-api-platform) 6. [Apollo使用场景和示例代码](https://github.com/ctripcorp/apollo-use-cases) 7. [Apollo实践案例](zh/usage/apollo-user-practices) 8. [Apollo安全相关最佳实践](zh/usage/apollo-user-guide?id=_71-%e5%ae%89%e5%85%a8%e7%9b%b8%e5%85%b3) # Design - [Apollo配置中心设计](zh/design/apollo-design.md) - [Apollo配置中心介绍](zh/design/apollo-introduction.md) - [Apollo核心概念之“Namespace”](zh/design/apollo-core-concept-namespace.md) - [Apollo源码解析](http://www.iocoder.cn/categories/Apollo/)(据说Apollo非常适合作为初学者第一个通读源码学习的分布式中间件产品) # Development - [Apollo开发指南](zh/development/apollo-development-guide.md) - Code Styles - [Eclipse Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/eclipse-java-google-style.xml) - [Intellij Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/intellij-java-google-style.xml) - [Portal实现用户登录功能](zh/development/portal-how-to-implement-user-login-function.md) - [Portal接入邮件服务](zh/development/portal-how-to-enable-email-service.md) - [Portal启用webhook通知](zh/development/portal-how-to-enable-webhook-notification.md) # Deployment - [Quick Start](zh/deployment/quick-start.md) - [Docker方式部署Quick Start](zh/deployment/quick-start-docker.md) - [分布式部署指南](zh/deployment/distributed-deployment-guide.md) # Release Notes * [版本发布历史](https://github.com/ctripcorp/apollo/releases) # FAQ * [常见问题回答](zh/faq/faq.md) * [部署&开发遇到的常见问题](zh/faq/common-issues-in-deployment-and-development-phase.md) # Presentation * [携程开源配置中心Apollo的设计与实现](http://www.itdks.com/dakalive/detail/3420) * [Slides](https://myslide.cn/slides/10168) * [配置中心,让微服务更『智能』](https://2018.qconshanghai.com/presentation/799) * [Slides](https://myslide.cn/slides/10035) # Publication * [开源配置中心Apollo的设计与实现](https://www.infoq.cn/article/open-source-configuration-center-apollo) * [配置中心,让微服务更『智能』](https://mp.weixin.qq.com/s/iDmYJre_ULEIxuliu1EbIQ) # Support <table> <thead> <th>Apollo技术支持②群<br />群号:904287263(未满)</th> <th>Apollo技术支持⑤群<br />群号:914839843(已满)</th> <th>Apollo技术支持④群<br />群号:516773934(已满)</th> <th>Apollo技术支持③群<br />群号:742035428(已满)</th> <th>Apollo技术支持①群<br />群号:375526581(已满)</th> </thead> <tbody> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-2.png" alt="tech-support-qq-2"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-5.png" alt="tech-support-qq-5"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-4.png" alt="tech-support-qq-4"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-3.png" alt="tech-support-qq-3"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-1.png" alt="tech-support-qq-1"></td> </tr> </tbody> </table> # Contribution Please make sure to read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making a pull request. Thanks for all the people who contributed to Apollo! <a href="https://github.com/ctripcorp/apollo/graphs/contributors"><img src="https://opencollective.com/apollo/contributors.svg?width=880&button=false" /></a> # License The project is licensed under the [Apache 2 license](https://github.com/ctripcorp/apollo/blob/master/LICENSE). # Known Users > 按照登记顺序排序,更多接入公司,欢迎在[https://github.com/ctripcorp/apollo/issues/451](https://github.com/ctripcorp/apollo/issues/451)登记(仅供开源用户参考) <table> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ctrip.png" alt="携程"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bluestone.png" alt="青石证券"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sagreen.png" alt="沙绿"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/umetrip.jpg" alt="航旅纵横"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhuanzhuan.png" alt="58转转"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/phone580.png" alt="蜂助手"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hainan-airlines.png" alt="海南航空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cvte.png" alt="CVTE"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mainbo.jpg" alt="明博教育"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/madailicai.png" alt="麻袋理财"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mxnavi.jpg" alt="美行科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fshows.jpg" alt="首展科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/feezu.png" alt="易微行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rencaijia.png" alt="人才加"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/keking.png" alt="凯京集团"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/leoao.png" alt="乐刻运动"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dji.png" alt="大疆"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kkmh.png" alt="快看漫画"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wolaidai.png" alt="我来贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xsrj.png" alt="虚实软件"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yanxuan.png" alt="网易严选"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sjzg.png" alt="视觉中国"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zc360.png" alt="资产360"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ecarx.png" alt="亿咖通"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/5173.png" alt="5173"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hujiang.png" alt="沪江"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/163yun.png" alt="网易云基础服务"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cash-bus.png" alt="现金巴士"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/smartisan.png" alt="锤子科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/toodc.png" alt="头等仓"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/juneyaoair.png" alt="吉祥航空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/263mobile.png" alt="263移动通信"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/toutoujinrong.png" alt="投投金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mytijian.png" alt="每天健康"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maiyabank.png" alt="麦芽金服"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fengunion.png" alt="蜂向科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/geex-logo.png" alt="即科金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/beike.png" alt="贝壳网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/youzan.png" alt="有赞"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yunjihuitong.png" alt="云集汇通"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rhinotech.png" alt="犀牛瀚海科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/nxin.png" alt="农信互联"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mgzf.png" alt="蘑菇租房"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/huli-logo.png" alt="狐狸金服"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mandao.png" alt="漫道集团"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/enmonster.png" alt="怪兽充电"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/nanguazufang.png" alt="南瓜租房"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shitoujinrong.png" alt="石投金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tubatu.png" alt="土巴兔"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/payh_logo.png" alt="平安银行"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xinxindai.png" alt="新新贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chrtc.png" alt="中国华戎科技集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tuya_logo.png" alt="涂鸦智能"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/szlcsc.jpg" alt="立创商城"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hairongyi.png" alt="乐赚金服"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kxqc.png" alt="开心汽车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ppcredit.png" alt="乐赚金服"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/primeton.png" alt="普元信息"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hoskeeper.png" alt="医帮管家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fula.png" alt="付啦信用卡管家"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/uzai.png" alt="悠哉网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/91wutong.png" alt="梧桐诚选"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ppdai.png" alt="拍拍贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xinyongfei.png" alt="信用飞"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dxy.png" alt="丁香园"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ghtech.png" alt="国槐科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/qbb.png" alt="亲宝宝"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/huawei_logo.png" alt="华为视频直播"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/weiboyi.png" alt="微播易"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ofpay.png" alt="欧飞"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mishuo.png" alt="迷说"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yixia.png" alt="一下科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/daocloud.png" alt="DaoCloud"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cnvex.png" alt="汽摩交易所"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/100tal.png" alt="好未来教育集团"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ainirobot.png" alt="猎户星空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhuojian.png" alt="卓健科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/enjoyor.png" alt="银江股份"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tuhu.png" alt="途虎养车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/homedo.png" alt="河姆渡"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xwbank.png" alt="新网银行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ctspcl.png" alt="中旅安信云贷"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/meiyou.png" alt="美柚"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zkh-logo.png" alt="震坤行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wgss.png" alt="万谷盛世"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/plateno.png" alt="铂涛旅行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lifesense.png" alt="乐心"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/reachmedia.png" alt="亿投传媒"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/guxiansheng.png" alt="股先生"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/caixuetang.png" alt="财学堂"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/4399.png" alt="4399"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/autohome.png" alt="汽车之家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mbcaijing.png" alt="面包财经"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hoopchina.png" alt="虎扑"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sohu-auto.png" alt="搜狐汽车"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/liangfuzhengxin.png" alt="量富征信"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maihaoche.png" alt="卖好车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zyiot.jpg" alt="中移物联网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/biauto.png" alt="易车网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maiyaole.png" alt="一药网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiaoying.png" alt="小影"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/caibeike.png" alt="彩贝壳"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yeelight.png" alt="YEELIGHT"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/itsgmu.png" alt="积目"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/acmedcare.png" alt="极致医疗"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jinhui365.png" alt="金汇金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/900etrip.png" alt="久柏易游"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/24xiaomai.png" alt="小麦铺"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/vvic.png" alt="搜款网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mizlicai.png" alt="米庄理财"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bjt.png" alt="贝吉塔网络科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/weimob.png" alt="微盟"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kada.png" alt="网易卡搭"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kapbook.png" alt="股书"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jumore.png" alt="聚贸"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bimface.png" alt="广联达bimface"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/globalgrow.png" alt="环球易购"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jollychic.png" alt="浙江执御"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/2dfire.jpg" alt="二维火"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shopin.png" alt="上品"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/inspur.png" alt="浪潮集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ngarihealth.png" alt="纳里健康"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/oraro.png" alt="橙红科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dragonpass.png" alt="龙腾出行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lizhi.fm.png" alt="荔枝"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/htd.png" alt="汇通达"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yunrong.png" alt="云融金科"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tszg360.png" alt="天生掌柜"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rongplus.png" alt="容联光辉"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/intellif.png" alt="云天励飞"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jiayundata.png" alt="嘉云数据"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zts.png" alt="中泰证券网络金融部"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/163dun.png" alt="网易易盾"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiangwushuo.png" alt="享物说"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sto.png" alt="申通"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jinhe.png" alt="金和网络"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/2345.png" alt="二三四五"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chtwm.jpg" alt="恒天财富"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/uweixin.png" alt="沐雪微信"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wzeye.png" alt="温州医科大学附属眼视光医院"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/10010pay.png" alt="联通支付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shanshu.png" alt="杉数科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/fenlibao.png" alt="分利宝"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hetao101.png" alt="核桃编程"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiaohongshu.png" alt="小红书"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/blissmall.png" alt="幸福西饼"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ky-express.png" alt="跨越速运"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/oyohotels.png" alt="OYO"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/100-me.png" alt="叮咚买菜"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhidaohulian.jpg" alt="智道网联"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xueqiu.jpg" alt="雪球"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/autocloudpro.png" alt="车通云"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dadaabc.png" alt="哒哒英语"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xedaojia.jpg" alt="小E微店"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/daling.png" alt="达令家"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/renliwo.png" alt="人力窝"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mocire.jpg" alt="嘉美在线"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/uepay.png" alt="极易付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wdom.png" alt="智慧开源"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cheshiku.png" alt="车仕库"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/taimeitech.png" alt="太美医疗科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yilianbaihui.png" alt="亿联百汇"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhoupu123.png" alt="舟谱数据"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/frxs.png" alt="芙蓉兴盛"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/beastshop.png" alt="野兽派"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kaishustory.png" alt="凯叔讲故事"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/haodf.png" alt="好大夫在线"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/insyunmi.png" alt="云幂信息技术"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/duiba.png" alt="兑吧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/9ji.png" alt="九机网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sui.png" alt="随手科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/aixiangdao.png" alt="万谷盛世"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yunzhangfang.png" alt="云账房"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yuantutech.png" alt="浙江远图互联"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/qk365.png" alt="青客公寓"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/eastmoney.png" alt="东方财富"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jikexiu.png" alt="极客修"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/meix.png" alt="美市科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zto.png" alt="中通快递"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/e6yun.png" alt="易流科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xiaoyuanzhao.png" alt="实习僧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dalingjia.png" alt="达令家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/secoo.png" alt="寺库"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lianlianpay.png" alt="连连支付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhongan.png" alt="众安保险"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/360jinrong.png" alt="360金融"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/caschina.png" alt="中航服商旅"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ke.png" alt="贝壳"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yeahmobi.png" alt="Yeahmobi易点天下"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/idengyun.png" alt="北京登云美业网络科技有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jinher.png" alt="金和网络"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/komect.png" alt="中移(杭州)信息技术有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/beisen.png" alt="北森"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/log56.png" alt="合肥维天运通"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/meboth.png" alt="北京蜜步科技有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/postop.png" alt="术康"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rfchina.png" alt="富力集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tfxing.png" alt="天府行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/8travelpay.png" alt="八商山"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/centaline.png" alt="中原地产"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zkyda.png" alt="智科云达"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/house730.png" alt="中原730"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/pagoda.png" alt="百果园"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bolome.png" alt="波罗蜜"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xignite.png" alt="Xignite"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/aduer.png" alt="杭州有云科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jojoreading.png" alt="成都书声科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sweetome.png" alt="斯维登集团"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/vipthink.png" alt="广东快乐种子科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/tongxuecool.png" alt="上海盈翼文化传播有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/sccfc.png" alt="上海尚诚消费金融股份有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ziroom.png" alt="自如网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jd.png" alt="京东"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/rabbitpre.png" alt="兔展智能"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhubei.png" alt="竹贝"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/imile.png" alt="iMile(中东)"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/helloglobal.png" alt="哈罗出行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zhaopin.png" alt="智联招聘"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/acadsoc.png" alt="阿卡索"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mojory.png" alt="妙知旅"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chengduoduo.png" alt="程多多"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/baojunev.png" alt="上汽通用五菱"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/leyan.png" alt="乐言科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/dushu.png" alt="樊登读书"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/zyiz.png" alt="找一找教程网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bppc.png" alt="中油碧辟石油有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shanglv51.png" alt="四川商旅无忧科技服务有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/waijiao365.png" alt="懿鸢网络科技(上海)有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gaoding.jpg" alt="稿定科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ricacorp.png" alt="搵樓 - 利嘉閣"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/t3go.png" alt="南京领行科技股份有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mokahr.jpg" alt="北京希瑞亚斯科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/printrainbow.png" alt="印彩虹印刷公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/milliontech.png" alt="Million Tech"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/guoguokeji.jpg" alt="果果科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/airkunming.png" alt="昆明航空"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/5i5j.png" alt="我爱我家"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gjzq.png" alt="国金证券"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/enjoymusic.jpg" alt="不亦乐乎"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cnhnb.png" alt="惠农网"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/daoklab.jpg" alt="成都道壳"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ausnutria.jpg" alt="澳优乳业"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/deiyoudian.png" alt="河南有态度信息科技有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ezhiyang.png" alt="智阳第一人力"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shie.png" alt="上海保险交易所"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/wsecar.png" alt="万顺叫车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shouqinba.jpg" alt="收钱吧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/baozun.png" alt="宝尊电商"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xbnwl.png" alt="喜百年供应链"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gwwisdom.png" alt="南京观为智慧软件科技有限公司"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ztrip.png" alt="在途商旅"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hualala.png" alt="哗啦啦"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/xin.png" alt="优信二手车"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/maycur.png" alt="每刻科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bullyun.png" alt="杭州蛮牛"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/bestpay.png" alt="翼支付"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mockuai.png" alt="魔筷科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ct108.png" alt="畅唐网络"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jusdaglobal.jpg" alt="准时达"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/izaodao.png" alt="早道网校"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ovopark.jpg" alt="万店掌"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/funstory.jpg" alt="推文科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/lemonbox.png" alt="Lemonbox"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/polyt.png" alt="保利票务"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/chipwing.png" alt="芯翼科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/czbank.png" alt="浙商银行"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/czbyqy.png" alt="易企银科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/yundun.jpg" alt="上海云盾"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/gaiaworks.jpg" alt="苏州盖雅信息技术有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mengxiang.png" alt="爱库存"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/jidouauto.png" alt="极豆车联网"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ipalfish.png" alt="伴鱼少儿英语"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/iqboard.png" alt="锐达科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/koolearn.png" alt="新东方在线"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kingcome.png" alt="金康高科"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/soulapp.png" alt="soul"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/ezrpro.png" alt="驿氪"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/hc360.png" alt="慧聪"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/21cp.png" alt="中塑在线"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/goinglink.jpg" alt="甄云科技"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/aitrace.jpg" alt="追溯科技"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/moqipobing.png" alt="玩吧"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/cassan.png" alt="广州卡桑信息技术有限公司"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/shuidichou.png" alt="水滴"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/kuwo.png" alt="酷我音乐"></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mi.png" alt="小米"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/known-users/mvmyun.png" alt="今典"></td> </tr> </table> # Awards <img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/awards/oschina-2018-award.jpg" width="240px" alt="2018 年度最受欢迎中国开源软件">
<img src="https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/logo/logo-simple.png" alt="apollo-logo" width="40%"> # Introduction Apollo(阿波罗)是携程框架部门研发的分布式配置中心,能够集中化管理应用不同环境、不同集群的配置,配置修改后能够实时推送到应用端,并且具备规范的权限、流程治理等特性,适用于微服务配置管理场景。 服务端基于Spring Boot和Spring Cloud开发,打包后可以直接运行,不需要额外安装Tomcat等应用容器。 Java客户端不依赖任何框架,能够运行于所有Java运行时环境,同时对Spring/Spring Boot环境也有较好的支持。 .Net客户端不依赖任何框架,能够运行于所有.Net运行时环境。 更多产品介绍参见[Apollo配置中心介绍](zh/design/apollo-introduction) 本地快速部署请参见[Quick Start](zh/deployment/quick-start) 演示环境(Demo): - [106.54.227.205](http://106.54.227.205/) - 账号/密码:apollo/admin > 如访问github速度缓慢,可以访问[gitee镜像](https://gitee.com/nobodyiam/apollo),不定期同步 # Screenshots ![配置界面](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/apollo-home-screenshot.jpg) # Features * **统一管理不同环境、不同集群的配置** * Apollo提供了一个统一界面集中式管理不同环境(environment)、不同集群(cluster)、不同命名空间(namespace)的配置。 * 同一份代码部署在不同的集群,可以有不同的配置,比如zk的地址等 * 通过命名空间(namespace)可以很方便的支持多个不同应用共享同一份配置,同时还允许应用对共享的配置进行覆盖 * 配置界面支持多语言(中文,English) * **配置修改实时生效(热发布)** * 用户在Apollo修改完配置并发布后,客户端能实时(1秒)接收到最新的配置,并通知到应用程序。 * **版本发布管理** * 所有的配置发布都有版本概念,从而可以方便的支持配置的回滚。 * **灰度发布** * 支持配置的灰度发布,比如点了发布后,只对部分应用实例生效,等观察一段时间没问题后再推给所有应用实例。 * **权限管理、发布审核、操作审计** * 应用和配置的管理都有完善的权限管理机制,对配置的管理还分为了编辑和发布两个环节,从而减少人为的错误。 * 所有的操作都有审计日志,可以方便的追踪问题。 * **客户端配置信息监控** * 可以方便的看到配置在被哪些实例使用 * **提供Java和.Net原生客户端** * 提供了Java和.Net的原生客户端,方便应用集成 * 支持Spring Placeholder,Annotation和Spring Boot的ConfigurationProperties,方便应用使用(需要Spring 3.1.1+) * 同时提供了Http接口,非Java和.Net应用也可以方便的使用 * **提供开放平台API** * Apollo自身提供了比较完善的统一配置管理界面,支持多环境、多数据中心配置管理、权限、流程治理等特性。 * 不过Apollo出于通用性考虑,对配置的修改不会做过多限制,只要符合基本的格式就能够保存。 * 在我们的调研中发现,对于有些使用方,它们的配置可能会有比较复杂的格式,如xml, json,需要对格式做校验。 * 还有一些使用方如DAL,不仅有特定的格式,而且对输入的值也需要进行校验后方可保存,如检查数据库、用户名和密码是否匹配。 * 对于这类应用,Apollo支持应用方通过开放接口在Apollo进行配置的修改和发布,并且具备完善的授权和权限控制 * **部署简单** * 配置中心作为基础服务,可用性要求非常高,这就要求Apollo对外部依赖尽可能地少 * 目前唯一的外部依赖是MySQL,所以部署非常简单,只要安装好Java和MySQL就可以让Apollo跑起来 * Apollo还提供了打包脚本,一键就可以生成所有需要的安装包,并且支持自定义运行时参数 # Usage 1. [应用接入指南](zh/usage/apollo-user-guide) 2. [Java客户端使用指南](zh/usage/java-sdk-user-guide) 3. [.Net客户端使用指南](zh/usage/dotnet-sdk-user-guide) 4. [其它语言客户端接入指南](zh/usage/other-language-client-user-guide) 5. [Apollo开放平台接入指南](zh/usage/apollo-open-api-platform) 6. [Apollo使用场景和示例代码](https://github.com/ctripcorp/apollo-use-cases) 7. [Apollo实践案例](zh/usage/apollo-user-practices) 8. [Apollo安全相关最佳实践](zh/usage/apollo-user-guide?id=_71-%e5%ae%89%e5%85%a8%e7%9b%b8%e5%85%b3) # Design - [Apollo配置中心设计](zh/design/apollo-design.md) - [Apollo配置中心介绍](zh/design/apollo-introduction.md) - [Apollo核心概念之“Namespace”](zh/design/apollo-core-concept-namespace.md) - [Apollo源码解析](http://www.iocoder.cn/categories/Apollo/)(据说Apollo非常适合作为初学者第一个通读源码学习的分布式中间件产品) # Development - [Apollo开发指南](zh/development/apollo-development-guide.md) - Code Styles - [Eclipse Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/eclipse-java-google-style.xml) - [Intellij Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/intellij-java-google-style.xml) - [Portal实现用户登录功能](zh/development/portal-how-to-implement-user-login-function.md) - [Portal接入邮件服务](zh/development/portal-how-to-enable-email-service.md) - [Portal启用webhook通知](zh/development/portal-how-to-enable-webhook-notification.md) # Deployment - [Quick Start](zh/deployment/quick-start.md) - [Docker方式部署Quick Start](zh/deployment/quick-start-docker.md) - [分布式部署指南](zh/deployment/distributed-deployment-guide.md) # Release Notes * [版本发布历史](https://github.com/ctripcorp/apollo/releases) # FAQ * [常见问题回答](zh/faq/faq.md) * [部署&开发遇到的常见问题](zh/faq/common-issues-in-deployment-and-development-phase.md) # Presentation * [携程开源配置中心Apollo的设计与实现](http://www.itdks.com/dakalive/detail/3420) * [Slides](https://myslide.cn/slides/10168) * [配置中心,让微服务更『智能』](https://2018.qconshanghai.com/presentation/799) * [Slides](https://myslide.cn/slides/10035) # Publication * [开源配置中心Apollo的设计与实现](https://www.infoq.cn/article/open-source-configuration-center-apollo) * [配置中心,让微服务更『智能』](https://mp.weixin.qq.com/s/iDmYJre_ULEIxuliu1EbIQ) # Support <table> <thead> <th>Apollo技术支持②群<br />群号:904287263(未满)</th> <th>Apollo技术支持⑤群<br />群号:914839843(已满)</th> <th>Apollo技术支持④群<br />群号:516773934(已满)</th> <th>Apollo技术支持③群<br />群号:742035428(已满)</th> <th>Apollo技术支持①群<br />群号:375526581(已满)</th> </thead> <tbody> <tr> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-2.png" alt="tech-support-qq-2"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-5.png" alt="tech-support-qq-5"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-4.png" alt="tech-support-qq-4"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-3.png" alt="tech-support-qq-3"></td> <td><img src="https://raw.githubusercontent.com/ctripcorp/apollo-community/master/images/tech-support/tech-support-qq-1.png" alt="tech-support-qq-1"></td> </tr> </tbody> </table> # Contribution Please make sure to read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making a pull request. Thanks for all the people who contributed to Apollo! <a href="https://github.com/ctripcorp/apollo/graphs/contributors"><img src="https://opencollective.com/apollo/contributors.svg?width=880&button=false" /></a> # License The project is licensed under the [Apache 2 license](https://github.com/ctripcorp/apollo/blob/master/LICENSE).
1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./.github/ISSUE_TEMPLATE/feature_request_en.md
--- name: Feature request about: Suggest an idea for this project title: '' labels: '' assignees: '' --- **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] **Describe the solution you'd like** A clear and concise description of what you want to happen. **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. **Additional context** Add any other context or screenshots about the feature request here.
--- name: Feature request about: Suggest an idea for this project title: '' labels: '' assignees: '' --- **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] **Describe the solution you'd like** A clear and concise description of what you want to happen. **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. **Additional context** Add any other context or screenshots about the feature request here.
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./.github/PULL_REQUEST_TEMPLATE.md
## What's the purpose of this PR XXXXX ## Which issue(s) this PR fixes: Fixes # ## Brief changelog XXXXX Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [ ] Write necessary unit tests to verify the code. - [ ] Run `mvn clean test` to make sure this pull request doesn't break anything.
## What's the purpose of this PR XXXXX ## Which issue(s) this PR fixes: Fixes # ## Brief changelog XXXXX Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [ ] Write necessary unit tests to verify the code. - [ ] Run `mvn clean test` to make sure this pull request doesn't break anything.
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./docs/zh/design/apollo-introduction.md
# &nbsp; # 1、What is Apollo ## 1.1 背景 随着程序功能的日益复杂,程序的配置日益增多:各种功能的开关、参数的配置、服务器的地址…… 对程序配置的期望值也越来越高:配置修改后实时生效,灰度发布,分环境、分集群管理配置,完善的权限、审核机制…… 在这样的大环境下,传统的通过配置文件、数据库等方式已经越来越无法满足开发人员对配置管理的需求。 Apollo配置中心应运而生! ## 1.2 Apollo简介 Apollo(阿波罗)是携程框架部门研发的开源配置管理中心,能够集中化管理应用不同环境、不同集群的配置,配置修改后能够实时推送到应用端,并且具备规范的权限、流程治理等特性。 Apollo支持4个维度管理Key-Value格式的配置: 1. application (应用) 2. environment (环境) 3. cluster (集群) 4. namespace (命名空间) 同时,Apollo基于开源模式开发,开源地址:<a href="https://github.com/ctripcorp/apollo" target="_blank">https://github.com/ctripcorp/apollo</a> ## 1.2 配置基本概念 既然Apollo定位于配置中心,那么在这里有必要先简单介绍一下什么是配置。 按照我们的理解,配置有以下几个属性: * **配置是独立于程序的只读变量** * 配置首先是独立于程序的,同一份程序在不同的配置下会有不同的行为。 * 其次,配置对于程序是只读的,程序通过读取配置来改变自己的行为,但是程序不应该去改变配置。 * 常见的配置有:DB Connection Str、Thread Pool Size、Buffer Size、Request Timeout、Feature Switch、Server Urls等。 * **配置伴随应用的整个生命周期** * 配置贯穿于应用的整个生命周期,应用在启动时通过读取配置来初始化,在运行时根据配置调整行为。 * **配置可以有多种加载方式** * 配置也有很多种加载方式,常见的有程序内部hard code,配置文件,环境变量,启动参数,基于数据库等 * **配置需要治理** * 权限控制 * 由于配置能改变程序的行为,不正确的配置甚至能引起灾难,所以对配置的修改必须有比较完善的权限控制 * 不同环境、集群配置管理 * 同一份程序在不同的环境(开发,测试,生产)、不同的集群(如不同的数据中心)经常需要有不同的配置,所以需要有完善的环境、集群配置管理 * 框架类组件配置管理 * 还有一类比较特殊的配置 - 框架类组件配置,比如CAT客户端的配置。 * 虽然这类框架类组件是由其他团队开发、维护,但是运行时是在业务实际应用内的,所以本质上可以认为框架类组件也是应用的一部分。 * 这类组件对应的配置也需要有比较完善的管理方式。 # 2、Why Apollo 正是基于配置的特殊性,所以Apollo从设计之初就立志于成为一个有治理能力的配置发布平台,目前提供了以下的特性: * **统一管理不同环境、不同集群的配置** * Apollo提供了一个统一界面集中式管理不同环境(environment)、不同集群(cluster)、不同命名空间(namespace)的配置。 * 同一份代码部署在不同的集群,可以有不同的配置,比如zookeeper的地址等 * 通过命名空间(namespace)可以很方便地支持多个不同应用共享同一份配置,同时还允许应用对共享的配置进行覆盖 * **配置修改实时生效(热发布)** * 用户在Apollo修改完配置并发布后,客户端能实时(1秒)接收到最新的配置,并通知到应用程序 * **版本发布管理** * 所有的配置发布都有版本概念,从而可以方便地支持配置的回滚 * **灰度发布** * 支持配置的灰度发布,比如点了发布后,只对部分应用实例生效,等观察一段时间没问题后再推给所有应用实例 * **权限管理、发布审核、操作审计** * 应用和配置的管理都有完善的权限管理机制,对配置的管理还分为了编辑和发布两个环节,从而减少人为的错误。 * 所有的操作都有审计日志,可以方便地追踪问题 * **客户端配置信息监控** * 可以在界面上方便地看到配置在被哪些实例使用 * **提供Java和.Net原生客户端** * 提供了Java和.Net的原生客户端,方便应用集成 * 支持Spring Placeholder, Annotation和Spring Boot的ConfigurationProperties,方便应用使用(需要Spring 3.1.1+) * 同时提供了Http接口,非Java和.Net应用也可以方便地使用 * **提供开放平台API** * Apollo自身提供了比较完善的统一配置管理界面,支持多环境、多数据中心配置管理、权限、流程治理等特性。不过Apollo出于通用性考虑,不会对配置的修改做过多限制,只要符合基本的格式就能保存,不会针对不同的配置值进行针对性的校验,如数据库用户名、密码,Redis服务地址等 * 对于这类应用配置,Apollo支持应用方通过开放平台API在Apollo进行配置的修改和发布,并且具备完善的授权和权限控制 * **部署简单** * 配置中心作为基础服务,可用性要求非常高,这就要求Apollo对外部依赖尽可能地少 * 目前唯一的外部依赖是MySQL,所以部署非常简单,只要安装好Java和MySQL就可以让Apollo跑起来 * Apollo还提供了打包脚本,一键就可以生成所有需要的安装包,并且支持自定义运行时参数 # 3、Apollo at a glance ## 3.1 基础模型 如下即是Apollo的基础模型: 1. 用户在配置中心对配置进行修改并发布 2. 配置中心通知Apollo客户端有配置更新 3. Apollo客户端从配置中心拉取最新的配置、更新本地配置并通知到应用 ![basic-architecture](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/basic-architecture.png) ## 3.2 界面概览 ![apollo-home-screenshot](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/apollo-home-screenshot.jpg) 上图是Apollo配置中心中一个项目的配置首页 * 在页面左上方的环境列表模块展示了所有的环境和集群,用户可以随时切换。 * 页面中央展示了两个namespace(application和FX.apollo)的配置信息,默认按照表格模式展示、编辑。用户也可以切换到文本模式,以文件形式查看、编辑。 * 页面上可以方便地进行发布、回滚、灰度、授权、查看更改历史和发布历史等操作 ## 3.3 添加/修改配置项 用户可以通过配置中心界面方便的添加/修改配置项,更多使用说明请参见[应用接入指南](zh/usage/apollo-user-guide) ![edit-item-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/edit-item-entry.png) 输入配置信息: ![edit-item](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/edit-item.png) ## 3.4 发布配置 通过配置中心发布配置: ![publish-items](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/publish-items-entry.png) 填写发布信息: ![publish-items](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/publish-items.png) ## 3.5 客户端获取配置(Java API样例) 配置发布后,就能在客户端获取到了,以Java为例,获取配置的示例代码如下。Apollo客户端还支持和Spring整合,更多客户端使用说明请参见[Java客户端使用指南](zh/usage/java-sdk-user-guide)和[.Net客户端使用指南](zh/usage/dotnet-sdk-user-guide)。 ```java Config config = ConfigService.getAppConfig(); Integer defaultRequestTimeout = 200; Integer requestTimeout = config.getIntProperty("requestTimeout", defaultRequestTimeout); ``` ## 3.6 客户端监听配置变化 通过上述获取配置代码,应用就能实时获取到最新的配置了。 不过在某些场景下,应用还需要在配置变化时获得通知,比如数据库连接的切换等,所以Apollo还提供了监听配置变化的功能,Java示例如下: ```java Config config = ConfigService.getAppConfig(); config.addChangeListener(new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { for (String key : changeEvent.changedKeys()) { ConfigChange change = changeEvent.getChange(key); System.out.println(String.format( "Found change - key: %s, oldValue: %s, newValue: %s, changeType: %s", change.getPropertyName(), change.getOldValue(), change.getNewValue(), change.getChangeType())); } } }); ``` ## 3.7 Spring集成样例 Apollo和Spring也可以很方便地集成,只需要标注`@EnableApolloConfig`后就可以通过`@Value`获取配置信息: ```java @Configuration @EnableApolloConfig public class AppConfig {} ``` ```java @Component public class SomeBean { //timeout的值会自动更新 @Value("${request.timeout:200}") private int timeout; } ``` # 4、Apollo in depth 通过上面的介绍,相信大家已经对Apollo有了一个初步的了解,并且相信已经覆盖到了大部分的使用场景。 接下来会主要介绍Apollo的cluster管理(集群)、namespace管理(命名空间)和对应的配置获取规则。 ## 4.1 Core Concepts 在介绍高级特性前,我们有必要先来了解一下Apollo中的几个核心概念: 1. **application (应用)** * 这个很好理解,就是实际使用配置的应用,Apollo客户端在运行时需要知道当前应用是谁,从而可以去获取对应的配置 * 每个应用都需要有唯一的身份标识 -- appId,我们认为应用身份是跟着代码走的,所以需要在代码中配置,具体信息请参见[Java客户端使用指南](zh/usage/java-sdk-user-guide)。 2. **environment (环境)** * 配置对应的环境,Apollo客户端在运行时需要知道当前应用处于哪个环境,从而可以去获取应用的配置 * 我们认为环境和代码无关,同一份代码部署在不同的环境就应该能够获取到不同环境的配置 * 所以环境默认是通过读取机器上的配置(server.properties中的env属性)指定的,不过为了开发方便,我们也支持运行时通过System Property等指定,具体信息请参见[Java客户端使用指南](zh/usage/java-sdk-user-guide)。 3. **cluster (集群)** * 一个应用下不同实例的分组,比如典型的可以按照数据中心分,把上海机房的应用实例分为一个集群,把北京机房的应用实例分为另一个集群。 * 对不同的cluster,同一个配置可以有不一样的值,如zookeeper地址。 * 集群默认是通过读取机器上的配置(server.properties中的idc属性)指定的,不过也支持运行时通过System Property指定,具体信息请参见[Java客户端使用指南](zh/usage/java-sdk-user-guide)。 4. **namespace (命名空间)** * 一个应用下不同配置的分组,可以简单地把namespace类比为文件,不同类型的配置存放在不同的文件中,如数据库配置文件,RPC配置文件,应用自身的配置文件等 * 应用可以直接读取到公共组件的配置namespace,如DAL,RPC等 * 应用也可以通过继承公共组件的配置namespace来对公共组件的配置做调整,如DAL的初始数据库连接数 ## 4.2 自定义Cluster > 【本节内容仅对应用需要对不同集群应用不同配置才需要,如没有相关需求,可以跳过本节】 比如我们有应用在A数据中心和B数据中心都有部署,那么如果希望两个数据中心的配置不一样的话,我们可以通过新建cluster来解决。 ### 4.2.1 新建Cluster 新建Cluster只有项目的管理员才有权限,管理员可以在页面左侧看到“添加集群”按钮。 ![create-cluster](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-cluster.png) 点击后就进入到集群添加页面,一般情况下可以按照数据中心来划分集群,如SHAJQ、SHAOY等。 不过也支持自定义集群,比如可以为A机房的某一台机器和B机房的某一台机创建一个集群,使用一套配置。 ![create-cluster-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-cluster-detail.png) ### 4.2.2 在Cluster中添加配置并发布 集群添加成功后,就可以为该集群添加配置了,首先需要按照下图所示切换到SHAJQ集群,之后配置添加流程和[3.3 添加/修改配置项](#_33-添加修改配置项)一样,这里就不再赘述了。 ![cluster-created](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/cluster-created.png) ### 4.2.3 指定应用实例所属的Cluster Apollo会默认使用应用实例所在的数据中心作为cluster,所以如果两者一致的话,不需要额外配置。 如果cluster和数据中心不一致的话,那么就需要通过System Property方式来指定运行时cluster: * -Dapollo.cluster=SomeCluster * 这里注意`apollo.cluster`为全小写 ## 4.3 自定义Namespace > 【本节仅对公共组件配置或需要多个应用共享配置才需要,如没有相关需求,可以跳过本节】 如果应用有公共组件(如hermes-producer,cat-client等)供其它应用使用,就需要通过自定义namespace来实现公共组件的配置。 ### 4.3.1 新建Namespace 以hermes-producer为例,需要先新建一个namespace,新建namespace只有项目的管理员才有权限,管理员可以在页面左侧看到“添加Namespace”按钮。 ![create-namespace](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-namespace.png) 点击后就进入namespace添加页面,Apollo会把应用所属的部门作为namespace的前缀,如FX。 ![create-namespace-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-namespace-detail.png) ### 4.3.2 关联到环境和集群 Namespace创建完,需要选择在哪些环境和集群下使用 ![link-namespace-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/link-namespace-detail.png) ### 4.3.3 在Namespace中添加配置项 接下来在这个新建的namespace下添加配置项 ![add-item-in-new-namespace](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/add-item-in-new-namespace.png) 添加完成后就能在FX.Hermes.Producer的namespace中看到配置。 ![item-created-in-new-namespace](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/item-created-in-new-namespace.png) ### 4.3.4 发布namespace的配置 ![publish-items-in-new-namespace](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/publish-items-in-new-namespace.png) ### 4.3.5 客户端获取Namespace配置 对自定义namespace的配置获取,稍有不同,需要程序传入namespace的名字。Apollo客户端还支持和Spring整合,更多客户端使用说明请参见[Java客户端使用指南](zh/usage/java-sdk-user-guide)和[.Net客户端使用指南](zh/usage/dotnet-sdk-user-guide)。 ```java Config config = ConfigService.getConfig("FX.Hermes.Producer"); Integer defaultSenderBatchSize = 200; Integer senderBatchSize = config.getIntProperty("sender.batchsize", defaultSenderBatchSize); ``` ### 4.3.6 客户端监听Namespace配置变化 ```java Config config = ConfigService.getConfig("FX.Hermes.Producer"); config.addChangeListener(new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { System.out.println("Changes for namespace " + changeEvent.getNamespace()); for (String key : changeEvent.changedKeys()) { ConfigChange change = changeEvent.getChange(key); System.out.println(String.format( "Found change - key: %s, oldValue: %s, newValue: %s, changeType: %s", change.getPropertyName(), change.getOldValue(), change.getNewValue(), change.getChangeType())); } } }); ``` ### 4.3.7 Spring集成样例 ```java @Configuration @EnableApolloConfig("FX.Hermes.Producer") public class AppConfig {} ``` ```java @Component public class SomeBean { //timeout的值会自动更新 @Value("${request.timeout:200}") private int timeout; } ``` ## 4.4 配置获取规则 > 【本节仅当应用自定义了集群或namespace才需要,如无相关需求,可以跳过本节】 在有了cluster概念后,配置的规则就显得重要了。 比如应用部署在A机房,但是并没有在Apollo新建cluster,这个时候Apollo的行为是怎样的? 或者在运行时指定了cluster=SomeCluster,但是并没有在Apollo新建cluster,这个时候Apollo的行为是怎样的? 接下来就来介绍一下配置获取的规则。 ### 4.4.1 应用自身配置的获取规则 当应用使用下面的语句获取配置时,我们称之为获取应用自身的配置,也就是应用自身的application namespace的配置。 ```java Config config = ConfigService.getAppConfig(); ``` 对这种情况的配置获取规则,简而言之如下: 1. 首先查找运行时cluster的配置(通过apollo.cluster指定) 2. 如果没有找到,则查找数据中心cluster的配置 3. 如果还是没有找到,则返回默认cluster的配置 图示如下: ![application-config-precedence](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/application-config-precedence.png) 所以如果应用部署在A数据中心,但是用户没有在Apollo创建cluster,那么获取的配置就是默认cluster(default)的。 如果应用部署在A数据中心,同时在运行时指定了SomeCluster,但是没有在Apollo创建cluster,那么获取的配置就是A数据中心cluster的配置,如果A数据中心cluster没有配置的话,那么获取的配置就是默认cluster(default)的。 ### 4.4.2 公共组件配置的获取规则 以`FX.Hermes.Producer`为例,hermes producer是hermes发布的公共组件。当使用下面的语句获取配置时,我们称之为获取公共组件的配置。 ```java Config config = ConfigService.getConfig("FX.Hermes.Producer"); ``` 对这种情况的配置获取规则,简而言之如下: 1. 首先获取当前应用下的`FX.Hermes.Producer` namespace的配置 2. 然后获取hermes应用下`FX.Hermes.Producer` namespace的配置 3. 上面两部分配置的并集就是最终使用的配置,如有key一样的部分,以当前应用优先 图示如下: ![public-namespace-config-precedence](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/public-namespace-config-precedence.png) 通过这种方式,就实现了对框架类组件的配置管理,框架组件提供方提供配置的默认值,应用如果有特殊需求,可以自行覆盖。 ## 4.5 总体设计 ![overall-architecture](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/overall-architecture.png) 上图简要描述了Apollo的总体设计,我们可以从下往上看: * Config Service提供配置的读取、推送等功能,服务对象是Apollo客户端 * Admin Service提供配置的修改、发布等功能,服务对象是Apollo Portal(管理界面) * Config Service和Admin Service都是多实例、无状态部署,所以需要将自己注册到Eureka中并保持心跳 * 在Eureka之上我们架了一层Meta Server用于封装Eureka的服务发现接口 * Client通过域名访问Meta Server获取Config Service服务列表(IP+Port),而后直接通过IP+Port访问服务,同时在Client侧会做load balance、错误重试 * Portal通过域名访问Meta Server获取Admin Service服务列表(IP+Port),而后直接通过IP+Port访问服务,同时在Portal侧会做load balance、错误重试 * 为了简化部署,我们实际上会把Config Service、Eureka和Meta Server三个逻辑角色部署在同一个JVM进程中 ### 4.5.1 Why Eureka 为什么我们采用Eureka作为服务注册中心,而不是使用传统的zk、etcd呢?我大致总结了一下,有以下几方面的原因: * 它提供了完整的Service Registry和Service Discovery实现 * 首先是提供了完整的实现,并且也经受住了Netflix自己的生产环境考验,相对使用起来会比较省心。 * 和Spring Cloud无缝集成 * 我们的项目本身就使用了Spring Cloud和Spring Boot,同时Spring Cloud还有一套非常完善的开源代码来整合Eureka,所以使用起来非常方便。 * 另外,Eureka还支持在我们应用自身的容器中启动,也就是说我们的应用启动完之后,既充当了Eureka的角色,同时也是服务的提供者。这样就极大的提高了服务的可用性。 * **这一点是我们选择Eureka而不是zk、etcd等的主要原因,为了提高配置中心的可用性和降低部署复杂度,我们需要尽可能地减少外部依赖。** * Open Source * 最后一点是开源,由于代码是开源的,所以非常便于我们了解它的实现原理和排查问题。 ## 4.6 客户端设计 ![client-architecture](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/client-architecture.png) 上图简要描述了Apollo客户端的实现原理: 1. 客户端和服务端保持了一个长连接,从而能第一时间获得配置更新的推送。 2. 客户端还会定时从Apollo配置中心服务端拉取应用的最新配置。 * 这是一个fallback机制,为了防止推送机制失效导致配置不更新 * 客户端定时拉取会上报本地版本,所以一般情况下,对于定时拉取的操作,服务端都会返回304 - Not Modified * 定时频率默认为每5分钟拉取一次,客户端也可以通过在运行时指定System Property: `apollo.refreshInterval`来覆盖,单位为分钟。 3. 客户端从Apollo配置中心服务端获取到应用的最新配置后,会保存在内存中 4. 客户端会把从服务端获取到的配置在本地文件系统缓存一份 * 在遇到服务不可用,或网络不通的时候,依然能从本地恢复配置 5. 应用程序从Apollo客户端获取最新的配置、订阅配置更新通知 ### 4.6.1 配置更新推送实现 前面提到了Apollo客户端和服务端保持了一个长连接,从而能第一时间获得配置更新的推送。 长连接实际上我们是通过Http Long Polling实现的,具体而言: * 客户端发起一个Http请求到服务端 * 服务端会保持住这个连接60秒 * 如果在60秒内有客户端关心的配置变化,被保持住的客户端请求会立即返回,并告知客户端有配置变化的namespace信息,客户端会据此拉取对应namespace的最新配置 * 如果在60秒内没有客户端关心的配置变化,那么会返回Http状态码304给客户端 * 客户端在收到服务端请求后会立即重新发起连接,回到第一步 考虑到会有数万客户端向服务端发起长连,在服务端我们使用了async servlet(Spring DeferredResult)来服务Http Long Polling请求。 ## 4.7 可用性考虑 配置中心作为基础服务,可用性要求非常高,下面的表格描述了不同场景下Apollo的可用性: | 场景 | 影响 | 降级 | 原因 | |------------------------|--------------------------------------|---------------------------------------|-----------------------------------------------------------------------------------------| | 某台config service下线 | 无影响 | | Config service无状态,客户端重连其它config service | | 所有config service下线 | 客户端无法读取最新配置,Portal无影响 | 客户端重启时,可以读取本地缓存配置文件 | | | 某台admin service下线 | 无影响 | | Admin service无状态,Portal重连其它admin service | | 所有admin service下线 | 客户端无影响,portal无法更新配置 | | | | 某台portal下线 | 无影响 | | Portal域名通过slb绑定多台服务器,重试后指向可用的服务器 | | 全部portal下线 | 客户端无影响,portal无法更新配置 | | | | 某个数据中心下线 | 无影响 | | 多数据中心部署,数据完全同步,Meta Server/Portal域名通过slb自动切换到其它存活的数据中心 | # 5、Contribute to Apollo Apollo从开发之初就是以开源模式开发的,所以也非常欢迎有兴趣、有余力的朋友一起加入进来。 服务端开发使用的是Java,基于Spring Cloud和Spring Boot框架。客户端目前提供了Java和.Net两种实现。 Github地址:<a href="https://github.com/ctripcorp/apollo" target="_blank">https://github.com/ctripcorp/apollo</a> 欢迎大家发起Pull Request!
# &nbsp; # 1、What is Apollo ## 1.1 背景 随着程序功能的日益复杂,程序的配置日益增多:各种功能的开关、参数的配置、服务器的地址…… 对程序配置的期望值也越来越高:配置修改后实时生效,灰度发布,分环境、分集群管理配置,完善的权限、审核机制…… 在这样的大环境下,传统的通过配置文件、数据库等方式已经越来越无法满足开发人员对配置管理的需求。 Apollo配置中心应运而生! ## 1.2 Apollo简介 Apollo(阿波罗)是携程框架部门研发的开源配置管理中心,能够集中化管理应用不同环境、不同集群的配置,配置修改后能够实时推送到应用端,并且具备规范的权限、流程治理等特性。 Apollo支持4个维度管理Key-Value格式的配置: 1. application (应用) 2. environment (环境) 3. cluster (集群) 4. namespace (命名空间) 同时,Apollo基于开源模式开发,开源地址:<a href="https://github.com/ctripcorp/apollo" target="_blank">https://github.com/ctripcorp/apollo</a> ## 1.2 配置基本概念 既然Apollo定位于配置中心,那么在这里有必要先简单介绍一下什么是配置。 按照我们的理解,配置有以下几个属性: * **配置是独立于程序的只读变量** * 配置首先是独立于程序的,同一份程序在不同的配置下会有不同的行为。 * 其次,配置对于程序是只读的,程序通过读取配置来改变自己的行为,但是程序不应该去改变配置。 * 常见的配置有:DB Connection Str、Thread Pool Size、Buffer Size、Request Timeout、Feature Switch、Server Urls等。 * **配置伴随应用的整个生命周期** * 配置贯穿于应用的整个生命周期,应用在启动时通过读取配置来初始化,在运行时根据配置调整行为。 * **配置可以有多种加载方式** * 配置也有很多种加载方式,常见的有程序内部hard code,配置文件,环境变量,启动参数,基于数据库等 * **配置需要治理** * 权限控制 * 由于配置能改变程序的行为,不正确的配置甚至能引起灾难,所以对配置的修改必须有比较完善的权限控制 * 不同环境、集群配置管理 * 同一份程序在不同的环境(开发,测试,生产)、不同的集群(如不同的数据中心)经常需要有不同的配置,所以需要有完善的环境、集群配置管理 * 框架类组件配置管理 * 还有一类比较特殊的配置 - 框架类组件配置,比如CAT客户端的配置。 * 虽然这类框架类组件是由其他团队开发、维护,但是运行时是在业务实际应用内的,所以本质上可以认为框架类组件也是应用的一部分。 * 这类组件对应的配置也需要有比较完善的管理方式。 # 2、Why Apollo 正是基于配置的特殊性,所以Apollo从设计之初就立志于成为一个有治理能力的配置发布平台,目前提供了以下的特性: * **统一管理不同环境、不同集群的配置** * Apollo提供了一个统一界面集中式管理不同环境(environment)、不同集群(cluster)、不同命名空间(namespace)的配置。 * 同一份代码部署在不同的集群,可以有不同的配置,比如zookeeper的地址等 * 通过命名空间(namespace)可以很方便地支持多个不同应用共享同一份配置,同时还允许应用对共享的配置进行覆盖 * **配置修改实时生效(热发布)** * 用户在Apollo修改完配置并发布后,客户端能实时(1秒)接收到最新的配置,并通知到应用程序 * **版本发布管理** * 所有的配置发布都有版本概念,从而可以方便地支持配置的回滚 * **灰度发布** * 支持配置的灰度发布,比如点了发布后,只对部分应用实例生效,等观察一段时间没问题后再推给所有应用实例 * **权限管理、发布审核、操作审计** * 应用和配置的管理都有完善的权限管理机制,对配置的管理还分为了编辑和发布两个环节,从而减少人为的错误。 * 所有的操作都有审计日志,可以方便地追踪问题 * **客户端配置信息监控** * 可以在界面上方便地看到配置在被哪些实例使用 * **提供Java和.Net原生客户端** * 提供了Java和.Net的原生客户端,方便应用集成 * 支持Spring Placeholder, Annotation和Spring Boot的ConfigurationProperties,方便应用使用(需要Spring 3.1.1+) * 同时提供了Http接口,非Java和.Net应用也可以方便地使用 * **提供开放平台API** * Apollo自身提供了比较完善的统一配置管理界面,支持多环境、多数据中心配置管理、权限、流程治理等特性。不过Apollo出于通用性考虑,不会对配置的修改做过多限制,只要符合基本的格式就能保存,不会针对不同的配置值进行针对性的校验,如数据库用户名、密码,Redis服务地址等 * 对于这类应用配置,Apollo支持应用方通过开放平台API在Apollo进行配置的修改和发布,并且具备完善的授权和权限控制 * **部署简单** * 配置中心作为基础服务,可用性要求非常高,这就要求Apollo对外部依赖尽可能地少 * 目前唯一的外部依赖是MySQL,所以部署非常简单,只要安装好Java和MySQL就可以让Apollo跑起来 * Apollo还提供了打包脚本,一键就可以生成所有需要的安装包,并且支持自定义运行时参数 # 3、Apollo at a glance ## 3.1 基础模型 如下即是Apollo的基础模型: 1. 用户在配置中心对配置进行修改并发布 2. 配置中心通知Apollo客户端有配置更新 3. Apollo客户端从配置中心拉取最新的配置、更新本地配置并通知到应用 ![basic-architecture](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/basic-architecture.png) ## 3.2 界面概览 ![apollo-home-screenshot](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/apollo-home-screenshot.jpg) 上图是Apollo配置中心中一个项目的配置首页 * 在页面左上方的环境列表模块展示了所有的环境和集群,用户可以随时切换。 * 页面中央展示了两个namespace(application和FX.apollo)的配置信息,默认按照表格模式展示、编辑。用户也可以切换到文本模式,以文件形式查看、编辑。 * 页面上可以方便地进行发布、回滚、灰度、授权、查看更改历史和发布历史等操作 ## 3.3 添加/修改配置项 用户可以通过配置中心界面方便的添加/修改配置项,更多使用说明请参见[应用接入指南](zh/usage/apollo-user-guide) ![edit-item-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/edit-item-entry.png) 输入配置信息: ![edit-item](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/edit-item.png) ## 3.4 发布配置 通过配置中心发布配置: ![publish-items](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/publish-items-entry.png) 填写发布信息: ![publish-items](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/publish-items.png) ## 3.5 客户端获取配置(Java API样例) 配置发布后,就能在客户端获取到了,以Java为例,获取配置的示例代码如下。Apollo客户端还支持和Spring整合,更多客户端使用说明请参见[Java客户端使用指南](zh/usage/java-sdk-user-guide)和[.Net客户端使用指南](zh/usage/dotnet-sdk-user-guide)。 ```java Config config = ConfigService.getAppConfig(); Integer defaultRequestTimeout = 200; Integer requestTimeout = config.getIntProperty("requestTimeout", defaultRequestTimeout); ``` ## 3.6 客户端监听配置变化 通过上述获取配置代码,应用就能实时获取到最新的配置了。 不过在某些场景下,应用还需要在配置变化时获得通知,比如数据库连接的切换等,所以Apollo还提供了监听配置变化的功能,Java示例如下: ```java Config config = ConfigService.getAppConfig(); config.addChangeListener(new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { for (String key : changeEvent.changedKeys()) { ConfigChange change = changeEvent.getChange(key); System.out.println(String.format( "Found change - key: %s, oldValue: %s, newValue: %s, changeType: %s", change.getPropertyName(), change.getOldValue(), change.getNewValue(), change.getChangeType())); } } }); ``` ## 3.7 Spring集成样例 Apollo和Spring也可以很方便地集成,只需要标注`@EnableApolloConfig`后就可以通过`@Value`获取配置信息: ```java @Configuration @EnableApolloConfig public class AppConfig {} ``` ```java @Component public class SomeBean { //timeout的值会自动更新 @Value("${request.timeout:200}") private int timeout; } ``` # 4、Apollo in depth 通过上面的介绍,相信大家已经对Apollo有了一个初步的了解,并且相信已经覆盖到了大部分的使用场景。 接下来会主要介绍Apollo的cluster管理(集群)、namespace管理(命名空间)和对应的配置获取规则。 ## 4.1 Core Concepts 在介绍高级特性前,我们有必要先来了解一下Apollo中的几个核心概念: 1. **application (应用)** * 这个很好理解,就是实际使用配置的应用,Apollo客户端在运行时需要知道当前应用是谁,从而可以去获取对应的配置 * 每个应用都需要有唯一的身份标识 -- appId,我们认为应用身份是跟着代码走的,所以需要在代码中配置,具体信息请参见[Java客户端使用指南](zh/usage/java-sdk-user-guide)。 2. **environment (环境)** * 配置对应的环境,Apollo客户端在运行时需要知道当前应用处于哪个环境,从而可以去获取应用的配置 * 我们认为环境和代码无关,同一份代码部署在不同的环境就应该能够获取到不同环境的配置 * 所以环境默认是通过读取机器上的配置(server.properties中的env属性)指定的,不过为了开发方便,我们也支持运行时通过System Property等指定,具体信息请参见[Java客户端使用指南](zh/usage/java-sdk-user-guide)。 3. **cluster (集群)** * 一个应用下不同实例的分组,比如典型的可以按照数据中心分,把上海机房的应用实例分为一个集群,把北京机房的应用实例分为另一个集群。 * 对不同的cluster,同一个配置可以有不一样的值,如zookeeper地址。 * 集群默认是通过读取机器上的配置(server.properties中的idc属性)指定的,不过也支持运行时通过System Property指定,具体信息请参见[Java客户端使用指南](zh/usage/java-sdk-user-guide)。 4. **namespace (命名空间)** * 一个应用下不同配置的分组,可以简单地把namespace类比为文件,不同类型的配置存放在不同的文件中,如数据库配置文件,RPC配置文件,应用自身的配置文件等 * 应用可以直接读取到公共组件的配置namespace,如DAL,RPC等 * 应用也可以通过继承公共组件的配置namespace来对公共组件的配置做调整,如DAL的初始数据库连接数 ## 4.2 自定义Cluster > 【本节内容仅对应用需要对不同集群应用不同配置才需要,如没有相关需求,可以跳过本节】 比如我们有应用在A数据中心和B数据中心都有部署,那么如果希望两个数据中心的配置不一样的话,我们可以通过新建cluster来解决。 ### 4.2.1 新建Cluster 新建Cluster只有项目的管理员才有权限,管理员可以在页面左侧看到“添加集群”按钮。 ![create-cluster](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-cluster.png) 点击后就进入到集群添加页面,一般情况下可以按照数据中心来划分集群,如SHAJQ、SHAOY等。 不过也支持自定义集群,比如可以为A机房的某一台机器和B机房的某一台机创建一个集群,使用一套配置。 ![create-cluster-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-cluster-detail.png) ### 4.2.2 在Cluster中添加配置并发布 集群添加成功后,就可以为该集群添加配置了,首先需要按照下图所示切换到SHAJQ集群,之后配置添加流程和[3.3 添加/修改配置项](#_33-添加修改配置项)一样,这里就不再赘述了。 ![cluster-created](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/cluster-created.png) ### 4.2.3 指定应用实例所属的Cluster Apollo会默认使用应用实例所在的数据中心作为cluster,所以如果两者一致的话,不需要额外配置。 如果cluster和数据中心不一致的话,那么就需要通过System Property方式来指定运行时cluster: * -Dapollo.cluster=SomeCluster * 这里注意`apollo.cluster`为全小写 ## 4.3 自定义Namespace > 【本节仅对公共组件配置或需要多个应用共享配置才需要,如没有相关需求,可以跳过本节】 如果应用有公共组件(如hermes-producer,cat-client等)供其它应用使用,就需要通过自定义namespace来实现公共组件的配置。 ### 4.3.1 新建Namespace 以hermes-producer为例,需要先新建一个namespace,新建namespace只有项目的管理员才有权限,管理员可以在页面左侧看到“添加Namespace”按钮。 ![create-namespace](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-namespace.png) 点击后就进入namespace添加页面,Apollo会把应用所属的部门作为namespace的前缀,如FX。 ![create-namespace-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-namespace-detail.png) ### 4.3.2 关联到环境和集群 Namespace创建完,需要选择在哪些环境和集群下使用 ![link-namespace-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/link-namespace-detail.png) ### 4.3.3 在Namespace中添加配置项 接下来在这个新建的namespace下添加配置项 ![add-item-in-new-namespace](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/add-item-in-new-namespace.png) 添加完成后就能在FX.Hermes.Producer的namespace中看到配置。 ![item-created-in-new-namespace](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/item-created-in-new-namespace.png) ### 4.3.4 发布namespace的配置 ![publish-items-in-new-namespace](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/publish-items-in-new-namespace.png) ### 4.3.5 客户端获取Namespace配置 对自定义namespace的配置获取,稍有不同,需要程序传入namespace的名字。Apollo客户端还支持和Spring整合,更多客户端使用说明请参见[Java客户端使用指南](zh/usage/java-sdk-user-guide)和[.Net客户端使用指南](zh/usage/dotnet-sdk-user-guide)。 ```java Config config = ConfigService.getConfig("FX.Hermes.Producer"); Integer defaultSenderBatchSize = 200; Integer senderBatchSize = config.getIntProperty("sender.batchsize", defaultSenderBatchSize); ``` ### 4.3.6 客户端监听Namespace配置变化 ```java Config config = ConfigService.getConfig("FX.Hermes.Producer"); config.addChangeListener(new ConfigChangeListener() { @Override public void onChange(ConfigChangeEvent changeEvent) { System.out.println("Changes for namespace " + changeEvent.getNamespace()); for (String key : changeEvent.changedKeys()) { ConfigChange change = changeEvent.getChange(key); System.out.println(String.format( "Found change - key: %s, oldValue: %s, newValue: %s, changeType: %s", change.getPropertyName(), change.getOldValue(), change.getNewValue(), change.getChangeType())); } } }); ``` ### 4.3.7 Spring集成样例 ```java @Configuration @EnableApolloConfig("FX.Hermes.Producer") public class AppConfig {} ``` ```java @Component public class SomeBean { //timeout的值会自动更新 @Value("${request.timeout:200}") private int timeout; } ``` ## 4.4 配置获取规则 > 【本节仅当应用自定义了集群或namespace才需要,如无相关需求,可以跳过本节】 在有了cluster概念后,配置的规则就显得重要了。 比如应用部署在A机房,但是并没有在Apollo新建cluster,这个时候Apollo的行为是怎样的? 或者在运行时指定了cluster=SomeCluster,但是并没有在Apollo新建cluster,这个时候Apollo的行为是怎样的? 接下来就来介绍一下配置获取的规则。 ### 4.4.1 应用自身配置的获取规则 当应用使用下面的语句获取配置时,我们称之为获取应用自身的配置,也就是应用自身的application namespace的配置。 ```java Config config = ConfigService.getAppConfig(); ``` 对这种情况的配置获取规则,简而言之如下: 1. 首先查找运行时cluster的配置(通过apollo.cluster指定) 2. 如果没有找到,则查找数据中心cluster的配置 3. 如果还是没有找到,则返回默认cluster的配置 图示如下: ![application-config-precedence](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/application-config-precedence.png) 所以如果应用部署在A数据中心,但是用户没有在Apollo创建cluster,那么获取的配置就是默认cluster(default)的。 如果应用部署在A数据中心,同时在运行时指定了SomeCluster,但是没有在Apollo创建cluster,那么获取的配置就是A数据中心cluster的配置,如果A数据中心cluster没有配置的话,那么获取的配置就是默认cluster(default)的。 ### 4.4.2 公共组件配置的获取规则 以`FX.Hermes.Producer`为例,hermes producer是hermes发布的公共组件。当使用下面的语句获取配置时,我们称之为获取公共组件的配置。 ```java Config config = ConfigService.getConfig("FX.Hermes.Producer"); ``` 对这种情况的配置获取规则,简而言之如下: 1. 首先获取当前应用下的`FX.Hermes.Producer` namespace的配置 2. 然后获取hermes应用下`FX.Hermes.Producer` namespace的配置 3. 上面两部分配置的并集就是最终使用的配置,如有key一样的部分,以当前应用优先 图示如下: ![public-namespace-config-precedence](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/public-namespace-config-precedence.png) 通过这种方式,就实现了对框架类组件的配置管理,框架组件提供方提供配置的默认值,应用如果有特殊需求,可以自行覆盖。 ## 4.5 总体设计 ![overall-architecture](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/overall-architecture.png) 上图简要描述了Apollo的总体设计,我们可以从下往上看: * Config Service提供配置的读取、推送等功能,服务对象是Apollo客户端 * Admin Service提供配置的修改、发布等功能,服务对象是Apollo Portal(管理界面) * Config Service和Admin Service都是多实例、无状态部署,所以需要将自己注册到Eureka中并保持心跳 * 在Eureka之上我们架了一层Meta Server用于封装Eureka的服务发现接口 * Client通过域名访问Meta Server获取Config Service服务列表(IP+Port),而后直接通过IP+Port访问服务,同时在Client侧会做load balance、错误重试 * Portal通过域名访问Meta Server获取Admin Service服务列表(IP+Port),而后直接通过IP+Port访问服务,同时在Portal侧会做load balance、错误重试 * 为了简化部署,我们实际上会把Config Service、Eureka和Meta Server三个逻辑角色部署在同一个JVM进程中 ### 4.5.1 Why Eureka 为什么我们采用Eureka作为服务注册中心,而不是使用传统的zk、etcd呢?我大致总结了一下,有以下几方面的原因: * 它提供了完整的Service Registry和Service Discovery实现 * 首先是提供了完整的实现,并且也经受住了Netflix自己的生产环境考验,相对使用起来会比较省心。 * 和Spring Cloud无缝集成 * 我们的项目本身就使用了Spring Cloud和Spring Boot,同时Spring Cloud还有一套非常完善的开源代码来整合Eureka,所以使用起来非常方便。 * 另外,Eureka还支持在我们应用自身的容器中启动,也就是说我们的应用启动完之后,既充当了Eureka的角色,同时也是服务的提供者。这样就极大的提高了服务的可用性。 * **这一点是我们选择Eureka而不是zk、etcd等的主要原因,为了提高配置中心的可用性和降低部署复杂度,我们需要尽可能地减少外部依赖。** * Open Source * 最后一点是开源,由于代码是开源的,所以非常便于我们了解它的实现原理和排查问题。 ## 4.6 客户端设计 ![client-architecture](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/client-architecture.png) 上图简要描述了Apollo客户端的实现原理: 1. 客户端和服务端保持了一个长连接,从而能第一时间获得配置更新的推送。 2. 客户端还会定时从Apollo配置中心服务端拉取应用的最新配置。 * 这是一个fallback机制,为了防止推送机制失效导致配置不更新 * 客户端定时拉取会上报本地版本,所以一般情况下,对于定时拉取的操作,服务端都会返回304 - Not Modified * 定时频率默认为每5分钟拉取一次,客户端也可以通过在运行时指定System Property: `apollo.refreshInterval`来覆盖,单位为分钟。 3. 客户端从Apollo配置中心服务端获取到应用的最新配置后,会保存在内存中 4. 客户端会把从服务端获取到的配置在本地文件系统缓存一份 * 在遇到服务不可用,或网络不通的时候,依然能从本地恢复配置 5. 应用程序从Apollo客户端获取最新的配置、订阅配置更新通知 ### 4.6.1 配置更新推送实现 前面提到了Apollo客户端和服务端保持了一个长连接,从而能第一时间获得配置更新的推送。 长连接实际上我们是通过Http Long Polling实现的,具体而言: * 客户端发起一个Http请求到服务端 * 服务端会保持住这个连接60秒 * 如果在60秒内有客户端关心的配置变化,被保持住的客户端请求会立即返回,并告知客户端有配置变化的namespace信息,客户端会据此拉取对应namespace的最新配置 * 如果在60秒内没有客户端关心的配置变化,那么会返回Http状态码304给客户端 * 客户端在收到服务端请求后会立即重新发起连接,回到第一步 考虑到会有数万客户端向服务端发起长连,在服务端我们使用了async servlet(Spring DeferredResult)来服务Http Long Polling请求。 ## 4.7 可用性考虑 配置中心作为基础服务,可用性要求非常高,下面的表格描述了不同场景下Apollo的可用性: | 场景 | 影响 | 降级 | 原因 | |------------------------|--------------------------------------|---------------------------------------|-----------------------------------------------------------------------------------------| | 某台config service下线 | 无影响 | | Config service无状态,客户端重连其它config service | | 所有config service下线 | 客户端无法读取最新配置,Portal无影响 | 客户端重启时,可以读取本地缓存配置文件 | | | 某台admin service下线 | 无影响 | | Admin service无状态,Portal重连其它admin service | | 所有admin service下线 | 客户端无影响,portal无法更新配置 | | | | 某台portal下线 | 无影响 | | Portal域名通过slb绑定多台服务器,重试后指向可用的服务器 | | 全部portal下线 | 客户端无影响,portal无法更新配置 | | | | 某个数据中心下线 | 无影响 | | 多数据中心部署,数据完全同步,Meta Server/Portal域名通过slb自动切换到其它存活的数据中心 | # 5、Contribute to Apollo Apollo从开发之初就是以开源模式开发的,所以也非常欢迎有兴趣、有余力的朋友一起加入进来。 服务端开发使用的是Java,基于Spring Cloud和Spring Boot框架。客户端目前提供了Java和.Net两种实现。 Github地址:<a href="https://github.com/ctripcorp/apollo" target="_blank">https://github.com/ctripcorp/apollo</a> 欢迎大家发起Pull Request!
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./CONTRIBUTING.md
## Contributing to apollo Apollo is released under the non-restrictive Apache 2.0 license, and follows a very standard Github development process, using Github tracker for issues and merging pull requests into master. If you want to contribute even something trivial please do not hesitate, but follow the guidelines below. ### Sign the Contributor License Agreement Before we accept a non-trivial patch or pull request we will need you to sign the Contributor License Agreement. Signing the contributor’s agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. Active contributors might be asked to join the core team, and given the ability to merge pull requests. ### Code Conventions Our code style is in line with [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html). We provide template files [intellij-java-google-style.xml](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/intellij-java-google-style.xml) for IntelliJ IDEA and [eclipse-java-google-style.xml](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/eclipse-java-google-style.xml) for Eclipse. If you use other IDEs, then you may config manually by referencing the template files. * Make sure all new .java files have a simple Javadoc class comment with at least an `@author` tag identifying you, and preferably at least a paragraph on what the class is for. * Add yourself as an @author to the .java files that you modify substantially (more than cosmetic changes). * Add some Javadocs and, if you change the namespace, some XSD doc elements. * A few unit tests should be added for a new feature or an important bug fix. * If no-one else is using your branch, please rebase it against the current master (or other target branch in the main project). * Normally, we would squash commits for one feature into one commit. There are 2 ways to do this: 1. To rebase and squash based on the remote branch * `git rebase -i <remote>/master` * merge commits via `fixup`, etc 2. Create a new branch and merge these commits into one * `git checkout -b <some-branch-name> <remote>/master` * `git merge --squash <current-feature-branch>` * When writing a commit message please follow these conventions: if you are fixing an existing issue, please add Fixes #XXX at the end of the commit message (where XXX is the issue number).
## Contributing to apollo Apollo is released under the non-restrictive Apache 2.0 license, and follows a very standard Github development process, using Github tracker for issues and merging pull requests into master. If you want to contribute even something trivial please do not hesitate, but follow the guidelines below. ### Sign the Contributor License Agreement Before we accept a non-trivial patch or pull request we will need you to sign the Contributor License Agreement. Signing the contributor’s agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. Active contributors might be asked to join the core team, and given the ability to merge pull requests. ### Code Conventions Our code style is in line with [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html). We provide template files [intellij-java-google-style.xml](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/intellij-java-google-style.xml) for IntelliJ IDEA and [eclipse-java-google-style.xml](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/eclipse-java-google-style.xml) for Eclipse. If you use other IDEs, then you may config manually by referencing the template files. * Make sure all new .java files have a simple Javadoc class comment with at least an `@author` tag identifying you, and preferably at least a paragraph on what the class is for. * Add yourself as an @author to the .java files that you modify substantially (more than cosmetic changes). * Add some Javadocs and, if you change the namespace, some XSD doc elements. * A few unit tests should be added for a new feature or an important bug fix. * If no-one else is using your branch, please rebase it against the current master (or other target branch in the main project). * Normally, we would squash commits for one feature into one commit. There are 2 ways to do this: 1. To rebase and squash based on the remote branch * `git rebase -i <remote>/master` * merge commits via `fixup`, etc 2. Create a new branch and merge these commits into one * `git checkout -b <some-branch-name> <remote>/master` * `git merge --squash <current-feature-branch>` * When writing a commit message please follow these conventions: if you are fixing an existing issue, please add Fixes #XXX at the end of the commit message (where XXX is the issue number).
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./docs/_navbar.md
- Translations - [:uk: English](/en/) - [:cn: 中文](/zh/)
- Translations - [:uk: English](/en/) - [:cn: 中文](/zh/)
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./docs/zh/deployment/distributed-deployment-guide.md
本文档介绍了如何按照分布式部署的方式编译、打包、部署Apollo配置中心,从而可以在开发、测试、生产等环境分别部署运行。 > 如果只是需要在本地快速部署试用Apollo的话,可以参考[Quick Start](zh/deployment/quick-start) # &nbsp; # 一、准备工作 ## 1.1 运行时环境 ### 1.1.1 OS 服务端基于Spring Boot,启动脚本理论上支持所有Linux发行版,建议[CentOS 7](https://www.centos.org/)。 ### 1.1.2 Java * Apollo服务端:1.8+ * Apollo客户端:1.7+ 由于需要同时运行服务端和客户端,所以建议安装Java 1.8+。 >对于Apollo客户端,运行时环境只需要1.7+即可。 >注:对于Apollo客户端,如果有需要的话,可以做少量代码修改来降级到Java 1.6,详细信息可以参考[Issue 483](https://github.com/ctripcorp/apollo/issues/483) 在配置好后,可以通过如下命令检查: ```sh java -version ``` 样例输出: ```sh java version "1.8.0_74" Java(TM) SE Runtime Environment (build 1.8.0_74-b02) Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode) ``` ## 1.2 MySQL * 版本要求:5.6.5+ Apollo的表结构对`timestamp`使用了多个default声明,所以需要5.6.5以上版本。 连接上MySQL后,可以通过如下命令检查: ```sql SHOW VARIABLES WHERE Variable_name = 'version'; ``` | Variable_name | Value | |---------------|--------| | version | 5.7.11 | > 注1:MySQL版本可以降级到5.5,详见[mysql 依赖降级讨论](https://github.com/ctripcorp/apollo/issues/481)。 > 注2:如果希望使用Oracle的话,可以参考[vanpersl](https://github.com/vanpersl)在Apollo 0.8.0基础上开发的[Oracle适配代码](https://github.com/ctripcorp/apollo/compare/v0.8.0...vanpersl:db-oracle),Oracle版本为10.2.0.1.0。 > 注3:如果希望使用Postgres的话,可以参考[oaksharks](https://github.com/oaksharks)在Apollo 0.9.1基础上开发的[Pg适配代码](https://github.com/oaksharks/apollo/compare/ac10768ee2e11c488523ca0e845984f6f71499ac...oaksharks:pg),Postgres的版本为9.3.20,也可以参考[xiao0yy](https://github.com/xiao0yy)在Apollo 0.10.2基础上开发的[Pg适配代码](https://github.com/ctripcorp/apollo/issues/1293),Postgres的版本为9.5。 ## 1.3 环境 分布式部署需要事先确定部署的环境以及部署方式。 Apollo目前支持以下环境: * DEV * 开发环境 * FAT * 测试环境,相当于alpha环境(功能测试) * UAT * 集成环境,相当于beta环境(回归测试) * PRO * 生产环境 > 如果希望添加自定义的环境名称,具体步骤可以参考[Portal如何增加环境](zh/faq/common-issues-in-deployment-and-development-phase?id=_4-portal如何增加环境?) 以ctrip为例,我们的部署策略如下: ![Deployment](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/apollo-deployment.png) * Portal部署在生产环境的机房,通过它来直接管理FAT、UAT、PRO等环境的配置 * Meta Server、Config Service和Admin Service在每个环境都单独部署,使用独立的数据库 * Meta Server、Config Service和Admin Service在生产环境部署在两个机房,实现双活 * Meta Server和Config Service部署在同一个JVM进程内,Admin Service部署在同一台服务器的另一个JVM进程内 另外也可以参考下[@lyliyongblue](https://github.com/lyliyongblue) 贡献的样例部署图(建议右键新窗口打开看大图): ![Deployment](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/lyliyongblue-apollo-deployment.png) ## 1.4 网络策略 分布式部署的时候,`apollo-configservice`和`apollo-adminservice`需要把自己的IP和端口注册到Meta Server(apollo-configservice本身)。 Apollo客户端和Portal会从Meta Server获取服务的地址(IP+端口),然后通过服务地址直接访问。 需要注意的是,`apollo-configservice`和`apollo-adminservice`是基于内网可信网络设计的,所以出于安全考虑,**请不要将`apollo-configservice`和`apollo-adminservice`直接暴露在公网**。 所以如果实际部署的机器有多块网卡(如docker),或者存在某些网卡的IP是Apollo客户端和Portal无法访问的(如网络安全限制),那么我们就需要在`apollo-configservice`和`apollo-adminservice`中做相关配置来解决连通性问题。 ### 1.4.1 忽略某些网卡 可以分别修改`apollo-configservice`和`apollo-adminservice`的startup.sh,通过JVM System Property传入-D参数,也可以通过OS Environment Variable传入,下面的例子会把`docker0`和`veth`开头的网卡在注册到Eureka时忽略掉。 JVM System Property示例: ```properties -Dspring.cloud.inetutils.ignoredInterfaces[0]=docker0 -Dspring.cloud.inetutils.ignoredInterfaces[1]=veth.* ``` OS Environment Variable示例: ```properties SPRING_CLOUD_INETUTILS_IGNORED_INTERFACES[0]=docker0 SPRING_CLOUD_INETUTILS_IGNORED_INTERFACES[1]=veth.* ``` ### 1.4.2 指定要注册的IP 可以分别修改`apollo-configservice`和`apollo-adminservice`的startup.sh,通过JVM System Property传入-D参数,也可以通过OS Environment Variable传入,下面的例子会指定注册的IP为`1.2.3.4`。 JVM System Property示例: ```properties -Deureka.instance.ip-address=1.2.3.4 ``` OS Environment Variable示例: ```properties EUREKA_INSTANCE_IP_ADDRESS=1.2.3.4 ``` ### 1.4.3 指定要注册的URL 可以分别修改`apollo-configservice`和`apollo-adminservice`的startup.sh,通过JVM System Property传入-D参数,也可以通过OS Environment Variable传入,下面的例子会指定注册的URL为`http://1.2.3.4:8080`。 JVM System Property示例: ```properties -Deureka.instance.homePageUrl=http://1.2.3.4:8080 -Deureka.instance.preferIpAddress=false ``` OS Environment Variable示例: ```properties EUREKA_INSTANCE_HOME_PAGE_URL=http://1.2.3.4:8080 EUREKA_INSTANCE_PREFER_IP_ADDRESS=false ``` ### 1.4.4 直接指定apollo-configservice地址 如果Apollo部署在公有云上,本地开发环境无法连接,但又需要做开发测试的话,客户端可以升级到0.11.0版本及以上,然后配置[跳过Apollo Meta Server服务发现](zh/usage/java-sdk-user-guide#_1222-跳过apollo-meta-server服务发现) # 二、部署步骤 部署步骤总体还是比较简单的,Apollo的唯一依赖是数据库,所以需要首先把数据库准备好,然后根据实际情况,选择不同的部署方式: > [@lingjiaju](https://github.com/lingjiaju)录制了一系列Apollo快速上手视频,如果看文档觉得略繁琐的话,不妨可以先看一下他的[视频教程](https://pan.baidu.com/s/1blv87EOZS77NWT8Amkijkw#list/path=%2F)。 > 如果部署过程中遇到了问题,可以参考[部署&开发遇到的常见问题](zh/faq/common-issues-in-deployment-and-development-phase),一般都能找到答案。 ## 2.1 创建数据库 Apollo服务端共需要两个数据库:`ApolloPortalDB`和`ApolloConfigDB`,我们把数据库、表的创建和样例数据都分别准备了sql文件,只需要导入数据库即可。 需要注意的是ApolloPortalDB只需要在生产环境部署一个即可,而ApolloConfigDB需要在每个环境部署一套,如fat、uat和pro分别部署3套ApolloConfigDB。 > 注意:如果你本地已经创建过Apollo数据库,请注意备份数据。我们准备的sql文件会清空Apollo相关的表。 ### 2.1.1 创建ApolloPortalDB 可以根据实际情况选择通过手动导入SQL或是通过[Flyway](https://flywaydb.org/)自动导入SQL创建。 #### 2.1.1.1 手动导入SQL创建 通过各种MySQL客户端导入[apolloportaldb.sql](https://github.com/ctripcorp/apollo/blob/master/scripts/sql/apolloportaldb.sql)即可。 以MySQL原生客户端为例: ```sql source /your_local_path/scripts/sql/apolloportaldb.sql ``` #### 2.1.1.2 通过Flyway导入SQL创建 > 需要1.3.0及以上版本 1. 根据实际情况修改[flyway-portaldb.properties](https://github.com/ctripcorp/apollo/blob/master/scripts/flyway/flyway-portaldb.properties)中的`flyway.user`、`flyway.password`和`flyway.url`配置 2. 在apollo项目根目录下执行`mvn -N -Pportaldb flyway:migrate` #### 2.1.1.3 验证 导入成功后,可以通过执行以下sql语句来验证: ```sql select `Id`, `Key`, `Value`, `Comment` from `ApolloPortalDB`.`ServerConfig` limit 1; ``` | Id | Key | Value | Comment | |----|--------------------|-------|------------------| | 1 | apollo.portal.envs | dev | 可支持的环境列表 | > 注:ApolloPortalDB只需要在生产环境部署一个即可 ### 2.1.2 创建ApolloConfigDB 可以根据实际情况选择通过手动导入SQL或是通过[Flyway](https://flywaydb.org/)自动导入SQL创建。 #### 2.1.2.1 手动导入SQL 通过各种MySQL客户端导入[apolloconfigdb.sql](https://github.com/ctripcorp/apollo/blob/master/scripts/sql/apolloconfigdb.sql)即可。 以MySQL原生客户端为例: ```sql source /your_local_path/scripts/sql/apolloconfigdb.sql ``` #### 2.1.2.2 通过Flyway导入SQL > 需要1.3.0及以上版本 1. 根据实际情况修改[flyway-configdb.properties](https://github.com/ctripcorp/apollo/blob/master/scripts/flyway/flyway-configdb.properties)中的`flyway.user`、`flyway.password`和`flyway.url`配置 2. 在apollo项目根目录下执行`mvn -N -Pconfigdb flyway:migrate` #### 2.1.2.3 验证 导入成功后,可以通过执行以下sql语句来验证: ```sql select `Id`, `Key`, `Value`, `Comment` from `ApolloConfigDB`.`ServerConfig` limit 1; ``` | Id | Key | Value | Comment | |----|--------------------|-------------------------------|---------------| | 1 | eureka.service.url | http://127.0.0.1:8080/eureka/ | Eureka服务Url | > 注:ApolloConfigDB需要在每个环境部署一套,如fat、uat和pro分别部署3套ApolloConfigDB #### 2.1.2.4 从别的环境导入ApolloConfigDB的项目数据 如果是全新部署的Apollo配置中心,请忽略此步。 如果不是全新部署的Apollo配置中心,比如已经使用了一段时间,这时在Apollo配置中心已经创建了不少项目以及namespace等,那么在新环境中的ApolloConfigDB中需要从其它正常运行的环境中导入必要的项目数据。 主要涉及ApolloConfigDB的下面4张表,下面同时附上需要导入的数据查询语句: 1. App * 导入全部的App * 如:insert into `新环境的ApolloConfigDB`.`App` select * from `其它环境的ApolloConfigDB`.`App` where `IsDeleted` = 0; 2. AppNamespace * 导入全部的AppNamespace * 如:insert into `新环境的ApolloConfigDB`.`AppNamespace` select * from `其它环境的ApolloConfigDB`.`AppNamespace` where `IsDeleted` = 0; 3. Cluster * 导入默认的default集群 * 如:insert into `新环境的ApolloConfigDB`.`Cluster` select * from `其它环境的ApolloConfigDB`.`Cluster` where `Name` = 'default' and `IsDeleted` = 0; 4. Namespace * 导入默认的default集群中的namespace * 如:insert into `新环境的ApolloConfigDB`.`Namespace` select * from `其它环境的ApolloConfigDB`.`Namespace` where `ClusterName` = 'default' and `IsDeleted` = 0; 同时也别忘了通知用户在新的环境给自己的项目设置正确的配置信息,尤其是一些影响面比较大的公共namespace配置。 > 如果是为正在运行的环境迁移数据,建议迁移完重启一下config service,因为config service中有appnamespace的缓存数据 ### 2.1.3 调整服务端配置 Apollo自身的一些配置是放在数据库里面的,所以需要针对实际情况做一些调整,具体参数说明请参考[三、服务端配置说明](#三、服务端配置说明)。 大部分配置可以先使用默认值,不过 [apollo.portal.envs](#_311-apolloportalenvs-可支持的环境列表) 和 [eureka.service.url](#_321-eurekaserviceurl-eureka服务url) 请务必配置正确后再进行下面的部署步骤。 ## 2.2 虚拟机/物理机部署 ### 2.2.1 获取安装包 可以通过两种方式获取安装包: 1. 直接下载安装包 * 从[GitHub Release](https://github.com/ctripcorp/apollo/releases)页面下载预先打好的安装包 * 如果对Apollo的代码没有定制需求,建议使用这种方式,可以省去本地打包的过程 2. 通过源码构建 * 从[GitHub Release](https://github.com/ctripcorp/apollo/releases)页面下载Source code包或直接clone[源码](https://github.com/ctripcorp/apollo)后在本地构建 * 如果需要对Apollo的做定制开发,需要使用这种方式 #### 2.2.1.1 直接下载安装包 ##### 2.2.1.1.1 获取apollo-configservice、apollo-adminservice、apollo-portal安装包 从[GitHub Release](https://github.com/ctripcorp/apollo/releases)页面下载最新版本的`apollo-configservice-x.x.x-github.zip`、`apollo-adminservice-x.x.x-github.zip`和`apollo-portal-x.x.x-github.zip`即可。 ##### 2.2.1.1.2 配置数据库连接信息 Apollo服务端需要知道如何连接到你前面创建的数据库,数据库连接串信息位于上一步下载的压缩包中的`config/application-github.properties`中。 ###### 2.2.1.1.2.1 配置apollo-configservice的数据库连接信息 1. 解压`apollo-configservice-x.x.x-github.zip` 2. 用程序员专用编辑器(如vim,notepad++,sublime等)打开`config`目录下的`application-github.properties`文件 3. 填写正确的ApolloConfigDB数据库连接串信息,注意用户名和密码后面不要有空格! 4. 修改完的效果如下: ```properties # DataSource spring.datasource.url = jdbc:mysql://localhost:3306/ApolloConfigDB?useSSL=false&characterEncoding=utf8 spring.datasource.username = someuser spring.datasource.password = somepwd ``` > 注:由于ApolloConfigDB在每个环境都有部署,所以对不同的环境config-service需要配置对应环境的数据库参数 ###### 2.2.1.1.2.2 配置apollo-adminservice的数据库连接信息 1. 解压`apollo-adminservice-x.x.x-github.zip` 2. 用程序员专用编辑器(如vim,notepad++,sublime等)打开`config`目录下的`application-github.properties`文件 3. 填写正确的ApolloConfigDB数据库连接串信息,注意用户名和密码后面不要有空格! 4. 修改完的效果如下: ```properties # DataSource spring.datasource.url = jdbc:mysql://localhost:3306/ApolloConfigDB?useSSL=false&characterEncoding=utf8 spring.datasource.username = someuser spring.datasource.password = somepwd ``` > 注:由于ApolloConfigDB在每个环境都有部署,所以对不同的环境admin-service需要配置对应环境的数据库参数 ###### 2.2.1.1.2.3 配置apollo-portal的数据库连接信息 1. 解压`apollo-portal-x.x.x-github.zip` 2. 用程序员专用编辑器(如vim,notepad++,sublime等)打开`config`目录下的`application-github.properties`文件 3. 填写正确的ApolloPortalDB数据库连接串信息,注意用户名和密码后面不要有空格! 4. 修改完的效果如下: ```properties # DataSource spring.datasource.url = jdbc:mysql://localhost:3306/ApolloPortalDB?useSSL=false&characterEncoding=utf8 spring.datasource.username = someuser spring.datasource.password = somepwd ``` ###### 2.2.1.1.2.4 配置apollo-portal的meta service信息 Apollo Portal需要在不同的环境访问不同的meta service(apollo-configservice)地址,所以我们需要在配置中提供这些信息。默认情况下,meta service和config service是部署在同一个JVM进程,所以meta service的地址就是config service的地址。 > 对于1.6.0及以上版本,可以通过ApolloPortalDB.ServerConfig中的配置项来配置Meta Service地址,详见[apollo.portal.meta.servers - 各环境Meta Service列表](#_312-apolloportalmetaservers-各环境meta-service列表) 使用程序员专用编辑器(如vim,notepad++,sublime等)打开`apollo-portal-x.x.x-github.zip`中`config`目录下的`apollo-env.properties`文件。 假设DEV的apollo-configservice未绑定域名,地址是1.1.1.1:8080,FAT的apollo-configservice绑定了域名apollo.fat.xxx.com,UAT的apollo-configservice绑定了域名apollo.uat.xxx.com,PRO的apollo-configservice绑定了域名apollo.xxx.com,那么可以如下修改各环境meta service服务地址,格式为`${env}.meta=http://${config-service-url:port}`,如果某个环境不需要,也可以直接删除对应的配置项(如lpt.meta): ```sh dev.meta=http://1.1.1.1:8080 fat.meta=http://apollo.fat.xxx.com uat.meta=http://apollo.uat.xxx.com pro.meta=http://apollo.xxx.com ``` 除了通过`apollo-env.properties`方式配置meta service以外,apollo也支持在运行时指定meta service(优先级比`apollo-env.properties`高): 1. 通过Java System Property `${env}_meta` * 可以通过Java的System Property `${env}_meta`来指定 * 如`java -Ddev_meta=http://config-service-url -jar xxx.jar` * 也可以通过程序指定,如`System.setProperty("dev_meta", "http://config-service-url");` 2. 通过操作系统的System Environment`${ENV}_META` * 如`DEV_META=http://config-service-url` * 注意key为全大写,且中间是`_`分隔 >注1: 为了实现meta service的高可用,推荐通过SLB(Software Load Balancer)做动态负载均衡 >注2: meta service地址也可以填入IP,0.11.0版本之前只支持填入一个IP。从0.11.0版本开始支持填入以逗号分隔的多个地址([PR #1214](https://github.com/ctripcorp/apollo/pull/1214)),如`http://1.1.1.1:8080,http://2.2.2.2:8080`,不过生产环境还是建议使用域名(走slb),因为机器扩容、缩容等都可能导致IP列表的变化。 #### 2.2.1.2 通过源码构建 ##### 2.2.1.2.1 配置数据库连接信息 Apollo服务端需要知道如何连接到你前面创建的数据库,所以需要编辑[scripts/build.sh](https://github.com/ctripcorp/apollo/blob/master/scripts/build.sh),修改ApolloPortalDB和ApolloConfigDB相关的数据库连接串信息。 > 注意:填入的用户需要具备对ApolloPortalDB和ApolloConfigDB数据的读写权限。 ```sh #apollo config db info apollo_config_db_url=jdbc:mysql://localhost:3306/ApolloConfigDB?useSSL=false&characterEncoding=utf8 apollo_config_db_username=用户名 apollo_config_db_password=密码(如果没有密码,留空即可) # apollo portal db info apollo_portal_db_url=jdbc:mysql://localhost:3306/ApolloPortalDB?useSSL=false&characterEncoding=utf8 apollo_portal_db_username=用户名 apollo_portal_db_password=密码(如果没有密码,留空即可) ``` > 注1:由于ApolloConfigDB在每个环境都有部署,所以对不同的环境config-service和admin-service需要使用不同的数据库参数打不同的包,portal只需要打一次包即可 > 注2:如果不想config-service和admin-service每个环境打一个包的话,也可以通过运行时传入数据库连接串信息实现,具体可以参考 [Issue 869](https://github.com/ctripcorp/apollo/issues/869) > 注3:每个环境都需要独立部署一套config-service、admin-service和ApolloConfigDB ##### 2.2.1.2.2 配置各环境meta service地址 Apollo Portal需要在不同的环境访问不同的meta service(apollo-configservice)地址,所以需要在打包时提供这些信息。 假设DEV的apollo-configservice未绑定域名,地址是1.1.1.1:8080,FAT的apollo-configservice绑定了域名apollo.fat.xxx.com,UAT的apollo-configservice绑定了域名apollo.uat.xxx.com,PRO的apollo-configservice绑定了域名apollo.xxx.com,那么编辑[scripts/build.sh](https://github.com/ctripcorp/apollo/blob/master/scripts/build.sh),如下修改各环境meta service服务地址,格式为`${env}_meta=http://${config-service-url:port}`,如果某个环境不需要,也可以直接删除对应的配置项: ```sh dev_meta=http://1.1.1.1:8080 fat_meta=http://apollo.fat.xxx.com uat_meta=http://apollo.uat.xxx.com pro_meta=http://apollo.xxx.com META_SERVERS_OPTS="-Ddev_meta=$dev_meta -Dfat_meta=$fat_meta -Duat_meta=$uat_meta -Dpro_meta=$pro_meta" ``` 除了在打包时配置meta service以外,apollo也支持在运行时指定meta service: 1. 通过Java System Property `${env}_meta` * 可以通过Java的System Property `${env}_meta`来指定 * 如`java -Ddev_meta=http://config-service-url -jar xxx.jar` * 也可以通过程序指定,如`System.setProperty("dev_meta", "http://config-service-url");` 2. 通过操作系统的System Environment`${ENV}_META` * 如`DEV_META=http://config-service-url` * 注意key为全大写,且中间是`_`分隔 >注1: 为了实现meta service的高可用,推荐通过SLB(Software Load Balancer)做动态负载均衡 >注2: meta service地址也可以填入IP,0.11.0版本之前只支持填入一个IP。从0.11.0版本开始支持填入以逗号分隔的多个地址([PR #1214](https://github.com/ctripcorp/apollo/pull/1214)),如`http://1.1.1.1:8080,http://2.2.2.2:8080`,不过生产环境还是建议使用域名(走slb),因为机器扩容、缩容等都可能导致IP列表的变化。 ##### 2.2.1.2.3 执行编译、打包 做完上述配置后,就可以执行编译和打包了。 > 注:初次编译会从Maven中央仓库下载不少依赖,如果网络情况不佳时很容易出错,建议使用国内的Maven仓库源,比如[阿里云Maven镜像](http://www.cnblogs.com/geektown/p/5705405.html) ```sh ./build.sh ``` 该脚本会依次打包apollo-configservice, apollo-adminservice, apollo-portal。 > 注:由于ApolloConfigDB在每个环境都有部署,所以对不同环境的config-service和admin-service需要使用不同的数据库连接信息打不同的包,portal只需要打一次包即可 ##### 2.2.1.2.4 获取apollo-configservice安装包 位于`apollo-configservice/target/`目录下的`apollo-configservice-x.x.x-github.zip` 需要注意的是由于ApolloConfigDB在每个环境都有部署,所以对不同环境的config-service需要使用不同的数据库参数打不同的包后分别部署 ##### 2.2.1.2.5 获取apollo-adminservice安装包 位于`apollo-adminservice/target/`目录下的`apollo-adminservice-x.x.x-github.zip` 需要注意的是由于ApolloConfigDB在每个环境都有部署,所以对不同环境的admin-service需要使用不同的数据库参数打不同的包后分别部署 ##### 2.2.1.2.6 获取apollo-portal安装包 位于`apollo-portal/target/`目录下的`apollo-portal-x.x.x-github.zip` ##### 2.2.1.2.7 启用外部nacos服务注册中心替换内置eureka 1. 修改build.sh/build.bat,将config-service和admin-service的maven编译命令更改为 ```shell mvn clean package -Pgithub,nacos-discovery -DskipTests -pl apollo-configservice,apollo-adminservice -am -Dapollo_profile=github,nacos-discovery -Dspring_datasource_url=$apollo_config_db_url -Dspring_datasource_username=$apollo_config_db_username -Dspring_datasource_password=$apollo_config_db_password ``` 2. 分别修改apollo-configservice和apollo-adminservice安装包中config目录下的application-github.properties,配置nacos服务器地址 ```properties nacos.discovery.server-addr=127.0.0.1:8848 ``` ##### 2.2.1.2.8 启用外部Consul服务注册中心替换内置eureka 1. 修改build.sh/build.bat,将config-service和admin-service的maven编译命令更改为 ```shell mvn clean package -Pgithub -DskipTests -pl apollo-configservice,apollo-adminservice -am -Dapollo_profile=github,consul-discovery -Dspring_datasource_url=$apollo_config_db_url -Dspring_datasource_username=$apollo_config_db_username -Dspring_datasource_password=$apollo_config_db_password ``` 2. 分别修改apollo-configservice和apollo-adminservice安装包中config目录下的application-github.properties,配置consul服务器地址 ```properties spring.cloud.consul.host=127.0.0.1 spring.cloud.consul.port=8500 ``` ### 2.2.2 部署Apollo服务端 #### 2.2.2.1 部署apollo-configservice 将对应环境的`apollo-configservice-x.x.x-github.zip`上传到服务器上,解压后执行scripts/startup.sh即可。如需停止服务,执行scripts/shutdown.sh. 记得在scripts/startup.sh中按照实际的环境设置一个JVM内存,以下是我们的默认设置,供参考: ```bash export JAVA_OPTS="-server -Xms6144m -Xmx6144m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=4096m -XX:MaxNewSize=4096m -XX:SurvivorRatio=18" ``` > 注1:如果需要修改JVM参数,可以修改scripts/startup.sh的`JAVA_OPTS`部分。 > 注2:如要调整服务的日志输出路径,可以修改scripts/startup.sh和apollo-configservice.conf中的`LOG_DIR`。 > 注3:如要调整服务的监听端口,可以修改scripts/startup.sh中的`SERVER_PORT`。另外apollo-configservice同时承担meta server职责,如果要修改端口,注意要同时ApolloConfigDB.ServerConfig表中的`eureka.service.url`配置项以及apollo-portal和apollo-client中的使用到的meta server信息,详见:[2.2.1.1.2.4 配置apollo-portal的meta service信息](#_221124-配置apollo-portal的meta-service信息)和[1.2.2 Apollo Meta Server](zh/usage/java-sdk-user-guide#_122-apollo-meta-server)。 > 注4:如果ApolloConfigDB.ServerConfig的eureka.service.url只配了当前正在启动的机器的话,在启动apollo-configservice的过程中会在日志中输出eureka注册失败的信息,如`com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused`。需要注意的是,这个是预期的情况,因为apollo-configservice需要向Meta Server(它自己)注册服务,但是因为在启动过程中,自己还没起来,所以会报这个错。后面会进行重试的动作,所以等自己服务起来后就会注册正常了。 > 注5:如果你看到了这里,相信你一定是一个细心阅读文档的人,而且离成功就差一点点了,继续加油,应该很快就能完成Apollo的分布式部署了!不过你是否有感觉Apollo的分布式部署步骤有点繁琐?是否有啥建议想要和作者说?如果答案是肯定的话,请移步 [#1424](https://github.com/ctripcorp/apollo/issues/1424),期待你的建议! #### 2.2.2.2 部署apollo-adminservice 将对应环境的`apollo-adminservice-x.x.x-github.zip`上传到服务器上,解压后执行scripts/startup.sh即可。如需停止服务,执行scripts/shutdown.sh. 记得在scripts/startup.sh中按照实际的环境设置一个JVM内存,以下是我们的默认设置,供参考: ```bash export JAVA_OPTS="-server -Xms2560m -Xmx2560m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=1024m -XX:MaxNewSize=1024m -XX:SurvivorRatio=22" ``` > 注1:如果需要修改JVM参数,可以修改scripts/startup.sh的`JAVA_OPTS`部分。 > 注2:如要调整服务的日志输出路径,可以修改scripts/startup.sh和apollo-adminservice.conf中的`LOG_DIR`。 > 注3:如要调整服务的监听端口,可以修改scripts/startup.sh中的`SERVER_PORT`。 #### 2.2.2.3 部署apollo-portal 将`apollo-portal-x.x.x-github.zip`上传到服务器上,解压后执行scripts/startup.sh即可。如需停止服务,执行scripts/shutdown.sh. 记得在startup.sh中按照实际的环境设置一个JVM内存,以下是我们的默认设置,供参考: ```bash export JAVA_OPTS="-server -Xms4096m -Xmx4096m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=1536m -XX:MaxNewSize=1536m -XX:SurvivorRatio=22" ``` > 注1:如果需要修改JVM参数,可以修改scripts/startup.sh的`JAVA_OPTS`部分。 > 注2:如要调整服务的日志输出路径,可以修改scripts/startup.sh和apollo-portal.conf中的`LOG_DIR`。 > 注3:如要调整服务的监听端口,可以修改scripts/startup.sh中的`SERVER_PORT`。 ## 2.3 Docker部署 ### 2.3.1 1.7.0及以上版本 Apollo 1.7.0版本开始会默认上传Docker镜像到[Docker Hub](https://hub.docker.com/u/apolloconfig),可以按照如下步骤获取 #### 2.3.1.1 Apollo Config Service ##### 2.3.1.1.1 获取镜像 ```bash docker pull apolloconfig/apollo-configservice:${version} ``` ##### 2.3.1.1.2 运行镜像 示例: ```bash docker run -p 8080:8080 \ -e SPRING_DATASOURCE_URL="jdbc:mysql://fill-in-the-correct-server:3306/ApolloConfigDB?characterEncoding=utf8" \ -e SPRING_DATASOURCE_USERNAME=FillInCorrectUser -e SPRING_DATASOURCE_PASSWORD=FillInCorrectPassword \ -d -v /tmp/logs:/opt/logs --name apollo-configservice apolloconfig/apollo-configservice:${version} ``` 参数说明: * SPRING_DATASOURCE_URL: 对应环境ApolloConfigDB的地址 * SPRING_DATASOURCE_USERNAME: 对应环境ApolloConfigDB的用户名 * SPRING_DATASOURCE_PASSWORD: 对应环境ApolloConfigDB的密码 #### 2.3.1.2 Apollo Admin Service ##### 2.3.1.2.1 获取镜像 ```bash docker pull apolloconfig/apollo-adminservice:${version} ``` ##### 2.3.1.2.2 运行镜像 示例: ```bash docker run -p 8090:8090 \ -e SPRING_DATASOURCE_URL="jdbc:mysql://fill-in-the-correct-server:3306/ApolloConfigDB?characterEncoding=utf8" \ -e SPRING_DATASOURCE_USERNAME=FillInCorrectUser -e SPRING_DATASOURCE_PASSWORD=FillInCorrectPassword \ -d -v /tmp/logs:/opt/logs --name apollo-adminservice apolloconfig/apollo-adminservice:${version} ``` 参数说明: * SPRING_DATASOURCE_URL: 对应环境ApolloConfigDB的地址 * SPRING_DATASOURCE_USERNAME: 对应环境ApolloConfigDB的用户名 * SPRING_DATASOURCE_PASSWORD: 对应环境ApolloConfigDB的密码 #### 2.3.1.3 Apollo Portal ##### 2.3.1.3.1 获取镜像 ```bash docker pull apolloconfig/apollo-portal:${version} ``` ##### 2.3.1.3.2 运行镜像 示例: ```bash docker run -p 8070:8070 \ -e SPRING_DATASOURCE_URL="jdbc:mysql://fill-in-the-correct-server:3306/ApolloPortalDB?characterEncoding=utf8" \ -e SPRING_DATASOURCE_USERNAME=FillInCorrectUser -e SPRING_DATASOURCE_PASSWORD=FillInCorrectPassword \ -e APOLLO_PORTAL_ENVS=dev,pro \ -e DEV_META=http://fill-in-dev-meta-server:8080 -e PRO_META=http://fill-in-pro-meta-server:8080 \ -d -v /tmp/logs:/opt/logs --name apollo-portal apolloconfig/apollo-portal:${version} ``` 参数说明: * SPRING_DATASOURCE_URL: 对应环境ApolloPortalDB的地址 * SPRING_DATASOURCE_USERNAME: 对应环境ApolloPortalDB的用户名 * SPRING_DATASOURCE_PASSWORD: 对应环境ApolloPortalDB的密码 * APOLLO_PORTAL_ENVS(可选): 对应ApolloPortalDB中的[apollo.portal.envs](#_311-apolloportalenvs-可支持的环境列表)配置项,如果没有在数据库中配置的话,可以通过此环境参数配置 * DEV_META/PRO_META(可选): 配置对应环境的Meta Service地址,以${ENV}_META命名,需要注意的是如果配置了ApolloPortalDB中的[apollo.portal.meta.servers](#_312-apolloportalmetaservers-各环境meta-service列表)配置,则以apollo.portal.meta.servers中的配置为准 #### 2.3.1.4 通过源码构建 Docker 镜像 如果修改了 apollo 服务端的代码,希望通过源码构建 Docker 镜像,可以参考下面的步骤: 1. 通过源码构建安装包:`./scripts/build.sh` 2. 构建 Docker 镜像:`mvn docker:build -pl apollo-configservice,apollo-adminservice,apollo-portal` ### 2.3.2 1.7.0之前的版本 Apollo项目已经自带了Docker file,可以参照[2.2.1 获取安装包](#_221-获取安装包)配置好安装包后通过下面的文件来打Docker镜像: 1. [apollo-configservice](https://github.com/ctripcorp/apollo/blob/master/apollo-configservice/src/main/docker/Dockerfile) 2. [apollo-adminservice](https://github.com/ctripcorp/apollo/blob/master/apollo-adminservice/src/main/docker/Dockerfile) 3. [apollo-portal](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/docker/Dockerfile) 也可以参考Apollo用户[@kulovecc](https://github.com/kulovecc)的[docker-apollo](https://github.com/kulovecc/docker-apollo)项目和[@idoop](https://github.com/idoop)的[docker-apollo](https://github.com/idoop/docker-apollo)项目。 ## 2.4 Kubernetes部署 ### 2.4.1 基于Kubernetes原生服务发现 Apollo 1.7.0版本增加了基于Kubernetes原生服务发现的部署模式,由于不再使用内置的Eureka,所以在整体部署上有很大简化,同时也提供了Helm Charts,便于部署。 > 更多设计说明可以参考[#3054](https://github.com/ctripcorp/apollo/issues/3054)。 #### 2.4.1.1 环境要求 - Kubernetes 1.10+ - Helm 3 #### 2.4.1.2 添加Apollo Helm Chart仓库 ```bash $ helm repo add apollo https://ctripcorp.github.io/apollo/charts $ helm search repo apollo ``` #### 2.4.1.3 部署apollo-configservice和apollo-adminservice ##### 2.4.1.3.1 安装apollo-configservice和apollo-adminservice 需要在每个环境中安装apollo-configservice和apollo-adminservice,所以建议在release名称中加入环境信息,例如:`apollo-service-dev` ```bash $ helm install apollo-service-dev \ --set configdb.host=1.2.3.4 \ --set configdb.userName=apollo \ --set configdb.password=apollo \ --set configdb.service.enabled=true \ --set configService.replicaCount=1 \ --set adminService.replicaCount=1 \ -n your-namespace \ apollo/apollo-service ``` 一般部署建议通过 values.yaml 来配置: ```bash $ helm install apollo-service-dev -f values.yaml -n your-namespace apollo/apollo-service ``` 安装完成后会提示对应环境的Meta Server地址,需要记录下来,apollo-portal安装时需要用到: ```bash Get meta service url for current release by running these commands: echo http://apollo-service-dev-apollo-configservice:8080 ``` > 更多配置项说明可以参考[2.4.1.3.3 配置项说明](#_24133-配置项说明) ##### 2.4.1.3.2 卸载apollo-configservice和apollo-adminservice 例如要卸载`apollo-service-dev`的部署: ```bash $ helm uninstall -n your-namespace apollo-service-dev ``` ##### 2.4.1.3.3 配置项说明 下表列出了apollo-service chart的可配置参数及其默认值: | Parameter | Description | Default | |----------------------|---------------------------------------------|---------------------| | `configdb.host` | The host for apollo config db | `nil` | | `configdb.port` | The port for apollo config db | `3306` | | `configdb.dbName` | The database name for apollo config db | `ApolloConfigDB` | | `configdb.userName` | The user name for apollo config db | `nil` | | `configdb.password` | The password for apollo config db | `nil` | | `configdb.connectionStringProperties` | The connection string properties for apollo config db | `characterEncoding=utf8` | | `configdb.service.enabled` | Whether to create a Kubernetes Service for `configdb.host` or not. Set it to `true` if `configdb.host` is an endpoint outside of the kubernetes cluster | `false` | | `configdb.service.fullNameOverride` | Override the service name for apollo config db | `nil` | | `configdb.service.port` | The port for the service of apollo config db | `3306` | | `configdb.service.type` | The service type of apollo config db: `ClusterIP` or `ExternalName`. If the host is a DNS name, please specify `ExternalName` as the service type, e.g. `xxx.mysql.rds.aliyuncs.com` | `ClusterIP` | | `configService.fullNameOverride` | Override the deployment name for apollo-configservice | `nil` | | `configService.replicaCount` | Replica count of apollo-configservice | `2` | | `configService.containerPort` | Container port of apollo-configservice | `8080` | | `configService.image.repository` | Image repository of apollo-configservice | `apolloconfig/apollo-configservice` | | `configService.image.tag` | Image tag of apollo-configservice, e.g. `1.8.0`, leave it to `nil` to use the default version. _(chart version >= 0.2.0)_ | `nil` | | `configService.image.pullPolicy` | Image pull policy of apollo-configservice | `IfNotPresent` | | `configService.imagePullSecrets` | Image pull secrets of apollo-configservice | `[]` | | `configService.service.fullNameOverride` | Override the service name for apollo-configservice | `nil` | | `configService.service.port` | The port for the service of apollo-configservice | `8080` | | `configService.service.targetPort` | The target port for the service of apollo-configservice | `8080` | | `configService.service.type` | The service type of apollo-configservice | `ClusterIP` | | `configService.ingress.enabled` | Whether to enable the ingress for config-service or not. _(chart version >= 0.2.0)_ | `false` | | `configService.ingress.annotations` | The annotations of the ingress for config-service. _(chart version >= 0.2.0)_ | `{}` | | `configService.ingress.hosts.host` | The host of the ingress for config-service. _(chart version >= 0.2.0)_ | `nil` | | `configService.ingress.hosts.paths` | The paths of the ingress for config-service. _(chart version >= 0.2.0)_ | `[]` | | `configService.ingress.tls` | The tls definition of the ingress for config-service. _(chart version >= 0.2.0)_ | `[]` | | `configService.liveness.initialDelaySeconds` | The initial delay seconds of liveness probe | `100` | | `configService.liveness.periodSeconds` | The period seconds of liveness probe | `10` | | `configService.readiness.initialDelaySeconds` | The initial delay seconds of readiness probe | `30` | | `configService.readiness.periodSeconds` | The period seconds of readiness probe | `5` | | `configService.config.profiles` | specify the spring profiles to activate | `github,kubernetes` | | `configService.config.configServiceUrlOverride` | Override `apollo.config-service.url`: config service url to be accessed by apollo-client, e.g. `http://apollo-config-service-dev:8080` | `nil` | | `configService.config.adminServiceUrlOverride` | Override `apollo.admin-service.url`: admin service url to be accessed by apollo-portal, e.g. `http://apollo-admin-service-dev:8090` | `nil` | | `configService.config.contextPath` | specify the context path, e.g. `/apollo`, then users could access config service via `http://{config_service_address}/apollo`. _(chart version >= 0.2.0)_ | `nil` | | `configService.env` | Environment variables passed to the container, e.g. <br />`JAVA_OPTS: -Xss256k` | `{}` | | `configService.strategy` | The deployment strategy of apollo-configservice | `{}` | | `configService.resources` | The resources definition of apollo-configservice | `{}` | | `configService.nodeSelector` | The node selector definition of apollo-configservice | `{}` | | `configService.tolerations` | The tolerations definition of apollo-configservice | `[]` | | `configService.affinity` | The affinity definition of apollo-configservice | `{}` | | `adminService.fullNameOverride` | Override the deployment name for apollo-adminservice | `nil` | | `adminService.replicaCount` | Replica count of apollo-adminservice | `2` | | `adminService.containerPort` | Container port of apollo-adminservice | `8090` | | `adminService.image.repository` | Image repository of apollo-adminservice | `apolloconfig/apollo-adminservice` | | `adminService.image.tag` | Image tag of apollo-adminservice, e.g. `1.8.0`, leave it to `nil` to use the default version. _(chart version >= 0.2.0)_ | `nil` | | `adminService.image.pullPolicy` | Image pull policy of apollo-adminservice | `IfNotPresent` | | `adminService.imagePullSecrets` | Image pull secrets of apollo-adminservice | `[]` | | `adminService.service.fullNameOverride` | Override the service name for apollo-adminservice | `nil` | | `adminService.service.port` | The port for the service of apollo-adminservice | `8090` | | `adminService.service.targetPort` | The target port for the service of apollo-adminservice | `8090` | | `adminService.service.type` | The service type of apollo-adminservice | `ClusterIP` | | `adminService.ingress.enabled` | Whether to enable the ingress for admin-service or not. _(chart version >= 0.2.0)_ | `false` | | `adminService.ingress.annotations` | The annotations of the ingress for admin-service. _(chart version >= 0.2.0)_ | `{}` | | `adminService.ingress.hosts.host` | The host of the ingress for admin-service. _(chart version >= 0.2.0)_ | `nil` | | `adminService.ingress.hosts.paths` | The paths of the ingress for admin-service. _(chart version >= 0.2.0)_ | `[]` | | `adminService.ingress.tls` | The tls definition of the ingress for admin-service. _(chart version >= 0.2.0)_ | `[]` | | `adminService.liveness.initialDelaySeconds` | The initial delay seconds of liveness probe | `100` | | `adminService.liveness.periodSeconds` | The period seconds of liveness probe | `10` | | `adminService.readiness.initialDelaySeconds` | The initial delay seconds of readiness probe | `30` | | `adminService.readiness.periodSeconds` | The period seconds of readiness probe | `5` | | `adminService.config.profiles` | specify the spring profiles to activate | `github,kubernetes` | | `adminService.config.contextPath` | specify the context path, e.g. `/apollo`, then users could access admin service via `http://{admin_service_address}/apollo`. _(chart version >= 0.2.0)_ | `nil` | | `adminService.env` | Environment variables passed to the container, e.g. <br />`JAVA_OPTS: -Xss256k` | `{}` | | `adminService.strategy` | The deployment strategy of apollo-adminservice | `{}` | | `adminService.resources` | The resources definition of apollo-adminservice | `{}` | | `adminService.nodeSelector` | The node selector definition of apollo-adminservice | `{}` | | `adminService.tolerations` | The tolerations definition of apollo-adminservice | `[]` | | `adminService.affinity` | The affinity definition of apollo-adminservice | `{}` | ##### 2.4.1.3.4 配置样例 ###### 2.4.1.3.4.1 ConfigDB的host是k8s集群外的IP ```yaml configdb: host: 1.2.3.4 dbName: ApolloConfigDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false service: enabled: true ``` ###### 2.4.1.3.4.2 ConfigDB的host是k8s集群外的域名 ```yaml configdb: host: xxx.mysql.rds.aliyuncs.com dbName: ApolloConfigDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false service: enabled: true type: ExternalName ``` ###### 2.4.1.3.4.3 ConfigDB的host是k8s集群内的一个服务 ```yaml configdb: host: apollodb-mysql.mysql dbName: ApolloConfigDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false ``` ###### 2.4.1.3.4.4 指定Meta Server返回的apollo-configservice地址 如果apollo-client无法直接访问apollo-configservice的Service(比如不在同一个k8s集群),那么可以参照下面的示例指定Meta Server返回给apollo-client的地址(比如可以通过nodeport访问) ```yaml configService: config: configServiceUrlOverride: http://1.2.3.4:12345 ``` ###### 2.4.1.3.4.5 指定Meta Server返回的apollo-adminservice地址 如果apollo-portal无法直接访问apollo-adminservice的Service(比如不在同一个k8s集群),那么可以参照下面的示例指定Meta Server返回给apollo-portal的地址(比如可以通过nodeport访问) ```yaml configService: config: adminServiceUrlOverride: http://1.2.3.4:23456 ``` ###### 2.4.1.3.4.6 以Ingress配置自定义路径`/config`形式暴露apollo-configservice服务 ```yaml # use /config as root, should specify configService.config.contextPath as /config configService: config: contextPath: /config ingress: enabled: true hosts: - paths: - /config ``` ###### 2.4.1.3.4.7 以Ingress配置自定义路径`/admin`形式暴露apollo-adminservice服务 ```yaml # use /admin as root, should specify adminService.config.contextPath as /admin adminService: config: contextPath: /admin ingress: enabled: true hosts: - paths: - /admin ``` #### 2.4.1.4 部署apollo-portal ##### 2.4.1.4.1 安装apollo-portal 假设有dev, pro两个环境,且meta server地址分别为`http://apollo-service-dev-apollo-configservice:8080`和`http://apollo-service-pro-apollo-configservice:8080`: ```bash $ helm install apollo-portal \ --set portaldb.host=1.2.3.4 \ --set portaldb.userName=apollo \ --set portaldb.password=apollo \ --set portaldb.service.enabled=true \ --set config.envs="dev\,pro" \ --set config.metaServers.dev=http://apollo-service-dev-apollo-configservice:8080 \ --set config.metaServers.pro=http://apollo-service-pro-apollo-configservice:8080 \ --set replicaCount=1 \ -n your-namespace \ apollo/apollo-portal ``` 一般部署建议通过 values.yaml 来配置: ```bash $ helm install apollo-portal -f values.yaml -n your-namespace apollo/apollo-portal ``` > 更多配置项说明可以参考[2.4.1.4.3 配置项说明](#_24143-配置项说明) ##### 2.4.1.4.2 卸载apollo-portal 例如要卸载`apollo-portal`的部署: ```bash $ helm uninstall -n your-namespace apollo-portal ``` ##### 2.4.1.4.3 配置项说明 下表列出了apollo-portal chart的可配置参数及其默认值: | Parameter | Description | Default | |----------------------|---------------------------------------------|-----------------------| | `fullNameOverride` | Override the deployment name for apollo-portal | `nil` | | `replicaCount` | Replica count of apollo-portal | `2` | | `containerPort` | Container port of apollo-portal | `8070` | | `image.repository` | Image repository of apollo-portal | `apolloconfig/apollo-portal` | | `image.tag` | Image tag of apollo-portal, e.g. `1.8.0`, leave it to `nil` to use the default version. _(chart version >= 0.2.0)_ | `nil` | | `image.pullPolicy` | Image pull policy of apollo-portal | `IfNotPresent` | | `imagePullSecrets` | Image pull secrets of apollo-portal | `[]` | | `service.fullNameOverride` | Override the service name for apollo-portal | `nil` | | `service.port` | The port for the service of apollo-portal | `8070` | | `service.targetPort` | The target port for the service of apollo-portal | `8070` | | `service.type` | The service type of apollo-portal | `ClusterIP` | | `service.sessionAffinity` | The session affinity for the service of apollo-portal | `ClientIP` | | `ingress.enabled` | Whether to enable the ingress or not | `false` | | `ingress.annotations` | The annotations of the ingress | `{}` | | `ingress.hosts.host` | The host of the ingress | `nil` | | `ingress.hosts.paths` | The paths of the ingress | `[]` | | `ingress.tls` | The tls definition of the ingress | `[]` | | `liveness.initialDelaySeconds` | The initial delay seconds of liveness probe | `100` | | `liveness.periodSeconds` | The period seconds of liveness probe | `10` | | `readiness.initialDelaySeconds` | The initial delay seconds of readiness probe | `30` | | `readiness.periodSeconds` | The period seconds of readiness probe | `5` | | `env` | Environment variables passed to the container, e.g. <br />`JAVA_OPTS: -Xss256k` | `{}` | | `strategy` | The deployment strategy of apollo-portal | `{}` | | `resources` | The resources definition of apollo-portal | `{}` | | `nodeSelector` | The node selector definition of apollo-portal | `{}` | | `tolerations` | The tolerations definition of apollo-portal | `[]` | | `affinity` | The affinity definition of apollo-portal | `{}` | | `config.profiles` | specify the spring profiles to activate | `github,auth` | | `config.envs` | specify the env names, e.g. `dev,pro` | `nil` | | `config.contextPath` | specify the context path, e.g. `/apollo`, then users could access portal via `http://{portal_address}/apollo` | `nil` | | `config.metaServers` | specify the meta servers, e.g.<br />`dev: http://apollo-configservice-dev:8080`<br />`pro: http://apollo-configservice-pro:8080` | `{}` | | `config.files` | specify the extra config files for apollo-portal, e.g. `application-ldap.yml` | `{}` | | `portaldb.host` | The host for apollo portal db | `nil` | | `portaldb.port` | The port for apollo portal db | `3306` | | `portaldb.dbName` | The database name for apollo portal db | `ApolloPortalDB` | | `portaldb.userName` | The user name for apollo portal db | `nil` | | `portaldb.password` | The password for apollo portal db | `nil` | | `portaldb.connectionStringProperties` | The connection string properties for apollo portal db | `characterEncoding=utf8` | | `portaldb.service.enabled` | Whether to create a Kubernetes Service for `portaldb.host` or not. Set it to `true` if `portaldb.host` is an endpoint outside of the kubernetes cluster | `false` | | `portaldb.service.fullNameOverride` | Override the service name for apollo portal db | `nil` | | `portaldb.service.port` | The port for the service of apollo portal db | `3306` | | `portaldb.service.type` | The service type of apollo portal db: `ClusterIP` or `ExternalName`. If the host is a DNS name, please specify `ExternalName` as the service type, e.g. `xxx.mysql.rds.aliyuncs.com` | `ClusterIP` | ##### 2.4.1.4.4 配置样例 ###### 2.4.1.4.4.1 PortalDB的host是k8s集群外的IP ```yaml portaldb: host: 1.2.3.4 dbName: ApolloPortalDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false service: enabled: true ``` ###### 2.4.1.4.4.2 PortalDB的host是k8s集群外的域名 ```yaml portaldb: host: xxx.mysql.rds.aliyuncs.com dbName: ApolloPortalDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false service: enabled: true type: ExternalName ``` ###### 2.4.1.4.4.3 PortalDB的host是k8s集群内的一个服务 ```yaml portaldb: host: apollodb-mysql.mysql dbName: ApolloPortalDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false ``` ###### 2.4.1.4.4.4 配置环境信息 ```yaml config: envs: dev,pro metaServers: dev: http://apollo-service-dev-apollo-configservice:8080 pro: http://apollo-service-pro-apollo-configservice:8080 ``` ###### 2.4.1.4.4.5 以Load Balancer形式暴露服务 ```yaml service: type: LoadBalancer ``` ###### 2.4.1.4.4.6 以Ingress形式暴露服务 ```yaml ingress: enabled: true hosts: - paths: - / ``` ###### 2.4.1.4.4.7 以Ingress配置自定义路径`/apollo`形式暴露服务 ```yaml # use /apollo as root, should specify config.contextPath as /apollo ingress: enabled: true hosts: - paths: - /apollo config: ... contextPath: /apollo ... ``` ###### 2.4.1.4.4.8 以Ingress配置session affinity形式暴露服务 ```yaml ingress: enabled: true annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/affinity: "cookie" nginx.ingress.kubernetes.io/affinity-mode: "persistent" nginx.ingress.kubernetes.io/session-cookie-conditional-samesite-none: "true" nginx.ingress.kubernetes.io/session-cookie-expires: "172800" nginx.ingress.kubernetes.io/session-cookie-max-age: "172800" hosts: - host: xxx.somedomain.com # host is required to make session affinity work paths: - / ``` ###### 2.4.1.4.4.9 启用 LDAP 支持 ```yaml config: ... profiles: github,ldap ... files: application-ldap.yml: | spring: ldap: base: "dc=example,dc=org" username: "cn=admin,dc=example,dc=org" password: "password" searchFilter: "(uid={0})" urls: - "ldap://xxx.somedomain.com:389" ldap: mapping: objectClass: "inetOrgPerson" loginId: "uid" userDisplayName: "cn" email: "mail" ``` #### 2.4.1.5 通过源码构建 Docker 镜像 如果修改了 apollo 服务端的代码,希望通过源码构建 Docker 镜像,可以参考[2.3.1.4 通过源码构建 Docker 镜像](#_2314-通过源码构建-docker-镜像)的步骤。 ### 2.4.2 基于内置的Eureka服务发现 感谢[AiotCEO](https://github.com/AiotCEO)提供了k8s的部署支持,使用说明可以参考[apollo-on-kubernetes](https://github.com/ctripcorp/apollo/blob/master/scripts/apollo-on-kubernetes/README.md)。 感谢[qct](https://github.com/qct)提供的Helm Chart部署支持,使用说明可以参考[qct/apollo-helm](https://github.com/qct/apollo-helm)。 # 三、服务端配置说明 > 以下配置除了支持在数据库中配置以外,也支持通过-D参数、application.properties等配置,且-D参数、application.properties等优先级高于数据库中的配置 ## 3.1 调整ApolloPortalDB配置 配置项统一存储在ApolloPortalDB.ServerConfig表中,也可以通过`管理员工具 - 系统参数`页面进行配置,无特殊说明则修改完一分钟实时生效。 ### 3.1.1 apollo.portal.envs - 可支持的环境列表 默认值是dev,如果portal需要管理多个环境的话,以逗号分隔即可(大小写不敏感),如: ``` DEV,FAT,UAT,PRO ``` 修改完需要重启生效。 >注1:一套Portal可以管理多个环境,但是每个环境都需要独立部署一套Config Service、Admin Service和ApolloConfigDB,具体请参考:[2.1.2 创建ApolloConfigDB](#_212-创建apolloconfigdb),[3.2 调整ApolloConfigDB配置](zh/deployment/distributed-deployment-guide?id=_32-调整apolloconfigdb配置),[2.2.1.1.2 配置数据库连接信息](#_22112-配置数据库连接信息),另外如果是为已经运行了一段时间的Apollo配置中心增加环境,别忘了参考[2.1.2.4 从别的环境导入ApolloConfigDB的项目数据](#_2124-从别的环境导入apolloconfigdb的项目数据)对新的环境做初始化。 >注2:只在数据库添加环境是不起作用的,还需要为apollo-portal添加新增环境对应的meta server地址,具体参考:[2.2.1.1.2.4 配置apollo-portal的meta service信息](#_221124-配置apollo-portal的meta-service信息)。apollo-client在新的环境下使用时也需要做好相应的配置,具体参考:[1.2.2 Apollo Meta Server](zh/usage/java-sdk-user-guide#_122-apollo-meta-server)。 >注3:如果希望添加自定义的环境名称,具体步骤可以参考[Portal如何增加环境](zh/faq/common-issues-in-deployment-and-development-phase?id=_4-portal如何增加环境?)。 >注4:1.1.0版本增加了系统信息页面(`管理员工具` -> `系统信息`),可以通过该页面检查配置是否正确 ### 3.1.2 apollo.portal.meta.servers - 各环境Meta Service列表 > 适用于1.6.0及以上版本 Apollo Portal需要在不同的环境访问不同的meta service(apollo-configservice)地址,所以我们需要在配置中提供这些信息。默认情况下,meta service和config service是部署在同一个JVM进程,所以meta service的地址就是config service的地址。 样例如下: ```json { "DEV":"http://1.1.1.1:8080", "FAT":"http://apollo.fat.xxx.com", "UAT":"http://apollo.uat.xxx.com", "PRO":"http://apollo.xxx.com" } ``` 修改完需要重启生效。 > 该配置优先级高于其它方式设置的Meta Service地址,更多信息可以参考[2.2.1.1.2.4 配置apollo-portal的meta service信息](#_221124-配置apollo-portal的meta-service信息)。 ### 3.1.3 organizations - 部门列表 Portal中新建的App都需要选择部门,所以需要在这里配置可选的部门信息,样例如下: ```json [{"orgId":"TEST1","orgName":"样例部门1"},{"orgId":"TEST2","orgName":"样例部门2"}] ``` ### 3.1.4 superAdmin - Portal超级管理员 超级管理员拥有所有权限,需要谨慎设置。 如果没有接入自己公司的SSO系统的话,可以先暂时使用默认值apollo(默认用户)。等接入后,修改为实际使用的账号,多个账号以英文逗号分隔(,)。 ### 3.1.5 consumer.token.salt - consumer token salt 如果会使用开放平台API的话,可以设置一个token salt。如果不使用,可以忽略。 ### 3.1.6 wiki.address portal上“帮助”链接的地址,默认是Apollo github的wiki首页,可自行设置。 ### 3.1.7 admin.createPrivateNamespace.switch 是否允许项目管理员创建private namespace。设置为`true`允许创建,设置为`false`则项目管理员在页面上看不到创建private namespace的选项。[了解更多Namespace](zh/design/apollo-core-concept-namespace) ### 3.1.8 emergencyPublish.supported.envs 配置允许紧急发布的环境列表,多个env以英文逗号分隔。 当config service开启一次发布只能有一个人修改开关(`namespace.lock.switch`)后,一次配置发布只能是一个人修改,另一个发布。为了避免遇到紧急情况时(如非工作时间、节假日)无法发布配置,可以配置此项以允许某些环境可以操作紧急发布,即同一个人可以修改并发布配置。 ### 3.1.9 configView.memberOnly.envs 只对项目成员显示配置信息的环境列表,多个env以英文逗号分隔。 对设定了只对项目成员显示配置信息的环境,只有该项目的管理员或拥有该namespace的编辑或发布权限的用户才能看到该私有namespace的配置信息和发布历史。公共namespace始终对所有用户可见。 > 从1.1.0版本开始支持,详见[PR 1531](https://github.com/ctripcorp/apollo/pull/1531) ### 3.1.10 role.create-application.enabled - 是否开启创建项目权限控制 > 适用于1.5.0及以上版本 默认为false,所有用户都可以创建项目 如果设置为true,那么只有超级管理员和拥有创建项目权限的帐号可以创建项目,超级管理员可以通过`管理员工具 - 系统权限管理`给用户分配创建项目权限 ### 3.1.11 role.manage-app-master.enabled - 是否开启项目管理员分配权限控制 > 适用于1.5.0及以上版本 默认为false,所有项目的管理员可以为项目添加/删除管理员 如果设置为true,那么只有超级管理员和拥有项目管理员分配权限的帐号可以为特定项目添加/删除管理员,超级管理员可以通过`管理员工具 - 系统权限管理`给用户分配特定项目的管理员分配权限 ### 3.1.12 admin-service.access.tokens - 设置apollo-portal访问各环境apollo-adminservice所需的access token > 适用于1.7.1及以上版本 如果对应环境的apollo-adminservice开启了[访问控制](#_326-admin-serviceaccesscontrolenabled-配置apollo-adminservice是否开启访问控制),那么需要在此配置apollo-portal访问该环境apollo-adminservice所需的access token,否则会访问失败 格式为json,如下所示: ```json { "dev" : "098f6bcd4621d373cade4e832627b4f6", "pro" : "ad0234829205b9033196ba818f7a872b" } ``` ## 3.2 调整ApolloConfigDB配置 配置项统一存储在ApolloConfigDB.ServerConfig表中,需要注意每个环境的ApolloConfigDB.ServerConfig都需要单独配置,修改完一分钟实时生效。 ### 3.2.1 eureka.service.url - Eureka服务Url > 不适用于基于Kubernetes原生服务发现场景 不管是apollo-configservice还是apollo-adminservice都需要向eureka服务注册,所以需要配置eureka服务地址。 按照目前的实现,apollo-configservice本身就是一个eureka服务,所以只需要填入apollo-configservice的地址即可,如有多个,用逗号分隔(注意不要忘了/eureka/后缀)。 需要注意的是每个环境只填入自己环境的eureka服务地址,比如FAT的apollo-configservice是1.1.1.1:8080和2.2.2.2:8080,UAT的apollo-configservice是3.3.3.3:8080和4.4.4.4:8080,PRO的apollo-configservice是5.5.5.5:8080和6.6.6.6:8080,那么: 1. 在FAT环境的ApolloConfigDB.ServerConfig表中设置eureka.service.url为: ``` http://1.1.1.1:8080/eureka/,http://2.2.2.2:8080/eureka/ ``` 2. 在UAT环境的ApolloConfigDB.ServerConfig表中设置eureka.service.url为: ``` http://3.3.3.3:8080/eureka/,http://4.4.4.4:8080/eureka/ ``` 3. 在PRO环境的ApolloConfigDB.ServerConfig表中设置eureka.service.url为: ``` http://5.5.5.5:8080/eureka/,http://6.6.6.6:8080/eureka/ ``` >注1:这里需要填写本环境中全部的eureka服务地址,因为eureka需要互相复制注册信息 >注2:如果希望将Config Service和Admin Service注册到公司统一的Eureka上,可以参考[部署&开发遇到的常见问题 - 将Config Service和Admin Service注册到单独的Eureka Server上](zh/faq/common-issues-in-deployment-and-development-phase#_8-将config-service和admin-service注册到单独的eureka-server上)章节 >注3:在多机房部署时,往往希望config service和admin service只向同机房的eureka注册,要实现这个效果,需要利用`ServerConfig`表中的cluster字段,config service和admin service会读取所在机器的`/opt/settings/server.properties`(Mac/Linux)或`C:\opt\settings\server.properties`(Windows)中的idc属性,如果该idc有对应的eureka.service.url配置,那么就只会向该机房的eureka注册。比如config service和admin service会部署到`SHAOY`和`SHAJQ`两个IDC,那么为了实现这两个机房中的服务只向该机房注册,那么可以在`ServerConfig`表中新增两条记录,分别填入`SHAOY`和`SHAJQ`两个机房的eureka地址即可,`default` cluster的记录可以保留,如果有config service和admin service不是部署在`SHAOY`和`SHAJQ`这两个机房的,就会使用这条默认配置。 | Key |Cluster | Value | Comment | |--------------------|-----------|-------------------------------|---------------------| | eureka.service.url | default | http://1.1.1.1:8080/eureka/ | 默认的Eureka服务Url | | eureka.service.url | SHAOY | http://2.2.2.2:8080/eureka/ | SHAOY的Eureka服务Url | | eureka.service.url | SHAJQ | http://3.3.3.3:8080/eureka/ | SHAJQ的Eureka服务Url | ### 3.2.2 namespace.lock.switch - 一次发布只能有一个人修改开关,用于发布审核 这是一个功能开关,如果配置为true的话,那么一次配置发布只能是一个人修改,另一个发布。 > 生产环境建议开启此选项 ### 3.2.3 config-service.cache.enabled - 是否开启配置缓存 这是一个功能开关,如果配置为true的话,config service会缓存加载过的配置信息,从而加快后续配置获取性能。 默认为false,开启前请先评估总配置大小并调整config service内存配置。 > 开启缓存后必须确保应用中配置的app.id大小写正确,否则将获取不到正确的配置 ### 3.2.4 item.key.length.limit - 配置项 key 最大长度限制 默认配置是128。 ### 3.2.5 item.value.length.limit - 配置项 value 最大长度限制 默认配置是20000。 ### 3.2.6 admin-service.access.control.enabled - 配置apollo-adminservice是否开启访问控制 > 适用于1.7.1及以上版本 默认为false,如果配置为true,那么apollo-portal就需要[正确配置](#_3112-admin-serviceaccesstokens-设置apollo-portal访问各环境apollo-adminservice所需的access-token)访问该环境的access token,否则访问会被拒绝 ### 3.2.7 admin-service.access.tokens - 配置允许访问apollo-adminservice的access token列表 > 适用于1.7.1及以上版本 如果该配置项为空,那么访问控制不会生效。如果允许多个token,token 之间以英文逗号分隔 样例: ```properties admin-service.access.tokens=098f6bcd4621d373cade4e832627b4f6 admin-service.access.tokens=098f6bcd4621d373cade4e832627b4f6,ad0234829205b9033196ba818f7a872b ```
本文档介绍了如何按照分布式部署的方式编译、打包、部署Apollo配置中心,从而可以在开发、测试、生产等环境分别部署运行。 > 如果只是需要在本地快速部署试用Apollo的话,可以参考[Quick Start](zh/deployment/quick-start) # &nbsp; # 一、准备工作 ## 1.1 运行时环境 ### 1.1.1 OS 服务端基于Spring Boot,启动脚本理论上支持所有Linux发行版,建议[CentOS 7](https://www.centos.org/)。 ### 1.1.2 Java * Apollo服务端:1.8+ * Apollo客户端:1.7+ 由于需要同时运行服务端和客户端,所以建议安装Java 1.8+。 >对于Apollo客户端,运行时环境只需要1.7+即可。 >注:对于Apollo客户端,如果有需要的话,可以做少量代码修改来降级到Java 1.6,详细信息可以参考[Issue 483](https://github.com/ctripcorp/apollo/issues/483) 在配置好后,可以通过如下命令检查: ```sh java -version ``` 样例输出: ```sh java version "1.8.0_74" Java(TM) SE Runtime Environment (build 1.8.0_74-b02) Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode) ``` ## 1.2 MySQL * 版本要求:5.6.5+ Apollo的表结构对`timestamp`使用了多个default声明,所以需要5.6.5以上版本。 连接上MySQL后,可以通过如下命令检查: ```sql SHOW VARIABLES WHERE Variable_name = 'version'; ``` | Variable_name | Value | |---------------|--------| | version | 5.7.11 | > 注1:MySQL版本可以降级到5.5,详见[mysql 依赖降级讨论](https://github.com/ctripcorp/apollo/issues/481)。 > 注2:如果希望使用Oracle的话,可以参考[vanpersl](https://github.com/vanpersl)在Apollo 0.8.0基础上开发的[Oracle适配代码](https://github.com/ctripcorp/apollo/compare/v0.8.0...vanpersl:db-oracle),Oracle版本为10.2.0.1.0。 > 注3:如果希望使用Postgres的话,可以参考[oaksharks](https://github.com/oaksharks)在Apollo 0.9.1基础上开发的[Pg适配代码](https://github.com/oaksharks/apollo/compare/ac10768ee2e11c488523ca0e845984f6f71499ac...oaksharks:pg),Postgres的版本为9.3.20,也可以参考[xiao0yy](https://github.com/xiao0yy)在Apollo 0.10.2基础上开发的[Pg适配代码](https://github.com/ctripcorp/apollo/issues/1293),Postgres的版本为9.5。 ## 1.3 环境 分布式部署需要事先确定部署的环境以及部署方式。 Apollo目前支持以下环境: * DEV * 开发环境 * FAT * 测试环境,相当于alpha环境(功能测试) * UAT * 集成环境,相当于beta环境(回归测试) * PRO * 生产环境 > 如果希望添加自定义的环境名称,具体步骤可以参考[Portal如何增加环境](zh/faq/common-issues-in-deployment-and-development-phase?id=_4-portal如何增加环境?) 以ctrip为例,我们的部署策略如下: ![Deployment](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/apollo-deployment.png) * Portal部署在生产环境的机房,通过它来直接管理FAT、UAT、PRO等环境的配置 * Meta Server、Config Service和Admin Service在每个环境都单独部署,使用独立的数据库 * Meta Server、Config Service和Admin Service在生产环境部署在两个机房,实现双活 * Meta Server和Config Service部署在同一个JVM进程内,Admin Service部署在同一台服务器的另一个JVM进程内 另外也可以参考下[@lyliyongblue](https://github.com/lyliyongblue) 贡献的样例部署图(建议右键新窗口打开看大图): ![Deployment](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/lyliyongblue-apollo-deployment.png) ## 1.4 网络策略 分布式部署的时候,`apollo-configservice`和`apollo-adminservice`需要把自己的IP和端口注册到Meta Server(apollo-configservice本身)。 Apollo客户端和Portal会从Meta Server获取服务的地址(IP+端口),然后通过服务地址直接访问。 需要注意的是,`apollo-configservice`和`apollo-adminservice`是基于内网可信网络设计的,所以出于安全考虑,**请不要将`apollo-configservice`和`apollo-adminservice`直接暴露在公网**。 所以如果实际部署的机器有多块网卡(如docker),或者存在某些网卡的IP是Apollo客户端和Portal无法访问的(如网络安全限制),那么我们就需要在`apollo-configservice`和`apollo-adminservice`中做相关配置来解决连通性问题。 ### 1.4.1 忽略某些网卡 可以分别修改`apollo-configservice`和`apollo-adminservice`的startup.sh,通过JVM System Property传入-D参数,也可以通过OS Environment Variable传入,下面的例子会把`docker0`和`veth`开头的网卡在注册到Eureka时忽略掉。 JVM System Property示例: ```properties -Dspring.cloud.inetutils.ignoredInterfaces[0]=docker0 -Dspring.cloud.inetutils.ignoredInterfaces[1]=veth.* ``` OS Environment Variable示例: ```properties SPRING_CLOUD_INETUTILS_IGNORED_INTERFACES[0]=docker0 SPRING_CLOUD_INETUTILS_IGNORED_INTERFACES[1]=veth.* ``` ### 1.4.2 指定要注册的IP 可以分别修改`apollo-configservice`和`apollo-adminservice`的startup.sh,通过JVM System Property传入-D参数,也可以通过OS Environment Variable传入,下面的例子会指定注册的IP为`1.2.3.4`。 JVM System Property示例: ```properties -Deureka.instance.ip-address=1.2.3.4 ``` OS Environment Variable示例: ```properties EUREKA_INSTANCE_IP_ADDRESS=1.2.3.4 ``` ### 1.4.3 指定要注册的URL 可以分别修改`apollo-configservice`和`apollo-adminservice`的startup.sh,通过JVM System Property传入-D参数,也可以通过OS Environment Variable传入,下面的例子会指定注册的URL为`http://1.2.3.4:8080`。 JVM System Property示例: ```properties -Deureka.instance.homePageUrl=http://1.2.3.4:8080 -Deureka.instance.preferIpAddress=false ``` OS Environment Variable示例: ```properties EUREKA_INSTANCE_HOME_PAGE_URL=http://1.2.3.4:8080 EUREKA_INSTANCE_PREFER_IP_ADDRESS=false ``` ### 1.4.4 直接指定apollo-configservice地址 如果Apollo部署在公有云上,本地开发环境无法连接,但又需要做开发测试的话,客户端可以升级到0.11.0版本及以上,然后配置[跳过Apollo Meta Server服务发现](zh/usage/java-sdk-user-guide#_1222-跳过apollo-meta-server服务发现) # 二、部署步骤 部署步骤总体还是比较简单的,Apollo的唯一依赖是数据库,所以需要首先把数据库准备好,然后根据实际情况,选择不同的部署方式: > [@lingjiaju](https://github.com/lingjiaju)录制了一系列Apollo快速上手视频,如果看文档觉得略繁琐的话,不妨可以先看一下他的[视频教程](https://pan.baidu.com/s/1blv87EOZS77NWT8Amkijkw#list/path=%2F)。 > 如果部署过程中遇到了问题,可以参考[部署&开发遇到的常见问题](zh/faq/common-issues-in-deployment-and-development-phase),一般都能找到答案。 ## 2.1 创建数据库 Apollo服务端共需要两个数据库:`ApolloPortalDB`和`ApolloConfigDB`,我们把数据库、表的创建和样例数据都分别准备了sql文件,只需要导入数据库即可。 需要注意的是ApolloPortalDB只需要在生产环境部署一个即可,而ApolloConfigDB需要在每个环境部署一套,如fat、uat和pro分别部署3套ApolloConfigDB。 > 注意:如果你本地已经创建过Apollo数据库,请注意备份数据。我们准备的sql文件会清空Apollo相关的表。 ### 2.1.1 创建ApolloPortalDB 可以根据实际情况选择通过手动导入SQL或是通过[Flyway](https://flywaydb.org/)自动导入SQL创建。 #### 2.1.1.1 手动导入SQL创建 通过各种MySQL客户端导入[apolloportaldb.sql](https://github.com/ctripcorp/apollo/blob/master/scripts/sql/apolloportaldb.sql)即可。 以MySQL原生客户端为例: ```sql source /your_local_path/scripts/sql/apolloportaldb.sql ``` #### 2.1.1.2 通过Flyway导入SQL创建 > 需要1.3.0及以上版本 1. 根据实际情况修改[flyway-portaldb.properties](https://github.com/ctripcorp/apollo/blob/master/scripts/flyway/flyway-portaldb.properties)中的`flyway.user`、`flyway.password`和`flyway.url`配置 2. 在apollo项目根目录下执行`mvn -N -Pportaldb flyway:migrate` #### 2.1.1.3 验证 导入成功后,可以通过执行以下sql语句来验证: ```sql select `Id`, `Key`, `Value`, `Comment` from `ApolloPortalDB`.`ServerConfig` limit 1; ``` | Id | Key | Value | Comment | |----|--------------------|-------|------------------| | 1 | apollo.portal.envs | dev | 可支持的环境列表 | > 注:ApolloPortalDB只需要在生产环境部署一个即可 ### 2.1.2 创建ApolloConfigDB 可以根据实际情况选择通过手动导入SQL或是通过[Flyway](https://flywaydb.org/)自动导入SQL创建。 #### 2.1.2.1 手动导入SQL 通过各种MySQL客户端导入[apolloconfigdb.sql](https://github.com/ctripcorp/apollo/blob/master/scripts/sql/apolloconfigdb.sql)即可。 以MySQL原生客户端为例: ```sql source /your_local_path/scripts/sql/apolloconfigdb.sql ``` #### 2.1.2.2 通过Flyway导入SQL > 需要1.3.0及以上版本 1. 根据实际情况修改[flyway-configdb.properties](https://github.com/ctripcorp/apollo/blob/master/scripts/flyway/flyway-configdb.properties)中的`flyway.user`、`flyway.password`和`flyway.url`配置 2. 在apollo项目根目录下执行`mvn -N -Pconfigdb flyway:migrate` #### 2.1.2.3 验证 导入成功后,可以通过执行以下sql语句来验证: ```sql select `Id`, `Key`, `Value`, `Comment` from `ApolloConfigDB`.`ServerConfig` limit 1; ``` | Id | Key | Value | Comment | |----|--------------------|-------------------------------|---------------| | 1 | eureka.service.url | http://127.0.0.1:8080/eureka/ | Eureka服务Url | > 注:ApolloConfigDB需要在每个环境部署一套,如fat、uat和pro分别部署3套ApolloConfigDB #### 2.1.2.4 从别的环境导入ApolloConfigDB的项目数据 如果是全新部署的Apollo配置中心,请忽略此步。 如果不是全新部署的Apollo配置中心,比如已经使用了一段时间,这时在Apollo配置中心已经创建了不少项目以及namespace等,那么在新环境中的ApolloConfigDB中需要从其它正常运行的环境中导入必要的项目数据。 主要涉及ApolloConfigDB的下面4张表,下面同时附上需要导入的数据查询语句: 1. App * 导入全部的App * 如:insert into `新环境的ApolloConfigDB`.`App` select * from `其它环境的ApolloConfigDB`.`App` where `IsDeleted` = 0; 2. AppNamespace * 导入全部的AppNamespace * 如:insert into `新环境的ApolloConfigDB`.`AppNamespace` select * from `其它环境的ApolloConfigDB`.`AppNamespace` where `IsDeleted` = 0; 3. Cluster * 导入默认的default集群 * 如:insert into `新环境的ApolloConfigDB`.`Cluster` select * from `其它环境的ApolloConfigDB`.`Cluster` where `Name` = 'default' and `IsDeleted` = 0; 4. Namespace * 导入默认的default集群中的namespace * 如:insert into `新环境的ApolloConfigDB`.`Namespace` select * from `其它环境的ApolloConfigDB`.`Namespace` where `ClusterName` = 'default' and `IsDeleted` = 0; 同时也别忘了通知用户在新的环境给自己的项目设置正确的配置信息,尤其是一些影响面比较大的公共namespace配置。 > 如果是为正在运行的环境迁移数据,建议迁移完重启一下config service,因为config service中有appnamespace的缓存数据 ### 2.1.3 调整服务端配置 Apollo自身的一些配置是放在数据库里面的,所以需要针对实际情况做一些调整,具体参数说明请参考[三、服务端配置说明](#三、服务端配置说明)。 大部分配置可以先使用默认值,不过 [apollo.portal.envs](#_311-apolloportalenvs-可支持的环境列表) 和 [eureka.service.url](#_321-eurekaserviceurl-eureka服务url) 请务必配置正确后再进行下面的部署步骤。 ## 2.2 虚拟机/物理机部署 ### 2.2.1 获取安装包 可以通过两种方式获取安装包: 1. 直接下载安装包 * 从[GitHub Release](https://github.com/ctripcorp/apollo/releases)页面下载预先打好的安装包 * 如果对Apollo的代码没有定制需求,建议使用这种方式,可以省去本地打包的过程 2. 通过源码构建 * 从[GitHub Release](https://github.com/ctripcorp/apollo/releases)页面下载Source code包或直接clone[源码](https://github.com/ctripcorp/apollo)后在本地构建 * 如果需要对Apollo的做定制开发,需要使用这种方式 #### 2.2.1.1 直接下载安装包 ##### 2.2.1.1.1 获取apollo-configservice、apollo-adminservice、apollo-portal安装包 从[GitHub Release](https://github.com/ctripcorp/apollo/releases)页面下载最新版本的`apollo-configservice-x.x.x-github.zip`、`apollo-adminservice-x.x.x-github.zip`和`apollo-portal-x.x.x-github.zip`即可。 ##### 2.2.1.1.2 配置数据库连接信息 Apollo服务端需要知道如何连接到你前面创建的数据库,数据库连接串信息位于上一步下载的压缩包中的`config/application-github.properties`中。 ###### 2.2.1.1.2.1 配置apollo-configservice的数据库连接信息 1. 解压`apollo-configservice-x.x.x-github.zip` 2. 用程序员专用编辑器(如vim,notepad++,sublime等)打开`config`目录下的`application-github.properties`文件 3. 填写正确的ApolloConfigDB数据库连接串信息,注意用户名和密码后面不要有空格! 4. 修改完的效果如下: ```properties # DataSource spring.datasource.url = jdbc:mysql://localhost:3306/ApolloConfigDB?useSSL=false&characterEncoding=utf8 spring.datasource.username = someuser spring.datasource.password = somepwd ``` > 注:由于ApolloConfigDB在每个环境都有部署,所以对不同的环境config-service需要配置对应环境的数据库参数 ###### 2.2.1.1.2.2 配置apollo-adminservice的数据库连接信息 1. 解压`apollo-adminservice-x.x.x-github.zip` 2. 用程序员专用编辑器(如vim,notepad++,sublime等)打开`config`目录下的`application-github.properties`文件 3. 填写正确的ApolloConfigDB数据库连接串信息,注意用户名和密码后面不要有空格! 4. 修改完的效果如下: ```properties # DataSource spring.datasource.url = jdbc:mysql://localhost:3306/ApolloConfigDB?useSSL=false&characterEncoding=utf8 spring.datasource.username = someuser spring.datasource.password = somepwd ``` > 注:由于ApolloConfigDB在每个环境都有部署,所以对不同的环境admin-service需要配置对应环境的数据库参数 ###### 2.2.1.1.2.3 配置apollo-portal的数据库连接信息 1. 解压`apollo-portal-x.x.x-github.zip` 2. 用程序员专用编辑器(如vim,notepad++,sublime等)打开`config`目录下的`application-github.properties`文件 3. 填写正确的ApolloPortalDB数据库连接串信息,注意用户名和密码后面不要有空格! 4. 修改完的效果如下: ```properties # DataSource spring.datasource.url = jdbc:mysql://localhost:3306/ApolloPortalDB?useSSL=false&characterEncoding=utf8 spring.datasource.username = someuser spring.datasource.password = somepwd ``` ###### 2.2.1.1.2.4 配置apollo-portal的meta service信息 Apollo Portal需要在不同的环境访问不同的meta service(apollo-configservice)地址,所以我们需要在配置中提供这些信息。默认情况下,meta service和config service是部署在同一个JVM进程,所以meta service的地址就是config service的地址。 > 对于1.6.0及以上版本,可以通过ApolloPortalDB.ServerConfig中的配置项来配置Meta Service地址,详见[apollo.portal.meta.servers - 各环境Meta Service列表](#_312-apolloportalmetaservers-各环境meta-service列表) 使用程序员专用编辑器(如vim,notepad++,sublime等)打开`apollo-portal-x.x.x-github.zip`中`config`目录下的`apollo-env.properties`文件。 假设DEV的apollo-configservice未绑定域名,地址是1.1.1.1:8080,FAT的apollo-configservice绑定了域名apollo.fat.xxx.com,UAT的apollo-configservice绑定了域名apollo.uat.xxx.com,PRO的apollo-configservice绑定了域名apollo.xxx.com,那么可以如下修改各环境meta service服务地址,格式为`${env}.meta=http://${config-service-url:port}`,如果某个环境不需要,也可以直接删除对应的配置项(如lpt.meta): ```sh dev.meta=http://1.1.1.1:8080 fat.meta=http://apollo.fat.xxx.com uat.meta=http://apollo.uat.xxx.com pro.meta=http://apollo.xxx.com ``` 除了通过`apollo-env.properties`方式配置meta service以外,apollo也支持在运行时指定meta service(优先级比`apollo-env.properties`高): 1. 通过Java System Property `${env}_meta` * 可以通过Java的System Property `${env}_meta`来指定 * 如`java -Ddev_meta=http://config-service-url -jar xxx.jar` * 也可以通过程序指定,如`System.setProperty("dev_meta", "http://config-service-url");` 2. 通过操作系统的System Environment`${ENV}_META` * 如`DEV_META=http://config-service-url` * 注意key为全大写,且中间是`_`分隔 >注1: 为了实现meta service的高可用,推荐通过SLB(Software Load Balancer)做动态负载均衡 >注2: meta service地址也可以填入IP,0.11.0版本之前只支持填入一个IP。从0.11.0版本开始支持填入以逗号分隔的多个地址([PR #1214](https://github.com/ctripcorp/apollo/pull/1214)),如`http://1.1.1.1:8080,http://2.2.2.2:8080`,不过生产环境还是建议使用域名(走slb),因为机器扩容、缩容等都可能导致IP列表的变化。 #### 2.2.1.2 通过源码构建 ##### 2.2.1.2.1 配置数据库连接信息 Apollo服务端需要知道如何连接到你前面创建的数据库,所以需要编辑[scripts/build.sh](https://github.com/ctripcorp/apollo/blob/master/scripts/build.sh),修改ApolloPortalDB和ApolloConfigDB相关的数据库连接串信息。 > 注意:填入的用户需要具备对ApolloPortalDB和ApolloConfigDB数据的读写权限。 ```sh #apollo config db info apollo_config_db_url=jdbc:mysql://localhost:3306/ApolloConfigDB?useSSL=false&characterEncoding=utf8 apollo_config_db_username=用户名 apollo_config_db_password=密码(如果没有密码,留空即可) # apollo portal db info apollo_portal_db_url=jdbc:mysql://localhost:3306/ApolloPortalDB?useSSL=false&characterEncoding=utf8 apollo_portal_db_username=用户名 apollo_portal_db_password=密码(如果没有密码,留空即可) ``` > 注1:由于ApolloConfigDB在每个环境都有部署,所以对不同的环境config-service和admin-service需要使用不同的数据库参数打不同的包,portal只需要打一次包即可 > 注2:如果不想config-service和admin-service每个环境打一个包的话,也可以通过运行时传入数据库连接串信息实现,具体可以参考 [Issue 869](https://github.com/ctripcorp/apollo/issues/869) > 注3:每个环境都需要独立部署一套config-service、admin-service和ApolloConfigDB ##### 2.2.1.2.2 配置各环境meta service地址 Apollo Portal需要在不同的环境访问不同的meta service(apollo-configservice)地址,所以需要在打包时提供这些信息。 假设DEV的apollo-configservice未绑定域名,地址是1.1.1.1:8080,FAT的apollo-configservice绑定了域名apollo.fat.xxx.com,UAT的apollo-configservice绑定了域名apollo.uat.xxx.com,PRO的apollo-configservice绑定了域名apollo.xxx.com,那么编辑[scripts/build.sh](https://github.com/ctripcorp/apollo/blob/master/scripts/build.sh),如下修改各环境meta service服务地址,格式为`${env}_meta=http://${config-service-url:port}`,如果某个环境不需要,也可以直接删除对应的配置项: ```sh dev_meta=http://1.1.1.1:8080 fat_meta=http://apollo.fat.xxx.com uat_meta=http://apollo.uat.xxx.com pro_meta=http://apollo.xxx.com META_SERVERS_OPTS="-Ddev_meta=$dev_meta -Dfat_meta=$fat_meta -Duat_meta=$uat_meta -Dpro_meta=$pro_meta" ``` 除了在打包时配置meta service以外,apollo也支持在运行时指定meta service: 1. 通过Java System Property `${env}_meta` * 可以通过Java的System Property `${env}_meta`来指定 * 如`java -Ddev_meta=http://config-service-url -jar xxx.jar` * 也可以通过程序指定,如`System.setProperty("dev_meta", "http://config-service-url");` 2. 通过操作系统的System Environment`${ENV}_META` * 如`DEV_META=http://config-service-url` * 注意key为全大写,且中间是`_`分隔 >注1: 为了实现meta service的高可用,推荐通过SLB(Software Load Balancer)做动态负载均衡 >注2: meta service地址也可以填入IP,0.11.0版本之前只支持填入一个IP。从0.11.0版本开始支持填入以逗号分隔的多个地址([PR #1214](https://github.com/ctripcorp/apollo/pull/1214)),如`http://1.1.1.1:8080,http://2.2.2.2:8080`,不过生产环境还是建议使用域名(走slb),因为机器扩容、缩容等都可能导致IP列表的变化。 ##### 2.2.1.2.3 执行编译、打包 做完上述配置后,就可以执行编译和打包了。 > 注:初次编译会从Maven中央仓库下载不少依赖,如果网络情况不佳时很容易出错,建议使用国内的Maven仓库源,比如[阿里云Maven镜像](http://www.cnblogs.com/geektown/p/5705405.html) ```sh ./build.sh ``` 该脚本会依次打包apollo-configservice, apollo-adminservice, apollo-portal。 > 注:由于ApolloConfigDB在每个环境都有部署,所以对不同环境的config-service和admin-service需要使用不同的数据库连接信息打不同的包,portal只需要打一次包即可 ##### 2.2.1.2.4 获取apollo-configservice安装包 位于`apollo-configservice/target/`目录下的`apollo-configservice-x.x.x-github.zip` 需要注意的是由于ApolloConfigDB在每个环境都有部署,所以对不同环境的config-service需要使用不同的数据库参数打不同的包后分别部署 ##### 2.2.1.2.5 获取apollo-adminservice安装包 位于`apollo-adminservice/target/`目录下的`apollo-adminservice-x.x.x-github.zip` 需要注意的是由于ApolloConfigDB在每个环境都有部署,所以对不同环境的admin-service需要使用不同的数据库参数打不同的包后分别部署 ##### 2.2.1.2.6 获取apollo-portal安装包 位于`apollo-portal/target/`目录下的`apollo-portal-x.x.x-github.zip` ##### 2.2.1.2.7 启用外部nacos服务注册中心替换内置eureka 1. 修改build.sh/build.bat,将config-service和admin-service的maven编译命令更改为 ```shell mvn clean package -Pgithub,nacos-discovery -DskipTests -pl apollo-configservice,apollo-adminservice -am -Dapollo_profile=github,nacos-discovery -Dspring_datasource_url=$apollo_config_db_url -Dspring_datasource_username=$apollo_config_db_username -Dspring_datasource_password=$apollo_config_db_password ``` 2. 分别修改apollo-configservice和apollo-adminservice安装包中config目录下的application-github.properties,配置nacos服务器地址 ```properties nacos.discovery.server-addr=127.0.0.1:8848 ``` ##### 2.2.1.2.8 启用外部Consul服务注册中心替换内置eureka 1. 修改build.sh/build.bat,将config-service和admin-service的maven编译命令更改为 ```shell mvn clean package -Pgithub -DskipTests -pl apollo-configservice,apollo-adminservice -am -Dapollo_profile=github,consul-discovery -Dspring_datasource_url=$apollo_config_db_url -Dspring_datasource_username=$apollo_config_db_username -Dspring_datasource_password=$apollo_config_db_password ``` 2. 分别修改apollo-configservice和apollo-adminservice安装包中config目录下的application-github.properties,配置consul服务器地址 ```properties spring.cloud.consul.host=127.0.0.1 spring.cloud.consul.port=8500 ``` ### 2.2.2 部署Apollo服务端 #### 2.2.2.1 部署apollo-configservice 将对应环境的`apollo-configservice-x.x.x-github.zip`上传到服务器上,解压后执行scripts/startup.sh即可。如需停止服务,执行scripts/shutdown.sh. 记得在scripts/startup.sh中按照实际的环境设置一个JVM内存,以下是我们的默认设置,供参考: ```bash export JAVA_OPTS="-server -Xms6144m -Xmx6144m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=4096m -XX:MaxNewSize=4096m -XX:SurvivorRatio=18" ``` > 注1:如果需要修改JVM参数,可以修改scripts/startup.sh的`JAVA_OPTS`部分。 > 注2:如要调整服务的日志输出路径,可以修改scripts/startup.sh和apollo-configservice.conf中的`LOG_DIR`。 > 注3:如要调整服务的监听端口,可以修改scripts/startup.sh中的`SERVER_PORT`。另外apollo-configservice同时承担meta server职责,如果要修改端口,注意要同时ApolloConfigDB.ServerConfig表中的`eureka.service.url`配置项以及apollo-portal和apollo-client中的使用到的meta server信息,详见:[2.2.1.1.2.4 配置apollo-portal的meta service信息](#_221124-配置apollo-portal的meta-service信息)和[1.2.2 Apollo Meta Server](zh/usage/java-sdk-user-guide#_122-apollo-meta-server)。 > 注4:如果ApolloConfigDB.ServerConfig的eureka.service.url只配了当前正在启动的机器的话,在启动apollo-configservice的过程中会在日志中输出eureka注册失败的信息,如`com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused`。需要注意的是,这个是预期的情况,因为apollo-configservice需要向Meta Server(它自己)注册服务,但是因为在启动过程中,自己还没起来,所以会报这个错。后面会进行重试的动作,所以等自己服务起来后就会注册正常了。 > 注5:如果你看到了这里,相信你一定是一个细心阅读文档的人,而且离成功就差一点点了,继续加油,应该很快就能完成Apollo的分布式部署了!不过你是否有感觉Apollo的分布式部署步骤有点繁琐?是否有啥建议想要和作者说?如果答案是肯定的话,请移步 [#1424](https://github.com/ctripcorp/apollo/issues/1424),期待你的建议! #### 2.2.2.2 部署apollo-adminservice 将对应环境的`apollo-adminservice-x.x.x-github.zip`上传到服务器上,解压后执行scripts/startup.sh即可。如需停止服务,执行scripts/shutdown.sh. 记得在scripts/startup.sh中按照实际的环境设置一个JVM内存,以下是我们的默认设置,供参考: ```bash export JAVA_OPTS="-server -Xms2560m -Xmx2560m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=1024m -XX:MaxNewSize=1024m -XX:SurvivorRatio=22" ``` > 注1:如果需要修改JVM参数,可以修改scripts/startup.sh的`JAVA_OPTS`部分。 > 注2:如要调整服务的日志输出路径,可以修改scripts/startup.sh和apollo-adminservice.conf中的`LOG_DIR`。 > 注3:如要调整服务的监听端口,可以修改scripts/startup.sh中的`SERVER_PORT`。 #### 2.2.2.3 部署apollo-portal 将`apollo-portal-x.x.x-github.zip`上传到服务器上,解压后执行scripts/startup.sh即可。如需停止服务,执行scripts/shutdown.sh. 记得在startup.sh中按照实际的环境设置一个JVM内存,以下是我们的默认设置,供参考: ```bash export JAVA_OPTS="-server -Xms4096m -Xmx4096m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=1536m -XX:MaxNewSize=1536m -XX:SurvivorRatio=22" ``` > 注1:如果需要修改JVM参数,可以修改scripts/startup.sh的`JAVA_OPTS`部分。 > 注2:如要调整服务的日志输出路径,可以修改scripts/startup.sh和apollo-portal.conf中的`LOG_DIR`。 > 注3:如要调整服务的监听端口,可以修改scripts/startup.sh中的`SERVER_PORT`。 ## 2.3 Docker部署 ### 2.3.1 1.7.0及以上版本 Apollo 1.7.0版本开始会默认上传Docker镜像到[Docker Hub](https://hub.docker.com/u/apolloconfig),可以按照如下步骤获取 #### 2.3.1.1 Apollo Config Service ##### 2.3.1.1.1 获取镜像 ```bash docker pull apolloconfig/apollo-configservice:${version} ``` ##### 2.3.1.1.2 运行镜像 示例: ```bash docker run -p 8080:8080 \ -e SPRING_DATASOURCE_URL="jdbc:mysql://fill-in-the-correct-server:3306/ApolloConfigDB?characterEncoding=utf8" \ -e SPRING_DATASOURCE_USERNAME=FillInCorrectUser -e SPRING_DATASOURCE_PASSWORD=FillInCorrectPassword \ -d -v /tmp/logs:/opt/logs --name apollo-configservice apolloconfig/apollo-configservice:${version} ``` 参数说明: * SPRING_DATASOURCE_URL: 对应环境ApolloConfigDB的地址 * SPRING_DATASOURCE_USERNAME: 对应环境ApolloConfigDB的用户名 * SPRING_DATASOURCE_PASSWORD: 对应环境ApolloConfigDB的密码 #### 2.3.1.2 Apollo Admin Service ##### 2.3.1.2.1 获取镜像 ```bash docker pull apolloconfig/apollo-adminservice:${version} ``` ##### 2.3.1.2.2 运行镜像 示例: ```bash docker run -p 8090:8090 \ -e SPRING_DATASOURCE_URL="jdbc:mysql://fill-in-the-correct-server:3306/ApolloConfigDB?characterEncoding=utf8" \ -e SPRING_DATASOURCE_USERNAME=FillInCorrectUser -e SPRING_DATASOURCE_PASSWORD=FillInCorrectPassword \ -d -v /tmp/logs:/opt/logs --name apollo-adminservice apolloconfig/apollo-adminservice:${version} ``` 参数说明: * SPRING_DATASOURCE_URL: 对应环境ApolloConfigDB的地址 * SPRING_DATASOURCE_USERNAME: 对应环境ApolloConfigDB的用户名 * SPRING_DATASOURCE_PASSWORD: 对应环境ApolloConfigDB的密码 #### 2.3.1.3 Apollo Portal ##### 2.3.1.3.1 获取镜像 ```bash docker pull apolloconfig/apollo-portal:${version} ``` ##### 2.3.1.3.2 运行镜像 示例: ```bash docker run -p 8070:8070 \ -e SPRING_DATASOURCE_URL="jdbc:mysql://fill-in-the-correct-server:3306/ApolloPortalDB?characterEncoding=utf8" \ -e SPRING_DATASOURCE_USERNAME=FillInCorrectUser -e SPRING_DATASOURCE_PASSWORD=FillInCorrectPassword \ -e APOLLO_PORTAL_ENVS=dev,pro \ -e DEV_META=http://fill-in-dev-meta-server:8080 -e PRO_META=http://fill-in-pro-meta-server:8080 \ -d -v /tmp/logs:/opt/logs --name apollo-portal apolloconfig/apollo-portal:${version} ``` 参数说明: * SPRING_DATASOURCE_URL: 对应环境ApolloPortalDB的地址 * SPRING_DATASOURCE_USERNAME: 对应环境ApolloPortalDB的用户名 * SPRING_DATASOURCE_PASSWORD: 对应环境ApolloPortalDB的密码 * APOLLO_PORTAL_ENVS(可选): 对应ApolloPortalDB中的[apollo.portal.envs](#_311-apolloportalenvs-可支持的环境列表)配置项,如果没有在数据库中配置的话,可以通过此环境参数配置 * DEV_META/PRO_META(可选): 配置对应环境的Meta Service地址,以${ENV}_META命名,需要注意的是如果配置了ApolloPortalDB中的[apollo.portal.meta.servers](#_312-apolloportalmetaservers-各环境meta-service列表)配置,则以apollo.portal.meta.servers中的配置为准 #### 2.3.1.4 通过源码构建 Docker 镜像 如果修改了 apollo 服务端的代码,希望通过源码构建 Docker 镜像,可以参考下面的步骤: 1. 通过源码构建安装包:`./scripts/build.sh` 2. 构建 Docker 镜像:`mvn docker:build -pl apollo-configservice,apollo-adminservice,apollo-portal` ### 2.3.2 1.7.0之前的版本 Apollo项目已经自带了Docker file,可以参照[2.2.1 获取安装包](#_221-获取安装包)配置好安装包后通过下面的文件来打Docker镜像: 1. [apollo-configservice](https://github.com/ctripcorp/apollo/blob/master/apollo-configservice/src/main/docker/Dockerfile) 2. [apollo-adminservice](https://github.com/ctripcorp/apollo/blob/master/apollo-adminservice/src/main/docker/Dockerfile) 3. [apollo-portal](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/docker/Dockerfile) 也可以参考Apollo用户[@kulovecc](https://github.com/kulovecc)的[docker-apollo](https://github.com/kulovecc/docker-apollo)项目和[@idoop](https://github.com/idoop)的[docker-apollo](https://github.com/idoop/docker-apollo)项目。 ## 2.4 Kubernetes部署 ### 2.4.1 基于Kubernetes原生服务发现 Apollo 1.7.0版本增加了基于Kubernetes原生服务发现的部署模式,由于不再使用内置的Eureka,所以在整体部署上有很大简化,同时也提供了Helm Charts,便于部署。 > 更多设计说明可以参考[#3054](https://github.com/ctripcorp/apollo/issues/3054)。 #### 2.4.1.1 环境要求 - Kubernetes 1.10+ - Helm 3 #### 2.4.1.2 添加Apollo Helm Chart仓库 ```bash $ helm repo add apollo https://ctripcorp.github.io/apollo/charts $ helm search repo apollo ``` #### 2.4.1.3 部署apollo-configservice和apollo-adminservice ##### 2.4.1.3.1 安装apollo-configservice和apollo-adminservice 需要在每个环境中安装apollo-configservice和apollo-adminservice,所以建议在release名称中加入环境信息,例如:`apollo-service-dev` ```bash $ helm install apollo-service-dev \ --set configdb.host=1.2.3.4 \ --set configdb.userName=apollo \ --set configdb.password=apollo \ --set configdb.service.enabled=true \ --set configService.replicaCount=1 \ --set adminService.replicaCount=1 \ -n your-namespace \ apollo/apollo-service ``` 一般部署建议通过 values.yaml 来配置: ```bash $ helm install apollo-service-dev -f values.yaml -n your-namespace apollo/apollo-service ``` 安装完成后会提示对应环境的Meta Server地址,需要记录下来,apollo-portal安装时需要用到: ```bash Get meta service url for current release by running these commands: echo http://apollo-service-dev-apollo-configservice:8080 ``` > 更多配置项说明可以参考[2.4.1.3.3 配置项说明](#_24133-配置项说明) ##### 2.4.1.3.2 卸载apollo-configservice和apollo-adminservice 例如要卸载`apollo-service-dev`的部署: ```bash $ helm uninstall -n your-namespace apollo-service-dev ``` ##### 2.4.1.3.3 配置项说明 下表列出了apollo-service chart的可配置参数及其默认值: | Parameter | Description | Default | |----------------------|---------------------------------------------|---------------------| | `configdb.host` | The host for apollo config db | `nil` | | `configdb.port` | The port for apollo config db | `3306` | | `configdb.dbName` | The database name for apollo config db | `ApolloConfigDB` | | `configdb.userName` | The user name for apollo config db | `nil` | | `configdb.password` | The password for apollo config db | `nil` | | `configdb.connectionStringProperties` | The connection string properties for apollo config db | `characterEncoding=utf8` | | `configdb.service.enabled` | Whether to create a Kubernetes Service for `configdb.host` or not. Set it to `true` if `configdb.host` is an endpoint outside of the kubernetes cluster | `false` | | `configdb.service.fullNameOverride` | Override the service name for apollo config db | `nil` | | `configdb.service.port` | The port for the service of apollo config db | `3306` | | `configdb.service.type` | The service type of apollo config db: `ClusterIP` or `ExternalName`. If the host is a DNS name, please specify `ExternalName` as the service type, e.g. `xxx.mysql.rds.aliyuncs.com` | `ClusterIP` | | `configService.fullNameOverride` | Override the deployment name for apollo-configservice | `nil` | | `configService.replicaCount` | Replica count of apollo-configservice | `2` | | `configService.containerPort` | Container port of apollo-configservice | `8080` | | `configService.image.repository` | Image repository of apollo-configservice | `apolloconfig/apollo-configservice` | | `configService.image.tag` | Image tag of apollo-configservice, e.g. `1.8.0`, leave it to `nil` to use the default version. _(chart version >= 0.2.0)_ | `nil` | | `configService.image.pullPolicy` | Image pull policy of apollo-configservice | `IfNotPresent` | | `configService.imagePullSecrets` | Image pull secrets of apollo-configservice | `[]` | | `configService.service.fullNameOverride` | Override the service name for apollo-configservice | `nil` | | `configService.service.port` | The port for the service of apollo-configservice | `8080` | | `configService.service.targetPort` | The target port for the service of apollo-configservice | `8080` | | `configService.service.type` | The service type of apollo-configservice | `ClusterIP` | | `configService.ingress.enabled` | Whether to enable the ingress for config-service or not. _(chart version >= 0.2.0)_ | `false` | | `configService.ingress.annotations` | The annotations of the ingress for config-service. _(chart version >= 0.2.0)_ | `{}` | | `configService.ingress.hosts.host` | The host of the ingress for config-service. _(chart version >= 0.2.0)_ | `nil` | | `configService.ingress.hosts.paths` | The paths of the ingress for config-service. _(chart version >= 0.2.0)_ | `[]` | | `configService.ingress.tls` | The tls definition of the ingress for config-service. _(chart version >= 0.2.0)_ | `[]` | | `configService.liveness.initialDelaySeconds` | The initial delay seconds of liveness probe | `100` | | `configService.liveness.periodSeconds` | The period seconds of liveness probe | `10` | | `configService.readiness.initialDelaySeconds` | The initial delay seconds of readiness probe | `30` | | `configService.readiness.periodSeconds` | The period seconds of readiness probe | `5` | | `configService.config.profiles` | specify the spring profiles to activate | `github,kubernetes` | | `configService.config.configServiceUrlOverride` | Override `apollo.config-service.url`: config service url to be accessed by apollo-client, e.g. `http://apollo-config-service-dev:8080` | `nil` | | `configService.config.adminServiceUrlOverride` | Override `apollo.admin-service.url`: admin service url to be accessed by apollo-portal, e.g. `http://apollo-admin-service-dev:8090` | `nil` | | `configService.config.contextPath` | specify the context path, e.g. `/apollo`, then users could access config service via `http://{config_service_address}/apollo`. _(chart version >= 0.2.0)_ | `nil` | | `configService.env` | Environment variables passed to the container, e.g. <br />`JAVA_OPTS: -Xss256k` | `{}` | | `configService.strategy` | The deployment strategy of apollo-configservice | `{}` | | `configService.resources` | The resources definition of apollo-configservice | `{}` | | `configService.nodeSelector` | The node selector definition of apollo-configservice | `{}` | | `configService.tolerations` | The tolerations definition of apollo-configservice | `[]` | | `configService.affinity` | The affinity definition of apollo-configservice | `{}` | | `adminService.fullNameOverride` | Override the deployment name for apollo-adminservice | `nil` | | `adminService.replicaCount` | Replica count of apollo-adminservice | `2` | | `adminService.containerPort` | Container port of apollo-adminservice | `8090` | | `adminService.image.repository` | Image repository of apollo-adminservice | `apolloconfig/apollo-adminservice` | | `adminService.image.tag` | Image tag of apollo-adminservice, e.g. `1.8.0`, leave it to `nil` to use the default version. _(chart version >= 0.2.0)_ | `nil` | | `adminService.image.pullPolicy` | Image pull policy of apollo-adminservice | `IfNotPresent` | | `adminService.imagePullSecrets` | Image pull secrets of apollo-adminservice | `[]` | | `adminService.service.fullNameOverride` | Override the service name for apollo-adminservice | `nil` | | `adminService.service.port` | The port for the service of apollo-adminservice | `8090` | | `adminService.service.targetPort` | The target port for the service of apollo-adminservice | `8090` | | `adminService.service.type` | The service type of apollo-adminservice | `ClusterIP` | | `adminService.ingress.enabled` | Whether to enable the ingress for admin-service or not. _(chart version >= 0.2.0)_ | `false` | | `adminService.ingress.annotations` | The annotations of the ingress for admin-service. _(chart version >= 0.2.0)_ | `{}` | | `adminService.ingress.hosts.host` | The host of the ingress for admin-service. _(chart version >= 0.2.0)_ | `nil` | | `adminService.ingress.hosts.paths` | The paths of the ingress for admin-service. _(chart version >= 0.2.0)_ | `[]` | | `adminService.ingress.tls` | The tls definition of the ingress for admin-service. _(chart version >= 0.2.0)_ | `[]` | | `adminService.liveness.initialDelaySeconds` | The initial delay seconds of liveness probe | `100` | | `adminService.liveness.periodSeconds` | The period seconds of liveness probe | `10` | | `adminService.readiness.initialDelaySeconds` | The initial delay seconds of readiness probe | `30` | | `adminService.readiness.periodSeconds` | The period seconds of readiness probe | `5` | | `adminService.config.profiles` | specify the spring profiles to activate | `github,kubernetes` | | `adminService.config.contextPath` | specify the context path, e.g. `/apollo`, then users could access admin service via `http://{admin_service_address}/apollo`. _(chart version >= 0.2.0)_ | `nil` | | `adminService.env` | Environment variables passed to the container, e.g. <br />`JAVA_OPTS: -Xss256k` | `{}` | | `adminService.strategy` | The deployment strategy of apollo-adminservice | `{}` | | `adminService.resources` | The resources definition of apollo-adminservice | `{}` | | `adminService.nodeSelector` | The node selector definition of apollo-adminservice | `{}` | | `adminService.tolerations` | The tolerations definition of apollo-adminservice | `[]` | | `adminService.affinity` | The affinity definition of apollo-adminservice | `{}` | ##### 2.4.1.3.4 配置样例 ###### 2.4.1.3.4.1 ConfigDB的host是k8s集群外的IP ```yaml configdb: host: 1.2.3.4 dbName: ApolloConfigDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false service: enabled: true ``` ###### 2.4.1.3.4.2 ConfigDB的host是k8s集群外的域名 ```yaml configdb: host: xxx.mysql.rds.aliyuncs.com dbName: ApolloConfigDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false service: enabled: true type: ExternalName ``` ###### 2.4.1.3.4.3 ConfigDB的host是k8s集群内的一个服务 ```yaml configdb: host: apollodb-mysql.mysql dbName: ApolloConfigDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false ``` ###### 2.4.1.3.4.4 指定Meta Server返回的apollo-configservice地址 如果apollo-client无法直接访问apollo-configservice的Service(比如不在同一个k8s集群),那么可以参照下面的示例指定Meta Server返回给apollo-client的地址(比如可以通过nodeport访问) ```yaml configService: config: configServiceUrlOverride: http://1.2.3.4:12345 ``` ###### 2.4.1.3.4.5 指定Meta Server返回的apollo-adminservice地址 如果apollo-portal无法直接访问apollo-adminservice的Service(比如不在同一个k8s集群),那么可以参照下面的示例指定Meta Server返回给apollo-portal的地址(比如可以通过nodeport访问) ```yaml configService: config: adminServiceUrlOverride: http://1.2.3.4:23456 ``` ###### 2.4.1.3.4.6 以Ingress配置自定义路径`/config`形式暴露apollo-configservice服务 ```yaml # use /config as root, should specify configService.config.contextPath as /config configService: config: contextPath: /config ingress: enabled: true hosts: - paths: - /config ``` ###### 2.4.1.3.4.7 以Ingress配置自定义路径`/admin`形式暴露apollo-adminservice服务 ```yaml # use /admin as root, should specify adminService.config.contextPath as /admin adminService: config: contextPath: /admin ingress: enabled: true hosts: - paths: - /admin ``` #### 2.4.1.4 部署apollo-portal ##### 2.4.1.4.1 安装apollo-portal 假设有dev, pro两个环境,且meta server地址分别为`http://apollo-service-dev-apollo-configservice:8080`和`http://apollo-service-pro-apollo-configservice:8080`: ```bash $ helm install apollo-portal \ --set portaldb.host=1.2.3.4 \ --set portaldb.userName=apollo \ --set portaldb.password=apollo \ --set portaldb.service.enabled=true \ --set config.envs="dev\,pro" \ --set config.metaServers.dev=http://apollo-service-dev-apollo-configservice:8080 \ --set config.metaServers.pro=http://apollo-service-pro-apollo-configservice:8080 \ --set replicaCount=1 \ -n your-namespace \ apollo/apollo-portal ``` 一般部署建议通过 values.yaml 来配置: ```bash $ helm install apollo-portal -f values.yaml -n your-namespace apollo/apollo-portal ``` > 更多配置项说明可以参考[2.4.1.4.3 配置项说明](#_24143-配置项说明) ##### 2.4.1.4.2 卸载apollo-portal 例如要卸载`apollo-portal`的部署: ```bash $ helm uninstall -n your-namespace apollo-portal ``` ##### 2.4.1.4.3 配置项说明 下表列出了apollo-portal chart的可配置参数及其默认值: | Parameter | Description | Default | |----------------------|---------------------------------------------|-----------------------| | `fullNameOverride` | Override the deployment name for apollo-portal | `nil` | | `replicaCount` | Replica count of apollo-portal | `2` | | `containerPort` | Container port of apollo-portal | `8070` | | `image.repository` | Image repository of apollo-portal | `apolloconfig/apollo-portal` | | `image.tag` | Image tag of apollo-portal, e.g. `1.8.0`, leave it to `nil` to use the default version. _(chart version >= 0.2.0)_ | `nil` | | `image.pullPolicy` | Image pull policy of apollo-portal | `IfNotPresent` | | `imagePullSecrets` | Image pull secrets of apollo-portal | `[]` | | `service.fullNameOverride` | Override the service name for apollo-portal | `nil` | | `service.port` | The port for the service of apollo-portal | `8070` | | `service.targetPort` | The target port for the service of apollo-portal | `8070` | | `service.type` | The service type of apollo-portal | `ClusterIP` | | `service.sessionAffinity` | The session affinity for the service of apollo-portal | `ClientIP` | | `ingress.enabled` | Whether to enable the ingress or not | `false` | | `ingress.annotations` | The annotations of the ingress | `{}` | | `ingress.hosts.host` | The host of the ingress | `nil` | | `ingress.hosts.paths` | The paths of the ingress | `[]` | | `ingress.tls` | The tls definition of the ingress | `[]` | | `liveness.initialDelaySeconds` | The initial delay seconds of liveness probe | `100` | | `liveness.periodSeconds` | The period seconds of liveness probe | `10` | | `readiness.initialDelaySeconds` | The initial delay seconds of readiness probe | `30` | | `readiness.periodSeconds` | The period seconds of readiness probe | `5` | | `env` | Environment variables passed to the container, e.g. <br />`JAVA_OPTS: -Xss256k` | `{}` | | `strategy` | The deployment strategy of apollo-portal | `{}` | | `resources` | The resources definition of apollo-portal | `{}` | | `nodeSelector` | The node selector definition of apollo-portal | `{}` | | `tolerations` | The tolerations definition of apollo-portal | `[]` | | `affinity` | The affinity definition of apollo-portal | `{}` | | `config.profiles` | specify the spring profiles to activate | `github,auth` | | `config.envs` | specify the env names, e.g. `dev,pro` | `nil` | | `config.contextPath` | specify the context path, e.g. `/apollo`, then users could access portal via `http://{portal_address}/apollo` | `nil` | | `config.metaServers` | specify the meta servers, e.g.<br />`dev: http://apollo-configservice-dev:8080`<br />`pro: http://apollo-configservice-pro:8080` | `{}` | | `config.files` | specify the extra config files for apollo-portal, e.g. `application-ldap.yml` | `{}` | | `portaldb.host` | The host for apollo portal db | `nil` | | `portaldb.port` | The port for apollo portal db | `3306` | | `portaldb.dbName` | The database name for apollo portal db | `ApolloPortalDB` | | `portaldb.userName` | The user name for apollo portal db | `nil` | | `portaldb.password` | The password for apollo portal db | `nil` | | `portaldb.connectionStringProperties` | The connection string properties for apollo portal db | `characterEncoding=utf8` | | `portaldb.service.enabled` | Whether to create a Kubernetes Service for `portaldb.host` or not. Set it to `true` if `portaldb.host` is an endpoint outside of the kubernetes cluster | `false` | | `portaldb.service.fullNameOverride` | Override the service name for apollo portal db | `nil` | | `portaldb.service.port` | The port for the service of apollo portal db | `3306` | | `portaldb.service.type` | The service type of apollo portal db: `ClusterIP` or `ExternalName`. If the host is a DNS name, please specify `ExternalName` as the service type, e.g. `xxx.mysql.rds.aliyuncs.com` | `ClusterIP` | ##### 2.4.1.4.4 配置样例 ###### 2.4.1.4.4.1 PortalDB的host是k8s集群外的IP ```yaml portaldb: host: 1.2.3.4 dbName: ApolloPortalDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false service: enabled: true ``` ###### 2.4.1.4.4.2 PortalDB的host是k8s集群外的域名 ```yaml portaldb: host: xxx.mysql.rds.aliyuncs.com dbName: ApolloPortalDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false service: enabled: true type: ExternalName ``` ###### 2.4.1.4.4.3 PortalDB的host是k8s集群内的一个服务 ```yaml portaldb: host: apollodb-mysql.mysql dbName: ApolloPortalDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false ``` ###### 2.4.1.4.4.4 配置环境信息 ```yaml config: envs: dev,pro metaServers: dev: http://apollo-service-dev-apollo-configservice:8080 pro: http://apollo-service-pro-apollo-configservice:8080 ``` ###### 2.4.1.4.4.5 以Load Balancer形式暴露服务 ```yaml service: type: LoadBalancer ``` ###### 2.4.1.4.4.6 以Ingress形式暴露服务 ```yaml ingress: enabled: true hosts: - paths: - / ``` ###### 2.4.1.4.4.7 以Ingress配置自定义路径`/apollo`形式暴露服务 ```yaml # use /apollo as root, should specify config.contextPath as /apollo ingress: enabled: true hosts: - paths: - /apollo config: ... contextPath: /apollo ... ``` ###### 2.4.1.4.4.8 以Ingress配置session affinity形式暴露服务 ```yaml ingress: enabled: true annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/affinity: "cookie" nginx.ingress.kubernetes.io/affinity-mode: "persistent" nginx.ingress.kubernetes.io/session-cookie-conditional-samesite-none: "true" nginx.ingress.kubernetes.io/session-cookie-expires: "172800" nginx.ingress.kubernetes.io/session-cookie-max-age: "172800" hosts: - host: xxx.somedomain.com # host is required to make session affinity work paths: - / ``` ###### 2.4.1.4.4.9 启用 LDAP 支持 ```yaml config: ... profiles: github,ldap ... files: application-ldap.yml: | spring: ldap: base: "dc=example,dc=org" username: "cn=admin,dc=example,dc=org" password: "password" searchFilter: "(uid={0})" urls: - "ldap://xxx.somedomain.com:389" ldap: mapping: objectClass: "inetOrgPerson" loginId: "uid" userDisplayName: "cn" email: "mail" ``` #### 2.4.1.5 通过源码构建 Docker 镜像 如果修改了 apollo 服务端的代码,希望通过源码构建 Docker 镜像,可以参考[2.3.1.4 通过源码构建 Docker 镜像](#_2314-通过源码构建-docker-镜像)的步骤。 ### 2.4.2 基于内置的Eureka服务发现 感谢[AiotCEO](https://github.com/AiotCEO)提供了k8s的部署支持,使用说明可以参考[apollo-on-kubernetes](https://github.com/ctripcorp/apollo/blob/master/scripts/apollo-on-kubernetes/README.md)。 感谢[qct](https://github.com/qct)提供的Helm Chart部署支持,使用说明可以参考[qct/apollo-helm](https://github.com/qct/apollo-helm)。 # 三、服务端配置说明 > 以下配置除了支持在数据库中配置以外,也支持通过-D参数、application.properties等配置,且-D参数、application.properties等优先级高于数据库中的配置 ## 3.1 调整ApolloPortalDB配置 配置项统一存储在ApolloPortalDB.ServerConfig表中,也可以通过`管理员工具 - 系统参数`页面进行配置,无特殊说明则修改完一分钟实时生效。 ### 3.1.1 apollo.portal.envs - 可支持的环境列表 默认值是dev,如果portal需要管理多个环境的话,以逗号分隔即可(大小写不敏感),如: ``` DEV,FAT,UAT,PRO ``` 修改完需要重启生效。 >注1:一套Portal可以管理多个环境,但是每个环境都需要独立部署一套Config Service、Admin Service和ApolloConfigDB,具体请参考:[2.1.2 创建ApolloConfigDB](#_212-创建apolloconfigdb),[3.2 调整ApolloConfigDB配置](zh/deployment/distributed-deployment-guide?id=_32-调整apolloconfigdb配置),[2.2.1.1.2 配置数据库连接信息](#_22112-配置数据库连接信息),另外如果是为已经运行了一段时间的Apollo配置中心增加环境,别忘了参考[2.1.2.4 从别的环境导入ApolloConfigDB的项目数据](#_2124-从别的环境导入apolloconfigdb的项目数据)对新的环境做初始化。 >注2:只在数据库添加环境是不起作用的,还需要为apollo-portal添加新增环境对应的meta server地址,具体参考:[2.2.1.1.2.4 配置apollo-portal的meta service信息](#_221124-配置apollo-portal的meta-service信息)。apollo-client在新的环境下使用时也需要做好相应的配置,具体参考:[1.2.2 Apollo Meta Server](zh/usage/java-sdk-user-guide#_122-apollo-meta-server)。 >注3:如果希望添加自定义的环境名称,具体步骤可以参考[Portal如何增加环境](zh/faq/common-issues-in-deployment-and-development-phase?id=_4-portal如何增加环境?)。 >注4:1.1.0版本增加了系统信息页面(`管理员工具` -> `系统信息`),可以通过该页面检查配置是否正确 ### 3.1.2 apollo.portal.meta.servers - 各环境Meta Service列表 > 适用于1.6.0及以上版本 Apollo Portal需要在不同的环境访问不同的meta service(apollo-configservice)地址,所以我们需要在配置中提供这些信息。默认情况下,meta service和config service是部署在同一个JVM进程,所以meta service的地址就是config service的地址。 样例如下: ```json { "DEV":"http://1.1.1.1:8080", "FAT":"http://apollo.fat.xxx.com", "UAT":"http://apollo.uat.xxx.com", "PRO":"http://apollo.xxx.com" } ``` 修改完需要重启生效。 > 该配置优先级高于其它方式设置的Meta Service地址,更多信息可以参考[2.2.1.1.2.4 配置apollo-portal的meta service信息](#_221124-配置apollo-portal的meta-service信息)。 ### 3.1.3 organizations - 部门列表 Portal中新建的App都需要选择部门,所以需要在这里配置可选的部门信息,样例如下: ```json [{"orgId":"TEST1","orgName":"样例部门1"},{"orgId":"TEST2","orgName":"样例部门2"}] ``` ### 3.1.4 superAdmin - Portal超级管理员 超级管理员拥有所有权限,需要谨慎设置。 如果没有接入自己公司的SSO系统的话,可以先暂时使用默认值apollo(默认用户)。等接入后,修改为实际使用的账号,多个账号以英文逗号分隔(,)。 ### 3.1.5 consumer.token.salt - consumer token salt 如果会使用开放平台API的话,可以设置一个token salt。如果不使用,可以忽略。 ### 3.1.6 wiki.address portal上“帮助”链接的地址,默认是Apollo github的wiki首页,可自行设置。 ### 3.1.7 admin.createPrivateNamespace.switch 是否允许项目管理员创建private namespace。设置为`true`允许创建,设置为`false`则项目管理员在页面上看不到创建private namespace的选项。[了解更多Namespace](zh/design/apollo-core-concept-namespace) ### 3.1.8 emergencyPublish.supported.envs 配置允许紧急发布的环境列表,多个env以英文逗号分隔。 当config service开启一次发布只能有一个人修改开关(`namespace.lock.switch`)后,一次配置发布只能是一个人修改,另一个发布。为了避免遇到紧急情况时(如非工作时间、节假日)无法发布配置,可以配置此项以允许某些环境可以操作紧急发布,即同一个人可以修改并发布配置。 ### 3.1.9 configView.memberOnly.envs 只对项目成员显示配置信息的环境列表,多个env以英文逗号分隔。 对设定了只对项目成员显示配置信息的环境,只有该项目的管理员或拥有该namespace的编辑或发布权限的用户才能看到该私有namespace的配置信息和发布历史。公共namespace始终对所有用户可见。 > 从1.1.0版本开始支持,详见[PR 1531](https://github.com/ctripcorp/apollo/pull/1531) ### 3.1.10 role.create-application.enabled - 是否开启创建项目权限控制 > 适用于1.5.0及以上版本 默认为false,所有用户都可以创建项目 如果设置为true,那么只有超级管理员和拥有创建项目权限的帐号可以创建项目,超级管理员可以通过`管理员工具 - 系统权限管理`给用户分配创建项目权限 ### 3.1.11 role.manage-app-master.enabled - 是否开启项目管理员分配权限控制 > 适用于1.5.0及以上版本 默认为false,所有项目的管理员可以为项目添加/删除管理员 如果设置为true,那么只有超级管理员和拥有项目管理员分配权限的帐号可以为特定项目添加/删除管理员,超级管理员可以通过`管理员工具 - 系统权限管理`给用户分配特定项目的管理员分配权限 ### 3.1.12 admin-service.access.tokens - 设置apollo-portal访问各环境apollo-adminservice所需的access token > 适用于1.7.1及以上版本 如果对应环境的apollo-adminservice开启了[访问控制](#_326-admin-serviceaccesscontrolenabled-配置apollo-adminservice是否开启访问控制),那么需要在此配置apollo-portal访问该环境apollo-adminservice所需的access token,否则会访问失败 格式为json,如下所示: ```json { "dev" : "098f6bcd4621d373cade4e832627b4f6", "pro" : "ad0234829205b9033196ba818f7a872b" } ``` ## 3.2 调整ApolloConfigDB配置 配置项统一存储在ApolloConfigDB.ServerConfig表中,需要注意每个环境的ApolloConfigDB.ServerConfig都需要单独配置,修改完一分钟实时生效。 ### 3.2.1 eureka.service.url - Eureka服务Url > 不适用于基于Kubernetes原生服务发现场景 不管是apollo-configservice还是apollo-adminservice都需要向eureka服务注册,所以需要配置eureka服务地址。 按照目前的实现,apollo-configservice本身就是一个eureka服务,所以只需要填入apollo-configservice的地址即可,如有多个,用逗号分隔(注意不要忘了/eureka/后缀)。 需要注意的是每个环境只填入自己环境的eureka服务地址,比如FAT的apollo-configservice是1.1.1.1:8080和2.2.2.2:8080,UAT的apollo-configservice是3.3.3.3:8080和4.4.4.4:8080,PRO的apollo-configservice是5.5.5.5:8080和6.6.6.6:8080,那么: 1. 在FAT环境的ApolloConfigDB.ServerConfig表中设置eureka.service.url为: ``` http://1.1.1.1:8080/eureka/,http://2.2.2.2:8080/eureka/ ``` 2. 在UAT环境的ApolloConfigDB.ServerConfig表中设置eureka.service.url为: ``` http://3.3.3.3:8080/eureka/,http://4.4.4.4:8080/eureka/ ``` 3. 在PRO环境的ApolloConfigDB.ServerConfig表中设置eureka.service.url为: ``` http://5.5.5.5:8080/eureka/,http://6.6.6.6:8080/eureka/ ``` >注1:这里需要填写本环境中全部的eureka服务地址,因为eureka需要互相复制注册信息 >注2:如果希望将Config Service和Admin Service注册到公司统一的Eureka上,可以参考[部署&开发遇到的常见问题 - 将Config Service和Admin Service注册到单独的Eureka Server上](zh/faq/common-issues-in-deployment-and-development-phase#_8-将config-service和admin-service注册到单独的eureka-server上)章节 >注3:在多机房部署时,往往希望config service和admin service只向同机房的eureka注册,要实现这个效果,需要利用`ServerConfig`表中的cluster字段,config service和admin service会读取所在机器的`/opt/settings/server.properties`(Mac/Linux)或`C:\opt\settings\server.properties`(Windows)中的idc属性,如果该idc有对应的eureka.service.url配置,那么就只会向该机房的eureka注册。比如config service和admin service会部署到`SHAOY`和`SHAJQ`两个IDC,那么为了实现这两个机房中的服务只向该机房注册,那么可以在`ServerConfig`表中新增两条记录,分别填入`SHAOY`和`SHAJQ`两个机房的eureka地址即可,`default` cluster的记录可以保留,如果有config service和admin service不是部署在`SHAOY`和`SHAJQ`这两个机房的,就会使用这条默认配置。 | Key |Cluster | Value | Comment | |--------------------|-----------|-------------------------------|---------------------| | eureka.service.url | default | http://1.1.1.1:8080/eureka/ | 默认的Eureka服务Url | | eureka.service.url | SHAOY | http://2.2.2.2:8080/eureka/ | SHAOY的Eureka服务Url | | eureka.service.url | SHAJQ | http://3.3.3.3:8080/eureka/ | SHAJQ的Eureka服务Url | ### 3.2.2 namespace.lock.switch - 一次发布只能有一个人修改开关,用于发布审核 这是一个功能开关,如果配置为true的话,那么一次配置发布只能是一个人修改,另一个发布。 > 生产环境建议开启此选项 ### 3.2.3 config-service.cache.enabled - 是否开启配置缓存 这是一个功能开关,如果配置为true的话,config service会缓存加载过的配置信息,从而加快后续配置获取性能。 默认为false,开启前请先评估总配置大小并调整config service内存配置。 > 开启缓存后必须确保应用中配置的app.id大小写正确,否则将获取不到正确的配置 ### 3.2.4 item.key.length.limit - 配置项 key 最大长度限制 默认配置是128。 ### 3.2.5 item.value.length.limit - 配置项 value 最大长度限制 默认配置是20000。 ### 3.2.6 admin-service.access.control.enabled - 配置apollo-adminservice是否开启访问控制 > 适用于1.7.1及以上版本 默认为false,如果配置为true,那么apollo-portal就需要[正确配置](#_3112-admin-serviceaccesstokens-设置apollo-portal访问各环境apollo-adminservice所需的access-token)访问该环境的access token,否则访问会被拒绝 ### 3.2.7 admin-service.access.tokens - 配置允许访问apollo-adminservice的access token列表 > 适用于1.7.1及以上版本 如果该配置项为空,那么访问控制不会生效。如果允许多个token,token 之间以英文逗号分隔 样例: ```properties admin-service.access.tokens=098f6bcd4621d373cade4e832627b4f6 admin-service.access.tokens=098f6bcd4621d373cade4e832627b4f6,ad0234829205b9033196ba818f7a872b ```
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./scripts/helm/README.md
# Apollo Helm Chart [Apollo](https://github.com/ctripcorp/apollo) is a reliable configuration management system. ## 1. Introduction The apollo-service and apollo-portal charts create deployments for apollo-configservice, apollo-adminservice and apollo-portal, which utilize the kubernetes native service discovery. ## 2. Prerequisites - Kubernetes 1.10+ - Helm 3 ## 3. Add Apollo Helm Chart Repository ```bash $ helm repo add apollo https://ctripcorp.github.io/apollo/charts $ helm search repo apollo ``` ## 4. Deployments of apollo-configservice and apollo-adminservice ### 4.1 Install apollo-configservice and apollo-adminservice should be installed per environment, so it is suggested to indicate environment in the release name, e.g. `apollo-service-dev` ```bash $ helm install apollo-service-dev \ --set configdb.host=1.2.3.4 \ --set configdb.userName=apollo \ --set configdb.password=apollo \ --set configdb.service.enabled=true \ --set configService.replicaCount=1 \ --set adminService.replicaCount=1 \ -n your-namespace \ apollo/apollo-service ``` Or customize it with values.yaml ```bash $ helm install apollo-service-dev -f values.yaml -n your-namespace apollo/apollo-service ``` ### 4.2 Uninstall To uninstall/delete the `apollo-service-dev` deployment: ```bash $ helm uninstall -n your-namespace apollo-service-dev ``` ### 4.3 Configuration The following table lists the configurable parameters of the apollo-service chart and their default values. | Parameter | Description | Default | |----------------------|---------------------------------------------|---------------------| | `configdb.host` | The host for apollo config db | `nil` | | `configdb.port` | The port for apollo config db | `3306` | | `configdb.dbName` | The database name for apollo config db | `ApolloConfigDB` | | `configdb.userName` | The user name for apollo config db | `nil` | | `configdb.password` | The password for apollo config db | `nil` | | `configdb.connectionStringProperties` | The connection string properties for apollo config db | `characterEncoding=utf8` | | `configdb.service.enabled` | Whether to create a Kubernetes Service for `configdb.host` or not. Set it to `true` if `configdb.host` is an endpoint outside of the kubernetes cluster | `false` | | `configdb.service.fullNameOverride` | Override the service name for apollo config db | `nil` | | `configdb.service.port` | The port for the service of apollo config db | `3306` | | `configdb.service.type` | The service type of apollo config db: `ClusterIP` or `ExternalName`. If the host is a DNS name, please specify `ExternalName` as the service type, e.g. xxx.mysql.rds.aliyuncs.com | `ClusterIP` | | `configService.fullNameOverride` | Override the deployment name for apollo-configservice | `nil` | | `configService.replicaCount` | Replica count of apollo-configservice | `2` | | `configService.containerPort` | Container port of apollo-configservice | `8080` | | `configService.image.repository` | Image repository of apollo-configservice | `apolloconfig/apollo-configservice` | | `configService.image.tag` | Image tag of apollo-configservice, e.g. `1.8.0`, leave it to `nil` to use the default version | `nil` | | `configService.image.pullPolicy` | Image pull policy of apollo-configservice | `IfNotPresent` | | `configService.imagePullSecrets` | Image pull secrets of apollo-configservice | `[]` | | `configService.service.fullNameOverride` | Override the service name for apollo-configservice | `nil` | | `configService.service.port` | The port for the service of apollo-configservice | `8080` | | `configService.service.targetPort` | The target port for the service of apollo-configservice | `8080` | | `configService.service.type` | The service type of apollo-configservice | `ClusterIP` | | `configService.ingress.enabled` | Whether to enable the ingress for config-service or not | `false` | | `configService.ingress.annotations` | The annotations of the ingress for config-service | `{}` | | `configService.ingress.hosts.host` | The host of the ingress for config-service | `nil` | | `configService.ingress.hosts.paths` | The paths of the ingress for config-service | `[]` | | `configService.ingress.tls` | The tls definition of the ingress for config-service | `[]` | | `configService.liveness.initialDelaySeconds` | The initial delay seconds of liveness probe | `100` | | `configService.liveness.periodSeconds` | The period seconds of liveness probe | `10` | | `configService.readiness.initialDelaySeconds` | The initial delay seconds of readiness probe | `30` | | `configService.readiness.periodSeconds` | The period seconds of readiness probe | `5` | | `configService.config.profiles` | specify the spring profiles to activate | `github,kubernetes` | | `configService.config.configServiceUrlOverride` | Override `apollo.config-service.url`: config service url to be accessed by apollo-client | `nil` | | `configService.config.adminServiceUrlOverride` | Override `apollo.admin-service.url`: admin service url to be accessed by apollo-portal | `nil` | | `configService.config.contextPath` | specify the context path, e.g. `/apollo`, then users could access config service via `http://{config_service_address}/apollo` | `nil` | | `configService.env` | Environment variables passed to the container, e.g. <br />`JAVA_OPTS: -Xss256k` | `{}` | | `configService.strategy` | The deployment strategy of apollo-configservice | `{}` | | `configService.resources` | The resources definition of apollo-configservice | `{}` | | `configService.nodeSelector` | The node selector definition of apollo-configservice | `{}` | | `configService.tolerations` | The tolerations definition of apollo-configservice | `[]` | | `configService.affinity` | The affinity definition of apollo-configservice | `{}` | | `adminService.fullNameOverride` | Override the deployment name for apollo-adminservice | `nil` | | `adminService.replicaCount` | Replica count of apollo-adminservice | `2` | | `adminService.containerPort` | Container port of apollo-adminservice | `8090` | | `adminService.image.repository` | Image repository of apollo-adminservice | `apolloconfig/apollo-adminservice` | | `adminService.image.tag` | Image tag of apollo-adminservice, e.g. `1.8.0`, leave it to `nil` to use the default version | `nil` | | `adminService.image.pullPolicy` | Image pull policy of apollo-adminservice | `IfNotPresent` | | `adminService.imagePullSecrets` | Image pull secrets of apollo-adminservice | `[]` | | `adminService.service.fullNameOverride` | Override the service name for apollo-adminservice | `nil` | | `adminService.service.port` | The port for the service of apollo-adminservice | `8090` | | `adminService.service.targetPort` | The target port for the service of apollo-adminservice | `8090` | | `adminService.service.type` | The service type of apollo-adminservice | `ClusterIP` | | `adminService.ingress.enabled` | Whether to enable the ingress for admin-service or not | `false` | | `adminService.ingress.annotations` | The annotations of the ingress for admin-service | `{}` | | `adminService.ingress.hosts.host` | The host of the ingress for admin-service | `nil` | | `adminService.ingress.hosts.paths` | The paths of the ingress for admin-service | `[]` | | `adminService.ingress.tls` | The tls definition of the ingress for admin-service | `[]` | | `adminService.liveness.initialDelaySeconds` | The initial delay seconds of liveness probe | `100` | | `adminService.liveness.periodSeconds` | The period seconds of liveness probe | `10` | | `adminService.readiness.initialDelaySeconds` | The initial delay seconds of readiness probe | `30` | | `adminService.readiness.periodSeconds` | The period seconds of readiness probe | `5` | | `adminService.config.profiles` | specify the spring profiles to activate | `github,kubernetes` | | `adminService.config.contextPath` | specify the context path, e.g. `/apollo`, then users could access admin service via `http://{admin_service_address}/apollo` | `nil` | | `adminService.env` | Environment variables passed to the container, e.g. <br />`JAVA_OPTS: -Xss256k` | `{}` | | `adminService.strategy` | The deployment strategy of apollo-adminservice | `{}` | | `adminService.resources` | The resources definition of apollo-adminservice | `{}` | | `adminService.nodeSelector` | The node selector definition of apollo-adminservice | `{}` | | `adminService.tolerations` | The tolerations definition of apollo-adminservice | `[]` | | `adminService.affinity` | The affinity definition of apollo-adminservice | `{}` | ### 4.4 Sample 1. ConfigDB host is an IP outside of kubernetes cluster ```yaml configdb: host: 1.2.3.4 dbName: ApolloConfigDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false service: enabled: true ``` 2. ConfigDB host is a dns name outside of kubernetes cluster ```yaml configdb: host: xxx.mysql.rds.aliyuncs.com dbName: ApolloConfigDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false service: enabled: true type: ExternalName ``` 3. ConfigDB host is a kubernetes service ```yaml configdb: host: apollodb-mysql.mysql dbName: ApolloConfigDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false ``` 4. Expose config service as Ingress with custom path `/config` ```yaml # use /config as root, should specify configService.config.contextPath as /config configService: config: contextPath: /config ingress: enabled: true hosts: - paths: - /config ``` 5. Expose admin service as Ingress with custom path `/admin` ```yaml # use /admin as root, should specify adminService.config.contextPath as /admin adminService: config: contextPath: /admin ingress: enabled: true hosts: - paths: - /admin ``` ## 5. Deployments of apollo-portal ### 5.1 Install To install the apollo-portal chart with the release name `apollo-portal`: ```bash $ helm install apollo-portal \ --set portaldb.host=1.2.3.4 \ --set portaldb.userName=apollo \ --set portaldb.password=apollo \ --set portaldb.service.enabled=true \ --set config.envs="dev\,pro" \ --set config.metaServers.dev=http://apollo-service-dev-apollo-configservice:8080 \ --set config.metaServers.pro=http://apollo-service-pro-apollo-configservice:8080 \ --set replicaCount=1 \ -n your-namespace \ apollo/apollo-portal ``` Or customize it with values.yaml ```bash $ helm install apollo-portal -f values.yaml -n your-namespace apollo/apollo-portal ``` ### 5.2 Uninstallation To uninstall/delete the `apollo-portal` deployment: ```bash $ helm uninstall -n your-namespace apollo-portal ``` ### 5.3 Configuration The following table lists the configurable parameters of the apollo-portal chart and their default values. | Parameter | Description | Default | |----------------------|---------------------------------------------|-----------------------| | `fullNameOverride` | Override the deployment name for apollo-portal | `nil` | | `replicaCount` | Replica count of apollo-portal | `2` | | `containerPort` | Container port of apollo-portal | `8070` | | `image.repository` | Image repository of apollo-portal | `apolloconfig/apollo-portal` | | `image.tag` | Image tag of apollo-portal, e.g. `1.8.0`, leave it to `nil` to use the default version | `nil` | | `image.pullPolicy` | Image pull policy of apollo-portal | `IfNotPresent` | | `imagePullSecrets` | Image pull secrets of apollo-portal | `[]` | | `service.fullNameOverride` | Override the service name for apollo-portal | `nil` | | `service.port` | The port for the service of apollo-portal | `8070` | | `service.targetPort` | The target port for the service of apollo-portal | `8070` | | `service.type` | The service type of apollo-portal | `ClusterIP` | | `service.sessionAffinity` | The session affinity for the service of apollo-portal | `ClientIP` | | `ingress.enabled` | Whether to enable the ingress or not | `false` | | `ingress.annotations` | The annotations of the ingress | `{}` | | `ingress.hosts.host` | The host of the ingress | `nil` | | `ingress.hosts.paths` | The paths of the ingress | `[]` | | `ingress.tls` | The tls definition of the ingress | `[]` | | `liveness.initialDelaySeconds` | The initial delay seconds of liveness probe | `100` | | `liveness.periodSeconds` | The period seconds of liveness probe | `10` | | `readiness.initialDelaySeconds` | The initial delay seconds of readiness probe | `30` | | `readiness.periodSeconds` | The period seconds of readiness probe | `5` | | `env` | Environment variables passed to the container, e.g. <br />`JAVA_OPTS: -Xss256k` | `{}` | | `strategy` | The deployment strategy of apollo-portal | `{}` | | `resources` | The resources definition of apollo-portal | `{}` | | `nodeSelector` | The node selector definition of apollo-portal | `{}` | | `tolerations` | The tolerations definition of apollo-portal | `[]` | | `affinity` | The affinity definition of apollo-portal | `{}` | | `config.profiles` | specify the spring profiles to activate | `github,auth` | | `config.envs` | specify the env names, e.g. dev,pro | `nil` | | `config.contextPath` | specify the context path, e.g. `/apollo`, then users could access portal via `http://{portal_address}/apollo` | `nil` | | `config.metaServers` | specify the meta servers, e.g.<br />`dev: http://apollo-configservice-dev:8080`<br />`pro: http://apollo-configservice-pro:8080` | `{}` | | `config.files` | specify the extra config files for apollo-portal, e.g. application-ldap.yml | `{}` | | `portaldb.host` | The host for apollo portal db | `nil` | | `portaldb.port` | The port for apollo portal db | `3306` | | `portaldb.dbName` | The database name for apollo portal db | `ApolloPortalDB` | | `portaldb.userName` | The user name for apollo portal db | `nil` | | `portaldb.password` | The password for apollo portal db | `nil` | | `portaldb.connectionStringProperties` | The connection string properties for apollo portal db | `characterEncoding=utf8` | | `portaldb.service.enabled` | Whether to create a Kubernetes Service for `portaldb.host` or not. Set it to `true` if `portaldb.host` is an endpoint outside of the kubernetes cluster | `false` | | `portaldb.service.fullNameOverride` | Override the service name for apollo portal db | `nil` | | `portaldb.service.port` | The port for the service of apollo portal db | `3306` | | `portaldb.service.type` | The service type of apollo portal db: `ClusterIP` or `ExternalName`. If the host is a DNS name, please specify `ExternalName` as the service type, e.g. xxx.mysql.rds.aliyuncs.com | `ClusterIP` | ### 5.4 Sample 1. PortalDB host is an IP outside of kubernetes cluster ```yaml portaldb: host: 1.2.3.4 dbName: ApolloPortalDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false service: enabled: true ``` 2. PortalDB host is a dns name outside of kubernetes cluster ```yaml portaldb: host: xxx.mysql.rds.aliyuncs.com dbName: ApolloPortalDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false service: enabled: true type: ExternalName ``` 3. PortalDB host is a kubernetes service ```yaml portaldb: host: apollodb-mysql.mysql dbName: ApolloPortalDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false ``` 4. Specify environments ```yaml config: envs: dev,pro metaServers: dev: http://apollo-service-dev-apollo-configservice:8080 pro: http://apollo-service-pro-apollo-configservice:8080 ``` 5. Expose service as Load Balancer ```yaml service: type: LoadBalancer ``` 6. Expose service as Ingress ```yaml ingress: enabled: true hosts: - paths: - / ``` 7. Expose service as Ingress with custom path `/apollo` ```yaml # use /apollo as root, should specify config.contextPath as /apollo ingress: enabled: true hosts: - paths: - /apollo config: ... contextPath: /apollo ... ``` 8. Expose service as Ingress with session affinity ```yaml ingress: enabled: true annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/affinity: "cookie" nginx.ingress.kubernetes.io/affinity-mode: "persistent" nginx.ingress.kubernetes.io/session-cookie-conditional-samesite-none: "true" nginx.ingress.kubernetes.io/session-cookie-expires: "172800" nginx.ingress.kubernetes.io/session-cookie-max-age: "172800" hosts: - host: xxx.somedomain.com # host is required to make session affinity work paths: - / ``` 9. Enable LDAP support ```yaml config: ... profiles: github,ldap ... files: application-ldap.yml: | spring: ldap: base: "dc=example,dc=org" username: "cn=admin,dc=example,dc=org" password: "password" searchFilter: "(uid={0})" urls: - "ldap://xxx.somedomain.com:389" ldap: mapping: objectClass: "inetOrgPerson" loginId: "uid" userDisplayName: "cn" email: "mail" ```
# Apollo Helm Chart [Apollo](https://github.com/ctripcorp/apollo) is a reliable configuration management system. ## 1. Introduction The apollo-service and apollo-portal charts create deployments for apollo-configservice, apollo-adminservice and apollo-portal, which utilize the kubernetes native service discovery. ## 2. Prerequisites - Kubernetes 1.10+ - Helm 3 ## 3. Add Apollo Helm Chart Repository ```bash $ helm repo add apollo https://ctripcorp.github.io/apollo/charts $ helm search repo apollo ``` ## 4. Deployments of apollo-configservice and apollo-adminservice ### 4.1 Install apollo-configservice and apollo-adminservice should be installed per environment, so it is suggested to indicate environment in the release name, e.g. `apollo-service-dev` ```bash $ helm install apollo-service-dev \ --set configdb.host=1.2.3.4 \ --set configdb.userName=apollo \ --set configdb.password=apollo \ --set configdb.service.enabled=true \ --set configService.replicaCount=1 \ --set adminService.replicaCount=1 \ -n your-namespace \ apollo/apollo-service ``` Or customize it with values.yaml ```bash $ helm install apollo-service-dev -f values.yaml -n your-namespace apollo/apollo-service ``` ### 4.2 Uninstall To uninstall/delete the `apollo-service-dev` deployment: ```bash $ helm uninstall -n your-namespace apollo-service-dev ``` ### 4.3 Configuration The following table lists the configurable parameters of the apollo-service chart and their default values. | Parameter | Description | Default | |----------------------|---------------------------------------------|---------------------| | `configdb.host` | The host for apollo config db | `nil` | | `configdb.port` | The port for apollo config db | `3306` | | `configdb.dbName` | The database name for apollo config db | `ApolloConfigDB` | | `configdb.userName` | The user name for apollo config db | `nil` | | `configdb.password` | The password for apollo config db | `nil` | | `configdb.connectionStringProperties` | The connection string properties for apollo config db | `characterEncoding=utf8` | | `configdb.service.enabled` | Whether to create a Kubernetes Service for `configdb.host` or not. Set it to `true` if `configdb.host` is an endpoint outside of the kubernetes cluster | `false` | | `configdb.service.fullNameOverride` | Override the service name for apollo config db | `nil` | | `configdb.service.port` | The port for the service of apollo config db | `3306` | | `configdb.service.type` | The service type of apollo config db: `ClusterIP` or `ExternalName`. If the host is a DNS name, please specify `ExternalName` as the service type, e.g. xxx.mysql.rds.aliyuncs.com | `ClusterIP` | | `configService.fullNameOverride` | Override the deployment name for apollo-configservice | `nil` | | `configService.replicaCount` | Replica count of apollo-configservice | `2` | | `configService.containerPort` | Container port of apollo-configservice | `8080` | | `configService.image.repository` | Image repository of apollo-configservice | `apolloconfig/apollo-configservice` | | `configService.image.tag` | Image tag of apollo-configservice, e.g. `1.8.0`, leave it to `nil` to use the default version | `nil` | | `configService.image.pullPolicy` | Image pull policy of apollo-configservice | `IfNotPresent` | | `configService.imagePullSecrets` | Image pull secrets of apollo-configservice | `[]` | | `configService.service.fullNameOverride` | Override the service name for apollo-configservice | `nil` | | `configService.service.port` | The port for the service of apollo-configservice | `8080` | | `configService.service.targetPort` | The target port for the service of apollo-configservice | `8080` | | `configService.service.type` | The service type of apollo-configservice | `ClusterIP` | | `configService.ingress.enabled` | Whether to enable the ingress for config-service or not | `false` | | `configService.ingress.annotations` | The annotations of the ingress for config-service | `{}` | | `configService.ingress.hosts.host` | The host of the ingress for config-service | `nil` | | `configService.ingress.hosts.paths` | The paths of the ingress for config-service | `[]` | | `configService.ingress.tls` | The tls definition of the ingress for config-service | `[]` | | `configService.liveness.initialDelaySeconds` | The initial delay seconds of liveness probe | `100` | | `configService.liveness.periodSeconds` | The period seconds of liveness probe | `10` | | `configService.readiness.initialDelaySeconds` | The initial delay seconds of readiness probe | `30` | | `configService.readiness.periodSeconds` | The period seconds of readiness probe | `5` | | `configService.config.profiles` | specify the spring profiles to activate | `github,kubernetes` | | `configService.config.configServiceUrlOverride` | Override `apollo.config-service.url`: config service url to be accessed by apollo-client | `nil` | | `configService.config.adminServiceUrlOverride` | Override `apollo.admin-service.url`: admin service url to be accessed by apollo-portal | `nil` | | `configService.config.contextPath` | specify the context path, e.g. `/apollo`, then users could access config service via `http://{config_service_address}/apollo` | `nil` | | `configService.env` | Environment variables passed to the container, e.g. <br />`JAVA_OPTS: -Xss256k` | `{}` | | `configService.strategy` | The deployment strategy of apollo-configservice | `{}` | | `configService.resources` | The resources definition of apollo-configservice | `{}` | | `configService.nodeSelector` | The node selector definition of apollo-configservice | `{}` | | `configService.tolerations` | The tolerations definition of apollo-configservice | `[]` | | `configService.affinity` | The affinity definition of apollo-configservice | `{}` | | `adminService.fullNameOverride` | Override the deployment name for apollo-adminservice | `nil` | | `adminService.replicaCount` | Replica count of apollo-adminservice | `2` | | `adminService.containerPort` | Container port of apollo-adminservice | `8090` | | `adminService.image.repository` | Image repository of apollo-adminservice | `apolloconfig/apollo-adminservice` | | `adminService.image.tag` | Image tag of apollo-adminservice, e.g. `1.8.0`, leave it to `nil` to use the default version | `nil` | | `adminService.image.pullPolicy` | Image pull policy of apollo-adminservice | `IfNotPresent` | | `adminService.imagePullSecrets` | Image pull secrets of apollo-adminservice | `[]` | | `adminService.service.fullNameOverride` | Override the service name for apollo-adminservice | `nil` | | `adminService.service.port` | The port for the service of apollo-adminservice | `8090` | | `adminService.service.targetPort` | The target port for the service of apollo-adminservice | `8090` | | `adminService.service.type` | The service type of apollo-adminservice | `ClusterIP` | | `adminService.ingress.enabled` | Whether to enable the ingress for admin-service or not | `false` | | `adminService.ingress.annotations` | The annotations of the ingress for admin-service | `{}` | | `adminService.ingress.hosts.host` | The host of the ingress for admin-service | `nil` | | `adminService.ingress.hosts.paths` | The paths of the ingress for admin-service | `[]` | | `adminService.ingress.tls` | The tls definition of the ingress for admin-service | `[]` | | `adminService.liveness.initialDelaySeconds` | The initial delay seconds of liveness probe | `100` | | `adminService.liveness.periodSeconds` | The period seconds of liveness probe | `10` | | `adminService.readiness.initialDelaySeconds` | The initial delay seconds of readiness probe | `30` | | `adminService.readiness.periodSeconds` | The period seconds of readiness probe | `5` | | `adminService.config.profiles` | specify the spring profiles to activate | `github,kubernetes` | | `adminService.config.contextPath` | specify the context path, e.g. `/apollo`, then users could access admin service via `http://{admin_service_address}/apollo` | `nil` | | `adminService.env` | Environment variables passed to the container, e.g. <br />`JAVA_OPTS: -Xss256k` | `{}` | | `adminService.strategy` | The deployment strategy of apollo-adminservice | `{}` | | `adminService.resources` | The resources definition of apollo-adminservice | `{}` | | `adminService.nodeSelector` | The node selector definition of apollo-adminservice | `{}` | | `adminService.tolerations` | The tolerations definition of apollo-adminservice | `[]` | | `adminService.affinity` | The affinity definition of apollo-adminservice | `{}` | ### 4.4 Sample 1. ConfigDB host is an IP outside of kubernetes cluster ```yaml configdb: host: 1.2.3.4 dbName: ApolloConfigDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false service: enabled: true ``` 2. ConfigDB host is a dns name outside of kubernetes cluster ```yaml configdb: host: xxx.mysql.rds.aliyuncs.com dbName: ApolloConfigDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false service: enabled: true type: ExternalName ``` 3. ConfigDB host is a kubernetes service ```yaml configdb: host: apollodb-mysql.mysql dbName: ApolloConfigDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false ``` 4. Expose config service as Ingress with custom path `/config` ```yaml # use /config as root, should specify configService.config.contextPath as /config configService: config: contextPath: /config ingress: enabled: true hosts: - paths: - /config ``` 5. Expose admin service as Ingress with custom path `/admin` ```yaml # use /admin as root, should specify adminService.config.contextPath as /admin adminService: config: contextPath: /admin ingress: enabled: true hosts: - paths: - /admin ``` ## 5. Deployments of apollo-portal ### 5.1 Install To install the apollo-portal chart with the release name `apollo-portal`: ```bash $ helm install apollo-portal \ --set portaldb.host=1.2.3.4 \ --set portaldb.userName=apollo \ --set portaldb.password=apollo \ --set portaldb.service.enabled=true \ --set config.envs="dev\,pro" \ --set config.metaServers.dev=http://apollo-service-dev-apollo-configservice:8080 \ --set config.metaServers.pro=http://apollo-service-pro-apollo-configservice:8080 \ --set replicaCount=1 \ -n your-namespace \ apollo/apollo-portal ``` Or customize it with values.yaml ```bash $ helm install apollo-portal -f values.yaml -n your-namespace apollo/apollo-portal ``` ### 5.2 Uninstallation To uninstall/delete the `apollo-portal` deployment: ```bash $ helm uninstall -n your-namespace apollo-portal ``` ### 5.3 Configuration The following table lists the configurable parameters of the apollo-portal chart and their default values. | Parameter | Description | Default | |----------------------|---------------------------------------------|-----------------------| | `fullNameOverride` | Override the deployment name for apollo-portal | `nil` | | `replicaCount` | Replica count of apollo-portal | `2` | | `containerPort` | Container port of apollo-portal | `8070` | | `image.repository` | Image repository of apollo-portal | `apolloconfig/apollo-portal` | | `image.tag` | Image tag of apollo-portal, e.g. `1.8.0`, leave it to `nil` to use the default version | `nil` | | `image.pullPolicy` | Image pull policy of apollo-portal | `IfNotPresent` | | `imagePullSecrets` | Image pull secrets of apollo-portal | `[]` | | `service.fullNameOverride` | Override the service name for apollo-portal | `nil` | | `service.port` | The port for the service of apollo-portal | `8070` | | `service.targetPort` | The target port for the service of apollo-portal | `8070` | | `service.type` | The service type of apollo-portal | `ClusterIP` | | `service.sessionAffinity` | The session affinity for the service of apollo-portal | `ClientIP` | | `ingress.enabled` | Whether to enable the ingress or not | `false` | | `ingress.annotations` | The annotations of the ingress | `{}` | | `ingress.hosts.host` | The host of the ingress | `nil` | | `ingress.hosts.paths` | The paths of the ingress | `[]` | | `ingress.tls` | The tls definition of the ingress | `[]` | | `liveness.initialDelaySeconds` | The initial delay seconds of liveness probe | `100` | | `liveness.periodSeconds` | The period seconds of liveness probe | `10` | | `readiness.initialDelaySeconds` | The initial delay seconds of readiness probe | `30` | | `readiness.periodSeconds` | The period seconds of readiness probe | `5` | | `env` | Environment variables passed to the container, e.g. <br />`JAVA_OPTS: -Xss256k` | `{}` | | `strategy` | The deployment strategy of apollo-portal | `{}` | | `resources` | The resources definition of apollo-portal | `{}` | | `nodeSelector` | The node selector definition of apollo-portal | `{}` | | `tolerations` | The tolerations definition of apollo-portal | `[]` | | `affinity` | The affinity definition of apollo-portal | `{}` | | `config.profiles` | specify the spring profiles to activate | `github,auth` | | `config.envs` | specify the env names, e.g. dev,pro | `nil` | | `config.contextPath` | specify the context path, e.g. `/apollo`, then users could access portal via `http://{portal_address}/apollo` | `nil` | | `config.metaServers` | specify the meta servers, e.g.<br />`dev: http://apollo-configservice-dev:8080`<br />`pro: http://apollo-configservice-pro:8080` | `{}` | | `config.files` | specify the extra config files for apollo-portal, e.g. application-ldap.yml | `{}` | | `portaldb.host` | The host for apollo portal db | `nil` | | `portaldb.port` | The port for apollo portal db | `3306` | | `portaldb.dbName` | The database name for apollo portal db | `ApolloPortalDB` | | `portaldb.userName` | The user name for apollo portal db | `nil` | | `portaldb.password` | The password for apollo portal db | `nil` | | `portaldb.connectionStringProperties` | The connection string properties for apollo portal db | `characterEncoding=utf8` | | `portaldb.service.enabled` | Whether to create a Kubernetes Service for `portaldb.host` or not. Set it to `true` if `portaldb.host` is an endpoint outside of the kubernetes cluster | `false` | | `portaldb.service.fullNameOverride` | Override the service name for apollo portal db | `nil` | | `portaldb.service.port` | The port for the service of apollo portal db | `3306` | | `portaldb.service.type` | The service type of apollo portal db: `ClusterIP` or `ExternalName`. If the host is a DNS name, please specify `ExternalName` as the service type, e.g. xxx.mysql.rds.aliyuncs.com | `ClusterIP` | ### 5.4 Sample 1. PortalDB host is an IP outside of kubernetes cluster ```yaml portaldb: host: 1.2.3.4 dbName: ApolloPortalDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false service: enabled: true ``` 2. PortalDB host is a dns name outside of kubernetes cluster ```yaml portaldb: host: xxx.mysql.rds.aliyuncs.com dbName: ApolloPortalDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false service: enabled: true type: ExternalName ``` 3. PortalDB host is a kubernetes service ```yaml portaldb: host: apollodb-mysql.mysql dbName: ApolloPortalDBName userName: someUserName password: somePassword connectionStringProperties: characterEncoding=utf8&useSSL=false ``` 4. Specify environments ```yaml config: envs: dev,pro metaServers: dev: http://apollo-service-dev-apollo-configservice:8080 pro: http://apollo-service-pro-apollo-configservice:8080 ``` 5. Expose service as Load Balancer ```yaml service: type: LoadBalancer ``` 6. Expose service as Ingress ```yaml ingress: enabled: true hosts: - paths: - / ``` 7. Expose service as Ingress with custom path `/apollo` ```yaml # use /apollo as root, should specify config.contextPath as /apollo ingress: enabled: true hosts: - paths: - /apollo config: ... contextPath: /apollo ... ``` 8. Expose service as Ingress with session affinity ```yaml ingress: enabled: true annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/affinity: "cookie" nginx.ingress.kubernetes.io/affinity-mode: "persistent" nginx.ingress.kubernetes.io/session-cookie-conditional-samesite-none: "true" nginx.ingress.kubernetes.io/session-cookie-expires: "172800" nginx.ingress.kubernetes.io/session-cookie-max-age: "172800" hosts: - host: xxx.somedomain.com # host is required to make session affinity work paths: - / ``` 9. Enable LDAP support ```yaml config: ... profiles: github,ldap ... files: application-ldap.yml: | spring: ldap: base: "dc=example,dc=org" username: "cn=admin,dc=example,dc=org" password: "password" searchFilter: "(uid={0})" urls: - "ldap://xxx.somedomain.com:389" ldap: mapping: objectClass: "inetOrgPerson" loginId: "uid" userDisplayName: "cn" email: "mail" ```
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./.github/ISSUE_TEMPLATE/bug_report_zh.md
--- name: 报告Bug/使用疑问 about: 提交Apollo Bug/使用疑问,使用这个模板 title: '' labels: '' assignees: '' --- <!-- 这段文字不会显示在你的内容中。为了避免重复的信息,方便后续的检索,在提issue之前,请检查如下事项。如果是比较新手级别的问题,推荐到讨论区https://github.com/ctripcorp/apollo/discussions 提问 --> - [ ] 我已经检查过[discussions](https://github.com/ctripcorp/apollo/discussions) - [ ] 我已经搜索过[issues](https://github.com/ctripcorp/apollo/issues) - [ ] 我已经仔细检查过[FAQ](https://ctripcorp.github.io/apollo/#/zh/faq/common-issues-in-deployment-and-development-phase) **描述bug** 简洁明了地描述一下bug **复现** 通过如下步骤可以复现: 1. 2. 3. 4. **期望** 简介明了地描述你希望正常情况下应该发生什么 **截图** 如果可以,附上截图来描述你的问题 ### 额外的细节和日志 - 版本: - 错误日志 - 配置: - 平台和操作系统
--- name: 报告Bug/使用疑问 about: 提交Apollo Bug/使用疑问,使用这个模板 title: '' labels: '' assignees: '' --- <!-- 这段文字不会显示在你的内容中。为了避免重复的信息,方便后续的检索,在提issue之前,请检查如下事项。如果是比较新手级别的问题,推荐到讨论区https://github.com/ctripcorp/apollo/discussions 提问 --> - [ ] 我已经检查过[discussions](https://github.com/ctripcorp/apollo/discussions) - [ ] 我已经搜索过[issues](https://github.com/ctripcorp/apollo/issues) - [ ] 我已经仔细检查过[FAQ](https://ctripcorp.github.io/apollo/#/zh/faq/common-issues-in-deployment-and-development-phase) **描述bug** 简洁明了地描述一下bug **复现** 通过如下步骤可以复现: 1. 2. 3. 4. **期望** 简介明了地描述你希望正常情况下应该发生什么 **截图** 如果可以,附上截图来描述你的问题 ### 额外的细节和日志 - 版本: - 错误日志 - 配置: - 平台和操作系统
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./docs/en/quick-start.md
# Prepare Wait for content... ```bash content for copy ```
# Prepare Wait for content... ```bash content for copy ```
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./docs/zh/_sidebar.md
- [**首页**](zh/README.md) - 设计文档 - [Apollo配置中心设计](zh/design/apollo-design.md) - [Apollo配置中心介绍](zh/design/apollo-introduction.md) - [Apollo核心概念之“Namespace”](zh/design/apollo-core-concept-namespace.md) - [Apollo源码解析(全)](http://www.iocoder.cn/categories/Apollo/) - 部署文档 - [Quick Start](zh/deployment/quick-start.md) - [Docker方式部署Quick Start](zh/deployment/quick-start-docker.md) - [分布式部署指南](zh/deployment/distributed-deployment-guide.md) - 开发文档 - [Apollo开发指南](zh/development/apollo-development-guide.md) - Code Styles - [Eclipse Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/eclipse-java-google-style.xml) - [Intellij Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/intellij-java-google-style.xml) - [Portal实现用户登录功能](zh/development/portal-how-to-implement-user-login-function.md) - [Portal接入邮件服务](zh/development/portal-how-to-enable-email-service.md) - [Portal启用webhook通知](zh/development/portal-how-to-enable-webhook-notification.md) - 使用文档 - [Apollo使用指南](zh/usage/apollo-user-guide.md) - [Java客户端使用指南](zh/usage/java-sdk-user-guide.md) - [.Net客户端使用指南](zh/usage/dotnet-sdk-user-guide.md) - [Go、Python、NodeJS、PHP等客户端使用指南](zh/usage/third-party-sdks-user-guide.md) - [其它语言客户端接入指南](zh/usage/other-language-client-user-guide.md) - [Apollo开放平台接入指南](zh/usage/apollo-open-api-platform.md) - [Apollo使用场景和示例代码](https://github.com/ctripcorp/apollo-use-cases) - [Apollo实践案例](zh/usage/apollo-user-practices.md) - [Apollo安全相关最佳实践](zh/usage/apollo-user-guide?id=_71-%e5%ae%89%e5%85%a8%e7%9b%b8%e5%85%b3) - FAQ - [常见问题回答](zh/faq/faq.md) - [部署&开发遇到的常见问题](zh/faq/common-issues-in-deployment-and-development-phase.md) - 其它 - [版本历史](https://github.com/ctripcorp/apollo/releases) - [Apollo性能测试报告](zh/misc/apollo-benchmark.md)
- [**首页**](zh/README.md) - 设计文档 - [Apollo配置中心设计](zh/design/apollo-design.md) - [Apollo配置中心介绍](zh/design/apollo-introduction.md) - [Apollo核心概念之“Namespace”](zh/design/apollo-core-concept-namespace.md) - [Apollo源码解析(全)](http://www.iocoder.cn/categories/Apollo/) - 部署文档 - [Quick Start](zh/deployment/quick-start.md) - [Docker方式部署Quick Start](zh/deployment/quick-start-docker.md) - [分布式部署指南](zh/deployment/distributed-deployment-guide.md) - 开发文档 - [Apollo开发指南](zh/development/apollo-development-guide.md) - Code Styles - [Eclipse Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/eclipse-java-google-style.xml) - [Intellij Code Style](https://github.com/ctripcorp/apollo/blob/master/apollo-buildtools/style/intellij-java-google-style.xml) - [Portal实现用户登录功能](zh/development/portal-how-to-implement-user-login-function.md) - [Portal接入邮件服务](zh/development/portal-how-to-enable-email-service.md) - [Portal启用webhook通知](zh/development/portal-how-to-enable-webhook-notification.md) - 使用文档 - [Apollo使用指南](zh/usage/apollo-user-guide.md) - [Java客户端使用指南](zh/usage/java-sdk-user-guide.md) - [.Net客户端使用指南](zh/usage/dotnet-sdk-user-guide.md) - [Go、Python、NodeJS、PHP等客户端使用指南](zh/usage/third-party-sdks-user-guide.md) - [其它语言客户端接入指南](zh/usage/other-language-client-user-guide.md) - [Apollo开放平台接入指南](zh/usage/apollo-open-api-platform.md) - [Apollo使用场景和示例代码](https://github.com/ctripcorp/apollo-use-cases) - [Apollo实践案例](zh/usage/apollo-user-practices.md) - [Apollo安全相关最佳实践](zh/usage/apollo-user-guide?id=_71-%e5%ae%89%e5%85%a8%e7%9b%b8%e5%85%b3) - FAQ - [常见问题回答](zh/faq/faq.md) - [部署&开发遇到的常见问题](zh/faq/common-issues-in-deployment-and-development-phase.md) - 其它 - [版本历史](https://github.com/ctripcorp/apollo/releases) - [Apollo性能测试报告](zh/misc/apollo-benchmark.md)
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./.github/ISSUE_TEMPLATE/bug_report_en.md
--- name: Bug report about: Create a report to help us improve title: '' labels: '' assignees: '' --- <!-- The content in here will not be show。To forbid duplication,easier search in the feature,before you create an issue,please check the following. If your question is a newer/beginner's,recommand to https://github.com/ctripcorp/apollo/discussions to ask it. --> - [ ] I have checked the [discussions](https://github.com/ctripcorp/apollo/discussions) - [ ] I have searched the [issues](https://github.com/ctripcorp/apollo/issues) of this repository and believe that this is not a duplicate. - [ ] I have checked the [FAQ](https://ctripcorp.github.io/apollo/#/zh/faq/common-issues-in-deployment-and-development-phase) of this repository and believe that this is not a duplicate. **Describe the bug** A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: 1. 2. 3. 4. **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. ### Additional Details & Logs - Version - Error logs - Configuration - Platform and Operating System
--- name: Bug report about: Create a report to help us improve title: '' labels: '' assignees: '' --- <!-- The content in here will not be show。To forbid duplication,easier search in the feature,before you create an issue,please check the following. If your question is a newer/beginner's,recommand to https://github.com/ctripcorp/apollo/discussions to ask it. --> - [ ] I have checked the [discussions](https://github.com/ctripcorp/apollo/discussions) - [ ] I have searched the [issues](https://github.com/ctripcorp/apollo/issues) of this repository and believe that this is not a duplicate. - [ ] I have checked the [FAQ](https://ctripcorp.github.io/apollo/#/zh/faq/common-issues-in-deployment-and-development-phase) of this repository and believe that this is not a duplicate. **Describe the bug** A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: 1. 2. 3. 4. **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. ### Additional Details & Logs - Version - Error logs - Configuration - Platform and Operating System
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./docs/zh/misc/apollo-benchmark.md
很多同学关心Apollo的性能和可靠性,以下数据是采集携程内部生产环境单台机器的数据。监控工具是[Cat](https://github.com/dianping/cat)。 ### 一、测试机器配置 #### 1.1 机器配置 4C12G #### 1.2 JVM参数 ```` -Xms6144m -Xmx6144m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=4096m -XX:MaxNewSize=4096m -XX:SurvivorRatio=8 -XX:+UseParNewGC -XX:ParallelGCThreads=4 -XX:MaxTenuringThreshold=9 -XX:+UseConcMarkSweepGC -XX:+DisableExplicitGC -XX:+UseCMSInitiatingOccupancyOnly -XX:+ScavengeBeforeFullGC -XX:+UseCMSCompactAtFullCollection -XX:+CMSParallelRemarkEnabled -XX:CMSFullGCsBeforeCompaction=9 -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSClassUnloadingEnabled -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+CMSPermGenSweepingEnabled -XX:CMSInitiatingPermOccupancyFraction=70 -XX:+ExplicitGCInvokesConcurrent -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintHeapAtGC -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Duser.timezone=Asia/Shanghai -Dclient.encoding.override=UTF-8 -Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/./urandom ```` #### 1.3 JVM版本 1.8.0_60 #### 1.4 Apollo版本 0.9.0 #### 1.5 单台机器客户端连接数(客户端数) 5600 #### 1.6 集群总客户端连接数(客户端数) 10W+ ### 二、性能指标 #### 2.1 获取配置Http接口响应时间 QPS: 160 平均响应时间: 0.1ms 95线响应时间: 0.3ms 999线响应时间: 2.5ms >注:config service开启了配置缓存,更多信息可以参考[分布式部署指南中的缓存配置](zh/deployment/distributed-deployment-guide#_323-config-servicecacheenabled-是否开启配置缓存) #### 2.2 Config Server GC情况 YGC: 平均2Min一次,一次耗时300ms OGC: 平均1H一次,一次耗时380ms #### 2.3 CPU指标 LoadAverage:0.5 System CPU利用率:6% Process CPU利用率:8%
很多同学关心Apollo的性能和可靠性,以下数据是采集携程内部生产环境单台机器的数据。监控工具是[Cat](https://github.com/dianping/cat)。 ### 一、测试机器配置 #### 1.1 机器配置 4C12G #### 1.2 JVM参数 ```` -Xms6144m -Xmx6144m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=4096m -XX:MaxNewSize=4096m -XX:SurvivorRatio=8 -XX:+UseParNewGC -XX:ParallelGCThreads=4 -XX:MaxTenuringThreshold=9 -XX:+UseConcMarkSweepGC -XX:+DisableExplicitGC -XX:+UseCMSInitiatingOccupancyOnly -XX:+ScavengeBeforeFullGC -XX:+UseCMSCompactAtFullCollection -XX:+CMSParallelRemarkEnabled -XX:CMSFullGCsBeforeCompaction=9 -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSClassUnloadingEnabled -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+CMSPermGenSweepingEnabled -XX:CMSInitiatingPermOccupancyFraction=70 -XX:+ExplicitGCInvokesConcurrent -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintHeapAtGC -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Duser.timezone=Asia/Shanghai -Dclient.encoding.override=UTF-8 -Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/./urandom ```` #### 1.3 JVM版本 1.8.0_60 #### 1.4 Apollo版本 0.9.0 #### 1.5 单台机器客户端连接数(客户端数) 5600 #### 1.6 集群总客户端连接数(客户端数) 10W+ ### 二、性能指标 #### 2.1 获取配置Http接口响应时间 QPS: 160 平均响应时间: 0.1ms 95线响应时间: 0.3ms 999线响应时间: 2.5ms >注:config service开启了配置缓存,更多信息可以参考[分布式部署指南中的缓存配置](zh/deployment/distributed-deployment-guide#_323-config-servicecacheenabled-是否开启配置缓存) #### 2.2 Config Server GC情况 YGC: 平均2Min一次,一次耗时300ms OGC: 平均1H一次,一次耗时380ms #### 2.3 CPU指标 LoadAverage:0.5 System CPU利用率:6% Process CPU利用率:8%
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./docs/zh/usage/apollo-user-guide.md
# &nbsp; # 名词解释 * 普通应用 * 普通应用指的是独立运行的程序,如 * Web应用程序 * 带有main函数的程序 * 公共组件 * 公共组件指的是发布的类库、客户端程序,不会自己独立运行,如 * Java的jar包 * .Net的dll文件 # 一、普通应用接入指南 ## 1.1 创建项目 要使用Apollo,第一步需要创建项目。 1. 打开apollo-portal主页 2. 点击“创建项目” ![create-app-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-app-entry.png) 3. 输入项目信息 * 部门:选择应用所在的部门 * 应用AppId:用来标识应用身份的唯一id,格式为string,需要和客户端app.properties中配置的app.id对应 * 应用名称:应用名,仅用于界面展示 * 应用负责人:选择的人默认会成为该项目的管理员,具备项目权限管理、集群创建、Namespace创建等权限 ![create-app](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-app.png) 4. 点击提交 创建成功后,会自动跳转到项目首页 ![app-created](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/app-created.png) ## 1.2 项目权限分配 ### 1.2.1 项目管理员权限 项目管理员拥有以下权限: 1. 可以管理项目的权限分配 2. 可以创建集群 3. 可以创建Namespace 创建项目时填写的应用负责人默认会成为项目的管理员之一,如果还需要其他人也成为项目管理员,可以按照下面步骤操作: 1. 点击页面左侧的“管理项目” * ![app-permission-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/app-permission-entry.png) 2. 搜索需要添加的成员并点击添加 * ![app-permission-search-user](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/app-permission-search-user.png) * ![app-permission-user-added](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/app-permission-user-added.png) ### 1.2.2 配置编辑、发布权限 配置权限分为编辑和发布: * 编辑权限允许用户在Apollo界面上创建、修改、删除配置 * 配置修改后只在Apollo界面上变化,不会影响到应用实际使用的配置 * 发布权限允许用户在Apollo界面上发布、回滚配置 * 配置只有在发布、回滚动作后才会被应用实际使用到 * Apollo在用户操作发布、回滚动作后实时通知到应用,并使最新配置生效 项目创建完,默认没有分配配置的编辑和发布权限,需要项目管理员进行授权。 1. 点击application这个namespace的授权按钮 * ![namespace-permission-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/namespace-permission-entry.png) 2. 分配修改权限 * ![namespace-permission-edit](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/namespace-permission-edit.png) 3. 分配发布权限 * ![namespace-publish-permission](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/namespace-publish-permission.png) ## 1.3 添加配置项 编辑配置需要拥有这个Namespace的编辑权限,如果发现没有新增配置按钮,可以找项目管理员授权。 ### 1.3.1 通过表格模式添加配置 1. 点击新增配置 * ![create-item-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-item-entry.png) 2. 输入配置项 * ![create-item-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-item-detail.png) 3. 点击提交 * ![item-created](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/item-created.png) ### 1.3.2 通过文本模式编辑 Apollo除了支持表格模式,逐个添加、修改配置外,还提供文本模式批量添加、修改。 这个对于从已有的properties文件迁移尤其有用。 1. 切换到文本编辑模式 ![text-mode-config-overview](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/text-mode-config-overview.png) 2. 点击右侧的修改配置按钮 ![text-mode-config-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/text-mode-config-entry.png) 3. 输入配置项,并点击提交修改 ![text-mode-config-submit](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/text-mode-config-submit.png) ## 1.4 发布配置 配置只有在发布后才会真的被应用使用到,所以在编辑完配置后,需要发布配置。 发布配置需要拥有这个Namespace的发布权限,如果发现没有发布按钮,可以找项目管理员授权。 1. 点击“发布按钮” ![publish-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/hermes-portal-publish-entry.png) 2. 填写发布相关信息,点击发布 ![publish-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/hermes-portal-publish-detail.png) ## 1.5 应用读取配置 配置发布成功后,应用就可以通过Apollo客户端读取到配置了。 Apollo目前提供Java客户端,具体信息请点击[Java客户端使用文档](zh/usage/java-sdk-user-guide): 如果应用使用了其它语言,也可以通过直接访问Http接口获取配置,具体可以参考[其它语言客户端接入指南](zh/usage/other-language-client-user-guide) ## 1.6 回滚已发布配置 如果发现已发布的配置有问题,可以通过点击『回滚』按钮来将客户端读取到的配置回滚到上一个发布版本。 这里的回滚机制类似于发布系统,发布系统中的回滚操作是将部署到机器上的安装包回滚到上一个部署的版本,但代码仓库中的代码是不会回滚的,从而开发可以在修复代码后重新发布。 Apollo中的回滚也是类似的机制,点击回滚后是将发布到客户端的配置回滚到上一个已发布版本,也就是说客户端读取到的配置会恢复到上一个版本,但页面上编辑状态的配置是不会回滚的,从而开发可以在修复配置后重新发布。 # 二、公共组件接入指南 ## 2.1 公共组件和普通应用的区别 公共组件是指那些发布给其它应用使用的客户端代码,比如CAT客户端、Hermes Producer客户端等。 虽然这类组件是由其他团队开发、维护,但是运行时是在业务实际应用内的,所以本质上可以认为是应用的一部分。 通常情况下,这类组件所用到的配置由原始开发团队维护,不过由于实际应用的运行时、环境各不一样,所以我们也允许应用在实际使用时能够覆盖公共组件的部分配置。 ## 2.2 公共组件接入步骤 公共组件的接入步骤,和普通应用几乎一致,唯一的区别是公共组件需要创建自己唯一的Namespace。 所以,首先执行普通应用接入文档中的以下几个步骤,然后再按照本章节后面的步骤操作。 1. [创建项目](#_11-%E5%88%9B%E5%BB%BA%E9%A1%B9%E7%9B%AE) 2. [项目管理员权限](#_121-%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86%E5%91%98%E6%9D%83%E9%99%90) ### 2.2.1 创建Namespace 创建Namespace需要项目管理员权限,如果发现没有添加Namespace按钮,可以找项目管理员授权。 1. 点击页面左侧的添加Namespace * ![create-namespace](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-namespace.png) 2. 点击“创建新的Namespace” * ![create-namespace-select-type](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-namespace-select-type.png) 3. 输入公共组件的Namespace名称,需要注意的是Namespace名称全局唯一 * Apollo会默认把部门代号添加在最前面 * ![create-namespace-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-namespace-detail.png) 4. 点击提交后,页面会自动跳转到关联Namespace页面 * 首先,选中所有需要有这个Namespace的环境和集群,一般建议全选 * 其次,选中刚刚创建的namespace * 最后,点击提交 * ![link-namespace-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/link-namespace-detail.png) 5. 关联成功后,页面会自动跳转到Namespace权限管理页面 1. 分配修改权限 * ![namespace-permission-edit](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/namespace-permission-edit.png) 2. 分配发布权限 * ![namespace-publish-permission](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/namespace-publish-permission.png) 6. 点击“返回”回到项目页面 ### 2.2.2 添加配置项 编辑配置需要拥有这个Namespace的编辑权限,如果发现没有新增配置按钮,可以找项目管理员授权。 #### 2.2.2.1 通过表格模式添加配置 1. 点击新增配置 ![public-namespace-edit-item-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/public-namespace-edit-item-entry.png) 2. 输入配置项 ![public-namespace-edit-item](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/public-namespace-edit-item.png) 3. 点击提交 ![public-namespace-item-created](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/public-namespace-item-created.png) #### 2.2.2.2 通过文本模式编辑 这部分和普通应用一致,具体步骤请参见[1.3.2 通过文本模式编辑](#_132-%E9%80%9A%E8%BF%87%E6%96%87%E6%9C%AC%E6%A8%A1%E5%BC%8F%E7%BC%96%E8%BE%91)。 ### 2.2.3 发布配置 配置只有在发布后才会真的被应用使用到,所以在编辑完配置后,需要发布配置。 发布配置需要拥有这个Namespace的发布权限,如果发现没有发布按钮,可以找项目管理员授权。 1. 点击“发布按钮” ![public-namespace-publish-items-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/public-namespace-publish-items-entry.png) 2. 填写发布相关信息,点击发布 ![public-namespace-publish-items](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/public-namespace-publish-items.png) ### 2.2.4 应用读取配置 配置发布成功后,应用就可以通过Apollo客户端读取到配置了。 Apollo目前提供Java客户端,具体信息请点击[Java客户端使用文档](zh/usage/java-sdk-user-guide): 如果应用使用了其它语言,也可以通过直接访问Http接口获取配置,具体可以参考[其它语言客户端接入指南](zh/usage/other-language-client-user-guide) 对于公共组件的配置读取,可以参考上述文档中的“获取公共Namespace的配置”部分。 ## 2.3 应用覆盖公用组件配置步骤 前面提到,通常情况下,公共组件所用到的配置由原始开发团队维护,不过由于实际应用的运行时、环境各不一样,所以我们也允许应用在实际使用时能够覆盖公共组件的部分配置。 这里就讲一下应用如何覆盖公用组件的配置,简单起见,假设apollo-portal应用使用了hermes producer客户端,并且希望调整hermes的批量发送大小。 ### 2.3.1 关联公共组件Namespace 1. 进入使用公共组件的应用项目首页,点击左侧的添加Namespace按钮 * 所以,在这个例子中,我们需要进入apollo-portal的首页。 * (添加Namespace需要项目管理员权限,如果发现没有添加Namespace按钮,可以找项目管理员授权) * ![link-public-namespace-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/link-public-namespace-entry.png) 2. 找到hermes producer的namespace,并选择需要关联到哪些环境和集群 ![link-public-namespace](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/link-public-namespace.png) 3. 关联成功后,页面会自动跳转到Namespace权限管理页面 1. 分配修改权限 ![namespace-permission-edit](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/namespace-permission-edit.png) 2. 分配发布权限 ![namespace-publish-permission](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/namespace-publish-permission.png) 4. 点击“返回”回到项目页面 ### 2.3.2 覆盖公用组件配置 1. 点击新增配置 ![override-public-namespace-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/override-public-namespace-entry.png) 2. 输入要覆盖的配置项 ![override-public-namespace-item](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/override-public-namespace-item.png) 3. 点击提交 ![override-public-namespace-item-done](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/override-public-namespace-item-done.png) ### 2.3.3 发布配置 配置只有在发布后才会真的被应用使用到,所以在编辑完配置后,需要发布配置。 发布配置需要拥有这个Namespace的发布权限,如果发现没有发布按钮,可以找项目管理员授权。 1. 点击“发布按钮” ![override-public-namespace-item-publish-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/override-public-namespace-item-publish-entry.png) 2. 填写发布相关信息,点击发布 ![override-public-namespace-item-publish](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/override-public-namespace-item-publish.png) 3. 配置发布成功后,hermes producer客户端在apollo-portal应用里面运行时读取到的sender.batchSize的值就是1000。 # 三、集群独立配置说明 在有些特殊情况下,应用有需求对不同的集群做不同的配置,比如部署在A机房的应用连接的es服务器地址和部署在B机房的应用连接的es服务器地址不一样。 在这种情况下,可以通过在Apollo创建不同的集群来解决。 ## 3.1 创建集群 创建集群需要项目管理员权限,如果发现没有添加集群按钮,可以找项目管理员授权。 1. 点击页面左侧的“添加集群”按钮 * ![create-cluster](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-cluster.png) 2. 输入集群名称,选择环境并提交 * ![create-cluster-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-cluster-detail.png) 3. 切换到对应的集群,修改配置并发布即可 * ![config-in-cluster-created](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/cluster-created.png) 4. 通过上述配置,部署在SHAJQ机房的应用就会读到SHAJQ集群下的配置 5. 如果应用还在其它机房部署了应用,那么在上述的配置下,会读到default集群下的配置。 # 四、多个AppId使用同一份配置 在一些情况下,尽管应用本身不是公共组件,但还是需要在多个AppId之间共用同一份配置,比如同一个产品的不同项目:XX-Web, XX-Service, XX-Job等。 这种情况下如果希望实现多个AppId使用同一份配置的话,基本概念和公共组件的配置是一致的。 具体来说,就是在其中一个AppId下创建一个namespace,写入公共的配置信息,然后在各个项目中读取该namespace的配置即可。 如果某个AppId需要覆盖公共的配置信息,那么在该AppId下关联公共的namespace并写入需要覆盖的配置即可。 具体步骤可以参考[公共组件接入指南](#%e4%ba%8c%e3%80%81%e5%85%ac%e5%85%b1%e7%bb%84%e4%bb%b6%e6%8e%a5%e5%85%a5%e6%8c%87%e5%8d%97)。 # 五、灰度发布使用指南 通过灰度发布功能,可以实现: 1. 对于一些对程序有比较大影响的配置,可以先在一个或者多个实例生效,观察一段时间没问题后再全量发布配置。 2. 对于一些需要调优的配置参数,可以通过灰度发布功能来实现A/B测试。可以在不同的机器上应用不同的配置,不断调整、测评一段时间后找出较优的配置再全量发布配置。 下面将结合一个实际例子来描述如何使用灰度发布功能。 ## 5.1 场景介绍 100004458(apollo-demo)项目有两个客户端: 1. 10.32.21.19 2. 10.32.21.22 ![initial-instance-list](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/initial-instance-list.png) **灰度目标:** * 当前有一个配置timeout=2000,我们希望对10.32.21.22灰度发布timeout=3000,对10.32.21.19仍然是timeout=2000。 ![initial-config](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/initial-config.png) ## 5.2 创建灰度 首先点击application namespace右上角的`创建灰度`按钮。 ![create-gray-release](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/create-gray-release.png) 点击确定后,灰度版本就创建成功了,页面会自动切换到`灰度版本`Tab。 ![initial-gray-release-tab](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/initial-gray-release-tab.png) ## 5.3 灰度配置 点击`主版本的配置`中,timeout配置最右侧的`对此配置灰度`按钮 ![initial-gray-release-tab](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/edit-gray-release-config.png) 在弹出框中填入要灰度的值:3000,点击提交。 ![submit-gray-release-config](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/submit-gray-release-config.png) ![gray-release-config-submitted](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/gray-release-config-submitted.png) ## 5.4 配置灰度规则 切换到`灰度规则`Tab,点击`新增规则`按钮 ![new-gray-release-rule](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/new-gray-release-rule.png) 在弹出框中`灰度的IP`下拉框会默认展示当前使用配置的机器列表,选择我们要灰度的IP,点击完成。 ![select-gray-release-ip](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/select-gray-release-ip.png) ![gray-release-ip-selected](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/gray-release-ip-selected.png) ![gray-release-rule-saved](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/gray-release-rule-saved.png) 如果下拉框中没找到需要的IP,说明机器还没从Apollo取过配置,可以点击手动输入IP来输入,输入完后点击添加按钮 ![manual-input-gray-release-ip](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/manual-input-gray-release-ip.png) ![manual-input-gray-release-ip-2](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/manual-input-gray-release-ip-2.png) >注:对于公共Namespace的灰度规则,需要先指定要灰度的appId,然后再选择IP。 ## 5.5 灰度发布 配置规则已经生效,不过灰度配置还没有发布。切换到`配置`Tab。 再次检查灰度的配置部分,如果没有问题,点击`灰度发布`。 ![prepare-to-do-gray-release](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/prepare-to-do-gray-release.png) 在弹出框中可以看到主版本的值是2000,灰度版本即将发布的值是3000。填入其它信息后,点击发布。 ![gray-release-confirm-dialog](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/gray-release-confirm-dialog.png) 发布后,切换到`灰度实例列表`Tab,就能看到10.32.21.22已经使用了灰度发布的值。 ![gray-release-instance-list](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/gray-release-instance-list.png) 切换到`主版本`的`实例列表`,会看到主版本配置只有10.32.21.19在使用了。 ![master-branch-instance-list](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/master-branch-instance-list.png) 后面可以继续配置的修改或规则的更改。配置的修改需要点击灰度发布后才会生效,规则的修改在规则点击完成后就会实时生效。 ## 5.6 全量发布 如果灰度的配置测试下来比较理想,符合预期,那么就可以操作`全量发布`。 全量发布的效果是: 1. 灰度版本的配置会合并回主版本,在这个例子中,就是主版本的timeout会被更新成3000 2. 主版本的配置会自动进行一次发布 3. 在全量发布页面,可以选择是否保留当前灰度版本,默认为不保留。 ![prepare-to-full-release](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/prepare-to-full-release.png) ![full-release-confirm-dialog](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/full-release-confirm-dialog.png) ![full-release-confirm-dialog-2](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/full-release-confirm-dialog-2.png) 我选择了不保留灰度版本,所以发布完的效果就是主版本的配置更新、灰度版本删除。点击主版本的实例列表,可以看到10.32.21.22和10.32.21.19都使用了主版本最新的配置。 ![master-branch-instance-list-after-full-release](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/master-branch-instance-list-after-full-release.png) ## 5.7 放弃灰度 如果灰度版本不理想或者不需要了,可以点击`放弃灰度`。 ![abandon-gray-release](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/abandon-gray-release.png) ## 5.8 发布历史 点击主版本的`发布历史`按钮,可以看到当前namespace的主版本以及灰度版本的发布历史。 ![view-release-history](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/view-release-history.png) ![view-release-history-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/view-release-history-detail.png) # 六、其它功能配置 ## 6.1 配置查看权限 从1.1.0版本开始,apollo-portal增加了查看权限的支持,可以支持配置某个环境只允许项目成员查看私有Namespace的配置。 这里的项目成员是指: 1. 项目的管理员 2. 具备该私有Namespace在该环境下的修改或发布权限 配置方式很简单,用超级管理员账号登录后,进入`管理员工具 - 系统参数`页面新增或修改`configView.memberOnly.envs`配置项即可。 ![configView.memberOnly.envs](https://user-images.githubusercontent.com/837658/46456519-c155e100-c7e1-11e8-969b-8f332379fa29.png) ## 6.2 配置访问密钥 Apollo从1.6.0版本开始增加访问密钥机制,从而只有经过身份验证的客户端才能访问敏感配置。如果应用开启了访问密钥,客户端需要配置密钥,否则无法获取配置。 1. 项目管理员打开管理密钥页面 ![管理密钥入口](https://user-images.githubusercontent.com/837658/94990081-f4d3cd80-05ab-11eb-9470-fed5ec6de92e.png) 2. 为项目的每个环境生成访问密钥,注意默认是禁用的,建议在客户端都配置完成后再开启 ![密钥配置页面](https://user-images.githubusercontent.com/837658/94990150-788dba00-05ac-11eb-9a12-727fdb872e42.png) 3. 客户端侧[配置访问密钥](zh/usage/java-sdk-user-guide#_1244-配置访问密钥) # 七、最佳实践 ## 7.1 安全相关 配置中心作为基础服务,存储着公司非常重要的配置信息,所以安全因素需要大家重点关注,下面列举了一些注意事项供大家参考,也欢迎大家分享自己的实践案例。 ### 7.1.1 认证 建议接入公司统一的身份认证系统,如 SSO、LDAP 等,接入方式可以参考[Portal 实现用户登录功能](zh/development/portal-how-to-implement-user-login-function) > 如果使用Apollo提供的Spring Security简单认证,务必记得要修改超级管理员apollo的密码 ### 7.1.2 授权 Apollo 支持细粒度的权限控制,请务必根据实际情况做好权限控制: 1. [项目管理员权限](#_121-项目管理员权限) * Apollo 默认允许所有登录用户创建项目,如果只允许部分用户创建项目,可以开启[创建项目权限控制](zh/deployment/distributed-deployment-guide?id=_3110-rolecreate-applicationenabled-是否开启创建项目权限控制) 2. [配置编辑、发布权限](#_122-配置编辑、发布权限) * 配置编辑、发布权限支持按环境配置,比如开发环境开发人员可以自行完成配置编辑和发布的过程,但是生产环境发布权限交由测试或运维人员 * 生产环境建议同时开启[发布审核](zh/deployment/distributed-deployment-guide?id=_322-namespacelockswitch-一次发布只能有一个人修改开关,用于发布审核),从而控制一次配置发布只能由一个人修改,另一个人发布,确保配置修改得到充分检查 3. [配置查看权限](#_61-配置查看权限) * 可以指定某个环境只允许项目成员查看私有Namespace的配置,从而避免敏感配置泄露,如生产环境 ### 7.1.3 系统访问 除了用户权限,在系统访问上也需要加以考虑: 1. `apollo-configservice`和`apollo-adminservice`是基于内网可信网络设计的,所以出于安全考虑,禁止`apollo-configservice`和`apollo-adminservice`直接暴露在公网 2. 对敏感配置可以考虑开启[访问秘钥](#_62-%e9%85%8d%e7%bd%ae%e8%ae%bf%e9%97%ae%e5%af%86%e9%92%a5),从而只有经过身份验证的客户端才能访问敏感配置 3. 1.7.1及以上版本可以考虑为`apollo-adminservice`开启[访问控制](zh/deployment/distributed-deployment-guide?id=_326-admin-serviceaccesscontrolenabled-配置apollo-adminservice是否开启访问控制),从而只有[受控的](zh/deployment/distributed-deployment-guide?id=_3112-admin-serviceaccesstokens-设置apollo-portal访问各环境apollo-adminservice所需的access-token)`apollo-portal`才能访问对应接口,增强安全性
# &nbsp; # 名词解释 * 普通应用 * 普通应用指的是独立运行的程序,如 * Web应用程序 * 带有main函数的程序 * 公共组件 * 公共组件指的是发布的类库、客户端程序,不会自己独立运行,如 * Java的jar包 * .Net的dll文件 # 一、普通应用接入指南 ## 1.1 创建项目 要使用Apollo,第一步需要创建项目。 1. 打开apollo-portal主页 2. 点击“创建项目” ![create-app-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-app-entry.png) 3. 输入项目信息 * 部门:选择应用所在的部门 * 应用AppId:用来标识应用身份的唯一id,格式为string,需要和客户端app.properties中配置的app.id对应 * 应用名称:应用名,仅用于界面展示 * 应用负责人:选择的人默认会成为该项目的管理员,具备项目权限管理、集群创建、Namespace创建等权限 ![create-app](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-app.png) 4. 点击提交 创建成功后,会自动跳转到项目首页 ![app-created](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/app-created.png) ## 1.2 项目权限分配 ### 1.2.1 项目管理员权限 项目管理员拥有以下权限: 1. 可以管理项目的权限分配 2. 可以创建集群 3. 可以创建Namespace 创建项目时填写的应用负责人默认会成为项目的管理员之一,如果还需要其他人也成为项目管理员,可以按照下面步骤操作: 1. 点击页面左侧的“管理项目” * ![app-permission-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/app-permission-entry.png) 2. 搜索需要添加的成员并点击添加 * ![app-permission-search-user](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/app-permission-search-user.png) * ![app-permission-user-added](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/app-permission-user-added.png) ### 1.2.2 配置编辑、发布权限 配置权限分为编辑和发布: * 编辑权限允许用户在Apollo界面上创建、修改、删除配置 * 配置修改后只在Apollo界面上变化,不会影响到应用实际使用的配置 * 发布权限允许用户在Apollo界面上发布、回滚配置 * 配置只有在发布、回滚动作后才会被应用实际使用到 * Apollo在用户操作发布、回滚动作后实时通知到应用,并使最新配置生效 项目创建完,默认没有分配配置的编辑和发布权限,需要项目管理员进行授权。 1. 点击application这个namespace的授权按钮 * ![namespace-permission-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/namespace-permission-entry.png) 2. 分配修改权限 * ![namespace-permission-edit](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/namespace-permission-edit.png) 3. 分配发布权限 * ![namespace-publish-permission](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/namespace-publish-permission.png) ## 1.3 添加配置项 编辑配置需要拥有这个Namespace的编辑权限,如果发现没有新增配置按钮,可以找项目管理员授权。 ### 1.3.1 通过表格模式添加配置 1. 点击新增配置 * ![create-item-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-item-entry.png) 2. 输入配置项 * ![create-item-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-item-detail.png) 3. 点击提交 * ![item-created](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/item-created.png) ### 1.3.2 通过文本模式编辑 Apollo除了支持表格模式,逐个添加、修改配置外,还提供文本模式批量添加、修改。 这个对于从已有的properties文件迁移尤其有用。 1. 切换到文本编辑模式 ![text-mode-config-overview](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/text-mode-config-overview.png) 2. 点击右侧的修改配置按钮 ![text-mode-config-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/text-mode-config-entry.png) 3. 输入配置项,并点击提交修改 ![text-mode-config-submit](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/text-mode-config-submit.png) ## 1.4 发布配置 配置只有在发布后才会真的被应用使用到,所以在编辑完配置后,需要发布配置。 发布配置需要拥有这个Namespace的发布权限,如果发现没有发布按钮,可以找项目管理员授权。 1. 点击“发布按钮” ![publish-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/hermes-portal-publish-entry.png) 2. 填写发布相关信息,点击发布 ![publish-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/hermes-portal-publish-detail.png) ## 1.5 应用读取配置 配置发布成功后,应用就可以通过Apollo客户端读取到配置了。 Apollo目前提供Java客户端,具体信息请点击[Java客户端使用文档](zh/usage/java-sdk-user-guide): 如果应用使用了其它语言,也可以通过直接访问Http接口获取配置,具体可以参考[其它语言客户端接入指南](zh/usage/other-language-client-user-guide) ## 1.6 回滚已发布配置 如果发现已发布的配置有问题,可以通过点击『回滚』按钮来将客户端读取到的配置回滚到上一个发布版本。 这里的回滚机制类似于发布系统,发布系统中的回滚操作是将部署到机器上的安装包回滚到上一个部署的版本,但代码仓库中的代码是不会回滚的,从而开发可以在修复代码后重新发布。 Apollo中的回滚也是类似的机制,点击回滚后是将发布到客户端的配置回滚到上一个已发布版本,也就是说客户端读取到的配置会恢复到上一个版本,但页面上编辑状态的配置是不会回滚的,从而开发可以在修复配置后重新发布。 # 二、公共组件接入指南 ## 2.1 公共组件和普通应用的区别 公共组件是指那些发布给其它应用使用的客户端代码,比如CAT客户端、Hermes Producer客户端等。 虽然这类组件是由其他团队开发、维护,但是运行时是在业务实际应用内的,所以本质上可以认为是应用的一部分。 通常情况下,这类组件所用到的配置由原始开发团队维护,不过由于实际应用的运行时、环境各不一样,所以我们也允许应用在实际使用时能够覆盖公共组件的部分配置。 ## 2.2 公共组件接入步骤 公共组件的接入步骤,和普通应用几乎一致,唯一的区别是公共组件需要创建自己唯一的Namespace。 所以,首先执行普通应用接入文档中的以下几个步骤,然后再按照本章节后面的步骤操作。 1. [创建项目](#_11-%E5%88%9B%E5%BB%BA%E9%A1%B9%E7%9B%AE) 2. [项目管理员权限](#_121-%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86%E5%91%98%E6%9D%83%E9%99%90) ### 2.2.1 创建Namespace 创建Namespace需要项目管理员权限,如果发现没有添加Namespace按钮,可以找项目管理员授权。 1. 点击页面左侧的添加Namespace * ![create-namespace](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-namespace.png) 2. 点击“创建新的Namespace” * ![create-namespace-select-type](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-namespace-select-type.png) 3. 输入公共组件的Namespace名称,需要注意的是Namespace名称全局唯一 * Apollo会默认把部门代号添加在最前面 * ![create-namespace-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-namespace-detail.png) 4. 点击提交后,页面会自动跳转到关联Namespace页面 * 首先,选中所有需要有这个Namespace的环境和集群,一般建议全选 * 其次,选中刚刚创建的namespace * 最后,点击提交 * ![link-namespace-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/link-namespace-detail.png) 5. 关联成功后,页面会自动跳转到Namespace权限管理页面 1. 分配修改权限 * ![namespace-permission-edit](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/namespace-permission-edit.png) 2. 分配发布权限 * ![namespace-publish-permission](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/namespace-publish-permission.png) 6. 点击“返回”回到项目页面 ### 2.2.2 添加配置项 编辑配置需要拥有这个Namespace的编辑权限,如果发现没有新增配置按钮,可以找项目管理员授权。 #### 2.2.2.1 通过表格模式添加配置 1. 点击新增配置 ![public-namespace-edit-item-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/public-namespace-edit-item-entry.png) 2. 输入配置项 ![public-namespace-edit-item](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/public-namespace-edit-item.png) 3. 点击提交 ![public-namespace-item-created](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/public-namespace-item-created.png) #### 2.2.2.2 通过文本模式编辑 这部分和普通应用一致,具体步骤请参见[1.3.2 通过文本模式编辑](#_132-%E9%80%9A%E8%BF%87%E6%96%87%E6%9C%AC%E6%A8%A1%E5%BC%8F%E7%BC%96%E8%BE%91)。 ### 2.2.3 发布配置 配置只有在发布后才会真的被应用使用到,所以在编辑完配置后,需要发布配置。 发布配置需要拥有这个Namespace的发布权限,如果发现没有发布按钮,可以找项目管理员授权。 1. 点击“发布按钮” ![public-namespace-publish-items-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/public-namespace-publish-items-entry.png) 2. 填写发布相关信息,点击发布 ![public-namespace-publish-items](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/public-namespace-publish-items.png) ### 2.2.4 应用读取配置 配置发布成功后,应用就可以通过Apollo客户端读取到配置了。 Apollo目前提供Java客户端,具体信息请点击[Java客户端使用文档](zh/usage/java-sdk-user-guide): 如果应用使用了其它语言,也可以通过直接访问Http接口获取配置,具体可以参考[其它语言客户端接入指南](zh/usage/other-language-client-user-guide) 对于公共组件的配置读取,可以参考上述文档中的“获取公共Namespace的配置”部分。 ## 2.3 应用覆盖公用组件配置步骤 前面提到,通常情况下,公共组件所用到的配置由原始开发团队维护,不过由于实际应用的运行时、环境各不一样,所以我们也允许应用在实际使用时能够覆盖公共组件的部分配置。 这里就讲一下应用如何覆盖公用组件的配置,简单起见,假设apollo-portal应用使用了hermes producer客户端,并且希望调整hermes的批量发送大小。 ### 2.3.1 关联公共组件Namespace 1. 进入使用公共组件的应用项目首页,点击左侧的添加Namespace按钮 * 所以,在这个例子中,我们需要进入apollo-portal的首页。 * (添加Namespace需要项目管理员权限,如果发现没有添加Namespace按钮,可以找项目管理员授权) * ![link-public-namespace-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/link-public-namespace-entry.png) 2. 找到hermes producer的namespace,并选择需要关联到哪些环境和集群 ![link-public-namespace](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/link-public-namespace.png) 3. 关联成功后,页面会自动跳转到Namespace权限管理页面 1. 分配修改权限 ![namespace-permission-edit](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/namespace-permission-edit.png) 2. 分配发布权限 ![namespace-publish-permission](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/namespace-publish-permission.png) 4. 点击“返回”回到项目页面 ### 2.3.2 覆盖公用组件配置 1. 点击新增配置 ![override-public-namespace-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/override-public-namespace-entry.png) 2. 输入要覆盖的配置项 ![override-public-namespace-item](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/override-public-namespace-item.png) 3. 点击提交 ![override-public-namespace-item-done](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/override-public-namespace-item-done.png) ### 2.3.3 发布配置 配置只有在发布后才会真的被应用使用到,所以在编辑完配置后,需要发布配置。 发布配置需要拥有这个Namespace的发布权限,如果发现没有发布按钮,可以找项目管理员授权。 1. 点击“发布按钮” ![override-public-namespace-item-publish-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/override-public-namespace-item-publish-entry.png) 2. 填写发布相关信息,点击发布 ![override-public-namespace-item-publish](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/override-public-namespace-item-publish.png) 3. 配置发布成功后,hermes producer客户端在apollo-portal应用里面运行时读取到的sender.batchSize的值就是1000。 # 三、集群独立配置说明 在有些特殊情况下,应用有需求对不同的集群做不同的配置,比如部署在A机房的应用连接的es服务器地址和部署在B机房的应用连接的es服务器地址不一样。 在这种情况下,可以通过在Apollo创建不同的集群来解决。 ## 3.1 创建集群 创建集群需要项目管理员权限,如果发现没有添加集群按钮,可以找项目管理员授权。 1. 点击页面左侧的“添加集群”按钮 * ![create-cluster](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-cluster.png) 2. 输入集群名称,选择环境并提交 * ![create-cluster-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/create-cluster-detail.png) 3. 切换到对应的集群,修改配置并发布即可 * ![config-in-cluster-created](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/cluster-created.png) 4. 通过上述配置,部署在SHAJQ机房的应用就会读到SHAJQ集群下的配置 5. 如果应用还在其它机房部署了应用,那么在上述的配置下,会读到default集群下的配置。 # 四、多个AppId使用同一份配置 在一些情况下,尽管应用本身不是公共组件,但还是需要在多个AppId之间共用同一份配置,比如同一个产品的不同项目:XX-Web, XX-Service, XX-Job等。 这种情况下如果希望实现多个AppId使用同一份配置的话,基本概念和公共组件的配置是一致的。 具体来说,就是在其中一个AppId下创建一个namespace,写入公共的配置信息,然后在各个项目中读取该namespace的配置即可。 如果某个AppId需要覆盖公共的配置信息,那么在该AppId下关联公共的namespace并写入需要覆盖的配置即可。 具体步骤可以参考[公共组件接入指南](#%e4%ba%8c%e3%80%81%e5%85%ac%e5%85%b1%e7%bb%84%e4%bb%b6%e6%8e%a5%e5%85%a5%e6%8c%87%e5%8d%97)。 # 五、灰度发布使用指南 通过灰度发布功能,可以实现: 1. 对于一些对程序有比较大影响的配置,可以先在一个或者多个实例生效,观察一段时间没问题后再全量发布配置。 2. 对于一些需要调优的配置参数,可以通过灰度发布功能来实现A/B测试。可以在不同的机器上应用不同的配置,不断调整、测评一段时间后找出较优的配置再全量发布配置。 下面将结合一个实际例子来描述如何使用灰度发布功能。 ## 5.1 场景介绍 100004458(apollo-demo)项目有两个客户端: 1. 10.32.21.19 2. 10.32.21.22 ![initial-instance-list](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/initial-instance-list.png) **灰度目标:** * 当前有一个配置timeout=2000,我们希望对10.32.21.22灰度发布timeout=3000,对10.32.21.19仍然是timeout=2000。 ![initial-config](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/initial-config.png) ## 5.2 创建灰度 首先点击application namespace右上角的`创建灰度`按钮。 ![create-gray-release](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/create-gray-release.png) 点击确定后,灰度版本就创建成功了,页面会自动切换到`灰度版本`Tab。 ![initial-gray-release-tab](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/initial-gray-release-tab.png) ## 5.3 灰度配置 点击`主版本的配置`中,timeout配置最右侧的`对此配置灰度`按钮 ![initial-gray-release-tab](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/edit-gray-release-config.png) 在弹出框中填入要灰度的值:3000,点击提交。 ![submit-gray-release-config](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/submit-gray-release-config.png) ![gray-release-config-submitted](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/gray-release-config-submitted.png) ## 5.4 配置灰度规则 切换到`灰度规则`Tab,点击`新增规则`按钮 ![new-gray-release-rule](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/new-gray-release-rule.png) 在弹出框中`灰度的IP`下拉框会默认展示当前使用配置的机器列表,选择我们要灰度的IP,点击完成。 ![select-gray-release-ip](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/select-gray-release-ip.png) ![gray-release-ip-selected](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/gray-release-ip-selected.png) ![gray-release-rule-saved](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/gray-release-rule-saved.png) 如果下拉框中没找到需要的IP,说明机器还没从Apollo取过配置,可以点击手动输入IP来输入,输入完后点击添加按钮 ![manual-input-gray-release-ip](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/manual-input-gray-release-ip.png) ![manual-input-gray-release-ip-2](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/manual-input-gray-release-ip-2.png) >注:对于公共Namespace的灰度规则,需要先指定要灰度的appId,然后再选择IP。 ## 5.5 灰度发布 配置规则已经生效,不过灰度配置还没有发布。切换到`配置`Tab。 再次检查灰度的配置部分,如果没有问题,点击`灰度发布`。 ![prepare-to-do-gray-release](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/prepare-to-do-gray-release.png) 在弹出框中可以看到主版本的值是2000,灰度版本即将发布的值是3000。填入其它信息后,点击发布。 ![gray-release-confirm-dialog](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/gray-release-confirm-dialog.png) 发布后,切换到`灰度实例列表`Tab,就能看到10.32.21.22已经使用了灰度发布的值。 ![gray-release-instance-list](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/gray-release-instance-list.png) 切换到`主版本`的`实例列表`,会看到主版本配置只有10.32.21.19在使用了。 ![master-branch-instance-list](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/master-branch-instance-list.png) 后面可以继续配置的修改或规则的更改。配置的修改需要点击灰度发布后才会生效,规则的修改在规则点击完成后就会实时生效。 ## 5.6 全量发布 如果灰度的配置测试下来比较理想,符合预期,那么就可以操作`全量发布`。 全量发布的效果是: 1. 灰度版本的配置会合并回主版本,在这个例子中,就是主版本的timeout会被更新成3000 2. 主版本的配置会自动进行一次发布 3. 在全量发布页面,可以选择是否保留当前灰度版本,默认为不保留。 ![prepare-to-full-release](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/prepare-to-full-release.png) ![full-release-confirm-dialog](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/full-release-confirm-dialog.png) ![full-release-confirm-dialog-2](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/full-release-confirm-dialog-2.png) 我选择了不保留灰度版本,所以发布完的效果就是主版本的配置更新、灰度版本删除。点击主版本的实例列表,可以看到10.32.21.22和10.32.21.19都使用了主版本最新的配置。 ![master-branch-instance-list-after-full-release](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/master-branch-instance-list-after-full-release.png) ## 5.7 放弃灰度 如果灰度版本不理想或者不需要了,可以点击`放弃灰度`。 ![abandon-gray-release](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/abandon-gray-release.png) ## 5.8 发布历史 点击主版本的`发布历史`按钮,可以看到当前namespace的主版本以及灰度版本的发布历史。 ![view-release-history](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/view-release-history.png) ![view-release-history-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/gray-release/view-release-history-detail.png) # 六、其它功能配置 ## 6.1 配置查看权限 从1.1.0版本开始,apollo-portal增加了查看权限的支持,可以支持配置某个环境只允许项目成员查看私有Namespace的配置。 这里的项目成员是指: 1. 项目的管理员 2. 具备该私有Namespace在该环境下的修改或发布权限 配置方式很简单,用超级管理员账号登录后,进入`管理员工具 - 系统参数`页面新增或修改`configView.memberOnly.envs`配置项即可。 ![configView.memberOnly.envs](https://user-images.githubusercontent.com/837658/46456519-c155e100-c7e1-11e8-969b-8f332379fa29.png) ## 6.2 配置访问密钥 Apollo从1.6.0版本开始增加访问密钥机制,从而只有经过身份验证的客户端才能访问敏感配置。如果应用开启了访问密钥,客户端需要配置密钥,否则无法获取配置。 1. 项目管理员打开管理密钥页面 ![管理密钥入口](https://user-images.githubusercontent.com/837658/94990081-f4d3cd80-05ab-11eb-9470-fed5ec6de92e.png) 2. 为项目的每个环境生成访问密钥,注意默认是禁用的,建议在客户端都配置完成后再开启 ![密钥配置页面](https://user-images.githubusercontent.com/837658/94990150-788dba00-05ac-11eb-9a12-727fdb872e42.png) 3. 客户端侧[配置访问密钥](zh/usage/java-sdk-user-guide#_1244-配置访问密钥) # 七、最佳实践 ## 7.1 安全相关 配置中心作为基础服务,存储着公司非常重要的配置信息,所以安全因素需要大家重点关注,下面列举了一些注意事项供大家参考,也欢迎大家分享自己的实践案例。 ### 7.1.1 认证 建议接入公司统一的身份认证系统,如 SSO、LDAP 等,接入方式可以参考[Portal 实现用户登录功能](zh/development/portal-how-to-implement-user-login-function) > 如果使用Apollo提供的Spring Security简单认证,务必记得要修改超级管理员apollo的密码 ### 7.1.2 授权 Apollo 支持细粒度的权限控制,请务必根据实际情况做好权限控制: 1. [项目管理员权限](#_121-项目管理员权限) * Apollo 默认允许所有登录用户创建项目,如果只允许部分用户创建项目,可以开启[创建项目权限控制](zh/deployment/distributed-deployment-guide?id=_3110-rolecreate-applicationenabled-是否开启创建项目权限控制) 2. [配置编辑、发布权限](#_122-配置编辑、发布权限) * 配置编辑、发布权限支持按环境配置,比如开发环境开发人员可以自行完成配置编辑和发布的过程,但是生产环境发布权限交由测试或运维人员 * 生产环境建议同时开启[发布审核](zh/deployment/distributed-deployment-guide?id=_322-namespacelockswitch-一次发布只能有一个人修改开关,用于发布审核),从而控制一次配置发布只能由一个人修改,另一个人发布,确保配置修改得到充分检查 3. [配置查看权限](#_61-配置查看权限) * 可以指定某个环境只允许项目成员查看私有Namespace的配置,从而避免敏感配置泄露,如生产环境 ### 7.1.3 系统访问 除了用户权限,在系统访问上也需要加以考虑: 1. `apollo-configservice`和`apollo-adminservice`是基于内网可信网络设计的,所以出于安全考虑,禁止`apollo-configservice`和`apollo-adminservice`直接暴露在公网 2. 对敏感配置可以考虑开启[访问秘钥](#_62-%e9%85%8d%e7%bd%ae%e8%ae%bf%e9%97%ae%e5%af%86%e9%92%a5),从而只有经过身份验证的客户端才能访问敏感配置 3. 1.7.1及以上版本可以考虑为`apollo-adminservice`开启[访问控制](zh/deployment/distributed-deployment-guide?id=_326-admin-serviceaccesscontrolenabled-配置apollo-adminservice是否开启访问控制),从而只有[受控的](zh/deployment/distributed-deployment-guide?id=_3112-admin-serviceaccesstokens-设置apollo-portal访问各环境apollo-adminservice所需的access-token)`apollo-portal`才能访问对应接口,增强安全性
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./docs/zh/development/portal-how-to-enable-email-service.md
在配置发布时候,我们希望发布信息邮件通知到相关的负责人。现支持发送邮件的动作有:普通发布、灰度发布、全量发布、回滚,通知对象包括:具有namespace编辑和发布权限的人员以及App负责人。 由于各公司的邮件服务往往有不同的实现,所以Apollo定义了一些SPI用来解耦,Apollo接入邮件服务的关键就是实现这些SPI。 ## 一、实现方式一:使用Apollo提供的smtp邮件服务 ### 1.1 接入步骤 在ApolloPortalDB.ServerConfig表配置以下参数,也可以通过管理员工具 - 系统参数页面进行配置,修改完一分钟实时生效。如下: * **email.enabled** 设置为true即可启用默认的smtp邮件服务 * **email.config.host** smtp的服务地址,如`smtp.163.com` * **email.config.user** smtp帐号用户名 * **email.config.password** smtp帐号密码 * **email.supported.envs** 支持发送邮件的环境列表,英文逗号隔开。我们不希望发布邮件变成用户的垃圾邮件,只有某些环境下的发布动作才会发送邮件。 * **email.sender** 邮件的发送人,可以不配置,默认为`email.config.user`。 * **apollo.portal.address** Apollo Portal的地址。方便用户从邮件点击跳转到Apollo Portal查看详细的发布信息。 * **email.template.framework** 邮件内容模板框架。将邮件内容模板化、可配置化,方便管理和变更邮件内容。 * **email.template.release.module.diff** 发布邮件的diff模块。 * **email.template.rollback.module.diff** 回滚邮件的diff模块。 * **email.template.release.module.rules** 灰度发布的灰度规则模块。 我们提供了[邮件模板样例](#三、邮件模板样例),方便大家使用。 ## 二、实现方式二:接入公司的统一邮件服务 和SSO类似,每个公司也有自己的邮件服务实现,所以我们相应的定义了[EmailService](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/EmailService.java)接口,现有两个实现类: 1. CtripEmailService:携程实现的EmailService 2. DefaultEmailService:smtp实现 ### 2.1 接入步骤 1. 提供自己公司的[EmailService](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/EmailService.java)实现,并在[EmailConfiguration](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/EmailConfiguration.java)中注册。 2. 在ApolloPortalDB.ServerConfig表配置以下参数,也可以通过管理员工具 - 系统参数页面进行配置,修改完一分钟实时生效。如下: * **email.supported.envs** 支持发送邮件的环境列表,英文逗号隔开。我们不希望发布邮件变成用户的垃圾邮件,只有某些环境下的发布动作才会发送邮件。 * **email.sender** 邮件的发送人。 * **apollo.portal.address** Apollo Portal的地址。方便用户从邮件点击跳转到Apollo Portal查看详细的发布信息。 * **email.template.framework** 邮件内容模板框架。将邮件内容模板化、可配置化,方便管理和变更邮件内容。 * **email.template.release.module.diff** 发布邮件的diff模块。 * **email.template.rollback.module.diff** 回滚邮件的diff模块。 * **email.template.release.module.rules** 灰度发布的灰度规则模块。 我们提供了[邮件模板样例](#三、邮件模板样例),方便大家使用。 >注:运行时使用不同的实现是通过[Profiles](http://docs.spring.io/autorepo/docs/spring-boot/current/reference/html/boot-features-profiles.html)实现的,比如你自己的Email实现是在`custom` profile中的话,在打包脚本中可以指定-Dapollo_profile=github,custom。其中`github`是Apollo必须的一个profile,用于数据库的配置,`custom`是你自己实现的profile。同时需要注意在[EmailConfiguration](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/EmailConfiguration.java)中修改默认实现的条件`@Profile({"!custom"})`。 ### 2.2 相关代码 1. [ConfigPublishListener](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/listener/ConfigPublishListener.java)监听发布事件,调用emailbuilder构建邮件内容,然后调用EmailService发送邮件 2. [emailbuilder](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/components/emailbuilder)包是构建邮件内容的实现 3. [EmailService](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/EmailService.java) 邮件发送服务 4. [EmailConfiguration](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/EmailConfiguration.java) 邮件服务注册类 ## 三、邮件模板样例 以下为发布邮件和回滚邮件的模板内容样式,邮件模板为html格式,发送html格式的邮件时,可能需要做一些额外的处理,取决于每个公司的邮件服务实现。为了减少字符数,模板经过了压缩处理,可自行格式化提高可读性。 ### 3.1 email.template.framework ```html <html><head><style type="text/css">.table{width:100%;max-width:100%;margin-bottom:20px;border-collapse:collapse;background-color:transparent}td{padding:8px;line-height:1.42857143;vertical-align:top;border:1px solid #ddd;border-top:1px solid #ddd}.table-bordered{border:1px solid #ddd}</style></head><body><h3>发布基本信息</h3><table class="table table-bordered"><tr><td width="10%"><b>AppId</b></td><td width="15%">#{appId}</td><td width="10%"><b>环境</b></td><td width="15%">#{env}</td><td width="10%"><b>集群</b></td><td width="15%">#{clusterName}</td><td width="10%"><b>Namespace</b></td><td width="15%">#{namespaceName}</td></tr><tr><td><b>发布者</b></td><td>#{operator}</td><td><b>发布时间</b></td><td>#{releaseTime}</td><td><b>发布标题</b></td><td>#{releaseTitle}</td><td><b>备注</b></td><td>#{releaseComment}</td></tr></table>#{diffModule}#{rulesModule}<br><a href="#{apollo.portal.address}/config/history.html?#/appid=#{appId}&env=#{env}&clusterName=#{clusterName}&namespaceName=#{namespaceName}&releaseHistoryId=#{releaseHistoryId}">点击查看详细的发布信息</a><br><br>如有Apollo使用问题请先查阅<a href="http://conf.ctripcorp.com/display/FRAM/Apollo">文档</a>,或直接回复本邮件咨询。</body></html> ``` > 注:使用此模板需要在 portal 的系统参数中配置 apollo.portal.address,指向 apollo portal 的地址 ### 3.2 email.template.release.module.diff ```html <h3>变更的配置</h3> <table class="table table-bordered"> <tr> <td width="10%"><b>Type</b></td> <td width="20%"><b>Key</b></td> <td width="35%"><b>Old Value</b></td> <td width="35%"><b>New Value</b></td> </tr> #{diffContent} </table> ``` ### 3.3 email.template.rollback.module.diff ```html <div> <br><br> <h3>变更的配置</h3> <table class="table table-bordered"> <tr> <td width="10%"><b>Type</b></td> <td width="20%"><b>Key</b></td> <td width="35%"><b>回滚前</b></td> <td width="35%"><b>回滚后</b></td> </tr> #{diffContent} </table> <br> </div> ``` ### 3.4 email.template.release.module.rules ```html <div> <br> <h3>灰度规则</h3> #{rulesContent} <br> </div> ``` ### 3.5 发布邮件样例 ![发布邮件模板](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/email-template-release.png) ### 3.6 回滚邮件样例 ![回滚邮件模板](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/email-template-rollback.png)
在配置发布时候,我们希望发布信息邮件通知到相关的负责人。现支持发送邮件的动作有:普通发布、灰度发布、全量发布、回滚,通知对象包括:具有namespace编辑和发布权限的人员以及App负责人。 由于各公司的邮件服务往往有不同的实现,所以Apollo定义了一些SPI用来解耦,Apollo接入邮件服务的关键就是实现这些SPI。 ## 一、实现方式一:使用Apollo提供的smtp邮件服务 ### 1.1 接入步骤 在ApolloPortalDB.ServerConfig表配置以下参数,也可以通过管理员工具 - 系统参数页面进行配置,修改完一分钟实时生效。如下: * **email.enabled** 设置为true即可启用默认的smtp邮件服务 * **email.config.host** smtp的服务地址,如`smtp.163.com` * **email.config.user** smtp帐号用户名 * **email.config.password** smtp帐号密码 * **email.supported.envs** 支持发送邮件的环境列表,英文逗号隔开。我们不希望发布邮件变成用户的垃圾邮件,只有某些环境下的发布动作才会发送邮件。 * **email.sender** 邮件的发送人,可以不配置,默认为`email.config.user`。 * **apollo.portal.address** Apollo Portal的地址。方便用户从邮件点击跳转到Apollo Portal查看详细的发布信息。 * **email.template.framework** 邮件内容模板框架。将邮件内容模板化、可配置化,方便管理和变更邮件内容。 * **email.template.release.module.diff** 发布邮件的diff模块。 * **email.template.rollback.module.diff** 回滚邮件的diff模块。 * **email.template.release.module.rules** 灰度发布的灰度规则模块。 我们提供了[邮件模板样例](#三、邮件模板样例),方便大家使用。 ## 二、实现方式二:接入公司的统一邮件服务 和SSO类似,每个公司也有自己的邮件服务实现,所以我们相应的定义了[EmailService](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/EmailService.java)接口,现有两个实现类: 1. CtripEmailService:携程实现的EmailService 2. DefaultEmailService:smtp实现 ### 2.1 接入步骤 1. 提供自己公司的[EmailService](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/EmailService.java)实现,并在[EmailConfiguration](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/EmailConfiguration.java)中注册。 2. 在ApolloPortalDB.ServerConfig表配置以下参数,也可以通过管理员工具 - 系统参数页面进行配置,修改完一分钟实时生效。如下: * **email.supported.envs** 支持发送邮件的环境列表,英文逗号隔开。我们不希望发布邮件变成用户的垃圾邮件,只有某些环境下的发布动作才会发送邮件。 * **email.sender** 邮件的发送人。 * **apollo.portal.address** Apollo Portal的地址。方便用户从邮件点击跳转到Apollo Portal查看详细的发布信息。 * **email.template.framework** 邮件内容模板框架。将邮件内容模板化、可配置化,方便管理和变更邮件内容。 * **email.template.release.module.diff** 发布邮件的diff模块。 * **email.template.rollback.module.diff** 回滚邮件的diff模块。 * **email.template.release.module.rules** 灰度发布的灰度规则模块。 我们提供了[邮件模板样例](#三、邮件模板样例),方便大家使用。 >注:运行时使用不同的实现是通过[Profiles](http://docs.spring.io/autorepo/docs/spring-boot/current/reference/html/boot-features-profiles.html)实现的,比如你自己的Email实现是在`custom` profile中的话,在打包脚本中可以指定-Dapollo_profile=github,custom。其中`github`是Apollo必须的一个profile,用于数据库的配置,`custom`是你自己实现的profile。同时需要注意在[EmailConfiguration](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/EmailConfiguration.java)中修改默认实现的条件`@Profile({"!custom"})`。 ### 2.2 相关代码 1. [ConfigPublishListener](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/listener/ConfigPublishListener.java)监听发布事件,调用emailbuilder构建邮件内容,然后调用EmailService发送邮件 2. [emailbuilder](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/components/emailbuilder)包是构建邮件内容的实现 3. [EmailService](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/EmailService.java) 邮件发送服务 4. [EmailConfiguration](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/EmailConfiguration.java) 邮件服务注册类 ## 三、邮件模板样例 以下为发布邮件和回滚邮件的模板内容样式,邮件模板为html格式,发送html格式的邮件时,可能需要做一些额外的处理,取决于每个公司的邮件服务实现。为了减少字符数,模板经过了压缩处理,可自行格式化提高可读性。 ### 3.1 email.template.framework ```html <html><head><style type="text/css">.table{width:100%;max-width:100%;margin-bottom:20px;border-collapse:collapse;background-color:transparent}td{padding:8px;line-height:1.42857143;vertical-align:top;border:1px solid #ddd;border-top:1px solid #ddd}.table-bordered{border:1px solid #ddd}</style></head><body><h3>发布基本信息</h3><table class="table table-bordered"><tr><td width="10%"><b>AppId</b></td><td width="15%">#{appId}</td><td width="10%"><b>环境</b></td><td width="15%">#{env}</td><td width="10%"><b>集群</b></td><td width="15%">#{clusterName}</td><td width="10%"><b>Namespace</b></td><td width="15%">#{namespaceName}</td></tr><tr><td><b>发布者</b></td><td>#{operator}</td><td><b>发布时间</b></td><td>#{releaseTime}</td><td><b>发布标题</b></td><td>#{releaseTitle}</td><td><b>备注</b></td><td>#{releaseComment}</td></tr></table>#{diffModule}#{rulesModule}<br><a href="#{apollo.portal.address}/config/history.html?#/appid=#{appId}&env=#{env}&clusterName=#{clusterName}&namespaceName=#{namespaceName}&releaseHistoryId=#{releaseHistoryId}">点击查看详细的发布信息</a><br><br>如有Apollo使用问题请先查阅<a href="http://conf.ctripcorp.com/display/FRAM/Apollo">文档</a>,或直接回复本邮件咨询。</body></html> ``` > 注:使用此模板需要在 portal 的系统参数中配置 apollo.portal.address,指向 apollo portal 的地址 ### 3.2 email.template.release.module.diff ```html <h3>变更的配置</h3> <table class="table table-bordered"> <tr> <td width="10%"><b>Type</b></td> <td width="20%"><b>Key</b></td> <td width="35%"><b>Old Value</b></td> <td width="35%"><b>New Value</b></td> </tr> #{diffContent} </table> ``` ### 3.3 email.template.rollback.module.diff ```html <div> <br><br> <h3>变更的配置</h3> <table class="table table-bordered"> <tr> <td width="10%"><b>Type</b></td> <td width="20%"><b>Key</b></td> <td width="35%"><b>回滚前</b></td> <td width="35%"><b>回滚后</b></td> </tr> #{diffContent} </table> <br> </div> ``` ### 3.4 email.template.release.module.rules ```html <div> <br> <h3>灰度规则</h3> #{rulesContent} <br> </div> ``` ### 3.5 发布邮件样例 ![发布邮件模板](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/email-template-release.png) ### 3.6 回滚邮件样例 ![回滚邮件模板](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/email-template-rollback.png)
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./CODE_OF_CONDUCT.md
# Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/
# Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./docs/zh/usage/third-party-sdks-user-guide.md
## 1. Go ### Apollo Go 客户端 1 项目地址:[zouyx/agollo](https://github.com/zouyx/agollo) > 非常感谢[@zouyx](https://github.com/zouyx)提供Go Apollo客户端的支持 ### Apollo Go 客户端 2 项目地址:[philchia/agollo](https://github.com/philchia/agollo) > 非常感谢[@philchia](https://github.com/philchia)提供Go Apollo客户端的支持 ### Apollo Go 客户端 3 项目地址:[shima-park/agollo](https://github.com/shima-park/agollo) > 非常感谢[@shima-park](https://github.com/shima-park)提供Go Apollo客户端的支持 ### Apollo Go 客户端 4 项目地址:[go-microservices/php_conf_agent](https://github.com/go-microservices/php_conf_agent) > 非常感谢[@GanymedeNil](https://github.com/GanymedeNil)提供Go Apollo客户端的支持 ### Apollo Go 客户端 5 项目地址:[hyperjiang/lunar](https://github.com/hyperjiang/lunar) > 非常感谢[@hyperjiang](https://github.com/hyperjiang)提供Go Apollo客户端的支持 ### Apollo Go 客户端 6 项目地址:[tagconfig/tagconfig](https://github.com/tagconfig/tagconfig) > 非常感谢[@n0trace](https://github.com/n0trace)提供Go Apollo客户端的支持 ### Apollo Go 客户端 7 项目地址:[go-chassis/go-archaius](https://github.com/go-chassis/go-archaius/tree/master/examples/apollo) > 非常感谢[@tianxiaoliang](https://github.com/tianxiaoliang) 和 [@Shonminh](https://github.com/Shonminh)提供Go Apollo客户端的支持 ### Apollo Go 客户端 8 项目地址:[xhrg-product/apollo-client-golang](https://github.com/xhrg-product/apollo-client-golang) > 非常感谢[@xhrg](https://github.com/xhrg)提供Go Apollo客户端的支持 ## 2. Python ### Apollo Python 客户端 1 项目地址:[pyapollo](https://github.com/filamoon/pyapollo) > 非常感谢[@filamoon](https://github.com/filamoon)提供Python Apollo客户端的支持 ### Apollo Python 客户端 2 项目地址:[BruceWW-pyapollo](https://github.com/BruceWW/pyapollo) > 非常感谢[@BruceWW](https://github.com/BruceWW)提供Python Apollo客户端的支持 ### Apollo Python 客户端 3 项目地址:[xhrg-product/apollo-client-python](https://github.com/xhrg-product/apollo-client-python) > 非常感谢[@xhrg-product](https://github.com/xhrg-product)提供Python Apollo客户端的支持 ## 3. NodeJS ### Apollo NodeJS 客户端 1 项目地址:[node-apollo](https://github.com/Quinton/node-apollo) > 非常感谢[@Quinton](https://github.com/Quinton)提供NodeJS Apollo客户端的支持 ### Apollo NodeJS 客户端 2 项目地址:[ctrip-apollo](https://github.com/kaelzhang/ctrip-apollo) > 非常感谢[@kaelzhang](https://github.com/kaelzhang)提供NodeJS Apollo客户端的支持 ### Apollo NodeJS 客户端 3 项目地址:[node-apollo-client](https://github.com/shinux/node-apollo-client) > 非常感谢[@shinux](https://github.com/shinux)提供NodeJS Apollo客户端的支持 ### Apollo NodeJS 客户端 4 项目地址:[ctrip-apollo-client](https://github.com/lvgithub/ctrip-apollo-client) > 非常感谢[@lvgithub](https://github.com/lvgithub)提供NodeJS Apollo客户端的支持 ### Apollo NodeJS 客户端 5 项目地址:[apollo-node](https://github.com/lengyuxuan/apollo-node) > 非常感谢[@lengyuxuan](https://github.com/lengyuxuan)提供NodeJS Apollo客户端的支持 ### Apollo NodeJS 客户端 6 项目地址:[egg-apollo-client](https://github.com/xuezier/egg-apollo-client) > 非常感谢[@xuezier](https://github.com/xuezier)提供NodeJS Apollo客户端的支持 ### Apollo NodeJS 客户端 7 项目地址:[apollo-node-client](https://github.com/zhangxh1023/apollo-node-client) > 非常感谢[@zhangxh1023](https://github.com/zhangxh1023)提供NodeJS Apollo客户端的支持 ## 4. PHP ### Apollo PHP 客户端 1 项目地址:[apollo-php-client](https://github.com/multilinguals/apollo-php-client) > 非常感谢[@t04041143](https://github.com/t04041143)提供PHP Apollo客户端的支持 ### Apollo PHP 客户端 2 项目地址:[apollo-sdk-config](https://github.com/fengzhibin/apollo-sdk-config) > 非常感谢[@fengzhibin](https://github.com/fengzhibin)提供PHP Apollo客户端的支持 ## 5. C ### Apollo C 客户端 项目地址:[apollo-c-client](https://github.com/lzeqian/apollo) > 非常感谢[@lzeqian](https://github.com/lzeqian)提供C Apollo客户端的支持
## 1. Go ### Apollo Go 客户端 1 项目地址:[zouyx/agollo](https://github.com/zouyx/agollo) > 非常感谢[@zouyx](https://github.com/zouyx)提供Go Apollo客户端的支持 ### Apollo Go 客户端 2 项目地址:[philchia/agollo](https://github.com/philchia/agollo) > 非常感谢[@philchia](https://github.com/philchia)提供Go Apollo客户端的支持 ### Apollo Go 客户端 3 项目地址:[shima-park/agollo](https://github.com/shima-park/agollo) > 非常感谢[@shima-park](https://github.com/shima-park)提供Go Apollo客户端的支持 ### Apollo Go 客户端 4 项目地址:[go-microservices/php_conf_agent](https://github.com/go-microservices/php_conf_agent) > 非常感谢[@GanymedeNil](https://github.com/GanymedeNil)提供Go Apollo客户端的支持 ### Apollo Go 客户端 5 项目地址:[hyperjiang/lunar](https://github.com/hyperjiang/lunar) > 非常感谢[@hyperjiang](https://github.com/hyperjiang)提供Go Apollo客户端的支持 ### Apollo Go 客户端 6 项目地址:[tagconfig/tagconfig](https://github.com/tagconfig/tagconfig) > 非常感谢[@n0trace](https://github.com/n0trace)提供Go Apollo客户端的支持 ### Apollo Go 客户端 7 项目地址:[go-chassis/go-archaius](https://github.com/go-chassis/go-archaius/tree/master/examples/apollo) > 非常感谢[@tianxiaoliang](https://github.com/tianxiaoliang) 和 [@Shonminh](https://github.com/Shonminh)提供Go Apollo客户端的支持 ### Apollo Go 客户端 8 项目地址:[xhrg-product/apollo-client-golang](https://github.com/xhrg-product/apollo-client-golang) > 非常感谢[@xhrg](https://github.com/xhrg)提供Go Apollo客户端的支持 ## 2. Python ### Apollo Python 客户端 1 项目地址:[pyapollo](https://github.com/filamoon/pyapollo) > 非常感谢[@filamoon](https://github.com/filamoon)提供Python Apollo客户端的支持 ### Apollo Python 客户端 2 项目地址:[BruceWW-pyapollo](https://github.com/BruceWW/pyapollo) > 非常感谢[@BruceWW](https://github.com/BruceWW)提供Python Apollo客户端的支持 ### Apollo Python 客户端 3 项目地址:[xhrg-product/apollo-client-python](https://github.com/xhrg-product/apollo-client-python) > 非常感谢[@xhrg-product](https://github.com/xhrg-product)提供Python Apollo客户端的支持 ## 3. NodeJS ### Apollo NodeJS 客户端 1 项目地址:[node-apollo](https://github.com/Quinton/node-apollo) > 非常感谢[@Quinton](https://github.com/Quinton)提供NodeJS Apollo客户端的支持 ### Apollo NodeJS 客户端 2 项目地址:[ctrip-apollo](https://github.com/kaelzhang/ctrip-apollo) > 非常感谢[@kaelzhang](https://github.com/kaelzhang)提供NodeJS Apollo客户端的支持 ### Apollo NodeJS 客户端 3 项目地址:[node-apollo-client](https://github.com/shinux/node-apollo-client) > 非常感谢[@shinux](https://github.com/shinux)提供NodeJS Apollo客户端的支持 ### Apollo NodeJS 客户端 4 项目地址:[ctrip-apollo-client](https://github.com/lvgithub/ctrip-apollo-client) > 非常感谢[@lvgithub](https://github.com/lvgithub)提供NodeJS Apollo客户端的支持 ### Apollo NodeJS 客户端 5 项目地址:[apollo-node](https://github.com/lengyuxuan/apollo-node) > 非常感谢[@lengyuxuan](https://github.com/lengyuxuan)提供NodeJS Apollo客户端的支持 ### Apollo NodeJS 客户端 6 项目地址:[egg-apollo-client](https://github.com/xuezier/egg-apollo-client) > 非常感谢[@xuezier](https://github.com/xuezier)提供NodeJS Apollo客户端的支持 ### Apollo NodeJS 客户端 7 项目地址:[apollo-node-client](https://github.com/zhangxh1023/apollo-node-client) > 非常感谢[@zhangxh1023](https://github.com/zhangxh1023)提供NodeJS Apollo客户端的支持 ## 4. PHP ### Apollo PHP 客户端 1 项目地址:[apollo-php-client](https://github.com/multilinguals/apollo-php-client) > 非常感谢[@t04041143](https://github.com/t04041143)提供PHP Apollo客户端的支持 ### Apollo PHP 客户端 2 项目地址:[apollo-sdk-config](https://github.com/fengzhibin/apollo-sdk-config) > 非常感谢[@fengzhibin](https://github.com/fengzhibin)提供PHP Apollo客户端的支持 ## 5. C ### Apollo C 客户端 项目地址:[apollo-c-client](https://github.com/lzeqian/apollo) > 非常感谢[@lzeqian](https://github.com/lzeqian)提供C Apollo客户端的支持
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./docs/zh/usage/dotnet-sdk-user-guide.md
>注意:本文档适用对象是Apollo系统的使用者,如果你是公司内Apollo系统的开发者/维护人员,建议先参考[Apollo开发指南](zh/development/apollo-development-guide)。 # &nbsp; # 一、准备工作 ## 1.1 环境要求 * .Net: 4.0+ ## 1.2 必选设置 Apollo客户端依赖于`AppId`,`Environment`等环境信息来工作,所以请确保阅读下面的说明并且做正确的配置: ### 1.2.1 AppId AppId是应用的身份信息,是从服务端获取配置的一个重要信息。 请确保在app.config或web.config有AppID的配置,其中内容形如: ```xml <?xml version="1.0"?> <configuration> <appSettings> <!-- Change to the actual app id --> <add key="AppID" value="100004458"/> </appSettings> </configuration> ``` > 注:app.id是用来标识应用身份的唯一id,格式为string。 ### 1.2.2 Environment Apollo支持应用在不同的环境有不同的配置,所以Environment是另一个从服务器获取配置的重要信息。 Environment通过配置文件来指定,文件位置为`C:\opt\settings\server.properties`,文件内容形如: ```properties env=DEV ``` 目前,`env`支持以下几个值(大小写不敏感): * DEV * Development environment * FAT * Feature Acceptance Test environment * UAT * User Acceptance Test environment * PRO * Production environment ### 1.2.3 服务地址 Apollo客户端针对不同的环境会从不同的服务器获取配置,所以请确保在app.config或web.config正确配置了服务器地址(Apollo.{ENV}.Meta),其中内容形如: ```xml <?xml version="1.0"?> <configuration> <appSettings> <!-- Change to the actual app id --> <add key="AppID" value="100004458"/> <!-- Should change the apollo config service url for each environment --> <add key="Apollo.DEV.Meta" value="http://dev-configservice:8080"/> <add key="Apollo.FAT.Meta" value="http://fat-configservice:8080"/> <add key="Apollo.UAT.Meta" value="http://uat-configservice:8080"/> <add key="Apollo.PRO.Meta" value="http://pro-configservice:8080"/> </appSettings> </configuration> ``` ### 1.2.4 本地缓存路径 Apollo客户端会把从服务端获取到的配置在本地文件系统缓存一份,用于在遇到服务不可用,或网络不通的时候,依然能从本地恢复配置,不影响应用正常运行。 本地缓存路径位于`C:\opt\data\{appId}\config-cache`,所以请确保`C:\opt\data\`目录存在,且应用有读写权限。 ### 1.2.5 可选设置 **Cluster**(集群) Apollo支持配置按照集群划分,也就是说对于一个appId和一个环境,对不同的集群可以有不同的配置。 如果需要使用这个功能,你可以通过以下方式来指定运行时的集群: 1. 通过App Config * 我们可以在App.config文件中设置Apollo.Cluster来指定运行时集群(注意大小写) * 例如,下面的截图配置指定了运行时的集群为SomeCluster * ![apollo-net-apollo-cluster](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/apollo-net-apollo-cluster.png) 2. 通过配置文件 * 首先确保`C:\opt\settings\server.properties`在目标机器上存在 * 在这个文件中,可以设置数据中心集群,如`idc=xxx` * 注意key为全小写 **Cluster Precedence**(集群顺序) 1. 如果`Apollo.Cluster`和`idc`同时指定: * 我们会首先尝试从`Apollo.Cluster`指定的集群加载配置 * 如果没找到任何配置,会尝试从`idc`指定的集群加载配置 * 如果还是没找到,会从默认的集群(`default`)加载 2. 如果只指定了`Apollo.Cluster`: * 我们会首先尝试从`Apollo.Cluster`指定的集群加载配置 * 如果没找到,会从默认的集群(`default`)加载 3. 如果只指定了`idc`: * 我们会首先尝试从`idc`指定的集群加载配置 * 如果没找到,会从默认的集群(`default`)加载 4. 如果`Apollo.Cluster`和`idc`都没有指定: * 我们会从默认的集群(`default`)加载配置 # 二、DLL引用 .Net客户端项目地址位于:[https://github.com/ctripcorp/apollo.net](https://github.com/ctripcorp/apollo.net)。 将项目下载到本地,切换到`Release`配置,编译Solution后会在`apollo.net\Apollo\bin\Release`中生成`Framework.Apollo.Client.dll`。 在应用中引用`Framework.Apollo.Client.dll`即可。 如果需要支持.Net Core的Apollo版本,可以参考[dotnet-core](https://github.com/ctripcorp/apollo.net/tree/dotnet-core)以及[nuget仓库](https://www.nuget.org/packages?q=Com.Ctrip.Framework.Apollo) # 三、客户端用法 ## 3.1 获取默认namespace的配置(application) ```c# Config config = ConfigService.GetAppConfig(); //config instance is singleton for each namespace and is never null string someKey = "someKeyFromDefaultNamespace"; string someDefaultValue = "someDefaultValueForTheKey"; string value = config.GetProperty(someKey, someDefaultValue); ``` 通过上述的**config.GetProperty**可以获取到someKey对应的实时最新的配置值。 另外,配置值从内存中获取,所以不需要应用自己做缓存。 ## 3.2 监听配置变化事件 监听配置变化事件只在应用真的关心配置变化,需要在配置变化时得到通知时使用,比如:数据库连接串变化后需要重建连接等。 如果只是希望每次都取到最新的配置的话,只需要按照上面的例子,调用**config.GetProperty**即可。 ```c# Config config = ConfigService.GetAppConfig(); //config instance is singleton for each namespace and is never null config.ConfigChanged += new ConfigChangeEvent(OnChanged); private void OnChanged(object sender, ConfigChangeEventArgs changeEvent) { Console.WriteLine("Changes for namespace {0}", changeEvent.Namespace); foreach (string key in changeEvent.ChangedKeys) { ConfigChange change = changeEvent.GetChange(key); Console.WriteLine("Change - key: {0}, oldValue: {1}, newValue: {2}, changeType: {3}", change.PropertyName, change.OldValue, change.NewValue, change.ChangeType); } } ``` ## 3.3 获取公共Namespace的配置 ```c# string somePublicNamespace = "CAT"; Config config = ConfigService.GetConfig(somePublicNamespace); //config instance is singleton for each namespace and is never null string someKey = "someKeyFromPublicNamespace"; string someDefaultValue = "someDefaultValueForTheKey"; string value = config.GetProperty(someKey, someDefaultValue); ``` ## 3.4 Demo apollo.net项目中有一个样例客户端的项目:`ApolloDemo`,具体信息可以参考[Apollo开发指南](zh/development/apollo-development-guide)中的[2.4 .Net样例客户端启动](zh/development/apollo-development-guide?id=_24-net样例客户端启动)部分。 >注:Apollo .Net客户端开源版目前默认会把日志直接输出到Console,大家可以自己实现Logging相关功能。 > > 详见[https://github.com/ctripcorp/apollo.net/tree/master/Apollo/Logging/Spi](https://github.com/ctripcorp/apollo.net/tree/master/Apollo/Logging/Spi) # 四、客户端设计 ![client-architecture](https://github.com/ctripcorp/apollo/raw/master/doc/images/client-architecture.png) 上图简要描述了Apollo客户端的实现原理: 1. 客户端和服务端保持了一个长连接,从而能第一时间获得配置更新的推送。(通过Http Long Polling实现) 2. 客户端还会定时从Apollo配置中心服务端拉取应用的最新配置。 * 这是一个fallback机制,为了防止推送机制失效导致配置不更新 * 客户端定时拉取会上报本地版本,所以一般情况下,对于定时拉取的操作,服务端都会返回304 - Not Modified * 定时频率默认为每5分钟拉取一次,客户端也可以通过App.config设置`Apollo.RefreshInterval`来覆盖,单位为毫秒。 3. 客户端从Apollo配置中心服务端获取到应用的最新配置后,会保存在内存中 4. 客户端会把从服务端获取到的配置在本地文件系统缓存一份 * 在遇到服务不可用,或网络不通的时候,依然能从本地恢复配置 5. 应用程序可以从Apollo客户端获取最新的配置、订阅配置更新通知 # 五、本地开发模式 Apollo客户端还支持本地开发模式,这个主要用于当开发环境无法连接Apollo服务器的时候,比如在邮轮、飞机上做相关功能开发。 在本地开发模式下,Apollo只会从本地文件读取配置信息,不会从Apollo服务器读取配置。 可以通过下面的步骤开启Apollo本地开发模式。 ## 5.1 修改环境 修改C:\opt\settings\server.properties文件,设置env为Local: ```properties env=Local ``` ## 5.2 准备本地配置文件 在本地开发模式下,Apollo客户端会从本地读取文件,所以我们需要事先准备好配置文件。 ### 5.2.1 本地配置目录 本地配置目录位于:C:\opt\data\\{_appId_}\config-cache。 appId就是应用的appId,如100004458。 请确保该目录存在,且应用程序对该目录有读权限。 **【小技巧】** 推荐的方式是先在普通模式下使用Apollo,这样Apollo会自动创建该目录并在目录下生成配置文件。 ### 5.2.2 本地配置文件 本地配置文件需要按照一定的文件名格式放置于本地配置目录下,文件名格式如下: **_{appId}+{cluster}+{namespace}.json_** * appId就是应用自己的appId,如100004458 * cluster就是应用使用的集群,一般在本地模式下没有做过配置的话,就是default * namespace就是应用使用配置namespace,一般是application ![client-local-cache](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/apollo-net-config-cache.png) 文件内容以json格式存储,比如如果有两个key,一个是request.timeout,另一个是batch,那么文件内容就是如下格式: ```json { "request.timeout":"1000", "batch":"2000" } ``` ## 5.3 修改配置 在本地开发模式下,Apollo不会实时监测文件内容是否有变化,所以如果修改了配置,需要重启应用生效。
>注意:本文档适用对象是Apollo系统的使用者,如果你是公司内Apollo系统的开发者/维护人员,建议先参考[Apollo开发指南](zh/development/apollo-development-guide)。 # &nbsp; # 一、准备工作 ## 1.1 环境要求 * .Net: 4.0+ ## 1.2 必选设置 Apollo客户端依赖于`AppId`,`Environment`等环境信息来工作,所以请确保阅读下面的说明并且做正确的配置: ### 1.2.1 AppId AppId是应用的身份信息,是从服务端获取配置的一个重要信息。 请确保在app.config或web.config有AppID的配置,其中内容形如: ```xml <?xml version="1.0"?> <configuration> <appSettings> <!-- Change to the actual app id --> <add key="AppID" value="100004458"/> </appSettings> </configuration> ``` > 注:app.id是用来标识应用身份的唯一id,格式为string。 ### 1.2.2 Environment Apollo支持应用在不同的环境有不同的配置,所以Environment是另一个从服务器获取配置的重要信息。 Environment通过配置文件来指定,文件位置为`C:\opt\settings\server.properties`,文件内容形如: ```properties env=DEV ``` 目前,`env`支持以下几个值(大小写不敏感): * DEV * Development environment * FAT * Feature Acceptance Test environment * UAT * User Acceptance Test environment * PRO * Production environment ### 1.2.3 服务地址 Apollo客户端针对不同的环境会从不同的服务器获取配置,所以请确保在app.config或web.config正确配置了服务器地址(Apollo.{ENV}.Meta),其中内容形如: ```xml <?xml version="1.0"?> <configuration> <appSettings> <!-- Change to the actual app id --> <add key="AppID" value="100004458"/> <!-- Should change the apollo config service url for each environment --> <add key="Apollo.DEV.Meta" value="http://dev-configservice:8080"/> <add key="Apollo.FAT.Meta" value="http://fat-configservice:8080"/> <add key="Apollo.UAT.Meta" value="http://uat-configservice:8080"/> <add key="Apollo.PRO.Meta" value="http://pro-configservice:8080"/> </appSettings> </configuration> ``` ### 1.2.4 本地缓存路径 Apollo客户端会把从服务端获取到的配置在本地文件系统缓存一份,用于在遇到服务不可用,或网络不通的时候,依然能从本地恢复配置,不影响应用正常运行。 本地缓存路径位于`C:\opt\data\{appId}\config-cache`,所以请确保`C:\opt\data\`目录存在,且应用有读写权限。 ### 1.2.5 可选设置 **Cluster**(集群) Apollo支持配置按照集群划分,也就是说对于一个appId和一个环境,对不同的集群可以有不同的配置。 如果需要使用这个功能,你可以通过以下方式来指定运行时的集群: 1. 通过App Config * 我们可以在App.config文件中设置Apollo.Cluster来指定运行时集群(注意大小写) * 例如,下面的截图配置指定了运行时的集群为SomeCluster * ![apollo-net-apollo-cluster](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/apollo-net-apollo-cluster.png) 2. 通过配置文件 * 首先确保`C:\opt\settings\server.properties`在目标机器上存在 * 在这个文件中,可以设置数据中心集群,如`idc=xxx` * 注意key为全小写 **Cluster Precedence**(集群顺序) 1. 如果`Apollo.Cluster`和`idc`同时指定: * 我们会首先尝试从`Apollo.Cluster`指定的集群加载配置 * 如果没找到任何配置,会尝试从`idc`指定的集群加载配置 * 如果还是没找到,会从默认的集群(`default`)加载 2. 如果只指定了`Apollo.Cluster`: * 我们会首先尝试从`Apollo.Cluster`指定的集群加载配置 * 如果没找到,会从默认的集群(`default`)加载 3. 如果只指定了`idc`: * 我们会首先尝试从`idc`指定的集群加载配置 * 如果没找到,会从默认的集群(`default`)加载 4. 如果`Apollo.Cluster`和`idc`都没有指定: * 我们会从默认的集群(`default`)加载配置 # 二、DLL引用 .Net客户端项目地址位于:[https://github.com/ctripcorp/apollo.net](https://github.com/ctripcorp/apollo.net)。 将项目下载到本地,切换到`Release`配置,编译Solution后会在`apollo.net\Apollo\bin\Release`中生成`Framework.Apollo.Client.dll`。 在应用中引用`Framework.Apollo.Client.dll`即可。 如果需要支持.Net Core的Apollo版本,可以参考[dotnet-core](https://github.com/ctripcorp/apollo.net/tree/dotnet-core)以及[nuget仓库](https://www.nuget.org/packages?q=Com.Ctrip.Framework.Apollo) # 三、客户端用法 ## 3.1 获取默认namespace的配置(application) ```c# Config config = ConfigService.GetAppConfig(); //config instance is singleton for each namespace and is never null string someKey = "someKeyFromDefaultNamespace"; string someDefaultValue = "someDefaultValueForTheKey"; string value = config.GetProperty(someKey, someDefaultValue); ``` 通过上述的**config.GetProperty**可以获取到someKey对应的实时最新的配置值。 另外,配置值从内存中获取,所以不需要应用自己做缓存。 ## 3.2 监听配置变化事件 监听配置变化事件只在应用真的关心配置变化,需要在配置变化时得到通知时使用,比如:数据库连接串变化后需要重建连接等。 如果只是希望每次都取到最新的配置的话,只需要按照上面的例子,调用**config.GetProperty**即可。 ```c# Config config = ConfigService.GetAppConfig(); //config instance is singleton for each namespace and is never null config.ConfigChanged += new ConfigChangeEvent(OnChanged); private void OnChanged(object sender, ConfigChangeEventArgs changeEvent) { Console.WriteLine("Changes for namespace {0}", changeEvent.Namespace); foreach (string key in changeEvent.ChangedKeys) { ConfigChange change = changeEvent.GetChange(key); Console.WriteLine("Change - key: {0}, oldValue: {1}, newValue: {2}, changeType: {3}", change.PropertyName, change.OldValue, change.NewValue, change.ChangeType); } } ``` ## 3.3 获取公共Namespace的配置 ```c# string somePublicNamespace = "CAT"; Config config = ConfigService.GetConfig(somePublicNamespace); //config instance is singleton for each namespace and is never null string someKey = "someKeyFromPublicNamespace"; string someDefaultValue = "someDefaultValueForTheKey"; string value = config.GetProperty(someKey, someDefaultValue); ``` ## 3.4 Demo apollo.net项目中有一个样例客户端的项目:`ApolloDemo`,具体信息可以参考[Apollo开发指南](zh/development/apollo-development-guide)中的[2.4 .Net样例客户端启动](zh/development/apollo-development-guide?id=_24-net样例客户端启动)部分。 >注:Apollo .Net客户端开源版目前默认会把日志直接输出到Console,大家可以自己实现Logging相关功能。 > > 详见[https://github.com/ctripcorp/apollo.net/tree/master/Apollo/Logging/Spi](https://github.com/ctripcorp/apollo.net/tree/master/Apollo/Logging/Spi) # 四、客户端设计 ![client-architecture](https://github.com/ctripcorp/apollo/raw/master/doc/images/client-architecture.png) 上图简要描述了Apollo客户端的实现原理: 1. 客户端和服务端保持了一个长连接,从而能第一时间获得配置更新的推送。(通过Http Long Polling实现) 2. 客户端还会定时从Apollo配置中心服务端拉取应用的最新配置。 * 这是一个fallback机制,为了防止推送机制失效导致配置不更新 * 客户端定时拉取会上报本地版本,所以一般情况下,对于定时拉取的操作,服务端都会返回304 - Not Modified * 定时频率默认为每5分钟拉取一次,客户端也可以通过App.config设置`Apollo.RefreshInterval`来覆盖,单位为毫秒。 3. 客户端从Apollo配置中心服务端获取到应用的最新配置后,会保存在内存中 4. 客户端会把从服务端获取到的配置在本地文件系统缓存一份 * 在遇到服务不可用,或网络不通的时候,依然能从本地恢复配置 5. 应用程序可以从Apollo客户端获取最新的配置、订阅配置更新通知 # 五、本地开发模式 Apollo客户端还支持本地开发模式,这个主要用于当开发环境无法连接Apollo服务器的时候,比如在邮轮、飞机上做相关功能开发。 在本地开发模式下,Apollo只会从本地文件读取配置信息,不会从Apollo服务器读取配置。 可以通过下面的步骤开启Apollo本地开发模式。 ## 5.1 修改环境 修改C:\opt\settings\server.properties文件,设置env为Local: ```properties env=Local ``` ## 5.2 准备本地配置文件 在本地开发模式下,Apollo客户端会从本地读取文件,所以我们需要事先准备好配置文件。 ### 5.2.1 本地配置目录 本地配置目录位于:C:\opt\data\\{_appId_}\config-cache。 appId就是应用的appId,如100004458。 请确保该目录存在,且应用程序对该目录有读权限。 **【小技巧】** 推荐的方式是先在普通模式下使用Apollo,这样Apollo会自动创建该目录并在目录下生成配置文件。 ### 5.2.2 本地配置文件 本地配置文件需要按照一定的文件名格式放置于本地配置目录下,文件名格式如下: **_{appId}+{cluster}+{namespace}.json_** * appId就是应用自己的appId,如100004458 * cluster就是应用使用的集群,一般在本地模式下没有做过配置的话,就是default * namespace就是应用使用配置namespace,一般是application ![client-local-cache](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/apollo-net-config-cache.png) 文件内容以json格式存储,比如如果有两个key,一个是request.timeout,另一个是batch,那么文件内容就是如下格式: ```json { "request.timeout":"1000", "batch":"2000" } ``` ## 5.3 修改配置 在本地开发模式下,Apollo不会实时监测文件内容是否有变化,所以如果修改了配置,需要重启应用生效。
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./docs/zh/development/portal-how-to-enable-webhook-notification.md
从 1.8.0 版本开始,apollo 增加了 webhook 支持,从而可以在配置发布时触发 webhook 并告知配置发布的信息。 ## 启用方式 > 配置项统一存储在ApolloPortalDB.ServerConfig表中,也可以通过`管理员工具 - 系统参数`页面进行配置,修改完一分钟实时生效。 1. webhook.supported.envs 开启 webhook 的环境列表,多个环境以英文逗号分隔,如 ``` DEV,FAT,UAT,PRO ``` 2. config.release.webhook.service.url webhook 通知的 url 地址,需要接收 HTTP POST 请求。如有多个地址,以英文逗号分隔,如 ``` http://www.xxx.com/webhook1,http://www.xxx.com/webhook2 ``` ## Webhook 接入方式 1. URL 参数 参数名 | 参数说明 --- | --- env | 该次配置发布所在的环境 2. Request body sample ```json { "appId": "", // appId "clusterName": "", // 集群 "namespaceName": "", // namespace "operator": "", // 发布人 "releaseId": 2, // releaseId "releaseTitle": "", // releaseTitle "releaseComment": "", // releaseComment "releaseTime": "", // 发布时间 eg:2020-01-01T00:00:00.000+0800 "configuration": [ { // 发布后的全部配置,如果为灰度发布,则为灰度发布后的全部配置 "firstEntity": "", // 配置的key "secondEntity": "" // 配置的value } ], "isReleaseAbandoned": false, "previousReleaseId": 1, // 上一次正式发布的releaseId "operation": // 0-正常发布 1-配置回滚 2-灰度发布 4-全量发布 "operationContext": { // 操作设置的属性配置 "isEmergencyPublish": true/false, // 是否紧急发布 "rules": [ { // 灰度规则 "clientAppId": "", // appId "clientIpList": [ "10.0.0.2", "10.0.0.3" ] // IP列表 } ], "branchReleaseKeys": [ "", "" ] // 灰度发布的key } } ```
从 1.8.0 版本开始,apollo 增加了 webhook 支持,从而可以在配置发布时触发 webhook 并告知配置发布的信息。 ## 启用方式 > 配置项统一存储在ApolloPortalDB.ServerConfig表中,也可以通过`管理员工具 - 系统参数`页面进行配置,修改完一分钟实时生效。 1. webhook.supported.envs 开启 webhook 的环境列表,多个环境以英文逗号分隔,如 ``` DEV,FAT,UAT,PRO ``` 2. config.release.webhook.service.url webhook 通知的 url 地址,需要接收 HTTP POST 请求。如有多个地址,以英文逗号分隔,如 ``` http://www.xxx.com/webhook1,http://www.xxx.com/webhook2 ``` ## Webhook 接入方式 1. URL 参数 参数名 | 参数说明 --- | --- env | 该次配置发布所在的环境 2. Request body sample ```json { "appId": "", // appId "clusterName": "", // 集群 "namespaceName": "", // namespace "operator": "", // 发布人 "releaseId": 2, // releaseId "releaseTitle": "", // releaseTitle "releaseComment": "", // releaseComment "releaseTime": "", // 发布时间 eg:2020-01-01T00:00:00.000+0800 "configuration": [ { // 发布后的全部配置,如果为灰度发布,则为灰度发布后的全部配置 "firstEntity": "", // 配置的key "secondEntity": "" // 配置的value } ], "isReleaseAbandoned": false, "previousReleaseId": 1, // 上一次正式发布的releaseId "operation": // 0-正常发布 1-配置回滚 2-灰度发布 4-全量发布 "operationContext": { // 操作设置的属性配置 "isEmergencyPublish": true/false, // 是否紧急发布 "rules": [ { // 灰度规则 "clientAppId": "", // appId "clientIpList": [ "10.0.0.2", "10.0.0.3" ] // IP列表 } ], "branchReleaseKeys": [ "", "" ] // 灰度发布的key } } ```
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./docs/zh/development/portal-how-to-implement-user-login-function.md
Apollo是配置管理系统,会提供权限管理(Authorization),理论上是不负责用户登录认证功能的实现(Authentication)。 所以Apollo定义了一些SPI用来解耦,Apollo接入登录的关键就是实现这些SPI。 ## 实现方式一:使用Apollo提供的Spring Security简单认证 可能很多公司并没有统一的登录认证系统,如果自己实现一套会比较麻烦。Apollo针对这种情况,从0.9.0开始提供了利用Spring Security实现的Http Basic简单认证版本。 使用步骤如下: ### 1. 安装0.9.0以上版本 >如果之前是0.8.0版本,需要导入[apolloportaldb-v080-v090.sql](https://github.com/ctripcorp/apollo/blob/master/scripts/sql/delta/v080-v090/apolloportaldb-v080-v090.sql) 查看ApolloPortalDB,应该已经存在`Users`表,并有一条初始记录。初始用户名是apollo,密码是admin。 |Id|Username|Password|Email|Enabled| |-|-|-|-|-| |1|apollo|$2a$10$7r20uS.BQ9uBpf3Baj3uQOZvMVvB1RN3PYoKE94gtz2.WAOuiiwXS|[email protected]|1| ### 2. 重启Portal 如果是IDE启动的话,确保`-Dapollo_profile=github,auth` ### 3. 添加用户 超级管理员登录系统后打开`管理员工具 - 用户管理`即可添加用户。 ### 4. 修改用户密码 超级管理员登录系统后打开`管理员工具 - 用户管理`,输入用户名和密码后即可修改用户密码,建议同时修改超级管理员apollo的密码。 ## 实现方式二: 接入LDAP 从1.2.0版本开始,Apollo支持了ldap协议的登录,按照如下方式配置即可。 > 如果采用helm chart部署方式,建议通过配置方式实现,不用修改镜像,可以参考[启用 LDAP 支持](zh/deployment/distributed-deployment-guide#_241449-启用-ldap-支持) ### 1. OpenLDAP接入方式 #### 1.1 配置`application-ldap.yml` 解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-ldap.yml`,内容参考如下([样例](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/config/application-ldap-openldap-sample.yml)),相关的内容需要按照具体情况调整: ```yml spring: ldap: base: "dc=example,dc=org" username: "cn=admin,dc=example,dc=org" # 配置管理员账号,用于搜索、匹配用户 password: "password" searchFilter: "(uid={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 urls: - "ldap://localhost:389" ldap: mapping: # 配置 ldap 属性 objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置 loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id userDisplayName: "cn" # ldap 用户名,用来作为显示名 email: "mail" # ldap 邮箱属性 ``` ##### 1.1.1 基于memberOf过滤用户 OpenLDAP[开启memberOf特性](https://myanbin.github.io/post/enable-memberof-in-openldap.html)后,可以配置filter从而缩小用户搜索的范围: ```yml spring: ldap: base: "dc=example,dc=org" username: "cn=admin,dc=example,dc=org" # 配置管理员账号,用于搜索、匹配用户 password: "password" searchFilter: "(uid={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 urls: - "ldap://localhost:389" ldap: mapping: # 配置 ldap 属性 objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置 loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id userDisplayName: "cn" # ldap 用户名,用来作为显示名 email: "mail" # ldap 邮箱属性 filter: # 配置过滤,目前只支持 memberOf memberOf: "cn=ServiceDEV,ou=DEV,dc=example,dc=org|cn=WebDEV,ou=DEV,dc=example,dc=org" # 只允许 memberOf 属性为 ServiceDEV 和 WebDEV 的用户访问 ``` ##### 1.1.2 基于Group过滤用户 从1.3.0版本开始支持基于Group过滤用户,从而可以控制只有特定Group的用户可以登录和使用apollo: ```yml spring: ldap: base: "dc=example,dc=org" username: "cn=admin,dc=example,dc=org" # 配置管理员账号,用于搜索、匹配用户 password: "password" searchFilter: "(uid={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 urls: - "ldap://localhost:389" ldap: mapping: # 配置 ldap 属性 objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置 loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id rdnKey: "uid" # ldap rdn key userDisplayName: "cn" # ldap 用户名,用来作为显示名 email: "mail" # ldap 邮箱属性 group: # 启用group search,启用后只有特定group的用户可以登录apollo objectClass: "posixGroup" # 配置groupClassName groupBase: "ou=group" # group search base groupSearch: "(&(cn=dev))" # group filter groupMembership: "memberUid" # group memberShip eg. member or memberUid ``` #### 1.2 配置`startup.sh` 修改`scripts/startup.sh`,指定`spring.profiles.active`为`github,ldap`。 ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary LOG_DIR=/opt/logs/100003173 ## Adjust server port if necessary SERVER_PORT=8070 export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=github,ldap" ``` ### 2. Active Directory接入方式 #### 2.1 配置`application-ldap.yml` 解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-ldap.yml`,内容参考如下([样例](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/config/application-ldap-activedirectory-sample.yml)),相关的内容需要按照具体情况调整: ```yml 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 的用户访问 ``` #### 2.2 配置`startup.sh` 修改`scripts/startup.sh`,指定`spring.profiles.active`为`github,ldap`。 ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary LOG_DIR=/opt/logs/100003173 ## Adjust server port if necessary SERVER_PORT=8070 export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=github,ldap" ``` ### 3. ApacheDS接入方式 #### 3.1 配置`application-ldap.yml` 解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-ldap.yml`,内容参考如下([样例](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/config/application-ldap-apacheds-sample.yml)),相关的内容需要按照具体情况调整: ```yml spring: ldap: base: "dc=example,dc=com" username: "uid=admin,ou=system" # 配置管理员账号,用于搜索、匹配用户 password: "password" searchFilter: "(uid={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 urls: - "ldap://localhost:10389" ldap: mapping: # 配置 ldap 属性 objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置 loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id userDisplayName: "displayName" # ldap 用户名,用来作为显示名 email: "mail" # ldap 邮箱属性 ``` ##### 3.1.1 基于Group过滤用户 从1.3.0版本开始支持基于Group过滤用户,从而可以控制只有特定Group的用户可以登录和使用apollo: ```yml spring: ldap: base: "dc=example,dc=com" username: "uid=admin,ou=system" # 配置管理员账号,用于搜索、匹配用户 password: "password" searchFilter: "(uid={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 urls: - "ldap://localhost:10389" ldap: mapping: # 配置 ldap 属性 objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置 loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id rdnKey: "cn" # ldap rdn key userDisplayName: "displayName" # ldap 用户名,用来作为显示名 email: "mail" # ldap 邮箱属性 group: # 配置ldap group,启用后只有特定group的用户可以登录apollo objectClass: "groupOfNames" # 配置groupClassName groupBase: "ou=group" # group search base groupSearch: "(&(cn=dev))" # group filter groupMembership: "member" # group memberShip eg. member or memberUid ``` #### 3.2 配置`startup.sh` 修改`scripts/startup.sh`,指定`spring.profiles.active`为`github,ldap`。 ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary LOG_DIR=/opt/logs/100003173 ## Adjust server port if necessary SERVER_PORT=8070 export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=github,ldap" ``` ## 实现方式三: 接入OIDC 从 1.8.0 版本开始支持 OpenID Connect 登录, 这种实现方式的前提是已经部署了 OpenID Connect 登录服务 配置前需要准备: * OpenID Connect 的提供者配置端点(符合 RFC 8414 标准的 issuer-uri), 需要是 **https** 的, 例如 https://host:port/auth/realms/apollo/.well-known/openid-configuration * 在 OpenID Connect 服务里创建一个 client, 获取 client-id 以及对应的 client-secret ### 1. 配置 `application-oidc.yml` 解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-oidc.yml`,内容参考如下([样例](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/config/application-oidc-sample.yml)),相关的内容需要按照具体情况调整: #### 1.1 最小配置 ```yml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri # 例如 你的 issuer-uri 是 https://host:port/auth/realms/apollo/.well-known/openid-configuration, 那么此处只需要配置 https://host:port/auth/realms/apollo 即可, spring boot 处理的时候会加上 /.well-known/openid-configuration 的后缀 issuer-uri: https://host:port/auth/realms/apollo registration: # registration-name 是 oidc 客户端的名称, 任意字符均可, oidc 登录必须配置一个 authorization_code 类型的 registration registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name # openid 为 oidc 登录的必须 scope, 此处可以添加其它自定义的 scope scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 从安全角度考虑更推荐使用环境变量来配置, 环境变量的命名规则为: 将配置项的 key 当中的 点(.)、横杠(-)替换为下划线(_), 然后将所有字母改为大写, spring boot 会自动处理符合此规则的环境变量 # 例如 spring.security.oauth2.client.registration.registration-name.client-secret -> SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 可以替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx ``` #### 1.2 扩展配置 * 如果 OpenID Connect 登录服务支持 client_credentials 模式, 还可以再配置一个 client_credentials 类型的 registration, 用于 apollo-portal 作为客户端请求其它被 oidc 保护的资源 * 如果 OpenID Connect 登录服务支持 jwt, 还可以配置 ${spring.security.oauth2.resourceserver.jwt.issuer-uri}, 以支持通过 jwt 访问 apollo-portal ```yml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可, oidc 登录必须配置一个 authorization_code 类型的 registration registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name # openid 为 oidc 登录的必须 scope, 此处可以添加其它自定义的 scope scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 从安全角度考虑更推荐使用环境变量来配置, 环境变量的命名规则为: 将配置项的 key 当中的 点(.)、横杠(-)替换为下划线(_), 然后将所有字母改为大写, spring boot 会自动处理符合此规则的环境变量 # 例如 spring.security.oauth2.client.registration.registration-name.client-secret -> SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 可以替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 用于 apollo-portal 作为客户端请求其它被 oidc 保护的资源, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name # openid 为 oidc 登录的必须 scope, 此处可以添加其它自定义的 scope scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri # 例如 你的 issuer-uri 是 https://host:port/auth/realms/apollo/.well-known/openid-configuration, 那么此处只需要配置 https://host:port/auth/realms/apollo 即可, spring boot 处理的时候会自动加上 /.well-known/openid-configuration 的后缀 issuer-uri: https://host:port/auth/realms/apollo ``` ### 2. 配置 `startup.sh` 修改`scripts/startup.sh`,指定`spring.profiles.active`为`github,oidc`。 ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary LOG_DIR=/opt/logs/100003173 ## Adjust server port if necessary SERVER_PORT=8070 export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=github,oidc" ``` ## 实现方式四: 接入公司的统一登录认证系统 这种实现方式的前提是公司已经有统一的登录认证系统,最常见的比如SSO、LDAP等。接入时,实现以下SPI。其中UserService和UserInfoHolder是必须要实现的。 接口说明如下: * UserService(Required):用户服务,用来给Portal提供用户搜索相关功能 * UserInfoHolder(Required):获取当前登录用户信息,SSO一般都是把当前登录用户信息放在线程ThreadLocal上 * LogoutHandler(Optional):用来实现登出功能 * SsoHeartbeatHandler(Optional):Portal页面如果长时间不刷新,登录信息会过期。通过此接口来刷新登录信息 可以参考apollo-portal下的[com.ctrip.framework.apollo.portal.spi](https://github.com/ctripcorp/apollo/tree/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi)这个包下面的四个实现: 1. defaultimpl:默认实现,全局只有apollo一个账号 2. ctrip:ctrip实现,接入了SSO并实现用户搜索、查询接口 3. springsecurity: spring security实现,可以新增用户,修改用户密码等 4. ldap: [@pandalin](https://github.com/pandalin)和[codepiano](https://github.com/codepiano)贡献的ldap实现 实现了相关接口后,可以通过[com.ctrip.framework.apollo.portal.configuration.AuthConfiguration](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java)在运行时替换默认的实现。 接入SSO的思路如下: 1. SSO会提供一个jar包,需要配置一个filter 2. filter会拦截所有请求,检查是否已经登录 3. 如果没有登录,那么就会跳转到SSO的登录页面 4. 在SSO登录页面登录成功后,会跳转回apollo的页面,带上认证的信息 5. 再次进入SSO的filter,校验认证信息,把用户的信息保存下来,并且把用户凭证写入cookie或分布式session,以免下次还要重新登录 6. 进入Apollo的代码,Apollo的代码会调用UserInfoHolder.getUser获取当前登录用户 注意,以上1-5这几步都是SSO的代码,不是Apollo的代码,Apollo的代码只需要你实现第6步。 >注:运行时使用不同的实现是通过[Profiles](http://docs.spring.io/autorepo/docs/spring-boot/current/reference/html/boot-features-profiles.html)实现的,比如你自己的sso实现是在`custom` profile中的话,在打包脚本中可以指定-Dapollo_profile=github,custom。其中`github`是Apollo必须的一个profile,用于数据库的配置,`custom`是你自己实现的profile。同时需要注意在[AuthConfiguration](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java)中修改默认实现的条件 ,从`@ConditionalOnMissingProfile({"ctrip", "auth", "ldap"})`改为`@ConditionalOnMissingProfile({"ctrip", "auth", "ldap", "custom"})`。
Apollo是配置管理系统,会提供权限管理(Authorization),理论上是不负责用户登录认证功能的实现(Authentication)。 所以Apollo定义了一些SPI用来解耦,Apollo接入登录的关键就是实现这些SPI。 ## 实现方式一:使用Apollo提供的Spring Security简单认证 可能很多公司并没有统一的登录认证系统,如果自己实现一套会比较麻烦。Apollo针对这种情况,从0.9.0开始提供了利用Spring Security实现的Http Basic简单认证版本。 使用步骤如下: ### 1. 安装0.9.0以上版本 >如果之前是0.8.0版本,需要导入[apolloportaldb-v080-v090.sql](https://github.com/ctripcorp/apollo/blob/master/scripts/sql/delta/v080-v090/apolloportaldb-v080-v090.sql) 查看ApolloPortalDB,应该已经存在`Users`表,并有一条初始记录。初始用户名是apollo,密码是admin。 |Id|Username|Password|Email|Enabled| |-|-|-|-|-| |1|apollo|$2a$10$7r20uS.BQ9uBpf3Baj3uQOZvMVvB1RN3PYoKE94gtz2.WAOuiiwXS|[email protected]|1| ### 2. 重启Portal 如果是IDE启动的话,确保`-Dapollo_profile=github,auth` ### 3. 添加用户 超级管理员登录系统后打开`管理员工具 - 用户管理`即可添加用户。 ### 4. 修改用户密码 超级管理员登录系统后打开`管理员工具 - 用户管理`,输入用户名和密码后即可修改用户密码,建议同时修改超级管理员apollo的密码。 ## 实现方式二: 接入LDAP 从1.2.0版本开始,Apollo支持了ldap协议的登录,按照如下方式配置即可。 > 如果采用helm chart部署方式,建议通过配置方式实现,不用修改镜像,可以参考[启用 LDAP 支持](zh/deployment/distributed-deployment-guide#_241449-启用-ldap-支持) ### 1. OpenLDAP接入方式 #### 1.1 配置`application-ldap.yml` 解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-ldap.yml`,内容参考如下([样例](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/config/application-ldap-openldap-sample.yml)),相关的内容需要按照具体情况调整: ```yml spring: ldap: base: "dc=example,dc=org" username: "cn=admin,dc=example,dc=org" # 配置管理员账号,用于搜索、匹配用户 password: "password" searchFilter: "(uid={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 urls: - "ldap://localhost:389" ldap: mapping: # 配置 ldap 属性 objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置 loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id userDisplayName: "cn" # ldap 用户名,用来作为显示名 email: "mail" # ldap 邮箱属性 ``` ##### 1.1.1 基于memberOf过滤用户 OpenLDAP[开启memberOf特性](https://myanbin.github.io/post/enable-memberof-in-openldap.html)后,可以配置filter从而缩小用户搜索的范围: ```yml spring: ldap: base: "dc=example,dc=org" username: "cn=admin,dc=example,dc=org" # 配置管理员账号,用于搜索、匹配用户 password: "password" searchFilter: "(uid={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 urls: - "ldap://localhost:389" ldap: mapping: # 配置 ldap 属性 objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置 loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id userDisplayName: "cn" # ldap 用户名,用来作为显示名 email: "mail" # ldap 邮箱属性 filter: # 配置过滤,目前只支持 memberOf memberOf: "cn=ServiceDEV,ou=DEV,dc=example,dc=org|cn=WebDEV,ou=DEV,dc=example,dc=org" # 只允许 memberOf 属性为 ServiceDEV 和 WebDEV 的用户访问 ``` ##### 1.1.2 基于Group过滤用户 从1.3.0版本开始支持基于Group过滤用户,从而可以控制只有特定Group的用户可以登录和使用apollo: ```yml spring: ldap: base: "dc=example,dc=org" username: "cn=admin,dc=example,dc=org" # 配置管理员账号,用于搜索、匹配用户 password: "password" searchFilter: "(uid={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 urls: - "ldap://localhost:389" ldap: mapping: # 配置 ldap 属性 objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置 loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id rdnKey: "uid" # ldap rdn key userDisplayName: "cn" # ldap 用户名,用来作为显示名 email: "mail" # ldap 邮箱属性 group: # 启用group search,启用后只有特定group的用户可以登录apollo objectClass: "posixGroup" # 配置groupClassName groupBase: "ou=group" # group search base groupSearch: "(&(cn=dev))" # group filter groupMembership: "memberUid" # group memberShip eg. member or memberUid ``` #### 1.2 配置`startup.sh` 修改`scripts/startup.sh`,指定`spring.profiles.active`为`github,ldap`。 ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary LOG_DIR=/opt/logs/100003173 ## Adjust server port if necessary SERVER_PORT=8070 export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=github,ldap" ``` ### 2. Active Directory接入方式 #### 2.1 配置`application-ldap.yml` 解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-ldap.yml`,内容参考如下([样例](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/config/application-ldap-activedirectory-sample.yml)),相关的内容需要按照具体情况调整: ```yml 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 的用户访问 ``` #### 2.2 配置`startup.sh` 修改`scripts/startup.sh`,指定`spring.profiles.active`为`github,ldap`。 ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary LOG_DIR=/opt/logs/100003173 ## Adjust server port if necessary SERVER_PORT=8070 export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=github,ldap" ``` ### 3. ApacheDS接入方式 #### 3.1 配置`application-ldap.yml` 解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-ldap.yml`,内容参考如下([样例](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/config/application-ldap-apacheds-sample.yml)),相关的内容需要按照具体情况调整: ```yml spring: ldap: base: "dc=example,dc=com" username: "uid=admin,ou=system" # 配置管理员账号,用于搜索、匹配用户 password: "password" searchFilter: "(uid={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 urls: - "ldap://localhost:10389" ldap: mapping: # 配置 ldap 属性 objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置 loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id userDisplayName: "displayName" # ldap 用户名,用来作为显示名 email: "mail" # ldap 邮箱属性 ``` ##### 3.1.1 基于Group过滤用户 从1.3.0版本开始支持基于Group过滤用户,从而可以控制只有特定Group的用户可以登录和使用apollo: ```yml spring: ldap: base: "dc=example,dc=com" username: "uid=admin,ou=system" # 配置管理员账号,用于搜索、匹配用户 password: "password" searchFilter: "(uid={0})" # 用户过滤器,登录的时候用这个过滤器来搜索用户 urls: - "ldap://localhost:10389" ldap: mapping: # 配置 ldap 属性 objectClass: "inetOrgPerson" # ldap 用户 objectClass 配置 loginId: "uid" # ldap 用户惟一 id,用来作为登录的 id rdnKey: "cn" # ldap rdn key userDisplayName: "displayName" # ldap 用户名,用来作为显示名 email: "mail" # ldap 邮箱属性 group: # 配置ldap group,启用后只有特定group的用户可以登录apollo objectClass: "groupOfNames" # 配置groupClassName groupBase: "ou=group" # group search base groupSearch: "(&(cn=dev))" # group filter groupMembership: "member" # group memberShip eg. member or memberUid ``` #### 3.2 配置`startup.sh` 修改`scripts/startup.sh`,指定`spring.profiles.active`为`github,ldap`。 ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary LOG_DIR=/opt/logs/100003173 ## Adjust server port if necessary SERVER_PORT=8070 export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=github,ldap" ``` ## 实现方式三: 接入OIDC 从 1.8.0 版本开始支持 OpenID Connect 登录, 这种实现方式的前提是已经部署了 OpenID Connect 登录服务 配置前需要准备: * OpenID Connect 的提供者配置端点(符合 RFC 8414 标准的 issuer-uri), 需要是 **https** 的, 例如 https://host:port/auth/realms/apollo/.well-known/openid-configuration * 在 OpenID Connect 服务里创建一个 client, 获取 client-id 以及对应的 client-secret ### 1. 配置 `application-oidc.yml` 解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-oidc.yml`,内容参考如下([样例](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/config/application-oidc-sample.yml)),相关的内容需要按照具体情况调整: #### 1.1 最小配置 ```yml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri # 例如 你的 issuer-uri 是 https://host:port/auth/realms/apollo/.well-known/openid-configuration, 那么此处只需要配置 https://host:port/auth/realms/apollo 即可, spring boot 处理的时候会加上 /.well-known/openid-configuration 的后缀 issuer-uri: https://host:port/auth/realms/apollo registration: # registration-name 是 oidc 客户端的名称, 任意字符均可, oidc 登录必须配置一个 authorization_code 类型的 registration registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name # openid 为 oidc 登录的必须 scope, 此处可以添加其它自定义的 scope scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 从安全角度考虑更推荐使用环境变量来配置, 环境变量的命名规则为: 将配置项的 key 当中的 点(.)、横杠(-)替换为下划线(_), 然后将所有字母改为大写, spring boot 会自动处理符合此规则的环境变量 # 例如 spring.security.oauth2.client.registration.registration-name.client-secret -> SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 可以替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx ``` #### 1.2 扩展配置 * 如果 OpenID Connect 登录服务支持 client_credentials 模式, 还可以再配置一个 client_credentials 类型的 registration, 用于 apollo-portal 作为客户端请求其它被 oidc 保护的资源 * 如果 OpenID Connect 登录服务支持 jwt, 还可以配置 ${spring.security.oauth2.resourceserver.jwt.issuer-uri}, 以支持通过 jwt 访问 apollo-portal ```yml spring: security: oauth2: client: provider: # provider-name 是 oidc 提供者的名称, 任意字符均可, registration 的配置需要用到这个名称 provider-name: # 必须是 https, oidc 的 issuer-uri, 和 jwt 的 issuer-uri 一致的话直接引用即可, 也可以单独设置 issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri} registration: # registration-name 是 oidc 客户端的名称, 任意字符均可, oidc 登录必须配置一个 authorization_code 类型的 registration registration-name: # oidc 登录必须配置一个 authorization_code 类型的 registration authorization-grant-type: authorization_code client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name # openid 为 oidc 登录的必须 scope, 此处可以添加其它自定义的 scope scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider # 从安全角度考虑更推荐使用环境变量来配置, 环境变量的命名规则为: 将配置项的 key 当中的 点(.)、横杠(-)替换为下划线(_), 然后将所有字母改为大写, spring boot 会自动处理符合此规则的环境变量 # 例如 spring.security.oauth2.client.registration.registration-name.client-secret -> SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_NAME_VDISK_CLIENT_SECRET (REGISTRATION_NAME 可以替换为自定义的 oidc 客户端的名称) client-secret: d43c91c0-xxxx-xxxx-xxxx-xxxxxxxxxxxx # registration-name-client 是 oidc 客户端的名称, 任意字符均可, client_credentials 类型的 registration 为选填项, 可以不配置 registration-name-client: # client_credentials 类型的 registration 为选填项, 用于 apollo-portal 作为客户端请求其它被 oidc 保护的资源, 可以不配置 authorization-grant-type: client_credentials client-authentication-method: basic # client-id 是在 oidc 提供者处配置的客户端ID, 用于登录 provider client-id: apollo-portal # provider 的名称, 需要和上面配置的 provider 名称保持一致 provider: provider-name # openid 为 oidc 登录的必须 scope, 此处可以添加其它自定义的 scope scope: - openid # client-secret 是在 oidc 提供者处配置的客户端密码, 用于登录 provider, 多个 registration 的密码如果一致可以直接引用 client-secret: ${spring.security.oauth2.client.registration.registration-name.client-secret} resourceserver: jwt: # 必须是 https, jwt 的 issuer-uri # 例如 你的 issuer-uri 是 https://host:port/auth/realms/apollo/.well-known/openid-configuration, 那么此处只需要配置 https://host:port/auth/realms/apollo 即可, spring boot 处理的时候会自动加上 /.well-known/openid-configuration 的后缀 issuer-uri: https://host:port/auth/realms/apollo ``` ### 2. 配置 `startup.sh` 修改`scripts/startup.sh`,指定`spring.profiles.active`为`github,oidc`。 ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary LOG_DIR=/opt/logs/100003173 ## Adjust server port if necessary SERVER_PORT=8070 export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=github,oidc" ``` ## 实现方式四: 接入公司的统一登录认证系统 这种实现方式的前提是公司已经有统一的登录认证系统,最常见的比如SSO、LDAP等。接入时,实现以下SPI。其中UserService和UserInfoHolder是必须要实现的。 接口说明如下: * UserService(Required):用户服务,用来给Portal提供用户搜索相关功能 * UserInfoHolder(Required):获取当前登录用户信息,SSO一般都是把当前登录用户信息放在线程ThreadLocal上 * LogoutHandler(Optional):用来实现登出功能 * SsoHeartbeatHandler(Optional):Portal页面如果长时间不刷新,登录信息会过期。通过此接口来刷新登录信息 可以参考apollo-portal下的[com.ctrip.framework.apollo.portal.spi](https://github.com/ctripcorp/apollo/tree/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi)这个包下面的四个实现: 1. defaultimpl:默认实现,全局只有apollo一个账号 2. ctrip:ctrip实现,接入了SSO并实现用户搜索、查询接口 3. springsecurity: spring security实现,可以新增用户,修改用户密码等 4. ldap: [@pandalin](https://github.com/pandalin)和[codepiano](https://github.com/codepiano)贡献的ldap实现 实现了相关接口后,可以通过[com.ctrip.framework.apollo.portal.configuration.AuthConfiguration](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java)在运行时替换默认的实现。 接入SSO的思路如下: 1. SSO会提供一个jar包,需要配置一个filter 2. filter会拦截所有请求,检查是否已经登录 3. 如果没有登录,那么就会跳转到SSO的登录页面 4. 在SSO登录页面登录成功后,会跳转回apollo的页面,带上认证的信息 5. 再次进入SSO的filter,校验认证信息,把用户的信息保存下来,并且把用户凭证写入cookie或分布式session,以免下次还要重新登录 6. 进入Apollo的代码,Apollo的代码会调用UserInfoHolder.getUser获取当前登录用户 注意,以上1-5这几步都是SSO的代码,不是Apollo的代码,Apollo的代码只需要你实现第6步。 >注:运行时使用不同的实现是通过[Profiles](http://docs.spring.io/autorepo/docs/spring-boot/current/reference/html/boot-features-profiles.html)实现的,比如你自己的sso实现是在`custom` profile中的话,在打包脚本中可以指定-Dapollo_profile=github,custom。其中`github`是Apollo必须的一个profile,用于数据库的配置,`custom`是你自己实现的profile。同时需要注意在[AuthConfiguration](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java)中修改默认实现的条件 ,从`@ConditionalOnMissingProfile({"ctrip", "auth", "ldap"})`改为`@ConditionalOnMissingProfile({"ctrip", "auth", "ldap", "custom"})`。
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./docs/zh/deployment/quick-start.md
为了让大家更快的上手了解Apollo配置中心,我们这里准备了一个Quick Start,能够在几分钟内在本地环境部署、启动Apollo配置中心。 考虑到Docker的便捷性,我们还提供了Quick Start的Docker版本,如果你对Docker比较熟悉的话,可以参考[Apollo Quick Start Docker部署](zh/deployment/quick-start-docker)通过Docker快速部署Apollo。 不过这里需要注意的是,Quick Start只针对本地测试使用,如果要部署到生产环境,还请另行参考[分布式部署指南](zh/deployment/distributed-deployment-guide)。 > 注:Quick Start需要有bash环境,Windows用户请安装[Git Bash](https://git-for-windows.github.io/),建议使用最新版本,老版本可能会遇到未知问题。也可以直接通过IDE环境启动,详见[Apollo开发指南](zh/development/apollo-development-guide)。 # &nbsp; # 一、准备工作 ## 1.1 Java * Apollo服务端:1.8+ * Apollo客户端:1.7+ 由于Quick Start会在本地同时启动服务端和客户端,所以需要在本地安装Java 1.8+。 在配置好后,可以通过如下命令检查: ```sh java -version ``` 样例输出: ```sh java version "1.8.0_74" Java(TM) SE Runtime Environment (build 1.8.0_74-b02) Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode) ``` Windows用户请确保JAVA_HOME环境变量已经设置。 ## 1.2 MySQL * 版本要求:5.6.5+ Apollo的表结构对`timestamp`使用了多个default声明,所以需要5.6.5以上版本。 连接上MySQL后,可以通过如下命令检查: ```sql SHOW VARIABLES WHERE Variable_name = 'version'; ``` | Variable_name | Value | |---------------|--------| | version | 5.7.11 | ## 1.3 下载Quick Start安装包 我们准备好了一个Quick Start安装包,大家只需要下载到本地,就可以直接使用,免去了编译、打包过程。 安装包共50M,如果访问github网速不给力的话,可以从百度网盘下载。 1. 从Github下载 * checkout或下载[apollo-build-scripts项目](https://github.com/nobodyiam/apollo-build-scripts) * **由于Quick Start项目比较大,所以放在了另外的repository,请注意项目地址** * https://github.com/nobodyiam/apollo-build-scripts 2. 从百度网盘下载 * 通过[网盘链接](https://pan.baidu.com/s/1Ieelw6y3adECgktO0ea0Gg)下载,提取码: 9wwe * 下载到本地后,在本地解压apollo-quick-start.zip 3. 为啥安装包要58M这么大? * 因为这是一个可以自启动的jar包,里面包含了所有依赖jar包以及一个内置的tomcat容器 ### 1.3.1 手动打包Quick Start安装包 Quick Start只针对本地测试使用,所以一般用户不需要自己下载源码打包,只需要下载已经打好的包即可。不过也有部分用户希望在修改代码后重新打包,那么可以参考如下步骤: 1. 修改apollo-configservice, apollo-adminservice和apollo-portal的pom.xml,注释掉spring-boot-maven-plugin和maven-assembly-plugin 2. 在根目录下执行`mvn clean package -pl apollo-assembly -am -DskipTests=true` 3. 复制apollo-assembly/target下的jar包,rename为apollo-all-in-one.jar # 二、安装步骤 ## 2.1 创建数据库 Apollo服务端共需要两个数据库:`ApolloPortalDB`和`ApolloConfigDB`,我们把数据库、表的创建和样例数据都分别准备了sql文件,只需要导入数据库即可。 > 注意:如果你本地已经创建过Apollo数据库,请注意备份数据。我们准备的sql文件会清空Apollo相关的表。 ### 2.1.1 创建ApolloPortalDB 通过各种MySQL客户端导入[sql/apolloportaldb.sql](https://github.com/nobodyiam/apollo-build-scripts/blob/master/sql/apolloportaldb.sql)即可。 下面以MySQL原生客户端为例: ```sql source /your_local_path/sql/apolloportaldb.sql ``` 导入成功后,可以通过执行以下sql语句来验证: ```sql select `Id`, `AppId`, `Name` from ApolloPortalDB.App; ``` | Id | AppId | Name | |----|-----------|------------| | 1 | SampleApp | Sample App | ### 2.1.2 创建ApolloConfigDB 通过各种MySQL客户端导入[sql/apolloconfigdb.sql](https://github.com/nobodyiam/apollo-build-scripts/blob/master/sql/apolloconfigdb.sql)即可。 下面以MySQL原生客户端为例: ```sql source /your_local_path/sql/apolloconfigdb.sql ``` 导入成功后,可以通过执行以下sql语句来验证: ```sql select `NamespaceId`, `Key`, `Value`, `Comment` from ApolloConfigDB.Item; ``` | NamespaceId | Key | Value | Comment | |-------------|---------|-------|--------------------| | 1 | timeout | 100 | sample timeout配置 | ## 2.2 配置数据库连接信息 Apollo服务端需要知道如何连接到你前面创建的数据库,所以需要编辑[demo.sh](https://github.com/nobodyiam/apollo-build-scripts/blob/master/demo.sh),修改ApolloPortalDB和ApolloConfigDB相关的数据库连接串信息。 > 注意:填入的用户需要具备对ApolloPortalDB和ApolloConfigDB数据的读写权限。 ```sh #apollo config db info apollo_config_db_url="jdbc:mysql://localhost:3306/ApolloConfigDB?characterEncoding=utf8&serverTimezone=Asia/Shanghai" apollo_config_db_username=用户名 apollo_config_db_password=密码(如果没有密码,留空即可) # apollo portal db info apollo_portal_db_url="jdbc:mysql://localhost:3306/ApolloPortalDB?characterEncoding=utf8&serverTimezone=Asia/Shanghai" apollo_portal_db_username=用户名 apollo_portal_db_password=密码(如果没有密码,留空即可) ``` > 注意:不要修改demo.sh的其它部分 # 三、启动Apollo配置中心 ## 3.1 确保端口未被占用 Quick Start脚本会在本地启动3个服务,分别使用8070, 8080, 8090端口,请确保这3个端口当前没有被使用。 例如,在Linux/Mac下,可以通过如下命令检查: ```sh lsof -i:8080 ``` ## 3.2 执行启动脚本 ```sh ./demo.sh start ``` 当看到如下输出后,就说明启动成功了! ```sh ==== starting service ==== Service logging file is ./service/apollo-service.log Started [10768] Waiting for config service startup....... Config service started. You may visit http://localhost:8080 for service status now! Waiting for admin service startup.... Admin service started ==== starting portal ==== Portal logging file is ./portal/apollo-portal.log Started [10846] Waiting for portal startup...... Portal started. You can visit http://localhost:8070 now! ``` ## 3.3 异常排查 如果启动遇到了异常,可以分别查看service和portal目录下的log文件排查问题。 > 注:在启动apollo-configservice的过程中会在日志中输出eureka注册失败的信息,如`com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused`。需要注意的是,这个是预期的情况,因为apollo-configservice需要向Meta Server(它自己)注册服务,但是因为在启动过程中,自己还没起来,所以会报这个错。后面会进行重试的动作,所以等自己服务起来后就会注册正常了。 ## 3.4 注意 Quick Start只是用来帮助大家快速体验Apollo项目,具体实际使用时请参考:[分布式部署指南](zh/deployment/distributed-deployment-guide)。 另外需要注意的是Quick Start不支持增加环境,只有通过分布式部署才可以新增环境,同样请参考:[分布式部署指南](zh/deployment/distributed-deployment-guide) # 四、使用Apollo配置中心 ## 4.1 使用样例项目 ### 4.1.1 查看样例配置 1. 打开http://localhost:8070 > Quick Start集成了[Spring Security简单认证](zh/development/portal-how-to-implement-user-login-function#实现方式一:使用apollo提供的spring-security简单认证),更多信息可以参考[Portal 实现用户登录功能](zh/development/portal-how-to-implement-user-login-function) <img src="https://github.com/nobodyiam/apollo-build-scripts/raw/master/images/apollo-login.png" alt="登录" width="640px"> 2. 输入用户名apollo,密码admin后登录 ![首页](https://raw.githubusercontent.com/nobodyiam/apollo-build-scripts/master/images/apollo-sample-home.png) 3. 点击SampleApp进入配置界面,可以看到当前有一个配置timeout=100 ![配置界面](https://raw.githubusercontent.com/nobodyiam/apollo-build-scripts/master/images/sample-app-config.png) > 如果提示`系统出错,请重试或联系系统负责人`,请稍后几秒钟重试一下,因为通过Eureka注册的服务有一个刷新的延时。 ### 4.1.2 运行客户端程序 我们准备了一个简单的[Demo客户端](https://github.com/ctripcorp/apollo/blob/master/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/api/SimpleApolloConfigDemo.java)来演示从Apollo配置中心获取配置。 程序很简单,就是用户输入一个key的名字,程序会输出这个key对应的值。 如果没找到这个key,则输出undefined。 同时,客户端还会监听配置变化事件,一旦有变化就会输出变化的配置信息。 运行`./demo.sh client`启动Demo客户端,忽略前面的调试信息,可以看到如下提示: ```sh Apollo Config Demo. Please input key to get the value. Input quit to exit. > ``` 输入`timeout`,会看到如下信息: ```sh > timeout > [SimpleApolloConfigDemo] Loading key : timeout with value: 100 ``` > 如果运行客户端遇到问题,可以通过修改`client/log4j2.xml`中的level为DEBUG来查看更详细日志信息 > ```xml > <logger name="com.ctrip.framework.apollo" additivity="false" level="trace"> > <AppenderRef ref="Async" level="DEBUG"/> > </logger> > ``` ### 4.1.3 修改配置并发布 1. 在配置界面点击timeout这一项的编辑按钮 ![编辑配置](https://raw.githubusercontent.com/nobodyiam/apollo-build-scripts/master/images/sample-app-modify-config.png) 2. 在弹出框中把值改成200并提交 ![配置修改](https://raw.githubusercontent.com/nobodyiam/apollo-build-scripts/master/images/sample-app-submit-config.png) 3. 点击发布按钮,并填写发布信息 ![发布](https://raw.githubusercontent.com/nobodyiam/apollo-build-scripts/master/images/sample-app-release-config.png) ![发布信息](https://raw.githubusercontent.com/nobodyiam/apollo-build-scripts/master/images/sample-app-release-detail.png) ### 4.1.4 客户端查看修改后的值 如果客户端一直在运行的话,在配置发布后就会监听到配置变化,并输出修改的配置信息: ```sh [SimpleApolloConfigDemo] Changes for namespace application [SimpleApolloConfigDemo] Change - key: timeout, oldValue: 100, newValue: 200, changeType: MODIFIED ``` 再次输入`timeout`查看对应的值,会看到如下信息: ```sh > timeout > [SimpleApolloConfigDemo] Loading key : timeout with value: 200 ``` ## 4.2 使用新的项目 ### 4.2.1 应用接入Apollo 这部分可以参考[Java应用接入指南](zh/usage/java-sdk-user-guide) ### 4.2.2 运行客户端程序 由于使用了新的项目,所以客户端需要修改appId信息。 编辑`client/META-INF/app.properties`,修改app.id为你新创建的app id。 ```properties app.id=你的appId ``` 运行`./demo.sh client`启动Demo客户端即可。
为了让大家更快的上手了解Apollo配置中心,我们这里准备了一个Quick Start,能够在几分钟内在本地环境部署、启动Apollo配置中心。 考虑到Docker的便捷性,我们还提供了Quick Start的Docker版本,如果你对Docker比较熟悉的话,可以参考[Apollo Quick Start Docker部署](zh/deployment/quick-start-docker)通过Docker快速部署Apollo。 不过这里需要注意的是,Quick Start只针对本地测试使用,如果要部署到生产环境,还请另行参考[分布式部署指南](zh/deployment/distributed-deployment-guide)。 > 注:Quick Start需要有bash环境,Windows用户请安装[Git Bash](https://git-for-windows.github.io/),建议使用最新版本,老版本可能会遇到未知问题。也可以直接通过IDE环境启动,详见[Apollo开发指南](zh/development/apollo-development-guide)。 # &nbsp; # 一、准备工作 ## 1.1 Java * Apollo服务端:1.8+ * Apollo客户端:1.7+ 由于Quick Start会在本地同时启动服务端和客户端,所以需要在本地安装Java 1.8+。 在配置好后,可以通过如下命令检查: ```sh java -version ``` 样例输出: ```sh java version "1.8.0_74" Java(TM) SE Runtime Environment (build 1.8.0_74-b02) Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode) ``` Windows用户请确保JAVA_HOME环境变量已经设置。 ## 1.2 MySQL * 版本要求:5.6.5+ Apollo的表结构对`timestamp`使用了多个default声明,所以需要5.6.5以上版本。 连接上MySQL后,可以通过如下命令检查: ```sql SHOW VARIABLES WHERE Variable_name = 'version'; ``` | Variable_name | Value | |---------------|--------| | version | 5.7.11 | ## 1.3 下载Quick Start安装包 我们准备好了一个Quick Start安装包,大家只需要下载到本地,就可以直接使用,免去了编译、打包过程。 安装包共50M,如果访问github网速不给力的话,可以从百度网盘下载。 1. 从Github下载 * checkout或下载[apollo-build-scripts项目](https://github.com/nobodyiam/apollo-build-scripts) * **由于Quick Start项目比较大,所以放在了另外的repository,请注意项目地址** * https://github.com/nobodyiam/apollo-build-scripts 2. 从百度网盘下载 * 通过[网盘链接](https://pan.baidu.com/s/1Ieelw6y3adECgktO0ea0Gg)下载,提取码: 9wwe * 下载到本地后,在本地解压apollo-quick-start.zip 3. 为啥安装包要58M这么大? * 因为这是一个可以自启动的jar包,里面包含了所有依赖jar包以及一个内置的tomcat容器 ### 1.3.1 手动打包Quick Start安装包 Quick Start只针对本地测试使用,所以一般用户不需要自己下载源码打包,只需要下载已经打好的包即可。不过也有部分用户希望在修改代码后重新打包,那么可以参考如下步骤: 1. 修改apollo-configservice, apollo-adminservice和apollo-portal的pom.xml,注释掉spring-boot-maven-plugin和maven-assembly-plugin 2. 在根目录下执行`mvn clean package -pl apollo-assembly -am -DskipTests=true` 3. 复制apollo-assembly/target下的jar包,rename为apollo-all-in-one.jar # 二、安装步骤 ## 2.1 创建数据库 Apollo服务端共需要两个数据库:`ApolloPortalDB`和`ApolloConfigDB`,我们把数据库、表的创建和样例数据都分别准备了sql文件,只需要导入数据库即可。 > 注意:如果你本地已经创建过Apollo数据库,请注意备份数据。我们准备的sql文件会清空Apollo相关的表。 ### 2.1.1 创建ApolloPortalDB 通过各种MySQL客户端导入[sql/apolloportaldb.sql](https://github.com/nobodyiam/apollo-build-scripts/blob/master/sql/apolloportaldb.sql)即可。 下面以MySQL原生客户端为例: ```sql source /your_local_path/sql/apolloportaldb.sql ``` 导入成功后,可以通过执行以下sql语句来验证: ```sql select `Id`, `AppId`, `Name` from ApolloPortalDB.App; ``` | Id | AppId | Name | |----|-----------|------------| | 1 | SampleApp | Sample App | ### 2.1.2 创建ApolloConfigDB 通过各种MySQL客户端导入[sql/apolloconfigdb.sql](https://github.com/nobodyiam/apollo-build-scripts/blob/master/sql/apolloconfigdb.sql)即可。 下面以MySQL原生客户端为例: ```sql source /your_local_path/sql/apolloconfigdb.sql ``` 导入成功后,可以通过执行以下sql语句来验证: ```sql select `NamespaceId`, `Key`, `Value`, `Comment` from ApolloConfigDB.Item; ``` | NamespaceId | Key | Value | Comment | |-------------|---------|-------|--------------------| | 1 | timeout | 100 | sample timeout配置 | ## 2.2 配置数据库连接信息 Apollo服务端需要知道如何连接到你前面创建的数据库,所以需要编辑[demo.sh](https://github.com/nobodyiam/apollo-build-scripts/blob/master/demo.sh),修改ApolloPortalDB和ApolloConfigDB相关的数据库连接串信息。 > 注意:填入的用户需要具备对ApolloPortalDB和ApolloConfigDB数据的读写权限。 ```sh #apollo config db info apollo_config_db_url="jdbc:mysql://localhost:3306/ApolloConfigDB?characterEncoding=utf8&serverTimezone=Asia/Shanghai" apollo_config_db_username=用户名 apollo_config_db_password=密码(如果没有密码,留空即可) # apollo portal db info apollo_portal_db_url="jdbc:mysql://localhost:3306/ApolloPortalDB?characterEncoding=utf8&serverTimezone=Asia/Shanghai" apollo_portal_db_username=用户名 apollo_portal_db_password=密码(如果没有密码,留空即可) ``` > 注意:不要修改demo.sh的其它部分 # 三、启动Apollo配置中心 ## 3.1 确保端口未被占用 Quick Start脚本会在本地启动3个服务,分别使用8070, 8080, 8090端口,请确保这3个端口当前没有被使用。 例如,在Linux/Mac下,可以通过如下命令检查: ```sh lsof -i:8080 ``` ## 3.2 执行启动脚本 ```sh ./demo.sh start ``` 当看到如下输出后,就说明启动成功了! ```sh ==== starting service ==== Service logging file is ./service/apollo-service.log Started [10768] Waiting for config service startup....... Config service started. You may visit http://localhost:8080 for service status now! Waiting for admin service startup.... Admin service started ==== starting portal ==== Portal logging file is ./portal/apollo-portal.log Started [10846] Waiting for portal startup...... Portal started. You can visit http://localhost:8070 now! ``` ## 3.3 异常排查 如果启动遇到了异常,可以分别查看service和portal目录下的log文件排查问题。 > 注:在启动apollo-configservice的过程中会在日志中输出eureka注册失败的信息,如`com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused`。需要注意的是,这个是预期的情况,因为apollo-configservice需要向Meta Server(它自己)注册服务,但是因为在启动过程中,自己还没起来,所以会报这个错。后面会进行重试的动作,所以等自己服务起来后就会注册正常了。 ## 3.4 注意 Quick Start只是用来帮助大家快速体验Apollo项目,具体实际使用时请参考:[分布式部署指南](zh/deployment/distributed-deployment-guide)。 另外需要注意的是Quick Start不支持增加环境,只有通过分布式部署才可以新增环境,同样请参考:[分布式部署指南](zh/deployment/distributed-deployment-guide) # 四、使用Apollo配置中心 ## 4.1 使用样例项目 ### 4.1.1 查看样例配置 1. 打开http://localhost:8070 > Quick Start集成了[Spring Security简单认证](zh/development/portal-how-to-implement-user-login-function#实现方式一:使用apollo提供的spring-security简单认证),更多信息可以参考[Portal 实现用户登录功能](zh/development/portal-how-to-implement-user-login-function) <img src="https://github.com/nobodyiam/apollo-build-scripts/raw/master/images/apollo-login.png" alt="登录" width="640px"> 2. 输入用户名apollo,密码admin后登录 ![首页](https://raw.githubusercontent.com/nobodyiam/apollo-build-scripts/master/images/apollo-sample-home.png) 3. 点击SampleApp进入配置界面,可以看到当前有一个配置timeout=100 ![配置界面](https://raw.githubusercontent.com/nobodyiam/apollo-build-scripts/master/images/sample-app-config.png) > 如果提示`系统出错,请重试或联系系统负责人`,请稍后几秒钟重试一下,因为通过Eureka注册的服务有一个刷新的延时。 ### 4.1.2 运行客户端程序 我们准备了一个简单的[Demo客户端](https://github.com/ctripcorp/apollo/blob/master/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/api/SimpleApolloConfigDemo.java)来演示从Apollo配置中心获取配置。 程序很简单,就是用户输入一个key的名字,程序会输出这个key对应的值。 如果没找到这个key,则输出undefined。 同时,客户端还会监听配置变化事件,一旦有变化就会输出变化的配置信息。 运行`./demo.sh client`启动Demo客户端,忽略前面的调试信息,可以看到如下提示: ```sh Apollo Config Demo. Please input key to get the value. Input quit to exit. > ``` 输入`timeout`,会看到如下信息: ```sh > timeout > [SimpleApolloConfigDemo] Loading key : timeout with value: 100 ``` > 如果运行客户端遇到问题,可以通过修改`client/log4j2.xml`中的level为DEBUG来查看更详细日志信息 > ```xml > <logger name="com.ctrip.framework.apollo" additivity="false" level="trace"> > <AppenderRef ref="Async" level="DEBUG"/> > </logger> > ``` ### 4.1.3 修改配置并发布 1. 在配置界面点击timeout这一项的编辑按钮 ![编辑配置](https://raw.githubusercontent.com/nobodyiam/apollo-build-scripts/master/images/sample-app-modify-config.png) 2. 在弹出框中把值改成200并提交 ![配置修改](https://raw.githubusercontent.com/nobodyiam/apollo-build-scripts/master/images/sample-app-submit-config.png) 3. 点击发布按钮,并填写发布信息 ![发布](https://raw.githubusercontent.com/nobodyiam/apollo-build-scripts/master/images/sample-app-release-config.png) ![发布信息](https://raw.githubusercontent.com/nobodyiam/apollo-build-scripts/master/images/sample-app-release-detail.png) ### 4.1.4 客户端查看修改后的值 如果客户端一直在运行的话,在配置发布后就会监听到配置变化,并输出修改的配置信息: ```sh [SimpleApolloConfigDemo] Changes for namespace application [SimpleApolloConfigDemo] Change - key: timeout, oldValue: 100, newValue: 200, changeType: MODIFIED ``` 再次输入`timeout`查看对应的值,会看到如下信息: ```sh > timeout > [SimpleApolloConfigDemo] Loading key : timeout with value: 200 ``` ## 4.2 使用新的项目 ### 4.2.1 应用接入Apollo 这部分可以参考[Java应用接入指南](zh/usage/java-sdk-user-guide) ### 4.2.2 运行客户端程序 由于使用了新的项目,所以客户端需要修改appId信息。 编辑`client/META-INF/app.properties`,修改app.id为你新创建的app id。 ```properties app.id=你的appId ``` 运行`./demo.sh client`启动Demo客户端即可。
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./docs/_coverpage.md
<img src="https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/logo/logo-simple.png" alt="apollo-logo" width="30%"> > A reliable configuration management system - Multiple environments and clusters support - Configuration changes take effect in real time - Versioned and grayscale releases management - Great authentication, authorization and audit control [GitHub](https://github.com/ctripcorp/apollo/) [Get Started](zh/README)
<img src="https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/logo/logo-simple.png" alt="apollo-logo" width="30%"> > A reliable configuration management system - Multiple environments and clusters support - Configuration changes take effect in real time - Versioned and grayscale releases management - Great authentication, authorization and audit control [GitHub](https://github.com/ctripcorp/apollo/) [Get Started](zh/README)
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./docs/zh/faq/faq.md
## 1. Apollo是什么? Apollo(阿波罗)是携程框架部门研发的配置管理平台,能够集中化管理应用不同环境、不同集群的配置,配置修改后能够实时推送到应用端,并且具备规范的权限、流程治理等特性。 更多介绍,可以参考[Apollo配置中心介绍](zh/design/apollo-introduction) ## 2. Cluster是什么? 一个应用下不同实例的分组,比如典型的可以按照数据中心分,把A机房的应用实例分为一个集群,把B机房的应用实例分为另一个集群。 ## 3. Namespace是什么? 一个应用下不同配置的分组。 请参考[Apollo核心概念之“Namespace”](zh/design/apollo-core-concept-namespace) ## 4. 我想要接入Apollo,该如何操作? 请参考[Apollo使用指南](zh/usage/apollo-user-guide) ## 5. 我的应用需要不同机房的配置不一样,Apollo是否能支持? Apollo是支持的。请参考[Apollo使用指南](zh/usage/apollo-user-guide)中的`三、集群独立配置说明` ## 6. 我有多个应用需要使用同一份配置,Apollo是否能支持? Apollo是支持的。请参考[Apollo使用指南](zh/usage/apollo-user-guide)中的`四、多个AppId使用同一份配置` ## 7. Apollo是否支持查看权限控制或者配置加密? 从1.1.0版本开始,apollo-portal增加了查看权限的支持,可以支持配置某个环境只允许项目成员查看私有Namespace的配置。 这里的项目成员是指: 1. 项目的管理员 2. 具备该私有Namespace在该环境下的修改或发布权限 配置方式很简单,用超级管理员账号登录后,进入`管理员工具 - 系统参数`页面新增或修改`configView.memberOnly.envs`配置项即可。 ![configView.memberOnly.envs](https://user-images.githubusercontent.com/837658/46456519-c155e100-c7e1-11e8-969b-8f332379fa29.png) 配置加密可以参考[spring-boot-encrypt demo项目](https://github.com/ctripcorp/apollo-use-cases/tree/master/spring-boot-encrypt) ## 8. 如果有多个config server,打包时如何配置meta server地址? 有多台meta server可以通过nginx反向代理,通过一个域名代理多个meta server实现ha。 ## 9. Apollo相比于Spring Cloud Config有什么优势? Spring Cloud Config的精妙之处在于它的配置存储于Git,这就天然的把配置的修改、权限、版本等问题隔离在外。通过这个设计使得Spring Cloud Config整体很简单,不过也带来了一些不便之处。 下面尝试做一个简单的小结: | 功能点 | Apollo | Spring Cloud Config | 备注 | |------------------|--------------------------------------------|-------------------------------------------------|----------------------------------------------------------------------------| | 配置界面 | 一个界面管理不同环境、不同集群配置 | 无,需要通过git操作 | | | 配置生效时间 | 实时 | 重启生效,或手动refresh生效 | Spring Cloud Config需要通过Git webhook,加上额外的消息队列才能支持实时生效 | | 版本管理 | 界面上直接提供发布历史和回滚按钮 | 无,需要通过git操作 | | | 灰度发布 | 支持 | 不支持 | | | 授权、审核、审计 | 界面上直接支持,而且支持修改、发布权限分离 | 需要通过git仓库设置,且不支持修改、发布权限分离 | | | 实例配置监控 | 可以方便的看到当前哪些客户端在使用哪些配置 | 不支持 | | | 配置获取性能 | 快,通过数据库访问,还有缓存支持 | 较慢,需要从git clone repository,然后从文件系统读取 | | | 客户端支持 | 原生支持所有Java和.Net应用,提供API支持其它语言应用,同时也支持Spring annotation获取配置 | 支持Spring应用,提供annotation获取配置 | Apollo的适用范围更广一些 | ## 10. Apollo和Disconf相比有什么优点? 由于我们自己并非Disconf的资深用户,所以无法主观地给出评价。 不过之前Apollo技术支持群中的热心网友[@Krast](https://github.com/krast)做了一个[开源配置中心对比矩阵](https://github.com/ctripcorp/apollo/files/983064/default.pdf),可以参考一下。
## 1. Apollo是什么? Apollo(阿波罗)是携程框架部门研发的配置管理平台,能够集中化管理应用不同环境、不同集群的配置,配置修改后能够实时推送到应用端,并且具备规范的权限、流程治理等特性。 更多介绍,可以参考[Apollo配置中心介绍](zh/design/apollo-introduction) ## 2. Cluster是什么? 一个应用下不同实例的分组,比如典型的可以按照数据中心分,把A机房的应用实例分为一个集群,把B机房的应用实例分为另一个集群。 ## 3. Namespace是什么? 一个应用下不同配置的分组。 请参考[Apollo核心概念之“Namespace”](zh/design/apollo-core-concept-namespace) ## 4. 我想要接入Apollo,该如何操作? 请参考[Apollo使用指南](zh/usage/apollo-user-guide) ## 5. 我的应用需要不同机房的配置不一样,Apollo是否能支持? Apollo是支持的。请参考[Apollo使用指南](zh/usage/apollo-user-guide)中的`三、集群独立配置说明` ## 6. 我有多个应用需要使用同一份配置,Apollo是否能支持? Apollo是支持的。请参考[Apollo使用指南](zh/usage/apollo-user-guide)中的`四、多个AppId使用同一份配置` ## 7. Apollo是否支持查看权限控制或者配置加密? 从1.1.0版本开始,apollo-portal增加了查看权限的支持,可以支持配置某个环境只允许项目成员查看私有Namespace的配置。 这里的项目成员是指: 1. 项目的管理员 2. 具备该私有Namespace在该环境下的修改或发布权限 配置方式很简单,用超级管理员账号登录后,进入`管理员工具 - 系统参数`页面新增或修改`configView.memberOnly.envs`配置项即可。 ![configView.memberOnly.envs](https://user-images.githubusercontent.com/837658/46456519-c155e100-c7e1-11e8-969b-8f332379fa29.png) 配置加密可以参考[spring-boot-encrypt demo项目](https://github.com/ctripcorp/apollo-use-cases/tree/master/spring-boot-encrypt) ## 8. 如果有多个config server,打包时如何配置meta server地址? 有多台meta server可以通过nginx反向代理,通过一个域名代理多个meta server实现ha。 ## 9. Apollo相比于Spring Cloud Config有什么优势? Spring Cloud Config的精妙之处在于它的配置存储于Git,这就天然的把配置的修改、权限、版本等问题隔离在外。通过这个设计使得Spring Cloud Config整体很简单,不过也带来了一些不便之处。 下面尝试做一个简单的小结: | 功能点 | Apollo | Spring Cloud Config | 备注 | |------------------|--------------------------------------------|-------------------------------------------------|----------------------------------------------------------------------------| | 配置界面 | 一个界面管理不同环境、不同集群配置 | 无,需要通过git操作 | | | 配置生效时间 | 实时 | 重启生效,或手动refresh生效 | Spring Cloud Config需要通过Git webhook,加上额外的消息队列才能支持实时生效 | | 版本管理 | 界面上直接提供发布历史和回滚按钮 | 无,需要通过git操作 | | | 灰度发布 | 支持 | 不支持 | | | 授权、审核、审计 | 界面上直接支持,而且支持修改、发布权限分离 | 需要通过git仓库设置,且不支持修改、发布权限分离 | | | 实例配置监控 | 可以方便的看到当前哪些客户端在使用哪些配置 | 不支持 | | | 配置获取性能 | 快,通过数据库访问,还有缓存支持 | 较慢,需要从git clone repository,然后从文件系统读取 | | | 客户端支持 | 原生支持所有Java和.Net应用,提供API支持其它语言应用,同时也支持Spring annotation获取配置 | 支持Spring应用,提供annotation获取配置 | Apollo的适用范围更广一些 | ## 10. Apollo和Disconf相比有什么优点? 由于我们自己并非Disconf的资深用户,所以无法主观地给出评价。 不过之前Apollo技术支持群中的热心网友[@Krast](https://github.com/krast)做了一个[开源配置中心对比矩阵](https://github.com/ctripcorp/apollo/files/983064/default.pdf),可以参考一下。
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./docs/zh/design/apollo-core-concept-namespace.md
### 1. 什么是Namespace? Namespace是配置项的集合,类似于一个配置文件的概念。 ### 2. 什么是“application”的Namespace? Apollo在创建项目的时候,都会默认创建一个“application”的Namespace。顾名思义,“application”是给应用自身使用的,熟悉Spring Boot的同学都知道,Spring Boot项目都有一个默认配置文件application.yml。在这里application.yml就等同于“application”的Namespace。对于90%的应用来说,“application”的Namespace已经满足日常配置使用场景了。 #### 客户端获取“application” Namespace的代码如下: ``` java Config config = ConfigService.getAppConfig(); ``` #### 客户端获取非“application” Namespace的代码如下: ``` java Config config = ConfigService.getConfig(namespaceName); ``` ### 3. Namespace的格式有哪些? 配置文件有多种格式,例如:properties、xml、yml、yaml、json等。同样Namespace也具有这些格式。在Portal UI中可以看到“application”的Namespace上有一个“properties”标签,表明“application”是properties格式的。 >注1:非properties格式的namespace,在客户端使用时需要调用`ConfigService.getConfigFile(String namespace, ConfigFileFormat configFileFormat)`来获取,如果使用[Http接口直接调用](zh/usage/other-language-client-user-guide#_12-通过带缓存的http接口从apollo读取配置)时,对应的namespace参数需要传入namespace的名字加上后缀名,如datasources.json。 >注2:apollo-client 1.3.0版本开始对yaml/yml做了更好的支持,使用起来和properties格式一致:`Config config = ConfigService.getConfig("application.yml");`,Spring的注入方式也和properties一致。 ### 4. Namespace的获取权限分类 Namespace的获取权限分为两种: * private (私有的) * public (公共的) 这里的获取权限是相对于Apollo客户端来说的。 #### 4.1 private权限 private权限的Namespace,只能被所属的应用获取到。一个应用尝试获取其它应用private的Namespace,Apollo会报“404”异常。 #### 4.2 public权限 public权限的Namespace,能被任何应用获取。 ### 5. Namespace的类型 Namespace类型有三种: * 私有类型 * 公共类型 * 关联类型(继承类型) #### 5.1 私有类型 私有类型的Namespace具有private权限。例如上文提到的“application” Namespace就是私有类型。 #### 5.2 公共类型 ##### 5.2.1 含义 公共类型的Namespace具有public权限。公共类型的Namespace相当于游离于应用之外的配置,且通过Namespace的名称去标识公共Namespace,所以公共的Namespace的名称必须全局唯一。 ##### 5.2.2 使用场景 * 部门级别共享的配置 * 小组级别共享的配置 * 几个项目之间共享的配置 * 中间件客户端的配置 #### 5.3 关联类型 ##### 5.3.1 含义 关联类型又可称为继承类型,关联类型具有private权限。关联类型的Namespace继承于公共类型的Namespace,用于覆盖公共Namespace的某些配置。例如公共的Namespace有两个配置项 ``` k1 = v1 k2 = v2 ``` 然后应用A有一个关联类型的Namespace关联了此公共Namespace,且覆盖了配置项k1,新值为v3。那么在应用A实际运行时,获取到的公共Namespace的配置为: ``` k1 = v3 k2 = v2 ``` ##### 5.3.2 使用场景 举一个实际使用的场景。假设RPC框架的配置(如:timeout)有以下要求: * 提供一份全公司默认的配置且可动态调整 * RPC客户端项目可以自定义某些配置项且可动态调整 1. 如果把以上两点要求去掉“动态调整”,那么做法很简单。在rpc-client.jar包里有一份配置文件,每次修改配置文件然后重新发一个版本的jar包即可。同理,客户端项目修改配置也是如此。 2. 如果只支持客户端项目可动态调整配置。客户端项目可以在Apollo “application” Namespace上配置一些配置项。在初始化service的时候,从Apollo上读取配置即可。这样做的坏处就是,每个项目都要自定义一些key,不统一。 3. 那么如何完美支持以上需求呢?答案就是结合使用Apollo的公共类型的Namespace和关联类型的Namespace。RPC团队在Apollo上维护一个叫“rpc-client”的公共Namespace,在“rpc-client” Namespace上配置默认的参数值。rpc-client.jar里的代码读取“rpc-client”Namespace的配置即可。如果需要调整默认的配置,只需要修改公共类型“rpc-client” Namespace的配置。如果客户端项目想要自定义或动态修改某些配置项,只需要在Apollo 自己项目下关联“rpc-client”,就能创建关联类型“rpc-client”的Namespace。然后在关联类型“rpc-client”的Namespace下修改配置项即可。这里有一点需要指出的,那就是rpc-client.jar是在应用容器里运行的,所以rpc-client获取到的“rpc-client” Namespace的配置是应用的关联类型的Namespace加上公共类型的Namespace。 #### 5.4 例子 如下图所示,有三个应用:应用A、应用B、应用C。 * 应用A有两个私有类型的Namespace:application和NS-Private,以及一个关联类型的Namespace:NS-Public。 * 应用B有一个私有类型的Namespace:application,以及一个公共类型的Namespace:NS-Public。 * 应用C只有一个私有类型的Namespace:application ![Namespace例子](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/namespace-model-example.png) ##### 5.4.1 应用A获取Apollo配置 ```java //application Config appConfig = ConfigService.getAppConfig(); appConfig.getProperty("k1", null); // k1 = v11 appConfig.getProperty("k2", null); // k2 = v21 //NS-Private Config privateConfig = ConfigService.getConfig("NS-Private"); privateConfig.getProperty("k1", null); // k1 = v3 privateConfig.getProperty("k3", null); // k3 = v4 //NS-Public,覆盖公共类型配置的情况,k4被覆盖 Config publicConfig = ConfigService.getConfig("NS-Public"); publicConfig.getProperty("k4", null); // k4 = v6 cover publicConfig.getProperty("k6", null); // k6 = v6 publicConfig.getProperty("k7", null); // k7 = v7 ``` ##### 5.4.2 应用B获取Apollo配置 ```java //application Config appConfig = ConfigService.getAppConfig(); appConfig.getProperty("k1", null); // k1 = v12 appConfig.getProperty("k2", null); // k2 = null appConfig.getProperty("k3", null); // k3 = v32 //NS-Private,由于没有NS-Private Namespace 所以获取到default value Config privateConfig = ConfigService.getConfig("NS-Private"); privateConfig.getProperty("k1", "default value"); //NS-Public Config publicConfig = ConfigService.getConfig("NS-Public"); publicConfig.getProperty("k4", null); // k4 = v5 publicConfig.getProperty("k6", null); // k6 = v6 publicConfig.getProperty("k7", null); // k7 = v7 ``` ##### 5.4.3 应用C获取Apollo配置 ```java //application Config appConfig = ConfigService.getAppConfig(); appConfig.getProperty("k1", null); // k1 = v12 appConfig.getProperty("k2", null); // k2 = null appConfig.getProperty("k3", null); // k3 = v33 //NS-Private,由于没有NS-Private Namespace 所以获取到default value Config privateConfig = ConfigService.getConfig("NS-Private"); privateConfig.getProperty("k1", "default value"); //NS-Public,公共类型的Namespace,任何项目都可以获取到 Config publicConfig = ConfigService.getConfig("NS-Public"); publicConfig.getProperty("k4", null); // k4 = v5 publicConfig.getProperty("k6", null); // k6 = v6 publicConfig.getProperty("k7", null); // k7 = v7 ``` ##### 5.4.4 ChangeListener 以上代码例子中可以看到,在客户端Namespace映射成一个Config对象。Namespace配置变更的监听器是注册在Config对象上。 所以在应用A中监听application的Namespace代码如下: ```java Config appConfig = ConfigService.getAppConfig(); appConfig.addChangeListener(new ConfigChangeListener() { public void onChange(ConfigChangeEvent changeEvent) { //do something } }) ``` 在应用A中监听NS-Private的Namespace代码如下: ```java Config privateConfig = ConfigService.getConfig("NS-Private"); privateConfig.addChangeListener(new ConfigChangeListener() { public void onChange(ConfigChangeEvent changeEvent) { //do something } }) ``` 在应用A、应用B、应用C中监听NS-Public的Namespace代码如下: ```java Config publicConfig = ConfigService.getConfig("NS-Public"); publicConfig.addChangeListener(new ConfigChangeListener() { public void onChange(ConfigChangeEvent changeEvent) { //do something } }) ```
### 1. 什么是Namespace? Namespace是配置项的集合,类似于一个配置文件的概念。 ### 2. 什么是“application”的Namespace? Apollo在创建项目的时候,都会默认创建一个“application”的Namespace。顾名思义,“application”是给应用自身使用的,熟悉Spring Boot的同学都知道,Spring Boot项目都有一个默认配置文件application.yml。在这里application.yml就等同于“application”的Namespace。对于90%的应用来说,“application”的Namespace已经满足日常配置使用场景了。 #### 客户端获取“application” Namespace的代码如下: ``` java Config config = ConfigService.getAppConfig(); ``` #### 客户端获取非“application” Namespace的代码如下: ``` java Config config = ConfigService.getConfig(namespaceName); ``` ### 3. Namespace的格式有哪些? 配置文件有多种格式,例如:properties、xml、yml、yaml、json等。同样Namespace也具有这些格式。在Portal UI中可以看到“application”的Namespace上有一个“properties”标签,表明“application”是properties格式的。 >注1:非properties格式的namespace,在客户端使用时需要调用`ConfigService.getConfigFile(String namespace, ConfigFileFormat configFileFormat)`来获取,如果使用[Http接口直接调用](zh/usage/other-language-client-user-guide#_12-通过带缓存的http接口从apollo读取配置)时,对应的namespace参数需要传入namespace的名字加上后缀名,如datasources.json。 >注2:apollo-client 1.3.0版本开始对yaml/yml做了更好的支持,使用起来和properties格式一致:`Config config = ConfigService.getConfig("application.yml");`,Spring的注入方式也和properties一致。 ### 4. Namespace的获取权限分类 Namespace的获取权限分为两种: * private (私有的) * public (公共的) 这里的获取权限是相对于Apollo客户端来说的。 #### 4.1 private权限 private权限的Namespace,只能被所属的应用获取到。一个应用尝试获取其它应用private的Namespace,Apollo会报“404”异常。 #### 4.2 public权限 public权限的Namespace,能被任何应用获取。 ### 5. Namespace的类型 Namespace类型有三种: * 私有类型 * 公共类型 * 关联类型(继承类型) #### 5.1 私有类型 私有类型的Namespace具有private权限。例如上文提到的“application” Namespace就是私有类型。 #### 5.2 公共类型 ##### 5.2.1 含义 公共类型的Namespace具有public权限。公共类型的Namespace相当于游离于应用之外的配置,且通过Namespace的名称去标识公共Namespace,所以公共的Namespace的名称必须全局唯一。 ##### 5.2.2 使用场景 * 部门级别共享的配置 * 小组级别共享的配置 * 几个项目之间共享的配置 * 中间件客户端的配置 #### 5.3 关联类型 ##### 5.3.1 含义 关联类型又可称为继承类型,关联类型具有private权限。关联类型的Namespace继承于公共类型的Namespace,用于覆盖公共Namespace的某些配置。例如公共的Namespace有两个配置项 ``` k1 = v1 k2 = v2 ``` 然后应用A有一个关联类型的Namespace关联了此公共Namespace,且覆盖了配置项k1,新值为v3。那么在应用A实际运行时,获取到的公共Namespace的配置为: ``` k1 = v3 k2 = v2 ``` ##### 5.3.2 使用场景 举一个实际使用的场景。假设RPC框架的配置(如:timeout)有以下要求: * 提供一份全公司默认的配置且可动态调整 * RPC客户端项目可以自定义某些配置项且可动态调整 1. 如果把以上两点要求去掉“动态调整”,那么做法很简单。在rpc-client.jar包里有一份配置文件,每次修改配置文件然后重新发一个版本的jar包即可。同理,客户端项目修改配置也是如此。 2. 如果只支持客户端项目可动态调整配置。客户端项目可以在Apollo “application” Namespace上配置一些配置项。在初始化service的时候,从Apollo上读取配置即可。这样做的坏处就是,每个项目都要自定义一些key,不统一。 3. 那么如何完美支持以上需求呢?答案就是结合使用Apollo的公共类型的Namespace和关联类型的Namespace。RPC团队在Apollo上维护一个叫“rpc-client”的公共Namespace,在“rpc-client” Namespace上配置默认的参数值。rpc-client.jar里的代码读取“rpc-client”Namespace的配置即可。如果需要调整默认的配置,只需要修改公共类型“rpc-client” Namespace的配置。如果客户端项目想要自定义或动态修改某些配置项,只需要在Apollo 自己项目下关联“rpc-client”,就能创建关联类型“rpc-client”的Namespace。然后在关联类型“rpc-client”的Namespace下修改配置项即可。这里有一点需要指出的,那就是rpc-client.jar是在应用容器里运行的,所以rpc-client获取到的“rpc-client” Namespace的配置是应用的关联类型的Namespace加上公共类型的Namespace。 #### 5.4 例子 如下图所示,有三个应用:应用A、应用B、应用C。 * 应用A有两个私有类型的Namespace:application和NS-Private,以及一个关联类型的Namespace:NS-Public。 * 应用B有一个私有类型的Namespace:application,以及一个公共类型的Namespace:NS-Public。 * 应用C只有一个私有类型的Namespace:application ![Namespace例子](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/namespace-model-example.png) ##### 5.4.1 应用A获取Apollo配置 ```java //application Config appConfig = ConfigService.getAppConfig(); appConfig.getProperty("k1", null); // k1 = v11 appConfig.getProperty("k2", null); // k2 = v21 //NS-Private Config privateConfig = ConfigService.getConfig("NS-Private"); privateConfig.getProperty("k1", null); // k1 = v3 privateConfig.getProperty("k3", null); // k3 = v4 //NS-Public,覆盖公共类型配置的情况,k4被覆盖 Config publicConfig = ConfigService.getConfig("NS-Public"); publicConfig.getProperty("k4", null); // k4 = v6 cover publicConfig.getProperty("k6", null); // k6 = v6 publicConfig.getProperty("k7", null); // k7 = v7 ``` ##### 5.4.2 应用B获取Apollo配置 ```java //application Config appConfig = ConfigService.getAppConfig(); appConfig.getProperty("k1", null); // k1 = v12 appConfig.getProperty("k2", null); // k2 = null appConfig.getProperty("k3", null); // k3 = v32 //NS-Private,由于没有NS-Private Namespace 所以获取到default value Config privateConfig = ConfigService.getConfig("NS-Private"); privateConfig.getProperty("k1", "default value"); //NS-Public Config publicConfig = ConfigService.getConfig("NS-Public"); publicConfig.getProperty("k4", null); // k4 = v5 publicConfig.getProperty("k6", null); // k6 = v6 publicConfig.getProperty("k7", null); // k7 = v7 ``` ##### 5.4.3 应用C获取Apollo配置 ```java //application Config appConfig = ConfigService.getAppConfig(); appConfig.getProperty("k1", null); // k1 = v12 appConfig.getProperty("k2", null); // k2 = null appConfig.getProperty("k3", null); // k3 = v33 //NS-Private,由于没有NS-Private Namespace 所以获取到default value Config privateConfig = ConfigService.getConfig("NS-Private"); privateConfig.getProperty("k1", "default value"); //NS-Public,公共类型的Namespace,任何项目都可以获取到 Config publicConfig = ConfigService.getConfig("NS-Public"); publicConfig.getProperty("k4", null); // k4 = v5 publicConfig.getProperty("k6", null); // k6 = v6 publicConfig.getProperty("k7", null); // k7 = v7 ``` ##### 5.4.4 ChangeListener 以上代码例子中可以看到,在客户端Namespace映射成一个Config对象。Namespace配置变更的监听器是注册在Config对象上。 所以在应用A中监听application的Namespace代码如下: ```java Config appConfig = ConfigService.getAppConfig(); appConfig.addChangeListener(new ConfigChangeListener() { public void onChange(ConfigChangeEvent changeEvent) { //do something } }) ``` 在应用A中监听NS-Private的Namespace代码如下: ```java Config privateConfig = ConfigService.getConfig("NS-Private"); privateConfig.addChangeListener(new ConfigChangeListener() { public void onChange(ConfigChangeEvent changeEvent) { //do something } }) ``` 在应用A、应用B、应用C中监听NS-Public的Namespace代码如下: ```java Config publicConfig = ConfigService.getConfig("NS-Public"); publicConfig.addChangeListener(new ConfigChangeListener() { public void onChange(ConfigChangeEvent changeEvent) { //do something } }) ```
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./docs/zh/faq/common-issues-in-deployment-and-development-phase.md
### 1. windows怎么执行build.sh? 安装[Git Bash](https://git-for-windows.github.io/),然后运行 “./build.sh” 注意前面 “./” ### 2. 本地运行时Portal一直报Env is down. 默认config service启动在8080端口,admin service启动在8090端口。请确认这两个端口是否被其它应用程序占用。 如果还伴有异常信息:org.springframework.web.client.HttpClientErrorException: 405 Method Not Allowed,一般是由于本地启动了`ShadowSocks`,因为`ShadowSocks`默认会占用8090端口。 1.1.0版本增加了**系统信息**页面,可以通过`管理员工具` -> `系统信息`查看当前各个环境的Meta Server以及admin service信息,有助于排查问题。 ### 3. admin server 或者 config server 注册了内网IP,导致portal或者client访问不了admin server或config server 请参考[网络策略](zh/deployment/distributed-deployment-guide?id=_14-网络策略)。 ### 4. Portal如何增加环境? #### 4.1 1.6.0及以上的版本 1.6.0版本增加了自定义环境的功能,可以在不修改代码的情况增加环境 1. protaldb增加环境,参考[3.1 调整ApolloPortalDB配置](zh/deployment/distributed-deployment-guide?id=_31-调整apolloportaldb配置) 2. 为apollo-portal添加新增环境对应的meta server地址,具体参考:[2.2.1.1.2.4 配置apollo-portal的meta service信息](zh/deployment/distributed-deployment-guide?id=_221124-配置apollo-portal的meta-service信息)。apollo-client在新的环境下使用时也需要做好相应的配置,具体参考:[1.2.2 Apollo Meta Server](zh/usage/java-sdk-user-guide?id=_122-apollo-meta-server)。 >注1:一套Portal可以管理多个环境,但是每个环境都需要独立部署一套Config Service、Admin Service和ApolloConfigDB,具体请参考:[2.1.2 创建ApolloConfigDB](zh/deployment/distributed-deployment-guide?id=_212-创建apolloconfigdb),[3.2 调整ApolloConfigDB配置](zh/deployment/distributed-deployment-guide?id=_32-调整apolloconfigdb配置),[2.2.1.1.2 配置数据库连接信息](zh/deployment/distributed-deployment-guide?id=_22112-配置数据库连接信息) > 注2:如果是为已经运行了一段时间的Apollo配置中心增加环境,别忘了参考[2.1.2.4 从别的环境导入ApolloConfigDB的项目数据](zh/deployment/distributed-deployment-guide?id=_2124-从别的环境导入apolloconfigdb的项目数据)对新的环境做初始化 #### 4.2 1.5.1及之前的版本 ##### 4.2.1 添加Apollo预先定义好的环境 如果需要添加的环境是Apollo预先定义的环境(DEV, FAT, UAT, PRO),需要两步操作: 1. protaldb增加环境,参考[3.1 调整ApolloPortalDB配置](zh/deployment/distributed-deployment-guide?id=_31-调整apolloportaldb配置) 2. 为apollo-portal添加新增环境对应的meta server地址,具体参考:[2.2.1.1.2.4 配置apollo-portal的meta service信息](zh/deployment/distributed-deployment-guide?id=_221124-配置apollo-portal的meta-service信息)。apollo-client在新的环境下使用时也需要做好相应的配置,具体参考:[1.2.2 Apollo Meta Server](zh/usage/java-sdk-user-guide?id=_122-apollo-meta-server)。 >注1:一套Portal可以管理多个环境,但是每个环境都需要独立部署一套Config Service、Admin Service和ApolloConfigDB,具体请参考:[2.1.2 创建ApolloConfigDB](zh/deployment/distributed-deployment-guide?id=_212-创建apolloconfigdb),[3.2 调整ApolloConfigDB配置](zh/deployment/distributed-deployment-guide?id=_32-调整apolloconfigdb配置),[2.2.1.1.2 配置数据库连接信息](zh/deployment/distributed-deployment-guide?id=_22112-配置数据库连接信息) > 注2:如果是为已经运行了一段时间的Apollo配置中心增加环境,别忘了参考[2.1.2.4 从别的环境导入ApolloConfigDB的项目数据](zh/deployment/distributed-deployment-guide?id=_2124-从别的环境导入apolloconfigdb的项目数据)对新的环境做初始化 ##### 4.2.2 添加自定义的环境 如果需要添加的环境不是Apollo预先定义的环境,请参照如下步骤操作: 1. 假设需要添加的环境名称叫beta 2. 修改[com.ctrip.framework.apollo.core.enums.Env](https://github.com/ctripcorp/apollo/blob/master/apollo-core/src/main/java/com/ctrip/framework/apollo/core/enums/Env.java)类,在其中加入`BETA`枚举: ```java public enum Env{ LOCAL, DEV, BETA, FWS, FAT, UAT, LPT, PRO, TOOLS, UNKNOWN; ... } ``` 3. 修改[com.ctrip.framework.apollo.core.enums.EnvUtils](https://github.com/ctripcorp/apollo/blob/master/apollo-core/src/main/java/com/ctrip/framework/apollo/core/enums/EnvUtils.java)类,在其中加入`BETA`枚举的转换逻辑: ```java public final class EnvUtils { public static Env transformEnv(String envName) { if (StringUtils.isBlank(envName)) { return Env.UNKNOWN; } switch (envName.trim().toUpperCase()) { ... case "BETA": return Env.BETA; ... default: return Env.UNKNOWN; } } } ``` 4. 修改[apollo-env.properties](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/resources/apollo-env.properties),增加`beta.meta`占位符: ```properties local.meta=http://localhost:8080 dev.meta=${dev_meta} fat.meta=${fat_meta} beta.meta=${beta_meta} uat.meta=${uat_meta} lpt.meta=${lpt_meta} pro.meta=${pro_meta} ``` 5. 修改[com.ctrip.framework.apollo.core.internals.LegacyMetaServerProvider](https://github.com/ctripcorp/apollo/blob/master/apollo-core/src/main/java/com/ctrip/framework/apollo/core/internals/LegacyMetaServerProvider.java)类,增加读取`BETA`环境的meta server地址逻辑: ```java public class LegacyMetaServerProvider { ... domains.put(Env.BETA, getMetaServerAddress(prop, "beta_meta", "beta.meta")); ... } ``` 6. protaldb增加`BETA`环境,参考[3.1 调整ApolloPortalDB配置](zh/deployment/distributed-deployment-guide?id=_31-调整apolloportaldb配置) 7. 为apollo-portal添加新增环境对应的meta server地址,具体参考:[2.2.1.1.2.4 配置apollo-portal的meta service信息](zh/deployment/distributed-deployment-guide?id=_221124-配置apollo-portal的meta-service信息)。apollo-client在新的环境下使用时也需要做好相应的配置,具体参考:[1.2.2 Apollo Meta Server](zh/usage/java-sdk-user-guide?id=_122-apollo-meta-server)。 >注1:一套Portal可以管理多个环境,但是每个环境都需要独立部署一套Config Service、Admin Service和ApolloConfigDB,具体请参考:[2.1.2 创建ApolloConfigDB](zh/deployment/distributed-deployment-guide?id=_212-创建apolloconfigdb),[3.2 调整ApolloConfigDB配置](zh/deployment/distributed-deployment-guide?id=_32-调整apolloconfigdb配置),[2.2.1.1.2 配置数据库连接信息](zh/deployment/distributed-deployment-guide?id=_22112-配置数据库连接信息) > 注2:如果是为已经运行了一段时间的Apollo配置中心增加环境,别忘了参考[2.1.2.4 从别的环境导入ApolloConfigDB的项目数据](zh/deployment/distributed-deployment-guide?id=_2124-从别的环境导入apolloconfigdb的项目数据)对新的环境做初始化 ### 5. 如何删除应用、集群、Namespace? 0.11.0版本开始Apollo管理员增加了删除应用、集群和AppNamespace的页面,建议使用该页面进行删除。 页面入口: ![delete-app-cluster-namespace-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/delete-app-cluster-namespace-entry.png) 页面详情: ![delete-app-cluster-namespace-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/delete-app-cluster-namespace-detail.png) ### 6. 客户端多块网卡造成获取IP不准,如何解决? 获取客户端网卡逻辑在1.4.0版本有所调整,所以需要根据客户端版本区分 #### 6.1 apollo-client为1.3.0及之前的版本 如果有多网卡,且都是普通网卡的话,需要在/etc/hosts里面加一条映射关系来提升权重。 格式:`ip ${hostname}` 这里的${hostname}就是你在机器上执行hostname的结果。 比如正确IP为:192.168.1.50,hostname执行结果为:jim-ubuntu-pc 那么最终在hosts文件映射的记录为: ``` 192.168.1.50 jim-ubuntu-pc ``` #### 6.2 apollo-client为1.4.0及之后的版本 如果有多网卡,且都是普通网卡的话,可以通过调整它们在系统中的顺序来改变优先级,顺序在前的优先级更高。 ### 7. 通过Apollo动态调整Spring Boot的Logging level 可以参考[apollo-use-cases](https://github.com/ctripcorp/apollo-use-cases)项目中的[spring-cloud-logger](https://github.com/ctripcorp/apollo-use-cases/tree/master/spring-cloud-logger)和[spring-boot-logger](https://github.com/ctripcorp/apollo-use-cases/tree/master/spring-boot-logger)代码示例。 ### 8. 将Config Service和Admin Service注册到单独的Eureka Server上 Apollo默认自带了Eureka作为内部的注册中心实现,一般情况下不需要考虑为Apollo单独部署注册中心。 不过有些公司自己已经有了一套Eureka,如果希望把Apollo的Config Service和Admin Service也注册过去实现统一管理的话,可以按照如下步骤操作: #### 1. 配置Config Service不启动内置Eureka Server ##### 1.1 1.5.0及以上版本 为apollo-configservice配置`apollo.eureka.server.enabled=false`即可,通过bootstrap.yml或-D参数等方式皆可。 ##### 1.2 1.5.0之前的版本 修改[com.ctrip.framework.apollo.configservice.ConfigServiceApplication](https://github.com/ctripcorp/apollo/blob/master/apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/ConfigServiceApplication.java),把`@EnableEurekaServer`改为`@EnableEurekaClient` ```java @EnableEurekaClient @EnableAspectJAutoProxy @EnableAutoConfiguration // (exclude = EurekaClientConfigBean.class) @Configuration @EnableTransactionManagement @PropertySource(value = {"classpath:configservice.properties"}) @ComponentScan(basePackageClasses = {ApolloCommonConfig.class, ApolloBizConfig.class, ConfigServiceApplication.class, ApolloMetaServiceConfig.class}) public class ConfigServiceApplication { ... } ``` #### 2. 修改ApolloConfigDB.ServerConfig表中的`eureka.service.url`,指向自己的Eureka地址 比如自己的Eureka服务地址是1.1.1.1:8761和2.2.2.2:8761,那么就将ApolloConfigDB.ServerConfig表中设置eureka.service.url为: ``` http://1.1.1.1:8761/eureka/,http://2.2.2.2:8761/eureka/ ``` 需要注意的是更改Eureka地址只需要改ApolloConfigDB.ServerConfig表中的`eureka.service.url`即可,不需要修改meta server地址。 > 默认情况下,meta service和config service是部署在同一个JVM进程,所以meta service的地址就是config service的地址,修改Eureka地址时不需要修改meta server地址。 ### 9. Spring Boot中使用`ConditionalOnProperty`读取不到配置 `@ConditionalOnProperty`功能从0.10.0版本开始支持,具体可以参考 [Spring Boot集成方式](zh/usage/java-sdk-user-guide?id=_3213-spring-boot集成方式(推荐)) ### 10. 多机房如何实现A机房的客户端就近读取A机房的config service,B机房的客户端就近读取B机房的config service? 请参考[Issue 1294](https://github.com/ctripcorp/apollo/issues/1294),该案例中由于中美机房相距甚远,所以需要config db两地部署,如果是同城多机房的话,两个机房的config service可以连同一个config db。 ### 11. apollo是否有支持HEAD请求的页面?阿里云slb配置健康检查只支持HEAD请求 apollo的每个服务都有`/health`页面的,该页面是apollo用来做健康检测的,支持各种请求方法,如GET, POST, HEAD等。 ### 12. apollo如何配置查看权限? 从1.1.0版本开始,apollo-portal增加了查看权限的支持,可以支持配置某个环境只允许项目成员查看私有Namespace的配置。 这里的项目成员是指: 1. 项目的管理员 2. 具备该私有Namespace在该环境下的修改或发布权限 配置方式很简单,用超级管理员账号登录后,进入`管理员工具 - 系统参数`页面新增或修改`configView.memberOnly.envs`配置项即可。 ![configView.memberOnly.envs](https://user-images.githubusercontent.com/837658/46456519-c155e100-c7e1-11e8-969b-8f332379fa29.png) ### 13. apollo如何放在独立的tomcat中跑? 有些公司的运维策略可能会要求必须使用独立的tomcat跑应用,不允许apollo默认的startup.sh方式运行,下面以apollo-configservice为例简述一下如何使apollo服务端运行在独立的tomcat中: 1. 获取apollo代码(生产部署建议用release的版本) 2. 修改apollo-configservice的pom.xml,增加`<packaging>war</packaging>` 3. 按照分布式部署文档配置build.sh,然后打包 4. 把apollo-configservice的war包放到tomcat下 * cp apollo-configservice/target/apollo-configservice-xxx.war ${tomcat-dir}/webapps/ROOT.war 运行tomcat的startup.sh 5. 运行tomcat的startup.sh 另外,apollo还有一些调优参数建议在tomcat的server.xml中配置一下,可以参考[application.properties](https://github.com/ctripcorp/apollo/blob/master/apollo-common/src/main/resources/application.properties#L12) ### 14. 注册中心Eureka如何替换为zookeeper? 许多公司微服务项目已经在使用zookeeper,如果出于方便服务管理的目的,希望Eureka替换为zookeeper的情况,可以参考[@hanyidreamer](https://github.com/hanyidreamer)贡献的改造步骤:[注册中心Eureka替换为zookeeper](https://blog.csdn.net/u014732209/article/details/89555535) ### 15. 本地多人同时开发,如何实现配置不一样且互不影响? 参考[#1560](https://github.com/ctripcorp/apollo/issues/1560) ### 16. Portal挂载到nginx/slb后如何设置相对路径? 一般情况下建议直接使用根目录来挂载portal,不过如果有些情况希望和其它应用共用nginx/slb,需要加上相对路径(如/apollo),那么可以按照下面的方式配置。 #### 16.1 Portal为1.7.0及以上版本 首先为apollo-portal增加-D参数`server.servlet.context-path=/apollo`或系统环境变量`SERVER_SERVLET_CONTEXT_PATH=/apollo`。 然后在nginx/slb上配置转发即可,以nginx为例: ``` location /apollo/ { proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://127.0.0.1:8070/apollo/; } ``` #### 16.2 Portal为1.6.0及以上版本 首先为portal加上`prefix.path=/apollo`配置参数,配置方式很简单,用超级管理员账号登录后,进入`管理员工具 - 系统参数`页面新增或修改`prefix.path`配置项即可。 然后在nginx/slb上配置转发即可,以nginx为例: ``` location /apollo/ { proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://127.0.0.1:8070/; } ```
### 1. windows怎么执行build.sh? 安装[Git Bash](https://git-for-windows.github.io/),然后运行 “./build.sh” 注意前面 “./” ### 2. 本地运行时Portal一直报Env is down. 默认config service启动在8080端口,admin service启动在8090端口。请确认这两个端口是否被其它应用程序占用。 如果还伴有异常信息:org.springframework.web.client.HttpClientErrorException: 405 Method Not Allowed,一般是由于本地启动了`ShadowSocks`,因为`ShadowSocks`默认会占用8090端口。 1.1.0版本增加了**系统信息**页面,可以通过`管理员工具` -> `系统信息`查看当前各个环境的Meta Server以及admin service信息,有助于排查问题。 ### 3. admin server 或者 config server 注册了内网IP,导致portal或者client访问不了admin server或config server 请参考[网络策略](zh/deployment/distributed-deployment-guide?id=_14-网络策略)。 ### 4. Portal如何增加环境? #### 4.1 1.6.0及以上的版本 1.6.0版本增加了自定义环境的功能,可以在不修改代码的情况增加环境 1. protaldb增加环境,参考[3.1 调整ApolloPortalDB配置](zh/deployment/distributed-deployment-guide?id=_31-调整apolloportaldb配置) 2. 为apollo-portal添加新增环境对应的meta server地址,具体参考:[2.2.1.1.2.4 配置apollo-portal的meta service信息](zh/deployment/distributed-deployment-guide?id=_221124-配置apollo-portal的meta-service信息)。apollo-client在新的环境下使用时也需要做好相应的配置,具体参考:[1.2.2 Apollo Meta Server](zh/usage/java-sdk-user-guide?id=_122-apollo-meta-server)。 >注1:一套Portal可以管理多个环境,但是每个环境都需要独立部署一套Config Service、Admin Service和ApolloConfigDB,具体请参考:[2.1.2 创建ApolloConfigDB](zh/deployment/distributed-deployment-guide?id=_212-创建apolloconfigdb),[3.2 调整ApolloConfigDB配置](zh/deployment/distributed-deployment-guide?id=_32-调整apolloconfigdb配置),[2.2.1.1.2 配置数据库连接信息](zh/deployment/distributed-deployment-guide?id=_22112-配置数据库连接信息) > 注2:如果是为已经运行了一段时间的Apollo配置中心增加环境,别忘了参考[2.1.2.4 从别的环境导入ApolloConfigDB的项目数据](zh/deployment/distributed-deployment-guide?id=_2124-从别的环境导入apolloconfigdb的项目数据)对新的环境做初始化 #### 4.2 1.5.1及之前的版本 ##### 4.2.1 添加Apollo预先定义好的环境 如果需要添加的环境是Apollo预先定义的环境(DEV, FAT, UAT, PRO),需要两步操作: 1. protaldb增加环境,参考[3.1 调整ApolloPortalDB配置](zh/deployment/distributed-deployment-guide?id=_31-调整apolloportaldb配置) 2. 为apollo-portal添加新增环境对应的meta server地址,具体参考:[2.2.1.1.2.4 配置apollo-portal的meta service信息](zh/deployment/distributed-deployment-guide?id=_221124-配置apollo-portal的meta-service信息)。apollo-client在新的环境下使用时也需要做好相应的配置,具体参考:[1.2.2 Apollo Meta Server](zh/usage/java-sdk-user-guide?id=_122-apollo-meta-server)。 >注1:一套Portal可以管理多个环境,但是每个环境都需要独立部署一套Config Service、Admin Service和ApolloConfigDB,具体请参考:[2.1.2 创建ApolloConfigDB](zh/deployment/distributed-deployment-guide?id=_212-创建apolloconfigdb),[3.2 调整ApolloConfigDB配置](zh/deployment/distributed-deployment-guide?id=_32-调整apolloconfigdb配置),[2.2.1.1.2 配置数据库连接信息](zh/deployment/distributed-deployment-guide?id=_22112-配置数据库连接信息) > 注2:如果是为已经运行了一段时间的Apollo配置中心增加环境,别忘了参考[2.1.2.4 从别的环境导入ApolloConfigDB的项目数据](zh/deployment/distributed-deployment-guide?id=_2124-从别的环境导入apolloconfigdb的项目数据)对新的环境做初始化 ##### 4.2.2 添加自定义的环境 如果需要添加的环境不是Apollo预先定义的环境,请参照如下步骤操作: 1. 假设需要添加的环境名称叫beta 2. 修改[com.ctrip.framework.apollo.core.enums.Env](https://github.com/ctripcorp/apollo/blob/master/apollo-core/src/main/java/com/ctrip/framework/apollo/core/enums/Env.java)类,在其中加入`BETA`枚举: ```java public enum Env{ LOCAL, DEV, BETA, FWS, FAT, UAT, LPT, PRO, TOOLS, UNKNOWN; ... } ``` 3. 修改[com.ctrip.framework.apollo.core.enums.EnvUtils](https://github.com/ctripcorp/apollo/blob/master/apollo-core/src/main/java/com/ctrip/framework/apollo/core/enums/EnvUtils.java)类,在其中加入`BETA`枚举的转换逻辑: ```java public final class EnvUtils { public static Env transformEnv(String envName) { if (StringUtils.isBlank(envName)) { return Env.UNKNOWN; } switch (envName.trim().toUpperCase()) { ... case "BETA": return Env.BETA; ... default: return Env.UNKNOWN; } } } ``` 4. 修改[apollo-env.properties](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/resources/apollo-env.properties),增加`beta.meta`占位符: ```properties local.meta=http://localhost:8080 dev.meta=${dev_meta} fat.meta=${fat_meta} beta.meta=${beta_meta} uat.meta=${uat_meta} lpt.meta=${lpt_meta} pro.meta=${pro_meta} ``` 5. 修改[com.ctrip.framework.apollo.core.internals.LegacyMetaServerProvider](https://github.com/ctripcorp/apollo/blob/master/apollo-core/src/main/java/com/ctrip/framework/apollo/core/internals/LegacyMetaServerProvider.java)类,增加读取`BETA`环境的meta server地址逻辑: ```java public class LegacyMetaServerProvider { ... domains.put(Env.BETA, getMetaServerAddress(prop, "beta_meta", "beta.meta")); ... } ``` 6. protaldb增加`BETA`环境,参考[3.1 调整ApolloPortalDB配置](zh/deployment/distributed-deployment-guide?id=_31-调整apolloportaldb配置) 7. 为apollo-portal添加新增环境对应的meta server地址,具体参考:[2.2.1.1.2.4 配置apollo-portal的meta service信息](zh/deployment/distributed-deployment-guide?id=_221124-配置apollo-portal的meta-service信息)。apollo-client在新的环境下使用时也需要做好相应的配置,具体参考:[1.2.2 Apollo Meta Server](zh/usage/java-sdk-user-guide?id=_122-apollo-meta-server)。 >注1:一套Portal可以管理多个环境,但是每个环境都需要独立部署一套Config Service、Admin Service和ApolloConfigDB,具体请参考:[2.1.2 创建ApolloConfigDB](zh/deployment/distributed-deployment-guide?id=_212-创建apolloconfigdb),[3.2 调整ApolloConfigDB配置](zh/deployment/distributed-deployment-guide?id=_32-调整apolloconfigdb配置),[2.2.1.1.2 配置数据库连接信息](zh/deployment/distributed-deployment-guide?id=_22112-配置数据库连接信息) > 注2:如果是为已经运行了一段时间的Apollo配置中心增加环境,别忘了参考[2.1.2.4 从别的环境导入ApolloConfigDB的项目数据](zh/deployment/distributed-deployment-guide?id=_2124-从别的环境导入apolloconfigdb的项目数据)对新的环境做初始化 ### 5. 如何删除应用、集群、Namespace? 0.11.0版本开始Apollo管理员增加了删除应用、集群和AppNamespace的页面,建议使用该页面进行删除。 页面入口: ![delete-app-cluster-namespace-entry](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/delete-app-cluster-namespace-entry.png) 页面详情: ![delete-app-cluster-namespace-detail](https://raw.githubusercontent.com/ctripcorp/apollo/master/doc/images/delete-app-cluster-namespace-detail.png) ### 6. 客户端多块网卡造成获取IP不准,如何解决? 获取客户端网卡逻辑在1.4.0版本有所调整,所以需要根据客户端版本区分 #### 6.1 apollo-client为1.3.0及之前的版本 如果有多网卡,且都是普通网卡的话,需要在/etc/hosts里面加一条映射关系来提升权重。 格式:`ip ${hostname}` 这里的${hostname}就是你在机器上执行hostname的结果。 比如正确IP为:192.168.1.50,hostname执行结果为:jim-ubuntu-pc 那么最终在hosts文件映射的记录为: ``` 192.168.1.50 jim-ubuntu-pc ``` #### 6.2 apollo-client为1.4.0及之后的版本 如果有多网卡,且都是普通网卡的话,可以通过调整它们在系统中的顺序来改变优先级,顺序在前的优先级更高。 ### 7. 通过Apollo动态调整Spring Boot的Logging level 可以参考[apollo-use-cases](https://github.com/ctripcorp/apollo-use-cases)项目中的[spring-cloud-logger](https://github.com/ctripcorp/apollo-use-cases/tree/master/spring-cloud-logger)和[spring-boot-logger](https://github.com/ctripcorp/apollo-use-cases/tree/master/spring-boot-logger)代码示例。 ### 8. 将Config Service和Admin Service注册到单独的Eureka Server上 Apollo默认自带了Eureka作为内部的注册中心实现,一般情况下不需要考虑为Apollo单独部署注册中心。 不过有些公司自己已经有了一套Eureka,如果希望把Apollo的Config Service和Admin Service也注册过去实现统一管理的话,可以按照如下步骤操作: #### 1. 配置Config Service不启动内置Eureka Server ##### 1.1 1.5.0及以上版本 为apollo-configservice配置`apollo.eureka.server.enabled=false`即可,通过bootstrap.yml或-D参数等方式皆可。 ##### 1.2 1.5.0之前的版本 修改[com.ctrip.framework.apollo.configservice.ConfigServiceApplication](https://github.com/ctripcorp/apollo/blob/master/apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/ConfigServiceApplication.java),把`@EnableEurekaServer`改为`@EnableEurekaClient` ```java @EnableEurekaClient @EnableAspectJAutoProxy @EnableAutoConfiguration // (exclude = EurekaClientConfigBean.class) @Configuration @EnableTransactionManagement @PropertySource(value = {"classpath:configservice.properties"}) @ComponentScan(basePackageClasses = {ApolloCommonConfig.class, ApolloBizConfig.class, ConfigServiceApplication.class, ApolloMetaServiceConfig.class}) public class ConfigServiceApplication { ... } ``` #### 2. 修改ApolloConfigDB.ServerConfig表中的`eureka.service.url`,指向自己的Eureka地址 比如自己的Eureka服务地址是1.1.1.1:8761和2.2.2.2:8761,那么就将ApolloConfigDB.ServerConfig表中设置eureka.service.url为: ``` http://1.1.1.1:8761/eureka/,http://2.2.2.2:8761/eureka/ ``` 需要注意的是更改Eureka地址只需要改ApolloConfigDB.ServerConfig表中的`eureka.service.url`即可,不需要修改meta server地址。 > 默认情况下,meta service和config service是部署在同一个JVM进程,所以meta service的地址就是config service的地址,修改Eureka地址时不需要修改meta server地址。 ### 9. Spring Boot中使用`ConditionalOnProperty`读取不到配置 `@ConditionalOnProperty`功能从0.10.0版本开始支持,具体可以参考 [Spring Boot集成方式](zh/usage/java-sdk-user-guide?id=_3213-spring-boot集成方式(推荐)) ### 10. 多机房如何实现A机房的客户端就近读取A机房的config service,B机房的客户端就近读取B机房的config service? 请参考[Issue 1294](https://github.com/ctripcorp/apollo/issues/1294),该案例中由于中美机房相距甚远,所以需要config db两地部署,如果是同城多机房的话,两个机房的config service可以连同一个config db。 ### 11. apollo是否有支持HEAD请求的页面?阿里云slb配置健康检查只支持HEAD请求 apollo的每个服务都有`/health`页面的,该页面是apollo用来做健康检测的,支持各种请求方法,如GET, POST, HEAD等。 ### 12. apollo如何配置查看权限? 从1.1.0版本开始,apollo-portal增加了查看权限的支持,可以支持配置某个环境只允许项目成员查看私有Namespace的配置。 这里的项目成员是指: 1. 项目的管理员 2. 具备该私有Namespace在该环境下的修改或发布权限 配置方式很简单,用超级管理员账号登录后,进入`管理员工具 - 系统参数`页面新增或修改`configView.memberOnly.envs`配置项即可。 ![configView.memberOnly.envs](https://user-images.githubusercontent.com/837658/46456519-c155e100-c7e1-11e8-969b-8f332379fa29.png) ### 13. apollo如何放在独立的tomcat中跑? 有些公司的运维策略可能会要求必须使用独立的tomcat跑应用,不允许apollo默认的startup.sh方式运行,下面以apollo-configservice为例简述一下如何使apollo服务端运行在独立的tomcat中: 1. 获取apollo代码(生产部署建议用release的版本) 2. 修改apollo-configservice的pom.xml,增加`<packaging>war</packaging>` 3. 按照分布式部署文档配置build.sh,然后打包 4. 把apollo-configservice的war包放到tomcat下 * cp apollo-configservice/target/apollo-configservice-xxx.war ${tomcat-dir}/webapps/ROOT.war 运行tomcat的startup.sh 5. 运行tomcat的startup.sh 另外,apollo还有一些调优参数建议在tomcat的server.xml中配置一下,可以参考[application.properties](https://github.com/ctripcorp/apollo/blob/master/apollo-common/src/main/resources/application.properties#L12) ### 14. 注册中心Eureka如何替换为zookeeper? 许多公司微服务项目已经在使用zookeeper,如果出于方便服务管理的目的,希望Eureka替换为zookeeper的情况,可以参考[@hanyidreamer](https://github.com/hanyidreamer)贡献的改造步骤:[注册中心Eureka替换为zookeeper](https://blog.csdn.net/u014732209/article/details/89555535) ### 15. 本地多人同时开发,如何实现配置不一样且互不影响? 参考[#1560](https://github.com/ctripcorp/apollo/issues/1560) ### 16. Portal挂载到nginx/slb后如何设置相对路径? 一般情况下建议直接使用根目录来挂载portal,不过如果有些情况希望和其它应用共用nginx/slb,需要加上相对路径(如/apollo),那么可以按照下面的方式配置。 #### 16.1 Portal为1.7.0及以上版本 首先为apollo-portal增加-D参数`server.servlet.context-path=/apollo`或系统环境变量`SERVER_SERVLET_CONTEXT_PATH=/apollo`。 然后在nginx/slb上配置转发即可,以nginx为例: ``` location /apollo/ { proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://127.0.0.1:8070/apollo/; } ``` #### 16.2 Portal为1.6.0及以上版本 首先为portal加上`prefix.path=/apollo`配置参数,配置方式很简单,用超级管理员账号登录后,进入`管理员工具 - 系统参数`页面新增或修改`prefix.path`配置项即可。 然后在nginx/slb上配置转发即可,以nginx为例: ``` location /apollo/ { proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://127.0.0.1:8070/; } ```
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./apollo-client/src/test/resources/spring/XmlConfigPlaceholderTest9.xml
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:apollo="http://www.ctrip.com/schema/apollo" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd"> <context:annotation-config /> <apollo:config/> <bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderAutoUpdateTest.TestXmlBeanWithInjectedValue"> <property name="batch" value="${batch}"/> </bean> </beans>
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:apollo="http://www.ctrip.com/schema/apollo" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd"> <context:annotation-config /> <apollo:config/> <bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderAutoUpdateTest.TestXmlBeanWithInjectedValue"> <property name="batch" value="${batch}"/> </bean> </beans>
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./apollo-portal/src/main/resources/static/config_export.html
<!doctype html> <html ng-app="config_export"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="icon" href="img/config.png"> <!-- styles --> <link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="vendor/angular/angular-toastr-1.4.1.min.css"> <link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css"> <link rel="stylesheet" type="text/css" media='all' href="vendor/angular/loading-bar.min.css"> <link rel="stylesheet" type="text/css" href="styles/common-style.css"> <title>{{'ConfigExport.Title' | translate }}</title> </head> <body> <apollonav></apollonav> <div class="container-fluid"> <div class="col-md-8 col-md-offset-2 panel"> <section class="panel-body"> <div class="row"> <header class="panel-heading"> {{'ConfigExport.Title' | translate }} <small> {{'ConfigExport.TitleTips' | translate}} </small> </header> <div class="col-sm-offset-2 col-sm-9"> <a href="export" target="_blank"> <button class="btn btn-block btn-lg btn-primary"> {{'ConfigExport.Download' | translate }} </button> </a> </div> </div> </section> </div> </div> <div ng-include="'views/common/footer.html'"></div> <!-- jquery.js --> <script src="vendor/jquery.min.js" type="text/javascript"></script> <!--angular--> <script src="vendor/angular/angular.min.js"></script> <script src="vendor/angular/angular-route.min.js"></script> <script src="vendor/angular/angular-resource.min.js"></script> <script src="vendor/angular/angular-toastr-1.4.1.tpls.min.js"></script> <script src="vendor/angular/loading-bar.min.js"></script> <script src="vendor/angular/angular-cookies.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate-loader-static-files.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate-storage-cookie.min.js"></script> <!--valdr--> <script src="vendor/valdr/valdr.min.js" type="text/javascript"></script> <script src="vendor/valdr/valdr-message.min.js" type="text/javascript"></script> <!-- bootstrap.js --> <script src="vendor/bootstrap/js/bootstrap.min.js" type="text/javascript"></script> <script src="vendor/lodash.min.js"></script> <script src="vendor/select2/select2.min.js" type="text/javascript"></script> <!--biz--> <!--must import--> <script type="application/javascript" src="scripts/app.js"></script> <script type="application/javascript" src="scripts/services/AppService.js"></script> <script type="application/javascript" src="scripts/services/EnvService.js"></script> <script type="application/javascript" src="scripts/services/UserService.js"></script> <script type="application/javascript" src="scripts/services/CommonService.js"></script> <script type="application/javascript" src="scripts/services/PermissionService.js"></script> <script type="application/javascript" src="scripts/services/ClusterService.js"></script> <script type="application/javascript" src="scripts/services/NamespaceService.js"></script> <script type="application/javascript" src="scripts/services/SystemInfoService.js"></script> <script type="application/javascript" src="scripts/AppUtils.js"></script> <script type="application/javascript" src="scripts/PageCommon.js"></script> <script type="application/javascript" src="scripts/directive/directive.js"></script> <script type="application/javascript" src="scripts/valdr.js"></script> <script type="application/javascript" src="scripts/AppUtils.js"></script> <script type="application/javascript" src="scripts/services/OrganizationService.js"></script> </body> </html>
<!doctype html> <html ng-app="config_export"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="icon" href="img/config.png"> <!-- styles --> <link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="vendor/angular/angular-toastr-1.4.1.min.css"> <link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css"> <link rel="stylesheet" type="text/css" media='all' href="vendor/angular/loading-bar.min.css"> <link rel="stylesheet" type="text/css" href="styles/common-style.css"> <title>{{'ConfigExport.Title' | translate }}</title> </head> <body> <apollonav></apollonav> <div class="container-fluid"> <div class="col-md-8 col-md-offset-2 panel"> <section class="panel-body"> <div class="row"> <header class="panel-heading"> {{'ConfigExport.Title' | translate }} <small> {{'ConfigExport.TitleTips' | translate}} </small> </header> <div class="col-sm-offset-2 col-sm-9"> <a href="export" target="_blank"> <button class="btn btn-block btn-lg btn-primary"> {{'ConfigExport.Download' | translate }} </button> </a> </div> </div> </section> </div> </div> <div ng-include="'views/common/footer.html'"></div> <!-- jquery.js --> <script src="vendor/jquery.min.js" type="text/javascript"></script> <!--angular--> <script src="vendor/angular/angular.min.js"></script> <script src="vendor/angular/angular-route.min.js"></script> <script src="vendor/angular/angular-resource.min.js"></script> <script src="vendor/angular/angular-toastr-1.4.1.tpls.min.js"></script> <script src="vendor/angular/loading-bar.min.js"></script> <script src="vendor/angular/angular-cookies.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate-loader-static-files.min.js"></script> <script src="vendor/angular/angular-translate.2.18.1/angular-translate-storage-cookie.min.js"></script> <!--valdr--> <script src="vendor/valdr/valdr.min.js" type="text/javascript"></script> <script src="vendor/valdr/valdr-message.min.js" type="text/javascript"></script> <!-- bootstrap.js --> <script src="vendor/bootstrap/js/bootstrap.min.js" type="text/javascript"></script> <script src="vendor/lodash.min.js"></script> <script src="vendor/select2/select2.min.js" type="text/javascript"></script> <!--biz--> <!--must import--> <script type="application/javascript" src="scripts/app.js"></script> <script type="application/javascript" src="scripts/services/AppService.js"></script> <script type="application/javascript" src="scripts/services/EnvService.js"></script> <script type="application/javascript" src="scripts/services/UserService.js"></script> <script type="application/javascript" src="scripts/services/CommonService.js"></script> <script type="application/javascript" src="scripts/services/PermissionService.js"></script> <script type="application/javascript" src="scripts/services/ClusterService.js"></script> <script type="application/javascript" src="scripts/services/NamespaceService.js"></script> <script type="application/javascript" src="scripts/services/SystemInfoService.js"></script> <script type="application/javascript" src="scripts/AppUtils.js"></script> <script type="application/javascript" src="scripts/PageCommon.js"></script> <script type="application/javascript" src="scripts/directive/directive.js"></script> <script type="application/javascript" src="scripts/valdr.js"></script> <script type="application/javascript" src="scripts/AppUtils.js"></script> <script type="application/javascript" src="scripts/services/OrganizationService.js"></script> </body> </html>
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./apollo-client/src/main/java/com/ctrip/framework/apollo/build/ApolloInjector.java
package com.ctrip.framework.apollo.build; import com.ctrip.framework.apollo.exceptions.ApolloConfigException; import com.ctrip.framework.apollo.internals.Injector; import com.ctrip.framework.apollo.tracer.Tracer; import com.ctrip.framework.foundation.internals.ServiceBootstrap; /** * @author Jason Song([email protected]) */ public class ApolloInjector { private static volatile Injector s_injector; private static final Object lock = new Object(); private static Injector getInjector() { if (s_injector == null) { synchronized (lock) { if (s_injector == null) { try { s_injector = ServiceBootstrap.loadFirst(Injector.class); } catch (Throwable ex) { ApolloConfigException exception = new ApolloConfigException("Unable to initialize Apollo Injector!", ex); Tracer.logError(exception); throw exception; } } } } return s_injector; } public static <T> T getInstance(Class<T> clazz) { try { return getInjector().getInstance(clazz); } catch (Throwable ex) { Tracer.logError(ex); throw new ApolloConfigException(String.format("Unable to load instance for type %s!", clazz.getName()), ex); } } public static <T> T getInstance(Class<T> clazz, String name) { try { return getInjector().getInstance(clazz, name); } catch (Throwable ex) { Tracer.logError(ex); throw new ApolloConfigException( String.format("Unable to load instance for type %s and name %s !", clazz.getName(), name), ex); } } }
package com.ctrip.framework.apollo.build; import com.ctrip.framework.apollo.exceptions.ApolloConfigException; import com.ctrip.framework.apollo.internals.Injector; import com.ctrip.framework.apollo.tracer.Tracer; import com.ctrip.framework.foundation.internals.ServiceBootstrap; /** * @author Jason Song([email protected]) */ public class ApolloInjector { private static volatile Injector s_injector; private static final Object lock = new Object(); private static Injector getInjector() { if (s_injector == null) { synchronized (lock) { if (s_injector == null) { try { s_injector = ServiceBootstrap.loadFirst(Injector.class); } catch (Throwable ex) { ApolloConfigException exception = new ApolloConfigException("Unable to initialize Apollo Injector!", ex); Tracer.logError(exception); throw exception; } } } } return s_injector; } public static <T> T getInstance(Class<T> clazz) { try { return getInjector().getInstance(clazz); } catch (Throwable ex) { Tracer.logError(ex); throw new ApolloConfigException(String.format("Unable to load instance for type %s!", clazz.getName()), ex); } } public static <T> T getInstance(Class<T> clazz, String name) { try { return getInjector().getInstance(clazz, name); } catch (Throwable ex) { Tracer.logError(ex); throw new ApolloConfigException( String.format("Unable to load instance for type %s and name %s !", clazz.getName(), name), ex); } } }
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./apollo-configservice/src/test/java/com/ctrip/framework/apollo/configservice/controller/ConfigFileControllerTest.java
package com.ctrip.framework.apollo.configservice.controller; import com.ctrip.framework.apollo.biz.entity.ReleaseMessage; import com.ctrip.framework.apollo.biz.grayReleaseRule.GrayReleaseRulesHolder; import com.ctrip.framework.apollo.biz.message.Topics; import com.ctrip.framework.apollo.configservice.util.NamespaceUtil; import com.ctrip.framework.apollo.configservice.util.WatchKeysUtil; import com.ctrip.framework.apollo.core.dto.ApolloConfig; import com.google.common.cache.Cache; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.collect.Multimap; import com.google.common.collect.Sets; import com.google.common.reflect.TypeToken; import com.google.gson.Gson; import java.lang.reflect.Type; import java.util.Map; import java.util.Set; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.test.util.ReflectionTestUtils; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; /** * @author Jason Song([email protected]) */ @RunWith(MockitoJUnitRunner.class) public class ConfigFileControllerTest { @Mock private ConfigController configController; @Mock private WatchKeysUtil watchKeysUtil; @Mock private NamespaceUtil namespaceUtil; @Mock private GrayReleaseRulesHolder grayReleaseRulesHolder; private ConfigFileController configFileController; private String someAppId; private String someClusterName; private String someNamespace; private String someDataCenter; private String someClientIp; @Mock private HttpServletResponse someResponse; @Mock private HttpServletRequest someRequest; Multimap<String, String> watchedKeys2CacheKey; Multimap<String, String> cacheKey2WatchedKeys; private static final Gson GSON = new Gson(); @Before public void setUp() throws Exception { configFileController = new ConfigFileController( configController, namespaceUtil, watchKeysUtil, grayReleaseRulesHolder ); someAppId = "someAppId"; someClusterName = "someClusterName"; someNamespace = "someNamespace"; someDataCenter = "someDataCenter"; someClientIp = "10.1.1.1"; when(namespaceUtil.filterNamespaceName(someNamespace)).thenReturn(someNamespace); when(namespaceUtil.normalizeNamespace(someAppId, someNamespace)).thenReturn(someNamespace); when(grayReleaseRulesHolder.hasGrayReleaseRule(anyString(), anyString(), anyString())) .thenReturn(false); watchedKeys2CacheKey = (Multimap<String, String>) ReflectionTestUtils .getField(configFileController, "watchedKeys2CacheKey"); cacheKey2WatchedKeys = (Multimap<String, String>) ReflectionTestUtils .getField(configFileController, "cacheKey2WatchedKeys"); } @Test public void testQueryConfigAsProperties() throws Exception { String someKey = "someKey"; String someValue = "someValue"; String anotherKey = "anotherKey"; String anotherValue = "anotherValue"; String someWatchKey = "someWatchKey"; String anotherWatchKey = "anotherWatchKey"; Set<String> watchKeys = Sets.newHashSet(someWatchKey, anotherWatchKey); String cacheKey = configFileController .assembleCacheKey(ConfigFileController.ConfigFileOutputFormat.PROPERTIES, someAppId, someClusterName, someNamespace, someDataCenter); Map<String, String> configurations = ImmutableMap.of(someKey, someValue, anotherKey, anotherValue); ApolloConfig someApolloConfig = mock(ApolloConfig.class); when(someApolloConfig.getConfigurations()).thenReturn(configurations); when(configController .queryConfig(someAppId, someClusterName, someNamespace, someDataCenter, "-1", someClientIp, null, someRequest, someResponse)).thenReturn(someApolloConfig); when(watchKeysUtil .assembleAllWatchKeys(someAppId, someClusterName, someNamespace, someDataCenter)) .thenReturn(watchKeys); ResponseEntity<String> response = configFileController .queryConfigAsProperties(someAppId, someClusterName, someNamespace, someDataCenter, someClientIp, someRequest, someResponse); assertEquals(2, watchedKeys2CacheKey.size()); assertEquals(2, cacheKey2WatchedKeys.size()); assertTrue(watchedKeys2CacheKey.containsEntry(someWatchKey, cacheKey)); assertTrue(watchedKeys2CacheKey.containsEntry(anotherWatchKey, cacheKey)); assertTrue(cacheKey2WatchedKeys.containsEntry(cacheKey, someWatchKey)); assertTrue(cacheKey2WatchedKeys.containsEntry(cacheKey, anotherWatchKey)); assertEquals(HttpStatus.OK, response.getStatusCode()); assertTrue(response.getBody().contains(String.format("%s=%s", someKey, someValue))); assertTrue(response.getBody().contains(String.format("%s=%s", anotherKey, anotherValue))); ResponseEntity<String> anotherResponse = configFileController .queryConfigAsProperties(someAppId, someClusterName, someNamespace, someDataCenter, someClientIp, someRequest, someResponse); assertEquals(response, anotherResponse); verify(configController, times(1)) .queryConfig(someAppId, someClusterName, someNamespace, someDataCenter, "-1", someClientIp, null, someRequest, someResponse); } @Test public void testQueryConfigAsJson() throws Exception { String someKey = "someKey"; String someValue = "someValue"; Type responseType = new TypeToken<Map<String, String>>(){}.getType(); String someWatchKey = "someWatchKey"; Set<String> watchKeys = Sets.newHashSet(someWatchKey); Map<String, String> configurations = ImmutableMap.of(someKey, someValue); ApolloConfig someApolloConfig = mock(ApolloConfig.class); when(configController .queryConfig(someAppId, someClusterName, someNamespace, someDataCenter, "-1", someClientIp, null, someRequest, someResponse)).thenReturn(someApolloConfig); when(someApolloConfig.getConfigurations()).thenReturn(configurations); when(watchKeysUtil .assembleAllWatchKeys(someAppId, someClusterName, someNamespace, someDataCenter)) .thenReturn(watchKeys); ResponseEntity<String> response = configFileController .queryConfigAsJson(someAppId, someClusterName, someNamespace, someDataCenter, someClientIp, someRequest, someResponse); assertEquals(HttpStatus.OK, response.getStatusCode()); assertEquals(configurations, GSON.fromJson(response.getBody(), responseType)); } @Test public void testQueryConfigWithGrayRelease() throws Exception { String someKey = "someKey"; String someValue = "someValue"; Type responseType = new TypeToken<Map<String, String>>(){}.getType(); Map<String, String> configurations = ImmutableMap.of(someKey, someValue); when(grayReleaseRulesHolder.hasGrayReleaseRule(someAppId, someClientIp, someNamespace)) .thenReturn(true); ApolloConfig someApolloConfig = mock(ApolloConfig.class); when(someApolloConfig.getConfigurations()).thenReturn(configurations); when(configController .queryConfig(someAppId, someClusterName, someNamespace, someDataCenter, "-1", someClientIp, null, someRequest, someResponse)).thenReturn(someApolloConfig); ResponseEntity<String> response = configFileController .queryConfigAsJson(someAppId, someClusterName, someNamespace, someDataCenter, someClientIp, someRequest, someResponse); ResponseEntity<String> anotherResponse = configFileController .queryConfigAsJson(someAppId, someClusterName, someNamespace, someDataCenter, someClientIp, someRequest, someResponse); verify(configController, times(2)) .queryConfig(someAppId, someClusterName, someNamespace, someDataCenter, "-1", someClientIp, null, someRequest, someResponse); assertEquals(HttpStatus.OK, response.getStatusCode()); assertEquals(configurations, GSON.fromJson(response.getBody(), responseType)); assertTrue(watchedKeys2CacheKey.isEmpty()); assertTrue(cacheKey2WatchedKeys.isEmpty()); } @Test public void testHandleMessage() throws Exception { String someWatchKey = "someWatchKey"; String anotherWatchKey = "anotherWatchKey"; String someCacheKey = "someCacheKey"; String anotherCacheKey = "anotherCacheKey"; String someValue = "someValue"; ReleaseMessage someReleaseMessage = mock(ReleaseMessage.class); when(someReleaseMessage.getMessage()).thenReturn(someWatchKey); Cache<String, String> cache = (Cache<String, String>) ReflectionTestUtils.getField(configFileController, "localCache"); cache.put(someCacheKey, someValue); cache.put(anotherCacheKey, someValue); watchedKeys2CacheKey.putAll(someWatchKey, Lists.newArrayList(someCacheKey, anotherCacheKey)); watchedKeys2CacheKey.putAll(anotherWatchKey, Lists.newArrayList(someCacheKey, anotherCacheKey)); cacheKey2WatchedKeys.putAll(someCacheKey, Lists.newArrayList(someWatchKey, anotherWatchKey)); cacheKey2WatchedKeys.putAll(anotherCacheKey, Lists.newArrayList(someWatchKey, anotherWatchKey)); configFileController.handleMessage(someReleaseMessage, Topics.APOLLO_RELEASE_TOPIC); assertTrue(watchedKeys2CacheKey.isEmpty()); assertTrue(cacheKey2WatchedKeys.isEmpty()); } }
package com.ctrip.framework.apollo.configservice.controller; import com.ctrip.framework.apollo.biz.entity.ReleaseMessage; import com.ctrip.framework.apollo.biz.grayReleaseRule.GrayReleaseRulesHolder; import com.ctrip.framework.apollo.biz.message.Topics; import com.ctrip.framework.apollo.configservice.util.NamespaceUtil; import com.ctrip.framework.apollo.configservice.util.WatchKeysUtil; import com.ctrip.framework.apollo.core.dto.ApolloConfig; import com.google.common.cache.Cache; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.collect.Multimap; import com.google.common.collect.Sets; import com.google.common.reflect.TypeToken; import com.google.gson.Gson; import java.lang.reflect.Type; import java.util.Map; import java.util.Set; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.test.util.ReflectionTestUtils; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; /** * @author Jason Song([email protected]) */ @RunWith(MockitoJUnitRunner.class) public class ConfigFileControllerTest { @Mock private ConfigController configController; @Mock private WatchKeysUtil watchKeysUtil; @Mock private NamespaceUtil namespaceUtil; @Mock private GrayReleaseRulesHolder grayReleaseRulesHolder; private ConfigFileController configFileController; private String someAppId; private String someClusterName; private String someNamespace; private String someDataCenter; private String someClientIp; @Mock private HttpServletResponse someResponse; @Mock private HttpServletRequest someRequest; Multimap<String, String> watchedKeys2CacheKey; Multimap<String, String> cacheKey2WatchedKeys; private static final Gson GSON = new Gson(); @Before public void setUp() throws Exception { configFileController = new ConfigFileController( configController, namespaceUtil, watchKeysUtil, grayReleaseRulesHolder ); someAppId = "someAppId"; someClusterName = "someClusterName"; someNamespace = "someNamespace"; someDataCenter = "someDataCenter"; someClientIp = "10.1.1.1"; when(namespaceUtil.filterNamespaceName(someNamespace)).thenReturn(someNamespace); when(namespaceUtil.normalizeNamespace(someAppId, someNamespace)).thenReturn(someNamespace); when(grayReleaseRulesHolder.hasGrayReleaseRule(anyString(), anyString(), anyString())) .thenReturn(false); watchedKeys2CacheKey = (Multimap<String, String>) ReflectionTestUtils .getField(configFileController, "watchedKeys2CacheKey"); cacheKey2WatchedKeys = (Multimap<String, String>) ReflectionTestUtils .getField(configFileController, "cacheKey2WatchedKeys"); } @Test public void testQueryConfigAsProperties() throws Exception { String someKey = "someKey"; String someValue = "someValue"; String anotherKey = "anotherKey"; String anotherValue = "anotherValue"; String someWatchKey = "someWatchKey"; String anotherWatchKey = "anotherWatchKey"; Set<String> watchKeys = Sets.newHashSet(someWatchKey, anotherWatchKey); String cacheKey = configFileController .assembleCacheKey(ConfigFileController.ConfigFileOutputFormat.PROPERTIES, someAppId, someClusterName, someNamespace, someDataCenter); Map<String, String> configurations = ImmutableMap.of(someKey, someValue, anotherKey, anotherValue); ApolloConfig someApolloConfig = mock(ApolloConfig.class); when(someApolloConfig.getConfigurations()).thenReturn(configurations); when(configController .queryConfig(someAppId, someClusterName, someNamespace, someDataCenter, "-1", someClientIp, null, someRequest, someResponse)).thenReturn(someApolloConfig); when(watchKeysUtil .assembleAllWatchKeys(someAppId, someClusterName, someNamespace, someDataCenter)) .thenReturn(watchKeys); ResponseEntity<String> response = configFileController .queryConfigAsProperties(someAppId, someClusterName, someNamespace, someDataCenter, someClientIp, someRequest, someResponse); assertEquals(2, watchedKeys2CacheKey.size()); assertEquals(2, cacheKey2WatchedKeys.size()); assertTrue(watchedKeys2CacheKey.containsEntry(someWatchKey, cacheKey)); assertTrue(watchedKeys2CacheKey.containsEntry(anotherWatchKey, cacheKey)); assertTrue(cacheKey2WatchedKeys.containsEntry(cacheKey, someWatchKey)); assertTrue(cacheKey2WatchedKeys.containsEntry(cacheKey, anotherWatchKey)); assertEquals(HttpStatus.OK, response.getStatusCode()); assertTrue(response.getBody().contains(String.format("%s=%s", someKey, someValue))); assertTrue(response.getBody().contains(String.format("%s=%s", anotherKey, anotherValue))); ResponseEntity<String> anotherResponse = configFileController .queryConfigAsProperties(someAppId, someClusterName, someNamespace, someDataCenter, someClientIp, someRequest, someResponse); assertEquals(response, anotherResponse); verify(configController, times(1)) .queryConfig(someAppId, someClusterName, someNamespace, someDataCenter, "-1", someClientIp, null, someRequest, someResponse); } @Test public void testQueryConfigAsJson() throws Exception { String someKey = "someKey"; String someValue = "someValue"; Type responseType = new TypeToken<Map<String, String>>(){}.getType(); String someWatchKey = "someWatchKey"; Set<String> watchKeys = Sets.newHashSet(someWatchKey); Map<String, String> configurations = ImmutableMap.of(someKey, someValue); ApolloConfig someApolloConfig = mock(ApolloConfig.class); when(configController .queryConfig(someAppId, someClusterName, someNamespace, someDataCenter, "-1", someClientIp, null, someRequest, someResponse)).thenReturn(someApolloConfig); when(someApolloConfig.getConfigurations()).thenReturn(configurations); when(watchKeysUtil .assembleAllWatchKeys(someAppId, someClusterName, someNamespace, someDataCenter)) .thenReturn(watchKeys); ResponseEntity<String> response = configFileController .queryConfigAsJson(someAppId, someClusterName, someNamespace, someDataCenter, someClientIp, someRequest, someResponse); assertEquals(HttpStatus.OK, response.getStatusCode()); assertEquals(configurations, GSON.fromJson(response.getBody(), responseType)); } @Test public void testQueryConfigWithGrayRelease() throws Exception { String someKey = "someKey"; String someValue = "someValue"; Type responseType = new TypeToken<Map<String, String>>(){}.getType(); Map<String, String> configurations = ImmutableMap.of(someKey, someValue); when(grayReleaseRulesHolder.hasGrayReleaseRule(someAppId, someClientIp, someNamespace)) .thenReturn(true); ApolloConfig someApolloConfig = mock(ApolloConfig.class); when(someApolloConfig.getConfigurations()).thenReturn(configurations); when(configController .queryConfig(someAppId, someClusterName, someNamespace, someDataCenter, "-1", someClientIp, null, someRequest, someResponse)).thenReturn(someApolloConfig); ResponseEntity<String> response = configFileController .queryConfigAsJson(someAppId, someClusterName, someNamespace, someDataCenter, someClientIp, someRequest, someResponse); ResponseEntity<String> anotherResponse = configFileController .queryConfigAsJson(someAppId, someClusterName, someNamespace, someDataCenter, someClientIp, someRequest, someResponse); verify(configController, times(2)) .queryConfig(someAppId, someClusterName, someNamespace, someDataCenter, "-1", someClientIp, null, someRequest, someResponse); assertEquals(HttpStatus.OK, response.getStatusCode()); assertEquals(configurations, GSON.fromJson(response.getBody(), responseType)); assertTrue(watchedKeys2CacheKey.isEmpty()); assertTrue(cacheKey2WatchedKeys.isEmpty()); } @Test public void testHandleMessage() throws Exception { String someWatchKey = "someWatchKey"; String anotherWatchKey = "anotherWatchKey"; String someCacheKey = "someCacheKey"; String anotherCacheKey = "anotherCacheKey"; String someValue = "someValue"; ReleaseMessage someReleaseMessage = mock(ReleaseMessage.class); when(someReleaseMessage.getMessage()).thenReturn(someWatchKey); Cache<String, String> cache = (Cache<String, String>) ReflectionTestUtils.getField(configFileController, "localCache"); cache.put(someCacheKey, someValue); cache.put(anotherCacheKey, someValue); watchedKeys2CacheKey.putAll(someWatchKey, Lists.newArrayList(someCacheKey, anotherCacheKey)); watchedKeys2CacheKey.putAll(anotherWatchKey, Lists.newArrayList(someCacheKey, anotherCacheKey)); cacheKey2WatchedKeys.putAll(someCacheKey, Lists.newArrayList(someWatchKey, anotherWatchKey)); cacheKey2WatchedKeys.putAll(anotherCacheKey, Lists.newArrayList(someWatchKey, anotherWatchKey)); configFileController.handleMessage(someReleaseMessage, Topics.APOLLO_RELEASE_TOPIC); assertTrue(watchedKeys2CacheKey.isEmpty()); assertTrue(cacheKey2WatchedKeys.isEmpty()); } }
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./apollo-configservice/src/test/java/com/ctrip/framework/apollo/metaservice/service/KubernetesDiscoveryServiceTest.java
package com.ctrip.framework.apollo.metaservice.service; import static org.junit.Assert.*; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import com.ctrip.framework.apollo.biz.config.BizConfig; import com.ctrip.framework.apollo.core.ServiceNameConsts; import com.ctrip.framework.apollo.core.dto.ServiceDTO; import java.util.List; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class KubernetesDiscoveryServiceTest { private String configServiceConfigName = "apollo.config-service.url"; private String adminServiceConfigName = "apollo.admin-service.url"; @Mock private BizConfig bizConfig; private KubernetesDiscoveryService kubernetesDiscoveryService; @Before public void setUp() throws Exception { kubernetesDiscoveryService = new KubernetesDiscoveryService(bizConfig); } @Test public void testGetServiceInstancesWithInvalidServiceId() { String someInvalidServiceId = "someInvalidServiceId"; assertTrue(kubernetesDiscoveryService.getServiceInstances(someInvalidServiceId).isEmpty()); } @Test public void testGetServiceInstancesWithNullConfig() { when(bizConfig.getValue(configServiceConfigName)).thenReturn(null); assertTrue( kubernetesDiscoveryService.getServiceInstances(ServiceNameConsts.APOLLO_CONFIGSERVICE) .isEmpty()); verify(bizConfig, times(1)).getValue(configServiceConfigName); } @Test public void testGetConfigServiceInstances() { String someUrl = "http://some-host/some-path"; when(bizConfig.getValue(configServiceConfigName)).thenReturn(someUrl); List<ServiceDTO> serviceDTOList = kubernetesDiscoveryService .getServiceInstances(ServiceNameConsts.APOLLO_CONFIGSERVICE); assertEquals(1, serviceDTOList.size()); ServiceDTO serviceDTO = serviceDTOList.get(0); assertEquals(ServiceNameConsts.APOLLO_CONFIGSERVICE, serviceDTO.getAppName()); assertEquals(String.format("%s:%s", ServiceNameConsts.APOLLO_CONFIGSERVICE, someUrl), serviceDTO.getInstanceId()); assertEquals(someUrl, serviceDTO.getHomepageUrl()); } @Test public void testGetAdminServiceInstances() { String someUrl = "http://some-host/some-path"; String anotherUrl = "http://another-host/another-path"; when(bizConfig.getValue(adminServiceConfigName)) .thenReturn(String.format("%s,%s", someUrl, anotherUrl)); List<ServiceDTO> serviceDTOList = kubernetesDiscoveryService .getServiceInstances(ServiceNameConsts.APOLLO_ADMINSERVICE); assertEquals(2, serviceDTOList.size()); ServiceDTO serviceDTO = serviceDTOList.get(0); assertEquals(ServiceNameConsts.APOLLO_ADMINSERVICE, serviceDTO.getAppName()); assertEquals(String.format("%s:%s", ServiceNameConsts.APOLLO_ADMINSERVICE, someUrl), serviceDTO.getInstanceId()); assertEquals(someUrl, serviceDTO.getHomepageUrl()); ServiceDTO anotherServiceDTO = serviceDTOList.get(1); assertEquals(ServiceNameConsts.APOLLO_ADMINSERVICE, anotherServiceDTO.getAppName()); assertEquals(String.format("%s:%s", ServiceNameConsts.APOLLO_ADMINSERVICE, anotherUrl), anotherServiceDTO.getInstanceId()); assertEquals(anotherUrl, anotherServiceDTO.getHomepageUrl()); } }
package com.ctrip.framework.apollo.metaservice.service; import static org.junit.Assert.*; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import com.ctrip.framework.apollo.biz.config.BizConfig; import com.ctrip.framework.apollo.core.ServiceNameConsts; import com.ctrip.framework.apollo.core.dto.ServiceDTO; import java.util.List; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class KubernetesDiscoveryServiceTest { private String configServiceConfigName = "apollo.config-service.url"; private String adminServiceConfigName = "apollo.admin-service.url"; @Mock private BizConfig bizConfig; private KubernetesDiscoveryService kubernetesDiscoveryService; @Before public void setUp() throws Exception { kubernetesDiscoveryService = new KubernetesDiscoveryService(bizConfig); } @Test public void testGetServiceInstancesWithInvalidServiceId() { String someInvalidServiceId = "someInvalidServiceId"; assertTrue(kubernetesDiscoveryService.getServiceInstances(someInvalidServiceId).isEmpty()); } @Test public void testGetServiceInstancesWithNullConfig() { when(bizConfig.getValue(configServiceConfigName)).thenReturn(null); assertTrue( kubernetesDiscoveryService.getServiceInstances(ServiceNameConsts.APOLLO_CONFIGSERVICE) .isEmpty()); verify(bizConfig, times(1)).getValue(configServiceConfigName); } @Test public void testGetConfigServiceInstances() { String someUrl = "http://some-host/some-path"; when(bizConfig.getValue(configServiceConfigName)).thenReturn(someUrl); List<ServiceDTO> serviceDTOList = kubernetesDiscoveryService .getServiceInstances(ServiceNameConsts.APOLLO_CONFIGSERVICE); assertEquals(1, serviceDTOList.size()); ServiceDTO serviceDTO = serviceDTOList.get(0); assertEquals(ServiceNameConsts.APOLLO_CONFIGSERVICE, serviceDTO.getAppName()); assertEquals(String.format("%s:%s", ServiceNameConsts.APOLLO_CONFIGSERVICE, someUrl), serviceDTO.getInstanceId()); assertEquals(someUrl, serviceDTO.getHomepageUrl()); } @Test public void testGetAdminServiceInstances() { String someUrl = "http://some-host/some-path"; String anotherUrl = "http://another-host/another-path"; when(bizConfig.getValue(adminServiceConfigName)) .thenReturn(String.format("%s,%s", someUrl, anotherUrl)); List<ServiceDTO> serviceDTOList = kubernetesDiscoveryService .getServiceInstances(ServiceNameConsts.APOLLO_ADMINSERVICE); assertEquals(2, serviceDTOList.size()); ServiceDTO serviceDTO = serviceDTOList.get(0); assertEquals(ServiceNameConsts.APOLLO_ADMINSERVICE, serviceDTO.getAppName()); assertEquals(String.format("%s:%s", ServiceNameConsts.APOLLO_ADMINSERVICE, someUrl), serviceDTO.getInstanceId()); assertEquals(someUrl, serviceDTO.getHomepageUrl()); ServiceDTO anotherServiceDTO = serviceDTOList.get(1); assertEquals(ServiceNameConsts.APOLLO_ADMINSERVICE, anotherServiceDTO.getAppName()); assertEquals(String.format("%s:%s", ServiceNameConsts.APOLLO_ADMINSERVICE, anotherUrl), anotherServiceDTO.getInstanceId()); assertEquals(anotherUrl, anotherServiceDTO.getHomepageUrl()); } }
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./apollo-client/src/main/java/com/ctrip/framework/apollo/util/function/Functions.java
package com.ctrip.framework.apollo.util.function; import java.util.Date; import com.ctrip.framework.apollo.exceptions.ApolloConfigException; import com.ctrip.framework.apollo.util.parser.ParserException; import com.ctrip.framework.apollo.util.parser.Parsers; import com.google.common.base.Function; /** * @author Jason Song([email protected]) */ public interface Functions { Function<String, Integer> TO_INT_FUNCTION = new Function<String, Integer>() { @Override public Integer apply(String input) { return Integer.parseInt(input); } }; Function<String, Long> TO_LONG_FUNCTION = new Function<String, Long>() { @Override public Long apply(String input) { return Long.parseLong(input); } }; Function<String, Short> TO_SHORT_FUNCTION = new Function<String, Short>() { @Override public Short apply(String input) { return Short.parseShort(input); } }; Function<String, Float> TO_FLOAT_FUNCTION = new Function<String, Float>() { @Override public Float apply(String input) { return Float.parseFloat(input); } }; Function<String, Double> TO_DOUBLE_FUNCTION = new Function<String, Double>() { @Override public Double apply(String input) { return Double.parseDouble(input); } }; Function<String, Byte> TO_BYTE_FUNCTION = new Function<String, Byte>() { @Override public Byte apply(String input) { return Byte.parseByte(input); } }; Function<String, Boolean> TO_BOOLEAN_FUNCTION = new Function<String, Boolean>() { @Override public Boolean apply(String input) { return Boolean.parseBoolean(input); } }; Function<String, Date> TO_DATE_FUNCTION = new Function<String, Date>() { @Override public Date apply(String input) { try { return Parsers.forDate().parse(input); } catch (ParserException ex) { throw new ApolloConfigException("Parse date failed", ex); } } }; Function<String, Long> TO_DURATION_FUNCTION = new Function<String, Long>() { @Override public Long apply(String input) { try { return Parsers.forDuration().parseToMillis(input); } catch (ParserException ex) { throw new ApolloConfigException("Parse duration failed", ex); } } }; }
package com.ctrip.framework.apollo.util.function; import java.util.Date; import com.ctrip.framework.apollo.exceptions.ApolloConfigException; import com.ctrip.framework.apollo.util.parser.ParserException; import com.ctrip.framework.apollo.util.parser.Parsers; import com.google.common.base.Function; /** * @author Jason Song([email protected]) */ public interface Functions { Function<String, Integer> TO_INT_FUNCTION = new Function<String, Integer>() { @Override public Integer apply(String input) { return Integer.parseInt(input); } }; Function<String, Long> TO_LONG_FUNCTION = new Function<String, Long>() { @Override public Long apply(String input) { return Long.parseLong(input); } }; Function<String, Short> TO_SHORT_FUNCTION = new Function<String, Short>() { @Override public Short apply(String input) { return Short.parseShort(input); } }; Function<String, Float> TO_FLOAT_FUNCTION = new Function<String, Float>() { @Override public Float apply(String input) { return Float.parseFloat(input); } }; Function<String, Double> TO_DOUBLE_FUNCTION = new Function<String, Double>() { @Override public Double apply(String input) { return Double.parseDouble(input); } }; Function<String, Byte> TO_BYTE_FUNCTION = new Function<String, Byte>() { @Override public Byte apply(String input) { return Byte.parseByte(input); } }; Function<String, Boolean> TO_BOOLEAN_FUNCTION = new Function<String, Boolean>() { @Override public Boolean apply(String input) { return Boolean.parseBoolean(input); } }; Function<String, Date> TO_DATE_FUNCTION = new Function<String, Date>() { @Override public Date apply(String input) { try { return Parsers.forDate().parse(input); } catch (ParserException ex) { throw new ApolloConfigException("Parse date failed", ex); } } }; Function<String, Long> TO_DURATION_FUNCTION = new Function<String, Long>() { @Override public Long apply(String input) { try { return Parsers.forDuration().parseToMillis(input); } catch (ParserException ex) { throw new ApolloConfigException("Parse duration failed", ex); } } }; }
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./apollo-client/src/main/java/com/ctrip/framework/apollo/util/OrderedProperties.java
package com.ctrip.framework.apollo.util; import java.util.Collections; import java.util.Enumeration; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.Map; import java.util.Map.Entry; import java.util.Properties; import java.util.Set; /** * An OrderedProperties instance will keep appearance order in config file. * * <strong> * Warnings: 1. It should be noticed that stream APIs or JDk1.8 APIs( listed in * https://github.com/ctripcorp/apollo/pull/2861) are not implemented here. 2. {@link Properties} * implementation are different between JDK1.8 and later JDKs. At least, {@link Properties} have an * individual implementation in JDK10. Hence, there should be an individual putAll method here. * </strong> * * @author [email protected] */ public class OrderedProperties extends Properties { private static final long serialVersionUID = -1741073539526213291L; private final Set<String> propertyNames; public OrderedProperties() { propertyNames = Collections.synchronizedSet(new LinkedHashSet<String>()); } @Override public synchronized Object put(Object key, Object value) { addPropertyName(key); return super.put(key, value); } private void addPropertyName(Object key) { if (key instanceof String) { propertyNames.add((String) key); } } @Override public Set<String> stringPropertyNames() { return propertyNames; } @Override public Enumeration<?> propertyNames() { return Collections.enumeration(propertyNames); } @Override public synchronized Enumeration<Object> keys() { return new Enumeration<Object>() { private final Iterator<String> i = propertyNames.iterator(); @Override public boolean hasMoreElements() { return i.hasNext(); } @Override public Object nextElement() { return i.next(); } }; } @Override public Set<Object> keySet() { return new LinkedHashSet<Object>(propertyNames); } @Override public Set<Entry<Object, Object>> entrySet() { Set<Entry<Object, Object>> original = super.entrySet(); LinkedHashMap<Object, Entry<Object, Object>> entryMap = new LinkedHashMap<>(); for (String propertyName : propertyNames) { entryMap.put(propertyName, null); } for (Entry<Object, Object> entry : original) { entryMap.put(entry.getKey(), entry); } return new LinkedHashSet<>(entryMap.values()); } @Override public synchronized void putAll(Map<?, ?> t) { super.putAll(t); for (Object name : t.keySet()) { addPropertyName(name); } } @Override public synchronized void clear() { super.clear(); this.propertyNames.clear(); } @Override public synchronized Object remove(Object key) { if (key instanceof String) { this.propertyNames.remove(key); } return super.remove(key); } }
package com.ctrip.framework.apollo.util; import java.util.Collections; import java.util.Enumeration; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.Map; import java.util.Map.Entry; import java.util.Properties; import java.util.Set; /** * An OrderedProperties instance will keep appearance order in config file. * * <strong> * Warnings: 1. It should be noticed that stream APIs or JDk1.8 APIs( listed in * https://github.com/ctripcorp/apollo/pull/2861) are not implemented here. 2. {@link Properties} * implementation are different between JDK1.8 and later JDKs. At least, {@link Properties} have an * individual implementation in JDK10. Hence, there should be an individual putAll method here. * </strong> * * @author [email protected] */ public class OrderedProperties extends Properties { private static final long serialVersionUID = -1741073539526213291L; private final Set<String> propertyNames; public OrderedProperties() { propertyNames = Collections.synchronizedSet(new LinkedHashSet<String>()); } @Override public synchronized Object put(Object key, Object value) { addPropertyName(key); return super.put(key, value); } private void addPropertyName(Object key) { if (key instanceof String) { propertyNames.add((String) key); } } @Override public Set<String> stringPropertyNames() { return propertyNames; } @Override public Enumeration<?> propertyNames() { return Collections.enumeration(propertyNames); } @Override public synchronized Enumeration<Object> keys() { return new Enumeration<Object>() { private final Iterator<String> i = propertyNames.iterator(); @Override public boolean hasMoreElements() { return i.hasNext(); } @Override public Object nextElement() { return i.next(); } }; } @Override public Set<Object> keySet() { return new LinkedHashSet<Object>(propertyNames); } @Override public Set<Entry<Object, Object>> entrySet() { Set<Entry<Object, Object>> original = super.entrySet(); LinkedHashMap<Object, Entry<Object, Object>> entryMap = new LinkedHashMap<>(); for (String propertyName : propertyNames) { entryMap.put(propertyName, null); } for (Entry<Object, Object> entry : original) { entryMap.put(entry.getKey(), entry); } return new LinkedHashSet<>(entryMap.values()); } @Override public synchronized void putAll(Map<?, ?> t) { super.putAll(t); for (Object name : t.keySet()) { addPropertyName(name); } } @Override public synchronized void clear() { super.clear(); this.propertyNames.clear(); } @Override public synchronized Object remove(Object key) { if (key instanceof String) { this.propertyNames.remove(key); } return super.remove(key); } }
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./apollo-portal/src/main/resources/static/img/edit.png
PNG  IHDRX 0IDATx^MzF*3hn |H 9ALYD'|8Q@"пՍ/[  @k`d݁nI@H@H,Arè$ =9M,7Iғ4K@rè$ =9M,7Iғ4K@r( i麮e Ku @:G(Z~%us51MjGg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%֧ľ(BQ$d@YaPH2 X]^} 7Lqb ֗Wd@=8m]Ih)<\\Tk'^q;'2Ӗr-g8(=s !VqQxryDQ/{)@vy$2 /Qdw&Q$ku@N7l|@DUss$_% D=ɭ{U@"]^ A%F@"b7mJqQrirGvB򆄪t|qh֛ '/ mق"2_<BZHyw=yiLjx;:N hPL崚8G .;5Ѥ < @"1imssML3p$2o.yBųk`&dK䩐̀"VۗWK/8Q聁=xEA|Gŧ+%@uIWpDO7*@Da[) @DO7*@Da[) @DO7*@Da[) @DO7*@Da[) @DO7*@Da[) @DO7*@Da[) @DO7*@Da[) @DO7*@Da[) @DO7*@Da[) @DO7*@Da[) @DO7*@Da[) @DO7*@Da[) @DO7*@Da[) @DO7*@Da[) @LOODh.E- gKQmM(:%py~fԻ]5Zص0l& rz"!# Ma'@J@r:H(k e6FBf~>13X/WRˌ~U0s||2+ M yŬ5HjLg-yQ+Bhv,$i{*SrdK!>>!H&ˢ8 8m):pEeIA̴]["W5 jeѲ $ 6al H;hؤ' bMbfd6 Mz}!$ 6al H;hؤ' bMHwIENDB`
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./apollo-portal/src/main/resources/static/scripts/controller/config/ConfigNamespaceController.js
application_module.controller("ConfigNamespaceController", ['$rootScope', '$scope', '$translate', 'toastr', 'AppUtil', 'EventManager', 'ConfigService', 'PermissionService', 'UserService', 'NamespaceBranchService', 'NamespaceService', controller]); function controller($rootScope, $scope, $translate, toastr, AppUtil, EventManager, ConfigService, PermissionService, UserService, NamespaceBranchService, NamespaceService) { $scope.rollback = rollback; $scope.preDeleteItem = preDeleteItem; $scope.deleteItem = deleteItem; $scope.editItem = editItem; $scope.createItem = createItem; $scope.preRevokeItem = preRevokeItem; $scope.revokeItem = revokeItem; $scope.closeTip = closeTip; $scope.showText = showText; $scope.createBranch = createBranch; $scope.preCreateBranch = preCreateBranch; $scope.preDeleteBranch = preDeleteBranch; $scope.deleteBranch = deleteBranch; $scope.showNoModifyPermissionDialog = showNoModifyPermissionDialog; $scope.lockCheck = lockCheck; $scope.emergencyPublish = emergencyPublish; init(); function init() { initRole(); initUser(); initPublishInfo(); } function initRole() { PermissionService.get_app_role_users($rootScope.pageContext.appId) .then(function (result) { var masterUsers = ''; result.masterUsers.forEach(function (user) { masterUsers += _.escape(user.userId) + ','; }); $scope.masterUsers = masterUsers.substring(0, masterUsers.length - 1); }, function (result) { }); } function initUser() { UserService.load_user().then(function (result) { $scope.currentUser = result.userId; }); } function initPublishInfo() { NamespaceService.getNamespacePublishInfo($rootScope.pageContext.appId) .then(function (result) { if (!result) { return; } $scope.hasNotPublishNamespace = false; var namespacePublishInfo = []; Object.keys(result).forEach(function (env) { if (env.indexOf("$") >= 0) { return; } var envPublishInfo = result[env]; Object.keys(envPublishInfo).forEach(function (cluster) { var clusterPublishInfo = envPublishInfo[cluster]; if (clusterPublishInfo) { $scope.hasNotPublishNamespace = true; if (Object.keys(envPublishInfo).length > 1) { namespacePublishInfo.push("[" + env + ", " + cluster + "]"); } else { namespacePublishInfo.push("[" + env + "]"); } } }) }); $scope.namespacePublishInfo = namespacePublishInfo; }); } EventManager.subscribe(EventManager.EventType.REFRESH_NAMESPACE, function (context) { if (context.namespace) { refreshSingleNamespace(context.namespace); } else { refreshAllNamespaces(); } }); function refreshAllNamespaces() { if ($rootScope.pageContext.env == '') { return; } ConfigService.load_all_namespaces($rootScope.pageContext.appId, $rootScope.pageContext.env, $rootScope.pageContext.clusterName).then( function (result) { $scope.namespaces = result; $('.config-item-container').removeClass('hide'); initPublishInfo(); }, function (result) { toastr.error(AppUtil.errorMsg(result), $translate.instant('Config.LoadingAllNamespaceError')); }); } function refreshSingleNamespace(namespace) { if ($rootScope.pageContext.env == '') { return; } ConfigService.load_namespace($rootScope.pageContext.appId, $rootScope.pageContext.env, $rootScope.pageContext.clusterName, namespace.baseInfo.namespaceName).then( function (result) { $scope.namespaces.forEach(function (namespace, index) { if (namespace.baseInfo.namespaceName == result.baseInfo.namespaceName) { result.showNamespaceBody = true; result.initialized = true; result.show = namespace.show; $scope.namespaces[index] = result; } }); initPublishInfo(); }, function (result) { toastr.error(AppUtil.errorMsg(result), $translate.instant('Config.LoadingAllNamespaceError')); }); } function rollback() { EventManager.emit(EventManager.EventType.ROLLBACK_NAMESPACE); } $scope.tableViewOperType = '', $scope.item = {}; $scope.toOperationNamespace; var toDeleteItemId = 0; function preDeleteItem(namespace, item) { if (!lockCheck(namespace)) { return; } $scope.config = {}; $scope.config.key = _.escape(item.key); $scope.config.value = _.escape(item.value); $scope.toOperationNamespace = namespace; toDeleteItemId = item.id; $("#deleteConfirmDialog").modal("show"); } function deleteItem() { ConfigService.delete_item($rootScope.pageContext.appId, $rootScope.pageContext.env, $scope.toOperationNamespace.baseInfo.clusterName, $scope.toOperationNamespace.baseInfo.namespaceName, toDeleteItemId).then( function (result) { toastr.success($translate.instant('Config.Deleted')); EventManager.emit(EventManager.EventType.REFRESH_NAMESPACE, { namespace: $scope.toOperationNamespace }); }, function (result) { toastr.error(AppUtil.errorMsg(result), $translate.instant('Config.DeleteFailed')); }); } function preRevokeItem(namespace) { if (!lockCheck(namespace)) { return; } $scope.toOperationNamespace = namespace; toRevokeItemId = namespace.baseInfo.id; $("#revokeItemConfirmDialog").modal("show"); } function revokeItem() { ConfigService.revoke_item($rootScope.pageContext.appId, $rootScope.pageContext.env, $scope.toOperationNamespace.baseInfo.clusterName, $scope.toOperationNamespace.baseInfo.namespaceName).then( function (result) { toastr.success($translate.instant('Revoke.RevokeSuccessfully')); EventManager.emit(EventManager.EventType.REFRESH_NAMESPACE, { namespace: $scope.toOperationNamespace }); }, function (result) { toastr.error(AppUtil.errorMsg(result), $translate.instant('Revoke.RevokeFailed')); } ); } //修改配置 function editItem(namespace, toEditItem) { if (!lockCheck(namespace)) { return; } $scope.item = _.clone(toEditItem); if (namespace.isBranch || namespace.isLinkedNamespace) { var existedItem = false; namespace.items.forEach(function (item) { if (!item.isDeleted && item.item.key == toEditItem.key) { existedItem = true; } }); if (!existedItem) { $scope.item.lineNum = 0; $scope.item.tableViewOperType = 'create'; } else { $scope.item.tableViewOperType = 'update'; } } else { $scope.item.tableViewOperType = 'update'; } $scope.toOperationNamespace = namespace; AppUtil.showModal('#itemModal'); } //新增配置 function createItem(namespace) { if (!lockCheck(namespace)) { return; } $scope.item = { tableViewOperType: 'create' }; $scope.toOperationNamespace = namespace; AppUtil.showModal('#itemModal'); } var selectedClusters = []; $scope.collectSelectedClusters = function (data) { selectedClusters = data; }; function lockCheck(namespace) { if (namespace.lockOwner && $scope.currentUser != namespace.lockOwner) { $scope.lockOwner = namespace.lockOwner; $('#namespaceLockedDialog').modal('show'); return false; } return true; } function closeTip(clusterName) { var hideTip = JSON.parse(localStorage.getItem("hideTip")); if (!hideTip) { hideTip = {}; hideTip[$rootScope.pageContext.appId] = {}; } if (!hideTip[$rootScope.pageContext.appId]) { hideTip[$rootScope.pageContext.appId] = {}; } hideTip[$rootScope.pageContext.appId][clusterName] = true; $rootScope.hideTip = hideTip; localStorage.setItem("hideTip", JSON.stringify(hideTip)); } function showText(text) { $scope.text = text; $('#showTextModal').modal('show'); } function showNoModifyPermissionDialog() { $("#modifyNoPermissionDialog").modal('show'); } var toCreateBranchNamespace = {}; function preCreateBranch(namespace) { toCreateBranchNamespace = namespace; AppUtil.showModal("#createBranchTips"); } function createBranch() { NamespaceBranchService.createBranch($rootScope.pageContext.appId, $rootScope.pageContext.env, $rootScope.pageContext.clusterName, toCreateBranchNamespace.baseInfo.namespaceName) .then(function (result) { toastr.success($translate.instant('Config.GrayscaleCreated')); EventManager.emit(EventManager.EventType.REFRESH_NAMESPACE, { namespace: toCreateBranchNamespace }); }, function (result) { toastr.error(AppUtil.errorMsg(result), $translate.instant('Config.GrayscaleCreateFailed')); }) } function preDeleteBranch(branch) { //normal delete branch.branchStatus = 0; $scope.toDeleteBranch = branch; AppUtil.showModal('#deleteBranchDialog'); } function deleteBranch() { NamespaceBranchService.deleteBranch($rootScope.pageContext.appId, $rootScope.pageContext.env, $rootScope.pageContext.clusterName, $scope.toDeleteBranch.baseInfo.namespaceName, $scope.toDeleteBranch.baseInfo.clusterName ) .then(function (result) { toastr.success($translate.instant('Config.BranchDeleted')); EventManager.emit(EventManager.EventType.REFRESH_NAMESPACE, { namespace: $scope.toDeleteBranch.parentNamespace }); }, function (result) { toastr.error(AppUtil.errorMsg(result), $translate.instant('Config.BranchDeleteFailed')); }) } EventManager.subscribe(EventManager.EventType.EMERGENCY_PUBLISH, function (context) { AppUtil.showModal("#emergencyPublishAlertDialog"); $scope.emergencyPublishContext = context; }); function emergencyPublish() { if ($scope.emergencyPublishContext.mergeAndPublish) { EventManager.emit(EventManager.EventType.MERGE_AND_PUBLISH_NAMESPACE, { branch: $scope.emergencyPublishContext.namespace, isEmergencyPublish: true }); } else { EventManager.emit(EventManager.EventType.PUBLISH_NAMESPACE, { namespace: $scope.emergencyPublishContext.namespace, isEmergencyPublish: true }); } } EventManager.subscribe(EventManager.EventType.DELETE_NAMESPACE_FAILED, function (context) { $scope.deleteNamespaceContext = context; if (context.reason == 'master_instance') { AppUtil.showModal('#deleteNamespaceDenyForMasterInstanceDialog'); } else if (context.reason == 'branch_instance') { AppUtil.showModal('#deleteNamespaceDenyForBranchInstanceDialog'); } else if (context.reason == 'public_namespace') { var otherAppAssociatedNamespaces = context.otherAppAssociatedNamespaces; var namespaceTips = []; otherAppAssociatedNamespaces.forEach(function (namespace) { var appId = namespace.appId; var clusterName = namespace.clusterName; var url = AppUtil.prefixPath() + '/config.html?#/appid=' + appId + '&env=' + $scope.pageContext.env + '&cluster=' + clusterName; namespaceTips.push("<a target='_blank' href=\'" + url + "\'>AppId = " + appId + ", Cluster = " + clusterName + ", Namespace = " + namespace.namespaceName + "</a>"); }); $scope.deleteNamespaceContext.detailReason = $translate.instant('Config.DeleteNamespaceFailedTips') + "<br>" + namespaceTips.join("<br>"); AppUtil.showModal('#deleteNamespaceDenyForPublicNamespaceDialog'); } }); EventManager.subscribe(EventManager.EventType.SYNTAX_CHECK_TEXT_FAILED, function (context) { $scope.syntaxCheckContext = context; AppUtil.showModal('#syntaxCheckFailedDialog'); }); new Clipboard('.clipboard'); }
application_module.controller("ConfigNamespaceController", ['$rootScope', '$scope', '$translate', 'toastr', 'AppUtil', 'EventManager', 'ConfigService', 'PermissionService', 'UserService', 'NamespaceBranchService', 'NamespaceService', controller]); function controller($rootScope, $scope, $translate, toastr, AppUtil, EventManager, ConfigService, PermissionService, UserService, NamespaceBranchService, NamespaceService) { $scope.rollback = rollback; $scope.preDeleteItem = preDeleteItem; $scope.deleteItem = deleteItem; $scope.editItem = editItem; $scope.createItem = createItem; $scope.preRevokeItem = preRevokeItem; $scope.revokeItem = revokeItem; $scope.closeTip = closeTip; $scope.showText = showText; $scope.createBranch = createBranch; $scope.preCreateBranch = preCreateBranch; $scope.preDeleteBranch = preDeleteBranch; $scope.deleteBranch = deleteBranch; $scope.showNoModifyPermissionDialog = showNoModifyPermissionDialog; $scope.lockCheck = lockCheck; $scope.emergencyPublish = emergencyPublish; init(); function init() { initRole(); initUser(); initPublishInfo(); } function initRole() { PermissionService.get_app_role_users($rootScope.pageContext.appId) .then(function (result) { var masterUsers = ''; result.masterUsers.forEach(function (user) { masterUsers += _.escape(user.userId) + ','; }); $scope.masterUsers = masterUsers.substring(0, masterUsers.length - 1); }, function (result) { }); } function initUser() { UserService.load_user().then(function (result) { $scope.currentUser = result.userId; }); } function initPublishInfo() { NamespaceService.getNamespacePublishInfo($rootScope.pageContext.appId) .then(function (result) { if (!result) { return; } $scope.hasNotPublishNamespace = false; var namespacePublishInfo = []; Object.keys(result).forEach(function (env) { if (env.indexOf("$") >= 0) { return; } var envPublishInfo = result[env]; Object.keys(envPublishInfo).forEach(function (cluster) { var clusterPublishInfo = envPublishInfo[cluster]; if (clusterPublishInfo) { $scope.hasNotPublishNamespace = true; if (Object.keys(envPublishInfo).length > 1) { namespacePublishInfo.push("[" + env + ", " + cluster + "]"); } else { namespacePublishInfo.push("[" + env + "]"); } } }) }); $scope.namespacePublishInfo = namespacePublishInfo; }); } EventManager.subscribe(EventManager.EventType.REFRESH_NAMESPACE, function (context) { if (context.namespace) { refreshSingleNamespace(context.namespace); } else { refreshAllNamespaces(); } }); function refreshAllNamespaces() { if ($rootScope.pageContext.env == '') { return; } ConfigService.load_all_namespaces($rootScope.pageContext.appId, $rootScope.pageContext.env, $rootScope.pageContext.clusterName).then( function (result) { $scope.namespaces = result; $('.config-item-container').removeClass('hide'); initPublishInfo(); }, function (result) { toastr.error(AppUtil.errorMsg(result), $translate.instant('Config.LoadingAllNamespaceError')); }); } function refreshSingleNamespace(namespace) { if ($rootScope.pageContext.env == '') { return; } ConfigService.load_namespace($rootScope.pageContext.appId, $rootScope.pageContext.env, $rootScope.pageContext.clusterName, namespace.baseInfo.namespaceName).then( function (result) { $scope.namespaces.forEach(function (namespace, index) { if (namespace.baseInfo.namespaceName == result.baseInfo.namespaceName) { result.showNamespaceBody = true; result.initialized = true; result.show = namespace.show; $scope.namespaces[index] = result; } }); initPublishInfo(); }, function (result) { toastr.error(AppUtil.errorMsg(result), $translate.instant('Config.LoadingAllNamespaceError')); }); } function rollback() { EventManager.emit(EventManager.EventType.ROLLBACK_NAMESPACE); } $scope.tableViewOperType = '', $scope.item = {}; $scope.toOperationNamespace; var toDeleteItemId = 0; function preDeleteItem(namespace, item) { if (!lockCheck(namespace)) { return; } $scope.config = {}; $scope.config.key = _.escape(item.key); $scope.config.value = _.escape(item.value); $scope.toOperationNamespace = namespace; toDeleteItemId = item.id; $("#deleteConfirmDialog").modal("show"); } function deleteItem() { ConfigService.delete_item($rootScope.pageContext.appId, $rootScope.pageContext.env, $scope.toOperationNamespace.baseInfo.clusterName, $scope.toOperationNamespace.baseInfo.namespaceName, toDeleteItemId).then( function (result) { toastr.success($translate.instant('Config.Deleted')); EventManager.emit(EventManager.EventType.REFRESH_NAMESPACE, { namespace: $scope.toOperationNamespace }); }, function (result) { toastr.error(AppUtil.errorMsg(result), $translate.instant('Config.DeleteFailed')); }); } function preRevokeItem(namespace) { if (!lockCheck(namespace)) { return; } $scope.toOperationNamespace = namespace; toRevokeItemId = namespace.baseInfo.id; $("#revokeItemConfirmDialog").modal("show"); } function revokeItem() { ConfigService.revoke_item($rootScope.pageContext.appId, $rootScope.pageContext.env, $scope.toOperationNamespace.baseInfo.clusterName, $scope.toOperationNamespace.baseInfo.namespaceName).then( function (result) { toastr.success($translate.instant('Revoke.RevokeSuccessfully')); EventManager.emit(EventManager.EventType.REFRESH_NAMESPACE, { namespace: $scope.toOperationNamespace }); }, function (result) { toastr.error(AppUtil.errorMsg(result), $translate.instant('Revoke.RevokeFailed')); } ); } //修改配置 function editItem(namespace, toEditItem) { if (!lockCheck(namespace)) { return; } $scope.item = _.clone(toEditItem); if (namespace.isBranch || namespace.isLinkedNamespace) { var existedItem = false; namespace.items.forEach(function (item) { if (!item.isDeleted && item.item.key == toEditItem.key) { existedItem = true; } }); if (!existedItem) { $scope.item.lineNum = 0; $scope.item.tableViewOperType = 'create'; } else { $scope.item.tableViewOperType = 'update'; } } else { $scope.item.tableViewOperType = 'update'; } $scope.toOperationNamespace = namespace; AppUtil.showModal('#itemModal'); } //新增配置 function createItem(namespace) { if (!lockCheck(namespace)) { return; } $scope.item = { tableViewOperType: 'create' }; $scope.toOperationNamespace = namespace; AppUtil.showModal('#itemModal'); } var selectedClusters = []; $scope.collectSelectedClusters = function (data) { selectedClusters = data; }; function lockCheck(namespace) { if (namespace.lockOwner && $scope.currentUser != namespace.lockOwner) { $scope.lockOwner = namespace.lockOwner; $('#namespaceLockedDialog').modal('show'); return false; } return true; } function closeTip(clusterName) { var hideTip = JSON.parse(localStorage.getItem("hideTip")); if (!hideTip) { hideTip = {}; hideTip[$rootScope.pageContext.appId] = {}; } if (!hideTip[$rootScope.pageContext.appId]) { hideTip[$rootScope.pageContext.appId] = {}; } hideTip[$rootScope.pageContext.appId][clusterName] = true; $rootScope.hideTip = hideTip; localStorage.setItem("hideTip", JSON.stringify(hideTip)); } function showText(text) { $scope.text = text; $('#showTextModal').modal('show'); } function showNoModifyPermissionDialog() { $("#modifyNoPermissionDialog").modal('show'); } var toCreateBranchNamespace = {}; function preCreateBranch(namespace) { toCreateBranchNamespace = namespace; AppUtil.showModal("#createBranchTips"); } function createBranch() { NamespaceBranchService.createBranch($rootScope.pageContext.appId, $rootScope.pageContext.env, $rootScope.pageContext.clusterName, toCreateBranchNamespace.baseInfo.namespaceName) .then(function (result) { toastr.success($translate.instant('Config.GrayscaleCreated')); EventManager.emit(EventManager.EventType.REFRESH_NAMESPACE, { namespace: toCreateBranchNamespace }); }, function (result) { toastr.error(AppUtil.errorMsg(result), $translate.instant('Config.GrayscaleCreateFailed')); }) } function preDeleteBranch(branch) { //normal delete branch.branchStatus = 0; $scope.toDeleteBranch = branch; AppUtil.showModal('#deleteBranchDialog'); } function deleteBranch() { NamespaceBranchService.deleteBranch($rootScope.pageContext.appId, $rootScope.pageContext.env, $rootScope.pageContext.clusterName, $scope.toDeleteBranch.baseInfo.namespaceName, $scope.toDeleteBranch.baseInfo.clusterName ) .then(function (result) { toastr.success($translate.instant('Config.BranchDeleted')); EventManager.emit(EventManager.EventType.REFRESH_NAMESPACE, { namespace: $scope.toDeleteBranch.parentNamespace }); }, function (result) { toastr.error(AppUtil.errorMsg(result), $translate.instant('Config.BranchDeleteFailed')); }) } EventManager.subscribe(EventManager.EventType.EMERGENCY_PUBLISH, function (context) { AppUtil.showModal("#emergencyPublishAlertDialog"); $scope.emergencyPublishContext = context; }); function emergencyPublish() { if ($scope.emergencyPublishContext.mergeAndPublish) { EventManager.emit(EventManager.EventType.MERGE_AND_PUBLISH_NAMESPACE, { branch: $scope.emergencyPublishContext.namespace, isEmergencyPublish: true }); } else { EventManager.emit(EventManager.EventType.PUBLISH_NAMESPACE, { namespace: $scope.emergencyPublishContext.namespace, isEmergencyPublish: true }); } } EventManager.subscribe(EventManager.EventType.DELETE_NAMESPACE_FAILED, function (context) { $scope.deleteNamespaceContext = context; if (context.reason == 'master_instance') { AppUtil.showModal('#deleteNamespaceDenyForMasterInstanceDialog'); } else if (context.reason == 'branch_instance') { AppUtil.showModal('#deleteNamespaceDenyForBranchInstanceDialog'); } else if (context.reason == 'public_namespace') { var otherAppAssociatedNamespaces = context.otherAppAssociatedNamespaces; var namespaceTips = []; otherAppAssociatedNamespaces.forEach(function (namespace) { var appId = namespace.appId; var clusterName = namespace.clusterName; var url = AppUtil.prefixPath() + '/config.html?#/appid=' + appId + '&env=' + $scope.pageContext.env + '&cluster=' + clusterName; namespaceTips.push("<a target='_blank' href=\'" + url + "\'>AppId = " + appId + ", Cluster = " + clusterName + ", Namespace = " + namespace.namespaceName + "</a>"); }); $scope.deleteNamespaceContext.detailReason = $translate.instant('Config.DeleteNamespaceFailedTips') + "<br>" + namespaceTips.join("<br>"); AppUtil.showModal('#deleteNamespaceDenyForPublicNamespaceDialog'); } }); EventManager.subscribe(EventManager.EventType.SYNTAX_CHECK_TEXT_FAILED, function (context) { $scope.syntaxCheckContext = context; AppUtil.showModal('#syntaxCheckFailedDialog'); }); new Clipboard('.clipboard'); }
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./apollo-portal/src/main/resources/static/scripts/services/ServerConfigService.js
appService.service('ServerConfigService', ['$resource', '$q', 'AppUtil', function ($resource, $q, AppUtil) { var server_config_resource = $resource('', {}, { create_server_config: { method: 'POST', url: AppUtil.prefixPath() + '/server/config' }, get_server_config_info: { method: 'GET', url: AppUtil.prefixPath() + '/server/config/:key' } }); return { create: function (serverConfig) { var d = $q.defer(); server_config_resource.create_server_config({}, serverConfig, function (result) { d.resolve(result); }, function (result) { d.reject(result); }); return d.promise; }, getServerConfigInfo: function (key) { var d = $q.defer(); server_config_resource.get_server_config_info({ key: key }, function (result) { d.resolve(result); }, function (result) { d.reject(result); }); return d.promise; } } }]);
appService.service('ServerConfigService', ['$resource', '$q', 'AppUtil', function ($resource, $q, AppUtil) { var server_config_resource = $resource('', {}, { create_server_config: { method: 'POST', url: AppUtil.prefixPath() + '/server/config' }, get_server_config_info: { method: 'GET', url: AppUtil.prefixPath() + '/server/config/:key' } }); return { create: function (serverConfig) { var d = $q.defer(); server_config_resource.create_server_config({}, serverConfig, function (result) { d.resolve(result); }, function (result) { d.reject(result); }); return d.promise; }, getServerConfigInfo: function (key) { var d = $q.defer(); server_config_resource.get_server_config_info({ key: key }, function (result) { d.resolve(result); }, function (result) { d.reject(result); }); return d.promise; } } }]);
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./doc/images/text-mode-spring-boot-config-sample.png
PNG  IHDRx iCCPICC ProfileHT̤ZBޑN5A: %A (""X**EւX- , Xxyߜo|on=G(LeHd\QLS4n%017=>EqxZ!ˋMK禠|3\(M:C8(Eh(YY=3'$ QG=ZgfrQ eS/@eGnr>F))|eщfDÉ.Ld#%Y< 4) " tdkV+aA̒9fp;tnQsα8)e9g9IK$l Ǧ{qߓ=9 !s[2Is$u8HsS)q9H!B/CRJ 3\%$`ɳDONd};~X3@Flnl?>!邞X&[51b>{3g bkBTݷH|-F vt_(kZuHGЖ2gkгM@h=`vf 3ڱ! \RkFP6Tԃ#h9p \}xx 0 AB4HR!CbAAP4 1AP%tj~NB+P?tƠ)0VuE0 v}x9p>p|߁2@c!HH!RT#H'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D7'     {{!G/ruZᘘu $@$@$@$@$@$@ǖ9@ }}JD$@$@$@$@$@$@w/yc@+&0l tvw,HHHHHH` (qG <]0aFwX< )%!U}VHHHHHHHH qxx$@$@$@$@$@$@$@$@cHHHHHHH8^ <ׇxsY};5s@$@$@$@$@$@$@@ ׮]lg}H`      lz%(7w/TWW<YJ@Yqƿzhs[q3s      >VW|t7n܀dBm-0۠1@@ :b wOR:m$     !D@כj\j[Oo1DEv(Mʶ CWjUQ]Z=-5KX$@$@$@$@$@$@$0pz-*q;pÒHHHHHHHH?P_48'hxIENDB`
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./apollo-client/src/main/resources/META-INF/services/com.ctrip.framework.apollo.spring.spi.ApolloConfigRegistrarHelper
com.ctrip.framework.apollo.spring.spi.DefaultApolloConfigRegistrarHelper
com.ctrip.framework.apollo.spring.spi.DefaultApolloConfigRegistrarHelper
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/vo/ItemDiffs.java
package com.ctrip.framework.apollo.portal.entity.vo; import com.ctrip.framework.apollo.common.dto.ItemChangeSets; public class ItemDiffs { private NamespaceIdentifier namespace; private ItemChangeSets diffs; private String extInfo; public ItemDiffs(NamespaceIdentifier namespace) { this.namespace = namespace; } public NamespaceIdentifier getNamespace() { return namespace; } public void setNamespace(NamespaceIdentifier namespace) { this.namespace = namespace; } public ItemChangeSets getDiffs() { return diffs; } public void setDiffs(ItemChangeSets diffs) { this.diffs = diffs; } public String getExtInfo() { return extInfo; } public void setExtInfo(String extInfo) { this.extInfo = extInfo; } }
package com.ctrip.framework.apollo.portal.entity.vo; import com.ctrip.framework.apollo.common.dto.ItemChangeSets; public class ItemDiffs { private NamespaceIdentifier namespace; private ItemChangeSets diffs; private String extInfo; public ItemDiffs(NamespaceIdentifier namespace) { this.namespace = namespace; } public NamespaceIdentifier getNamespace() { return namespace; } public void setNamespace(NamespaceIdentifier namespace) { this.namespace = namespace; } public ItemChangeSets getDiffs() { return diffs; } public void setDiffs(ItemChangeSets diffs) { this.diffs = diffs; } public String getExtInfo() { return extInfo; } public void setExtInfo(String extInfo) { this.extInfo = extInfo; } }
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/LogoutHandler.java
package com.ctrip.framework.apollo.portal.spi; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public interface LogoutHandler { void logout(HttpServletRequest request, HttpServletResponse response); }
package com.ctrip.framework.apollo.portal.spi; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public interface LogoutHandler { void logout(HttpServletRequest request, HttpServletResponse response); }
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./apollo-client/src/test/resources/spring/yaml/case2-new.yml
batch: 2001
batch: 2001
-1
apolloconfig/apollo
3,656
add English version of readme
## What's the purpose of this PR add English version of readme
nobodyiam
2021-05-01T05:18:07Z
2021-05-01T05:35:25Z
de05540e6c9a18cdf370ae95ca5e544d7b8d04bf
01b5c2a05ad019a7b46177a5570fee8e11b05940
add English version of readme. ## What's the purpose of this PR add English version of readme
./.git/refs/remotes/origin/HEAD
ref: refs/remotes/origin/master
ref: refs/remotes/origin/master
-1
apolloconfig/apollo
3,647
feat(open-api): get authorized apps
## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
Anilople
2021-04-24T06:40:38Z
2021-06-26T13:21:02Z
9a6f8e277f678fa583a23f551ed1648d5e13bdfa
f1eca02f4033d050bd71ede288d1707954d3dea4
feat(open-api): get authorized apps. ## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./CHANGES.md
Changes by Version ================== Release Notes. Apollo 1.9.0 ------------------ * [extend DataChange_CreatedBy, DataChange_LastModifiedBy from 32 to 64.](https://github.com/ctripcorp/apollo/pull/3552) * [add spring configuration metadata](https://github.com/ctripcorp/apollo/pull/3553) * [fix #3551 and optimize ldap samples ](https://github.com/ctripcorp/apollo/pull/3561) * [update wiki url and refine documentation](https://github.com/ctripcorp/apollo/pull/3563) * [slim docker images](https://github.com/ctripcorp/apollo/pull/3572) * [add network strategy guideline to docker quick start](https://github.com/ctripcorp/apollo/pull/3574) * [Added support for consul service discovery](https://github.com/ctripcorp/apollo/pull/3575) * [disable consul in apollo-assembly by default ](https://github.com/ctripcorp/apollo/pull/3585) * [ServiceBootstrap unit test fix](https://github.com/ctripcorp/apollo/pull/3593) * [replace http client implementation with interface ](https://github.com/ctripcorp/apollo/pull/3594) * [Allow users to inject customized instance via ApolloInjectorCustomizer](https://github.com/ctripcorp/apollo/pull/3602) * [Fixes #3606](https://github.com/ctripcorp/apollo/pull/3609) * [Bump xstream from 1.4.15 to 1.4.16](https://github.com/ctripcorp/apollo/pull/3611) * [docs: user practices. Alibaba Sentinel Dashboard Push Rules to apollo](https://github.com/ctripcorp/apollo/pull/3617) * [update known users](https://github.com/ctripcorp/apollo/pull/3619) * [add maven deploy action](https://github.com/ctripcorp/apollo/pull/3620) * [fix the issue that access key doesn't work if appid passed is in different case](https://github.com/ctripcorp/apollo/pull/3627) * [fix oidc logout](https://github.com/ctripcorp/apollo/pull/3628) * [docs: third party sdk nodejs client](https://github.com/ctripcorp/apollo/pull/3632) * [update known users](https://github.com/ctripcorp/apollo/pull/3633) * [docs: use docsify pagination plugin](https://github.com/ctripcorp/apollo/pull/3634) * [apollo client to support jdk16](https://github.com/ctripcorp/apollo/pull/3646) * [add English version of readme](https://github.com/ctripcorp/apollo/pull/3656) * [update known users](https://github.com/ctripcorp/apollo/pull/3657) * [update apolloconfig.com domain](https://github.com/ctripcorp/apollo/pull/3658) * [localize css to speed up the loading of google fonts](https://github.com/ctripcorp/apollo/pull/3660) * [test(apollo-client): use assertEquals instead of assertThat](https://github.com/ctripcorp/apollo/pull/3667) * [test(apollo-client): make timeout more longer when long poll](https://github.com/ctripcorp/apollo/pull/3668) * [fix unit test](https://github.com/ctripcorp/apollo/pull/3669) * [解决日志系统未初始化完成时,apollo 的加载日志没法输出问题](https://github.com/ctripcorp/apollo/pull/3677) * [fix[apollo-configService]: Solve configService startup exception](https://github.com/ctripcorp/apollo/pull/3679) * [Community Governance Proposal](https://github.com/ctripcorp/apollo/pull/3670) * [增加阿波罗client的php库](https://github.com/ctripcorp/apollo/pull/3682) * [Bump xstream from 1.4.16 to 1.4.17](https://github.com/ctripcorp/apollo/pull/3692) * [Improve the nacos registry configuration document](https://github.com/ctripcorp/apollo/pull/3695) * [Remove redundant invoke of trySyncFromUpstream](https://github.com/ctripcorp/apollo/pull/3699) * [add apollo team introduction and community releated contents](https://github.com/ctripcorp/apollo/pull/3713) * [fix oidc sql](https://github.com/ctripcorp/apollo/pull/3720) * [feat(apollo-client): add method interestedChangedKeys to ConfigChangeEvent](https://github.com/ctripcorp/apollo/pull/3666) * [add More... link for known users](https://github.com/ctripcorp/apollo/pull/3757) * [update OIDC documentation](https://github.com/ctripcorp/apollo/pull/3766) * [feature: add Spring Boot 2.4 config data loader support](https://github.com/ctripcorp/apollo/pull/3754) ------------------ All issues and pull requests are [here](https://github.com/ctripcorp/apollo/milestone/6?closed=1)
Changes by Version ================== Release Notes. Apollo 1.9.0 ------------------ * [extend DataChange_CreatedBy, DataChange_LastModifiedBy from 32 to 64.](https://github.com/ctripcorp/apollo/pull/3552) * [add spring configuration metadata](https://github.com/ctripcorp/apollo/pull/3553) * [fix #3551 and optimize ldap samples ](https://github.com/ctripcorp/apollo/pull/3561) * [update wiki url and refine documentation](https://github.com/ctripcorp/apollo/pull/3563) * [slim docker images](https://github.com/ctripcorp/apollo/pull/3572) * [add network strategy guideline to docker quick start](https://github.com/ctripcorp/apollo/pull/3574) * [Added support for consul service discovery](https://github.com/ctripcorp/apollo/pull/3575) * [disable consul in apollo-assembly by default ](https://github.com/ctripcorp/apollo/pull/3585) * [ServiceBootstrap unit test fix](https://github.com/ctripcorp/apollo/pull/3593) * [replace http client implementation with interface ](https://github.com/ctripcorp/apollo/pull/3594) * [Allow users to inject customized instance via ApolloInjectorCustomizer](https://github.com/ctripcorp/apollo/pull/3602) * [Fixes #3606](https://github.com/ctripcorp/apollo/pull/3609) * [Bump xstream from 1.4.15 to 1.4.16](https://github.com/ctripcorp/apollo/pull/3611) * [docs: user practices. Alibaba Sentinel Dashboard Push Rules to apollo](https://github.com/ctripcorp/apollo/pull/3617) * [update known users](https://github.com/ctripcorp/apollo/pull/3619) * [add maven deploy action](https://github.com/ctripcorp/apollo/pull/3620) * [fix the issue that access key doesn't work if appid passed is in different case](https://github.com/ctripcorp/apollo/pull/3627) * [fix oidc logout](https://github.com/ctripcorp/apollo/pull/3628) * [docs: third party sdk nodejs client](https://github.com/ctripcorp/apollo/pull/3632) * [update known users](https://github.com/ctripcorp/apollo/pull/3633) * [docs: use docsify pagination plugin](https://github.com/ctripcorp/apollo/pull/3634) * [apollo client to support jdk16](https://github.com/ctripcorp/apollo/pull/3646) * [add English version of readme](https://github.com/ctripcorp/apollo/pull/3656) * [update known users](https://github.com/ctripcorp/apollo/pull/3657) * [update apolloconfig.com domain](https://github.com/ctripcorp/apollo/pull/3658) * [localize css to speed up the loading of google fonts](https://github.com/ctripcorp/apollo/pull/3660) * [test(apollo-client): use assertEquals instead of assertThat](https://github.com/ctripcorp/apollo/pull/3667) * [test(apollo-client): make timeout more longer when long poll](https://github.com/ctripcorp/apollo/pull/3668) * [fix unit test](https://github.com/ctripcorp/apollo/pull/3669) * [解决日志系统未初始化完成时,apollo 的加载日志没法输出问题](https://github.com/ctripcorp/apollo/pull/3677) * [fix[apollo-configService]: Solve configService startup exception](https://github.com/ctripcorp/apollo/pull/3679) * [Community Governance Proposal](https://github.com/ctripcorp/apollo/pull/3670) * [增加阿波罗client的php库](https://github.com/ctripcorp/apollo/pull/3682) * [Bump xstream from 1.4.16 to 1.4.17](https://github.com/ctripcorp/apollo/pull/3692) * [Improve the nacos registry configuration document](https://github.com/ctripcorp/apollo/pull/3695) * [Remove redundant invoke of trySyncFromUpstream](https://github.com/ctripcorp/apollo/pull/3699) * [add apollo team introduction and community releated contents](https://github.com/ctripcorp/apollo/pull/3713) * [fix oidc sql](https://github.com/ctripcorp/apollo/pull/3720) * [feat(apollo-client): add method interestedChangedKeys to ConfigChangeEvent](https://github.com/ctripcorp/apollo/pull/3666) * [add More... link for known users](https://github.com/ctripcorp/apollo/pull/3757) * [update OIDC documentation](https://github.com/ctripcorp/apollo/pull/3766) * [feature: add Spring Boot 2.4 config data loader support](https://github.com/ctripcorp/apollo/pull/3754) * [feat(open-api): get authorized apps](https://github.com/ctripcorp/apollo/pull/3647) ------------------ All issues and pull requests are [here](https://github.com/ctripcorp/apollo/milestone/6?closed=1)
1
apolloconfig/apollo
3,647
feat(open-api): get authorized apps
## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
Anilople
2021-04-24T06:40:38Z
2021-06-26T13:21:02Z
9a6f8e277f678fa583a23f551ed1648d5e13bdfa
f1eca02f4033d050bd71ede288d1707954d3dea4
feat(open-api): get authorized apps. ## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-openapi/src/main/java/com/ctrip/framework/apollo/openapi/client/ApolloOpenApiClient.java
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.openapi.client; import com.ctrip.framework.apollo.openapi.client.constant.ApolloOpenApiConstants; import com.ctrip.framework.apollo.openapi.client.service.AppOpenApiService; import com.ctrip.framework.apollo.openapi.client.service.ClusterOpenApiService; import com.ctrip.framework.apollo.openapi.client.service.ItemOpenApiService; import com.ctrip.framework.apollo.openapi.client.service.NamespaceOpenApiService; import com.ctrip.framework.apollo.openapi.client.service.ReleaseOpenApiService; import com.ctrip.framework.apollo.openapi.dto.NamespaceReleaseDTO; import com.ctrip.framework.apollo.openapi.dto.OpenAppDTO; import com.ctrip.framework.apollo.openapi.dto.OpenAppNamespaceDTO; import com.ctrip.framework.apollo.openapi.dto.OpenClusterDTO; import com.ctrip.framework.apollo.openapi.dto.OpenEnvClusterDTO; import com.ctrip.framework.apollo.openapi.dto.OpenItemDTO; import com.ctrip.framework.apollo.openapi.dto.OpenNamespaceDTO; import com.ctrip.framework.apollo.openapi.dto.OpenNamespaceLockDTO; import com.ctrip.framework.apollo.openapi.dto.OpenReleaseDTO; import com.google.common.base.Preconditions; import com.google.common.base.Strings; import com.google.common.collect.Lists; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import org.apache.http.client.config.RequestConfig; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.message.BasicHeader; import java.util.List; /** * This class contains collections of methods to access Apollo Open Api. * <br /> * For more information, please refer <a href="https://www.apolloconfig.com/#/zh/usage/apollo-open-api-platform">Apollo Wiki</a>. * */ public class ApolloOpenApiClient { private final String portalUrl; private final String token; private final AppOpenApiService appService; private final ItemOpenApiService itemService; private final ReleaseOpenApiService releaseService; private final NamespaceOpenApiService namespaceService; private final ClusterOpenApiService clusterService; private static final Gson GSON = new GsonBuilder().setDateFormat(ApolloOpenApiConstants.JSON_DATE_FORMAT).create(); private ApolloOpenApiClient(String portalUrl, String token, RequestConfig requestConfig) { this.portalUrl = portalUrl; this.token = token; CloseableHttpClient client = HttpClients.custom().setDefaultRequestConfig(requestConfig) .setDefaultHeaders(Lists.newArrayList(new BasicHeader("Authorization", token))).build(); String baseUrl = this.portalUrl + ApolloOpenApiConstants.OPEN_API_V1_PREFIX; appService = new AppOpenApiService(client, baseUrl, GSON); clusterService = new ClusterOpenApiService(client, baseUrl, GSON); namespaceService = new NamespaceOpenApiService(client, baseUrl, GSON); itemService = new ItemOpenApiService(client, baseUrl, GSON); releaseService = new ReleaseOpenApiService(client, baseUrl, GSON); } /** * Get the environment and cluster information */ public List<OpenEnvClusterDTO> getEnvClusterInfo(String appId) { return appService.getEnvClusterInfo(appId); } /** * Get all App information */ public List<OpenAppDTO> getAllApps() { return appService.getAppsInfo(null); } /** * Get App information by app ids */ public List<OpenAppDTO> getAppsByIds(List<String> appIds) { return appService.getAppsInfo(appIds); } /** * Get the namespaces */ public List<OpenNamespaceDTO> getNamespaces(String appId, String env, String clusterName) { return namespaceService.getNamespaces(appId, env, clusterName); } /** * Get the cluster * * @since 1.5.0 */ public OpenClusterDTO getCluster(String appId, String env, String clusterName) { return clusterService.getCluster(appId, env, clusterName); } /** * Create the cluster * * @since 1.5.0 */ public OpenClusterDTO createCluster(String env, OpenClusterDTO openClusterDTO) { return clusterService.createCluster(env, openClusterDTO); } /** * Get the namespace */ public OpenNamespaceDTO getNamespace(String appId, String env, String clusterName, String namespaceName) { return namespaceService.getNamespace(appId, env, clusterName, namespaceName); } /** * Create the app namespace */ public OpenAppNamespaceDTO createAppNamespace(OpenAppNamespaceDTO appNamespaceDTO) { return namespaceService.createAppNamespace(appNamespaceDTO); } /** * Get the namespace lock */ public OpenNamespaceLockDTO getNamespaceLock(String appId, String env, String clusterName, String namespaceName) { return namespaceService.getNamespaceLock(appId, env, clusterName, namespaceName); } /** * Get config * * @return the item or null if not exists * * @since 1.2.0 */ public OpenItemDTO getItem(String appId, String env, String clusterName, String namespaceName, String key) { return itemService.getItem(appId, env, clusterName, namespaceName, key); } /** * Add config * @return the created config */ public OpenItemDTO createItem(String appId, String env, String clusterName, String namespaceName, OpenItemDTO itemDTO) { return itemService.createItem(appId, env, clusterName, namespaceName, itemDTO); } /** * Update config */ public void updateItem(String appId, String env, String clusterName, String namespaceName, OpenItemDTO itemDTO) { itemService.updateItem(appId, env, clusterName, namespaceName, itemDTO); } /** * Create config if not exists or update config if already exists */ public void createOrUpdateItem(String appId, String env, String clusterName, String namespaceName, OpenItemDTO itemDTO) { itemService.createOrUpdateItem(appId, env, clusterName, namespaceName, itemDTO); } /** * Remove config * * @param operator the user who removes the item */ public void removeItem(String appId, String env, String clusterName, String namespaceName, String key, String operator) { itemService.removeItem(appId, env, clusterName, namespaceName, key, operator); } /** * publish namespace * @return the released configurations */ public OpenReleaseDTO publishNamespace(String appId, String env, String clusterName, String namespaceName, NamespaceReleaseDTO releaseDTO) { return releaseService.publishNamespace(appId, env, clusterName, namespaceName, releaseDTO); } /** * @return the latest active release information or <code>null</code> if not found */ public OpenReleaseDTO getLatestActiveRelease(String appId, String env, String clusterName, String namespaceName) { return releaseService.getLatestActiveRelease(appId, env, clusterName, namespaceName); } /** * Rollback the release * * @param operator the user who rollbacks the release * @since 1.5.0 */ public void rollbackRelease(String env, long releaseId, String operator) { releaseService.rollbackRelease(env, releaseId, operator); } public String getPortalUrl() { return portalUrl; } public String getToken() { return token; } public static ApolloOpenApiClientBuilder newBuilder() { return new ApolloOpenApiClientBuilder(); } public static class ApolloOpenApiClientBuilder { private String portalUrl; private String token; private int connectTimeout = -1; private int readTimeout = -1; /** * @param portalUrl The apollo portal url, e.g http://localhost:8070 */ public ApolloOpenApiClientBuilder withPortalUrl(String portalUrl) { this.portalUrl = portalUrl; return this; } /** * @param token The authorization token, e.g. e16e5cd903fd0c97a116c873b448544b9d086de8 */ public ApolloOpenApiClientBuilder withToken(String token) { this.token = token; return this; } /** * @param connectTimeout an int that specifies the connect timeout value in milliseconds */ public ApolloOpenApiClientBuilder withConnectTimeout(int connectTimeout) { this.connectTimeout = connectTimeout; return this; } /** * @param readTimeout an int that specifies the timeout value to be used in milliseconds */ public ApolloOpenApiClientBuilder withReadTimeout(int readTimeout) { this.readTimeout = readTimeout; return this; } public ApolloOpenApiClient build() { Preconditions.checkArgument(!Strings.isNullOrEmpty(portalUrl), "Portal url should not be null or empty!"); Preconditions.checkArgument(portalUrl.startsWith("http://") || portalUrl.startsWith("https://"), "Portal url should start with http:// or https://" ); Preconditions.checkArgument(!Strings.isNullOrEmpty(token), "Token should not be null or empty!"); if (connectTimeout < 0) { connectTimeout = ApolloOpenApiConstants.DEFAULT_CONNECT_TIMEOUT; } if (readTimeout < 0) { readTimeout = ApolloOpenApiConstants.DEFAULT_READ_TIMEOUT; } RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(connectTimeout) .setSocketTimeout(readTimeout).build(); return new ApolloOpenApiClient(portalUrl, token, requestConfig); } } }
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.openapi.client; import com.ctrip.framework.apollo.openapi.client.constant.ApolloOpenApiConstants; import com.ctrip.framework.apollo.openapi.client.service.AppOpenApiService; import com.ctrip.framework.apollo.openapi.client.service.ClusterOpenApiService; import com.ctrip.framework.apollo.openapi.client.service.ItemOpenApiService; import com.ctrip.framework.apollo.openapi.client.service.NamespaceOpenApiService; import com.ctrip.framework.apollo.openapi.client.service.ReleaseOpenApiService; import com.ctrip.framework.apollo.openapi.dto.NamespaceReleaseDTO; import com.ctrip.framework.apollo.openapi.dto.OpenAppDTO; import com.ctrip.framework.apollo.openapi.dto.OpenAppNamespaceDTO; import com.ctrip.framework.apollo.openapi.dto.OpenClusterDTO; import com.ctrip.framework.apollo.openapi.dto.OpenEnvClusterDTO; import com.ctrip.framework.apollo.openapi.dto.OpenItemDTO; import com.ctrip.framework.apollo.openapi.dto.OpenNamespaceDTO; import com.ctrip.framework.apollo.openapi.dto.OpenNamespaceLockDTO; import com.ctrip.framework.apollo.openapi.dto.OpenReleaseDTO; import com.google.common.base.Preconditions; import com.google.common.base.Strings; import com.google.common.collect.Lists; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import org.apache.http.client.config.RequestConfig; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.message.BasicHeader; import java.util.List; /** * This class contains collections of methods to access Apollo Open Api. * <br /> * For more information, please refer <a href="https://www.apolloconfig.com/#/zh/usage/apollo-open-api-platform">Apollo Wiki</a>. * */ public class ApolloOpenApiClient { private final String portalUrl; private final String token; private final AppOpenApiService appService; private final ItemOpenApiService itemService; private final ReleaseOpenApiService releaseService; private final NamespaceOpenApiService namespaceService; private final ClusterOpenApiService clusterService; private static final Gson GSON = new GsonBuilder().setDateFormat(ApolloOpenApiConstants.JSON_DATE_FORMAT).create(); private ApolloOpenApiClient(String portalUrl, String token, RequestConfig requestConfig) { this.portalUrl = portalUrl; this.token = token; CloseableHttpClient client = HttpClients.custom().setDefaultRequestConfig(requestConfig) .setDefaultHeaders(Lists.newArrayList(new BasicHeader("Authorization", token))).build(); String baseUrl = this.portalUrl + ApolloOpenApiConstants.OPEN_API_V1_PREFIX; appService = new AppOpenApiService(client, baseUrl, GSON); clusterService = new ClusterOpenApiService(client, baseUrl, GSON); namespaceService = new NamespaceOpenApiService(client, baseUrl, GSON); itemService = new ItemOpenApiService(client, baseUrl, GSON); releaseService = new ReleaseOpenApiService(client, baseUrl, GSON); } /** * Get the environment and cluster information */ public List<OpenEnvClusterDTO> getEnvClusterInfo(String appId) { return appService.getEnvClusterInfo(appId); } /** * Get all App information */ public List<OpenAppDTO> getAllApps() { return appService.getAppsInfo(null); } /** * Get applications which can be operated by current open api client. * * @return app's information */ public List<OpenAppDTO> getAuthorizedApps() { return this.appService.getAuthorizedApps(); } /** * Get App information by app ids */ public List<OpenAppDTO> getAppsByIds(List<String> appIds) { return appService.getAppsInfo(appIds); } /** * Get the namespaces */ public List<OpenNamespaceDTO> getNamespaces(String appId, String env, String clusterName) { return namespaceService.getNamespaces(appId, env, clusterName); } /** * Get the cluster * * @since 1.5.0 */ public OpenClusterDTO getCluster(String appId, String env, String clusterName) { return clusterService.getCluster(appId, env, clusterName); } /** * Create the cluster * * @since 1.5.0 */ public OpenClusterDTO createCluster(String env, OpenClusterDTO openClusterDTO) { return clusterService.createCluster(env, openClusterDTO); } /** * Get the namespace */ public OpenNamespaceDTO getNamespace(String appId, String env, String clusterName, String namespaceName) { return namespaceService.getNamespace(appId, env, clusterName, namespaceName); } /** * Create the app namespace */ public OpenAppNamespaceDTO createAppNamespace(OpenAppNamespaceDTO appNamespaceDTO) { return namespaceService.createAppNamespace(appNamespaceDTO); } /** * Get the namespace lock */ public OpenNamespaceLockDTO getNamespaceLock(String appId, String env, String clusterName, String namespaceName) { return namespaceService.getNamespaceLock(appId, env, clusterName, namespaceName); } /** * Get config * * @return the item or null if not exists * * @since 1.2.0 */ public OpenItemDTO getItem(String appId, String env, String clusterName, String namespaceName, String key) { return itemService.getItem(appId, env, clusterName, namespaceName, key); } /** * Add config * @return the created config */ public OpenItemDTO createItem(String appId, String env, String clusterName, String namespaceName, OpenItemDTO itemDTO) { return itemService.createItem(appId, env, clusterName, namespaceName, itemDTO); } /** * Update config */ public void updateItem(String appId, String env, String clusterName, String namespaceName, OpenItemDTO itemDTO) { itemService.updateItem(appId, env, clusterName, namespaceName, itemDTO); } /** * Create config if not exists or update config if already exists */ public void createOrUpdateItem(String appId, String env, String clusterName, String namespaceName, OpenItemDTO itemDTO) { itemService.createOrUpdateItem(appId, env, clusterName, namespaceName, itemDTO); } /** * Remove config * * @param operator the user who removes the item */ public void removeItem(String appId, String env, String clusterName, String namespaceName, String key, String operator) { itemService.removeItem(appId, env, clusterName, namespaceName, key, operator); } /** * publish namespace * @return the released configurations */ public OpenReleaseDTO publishNamespace(String appId, String env, String clusterName, String namespaceName, NamespaceReleaseDTO releaseDTO) { return releaseService.publishNamespace(appId, env, clusterName, namespaceName, releaseDTO); } /** * @return the latest active release information or <code>null</code> if not found */ public OpenReleaseDTO getLatestActiveRelease(String appId, String env, String clusterName, String namespaceName) { return releaseService.getLatestActiveRelease(appId, env, clusterName, namespaceName); } /** * Rollback the release * * @param operator the user who rollbacks the release * @since 1.5.0 */ public void rollbackRelease(String env, long releaseId, String operator) { releaseService.rollbackRelease(env, releaseId, operator); } public String getPortalUrl() { return portalUrl; } public String getToken() { return token; } public static ApolloOpenApiClientBuilder newBuilder() { return new ApolloOpenApiClientBuilder(); } public static class ApolloOpenApiClientBuilder { private String portalUrl; private String token; private int connectTimeout = -1; private int readTimeout = -1; /** * @param portalUrl The apollo portal url, e.g http://localhost:8070 */ public ApolloOpenApiClientBuilder withPortalUrl(String portalUrl) { this.portalUrl = portalUrl; return this; } /** * @param token The authorization token, e.g. e16e5cd903fd0c97a116c873b448544b9d086de8 */ public ApolloOpenApiClientBuilder withToken(String token) { this.token = token; return this; } /** * @param connectTimeout an int that specifies the connect timeout value in milliseconds */ public ApolloOpenApiClientBuilder withConnectTimeout(int connectTimeout) { this.connectTimeout = connectTimeout; return this; } /** * @param readTimeout an int that specifies the timeout value to be used in milliseconds */ public ApolloOpenApiClientBuilder withReadTimeout(int readTimeout) { this.readTimeout = readTimeout; return this; } public ApolloOpenApiClient build() { Preconditions.checkArgument(!Strings.isNullOrEmpty(portalUrl), "Portal url should not be null or empty!"); Preconditions.checkArgument(portalUrl.startsWith("http://") || portalUrl.startsWith("https://"), "Portal url should start with http:// or https://" ); Preconditions.checkArgument(!Strings.isNullOrEmpty(token), "Token should not be null or empty!"); if (connectTimeout < 0) { connectTimeout = ApolloOpenApiConstants.DEFAULT_CONNECT_TIMEOUT; } if (readTimeout < 0) { readTimeout = ApolloOpenApiConstants.DEFAULT_READ_TIMEOUT; } RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(connectTimeout) .setSocketTimeout(readTimeout).build(); return new ApolloOpenApiClient(portalUrl, token, requestConfig); } } }
1
apolloconfig/apollo
3,647
feat(open-api): get authorized apps
## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
Anilople
2021-04-24T06:40:38Z
2021-06-26T13:21:02Z
9a6f8e277f678fa583a23f551ed1648d5e13bdfa
f1eca02f4033d050bd71ede288d1707954d3dea4
feat(open-api): get authorized apps. ## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-openapi/src/main/java/com/ctrip/framework/apollo/openapi/client/service/AppOpenApiService.java
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.openapi.client.service; import com.ctrip.framework.apollo.openapi.dto.OpenAppDTO; import com.ctrip.framework.apollo.openapi.dto.OpenEnvClusterDTO; import com.google.common.base.Joiner; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.List; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.util.EntityUtils; public class AppOpenApiService extends AbstractOpenApiService { private static final Type OPEN_ENV_CLUSTER_DTO_LIST_TYPE = new TypeToken<List<OpenEnvClusterDTO>>() { }.getType(); private static final Type OPEN_APP_DTO_LIST_TYPE = new TypeToken<List<OpenAppDTO>>() { }.getType(); public AppOpenApiService(CloseableHttpClient client, String baseUrl, Gson gson) { super(client, baseUrl, gson); } public List<OpenEnvClusterDTO> getEnvClusterInfo(String appId) { checkNotEmpty(appId, "App id"); String path = String.format("apps/%s/envclusters", escapePath(appId)); try (CloseableHttpResponse response = get(path)) { return gson.fromJson(EntityUtils.toString(response.getEntity()), OPEN_ENV_CLUSTER_DTO_LIST_TYPE); } catch (Throwable ex) { throw new RuntimeException(String.format("Load env cluster information for appId: %s failed", appId), ex); } } public List<OpenAppDTO> getAppsInfo(List<String> appIds) { String path = "apps"; if (appIds != null && !appIds.isEmpty()) { String param = Joiner.on(",").join(appIds); path = String.format("apps?appIds=%s", escapeParam(param)); } try (CloseableHttpResponse response = get(path)) { return gson.fromJson(EntityUtils.toString(response.getEntity()), OPEN_APP_DTO_LIST_TYPE); } catch (Throwable ex) { throw new RuntimeException(String.format("Load app information for appIds: %s failed", appIds), ex); } } }
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.openapi.client.service; import com.ctrip.framework.apollo.openapi.dto.OpenAppDTO; import com.ctrip.framework.apollo.openapi.dto.OpenEnvClusterDTO; import com.google.common.base.Joiner; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.List; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.util.EntityUtils; public class AppOpenApiService extends AbstractOpenApiService { private static final Type OPEN_ENV_CLUSTER_DTO_LIST_TYPE = new TypeToken<List<OpenEnvClusterDTO>>() { }.getType(); private static final Type OPEN_APP_DTO_LIST_TYPE = new TypeToken<List<OpenAppDTO>>() { }.getType(); public AppOpenApiService(CloseableHttpClient client, String baseUrl, Gson gson) { super(client, baseUrl, gson); } public List<OpenEnvClusterDTO> getEnvClusterInfo(String appId) { checkNotEmpty(appId, "App id"); String path = String.format("apps/%s/envclusters", escapePath(appId)); try (CloseableHttpResponse response = get(path)) { return gson.fromJson(EntityUtils.toString(response.getEntity()), OPEN_ENV_CLUSTER_DTO_LIST_TYPE); } catch (Throwable ex) { throw new RuntimeException(String.format("Load env cluster information for appId: %s failed", appId), ex); } } public List<OpenAppDTO> getAppsInfo(List<String> appIds) { String path = "apps"; if (appIds != null && !appIds.isEmpty()) { String param = Joiner.on(",").join(appIds); path = String.format("apps?appIds=%s", escapeParam(param)); } try (CloseableHttpResponse response = get(path)) { return gson.fromJson(EntityUtils.toString(response.getEntity()), OPEN_APP_DTO_LIST_TYPE); } catch (Throwable ex) { throw new RuntimeException(String.format("Load app information for appIds: %s failed", appIds), ex); } } public List<OpenAppDTO> getAuthorizedApps() { String path = "apps/authorized"; try(CloseableHttpResponse response = this.get(path)) { return gson.fromJson(EntityUtils.toString(response.getEntity()), OPEN_APP_DTO_LIST_TYPE); } catch (Throwable ex) { throw new RuntimeException("Load authorized apps failed", ex); } } }
1
apolloconfig/apollo
3,647
feat(open-api): get authorized apps
## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
Anilople
2021-04-24T06:40:38Z
2021-06-26T13:21:02Z
9a6f8e277f678fa583a23f551ed1648d5e13bdfa
f1eca02f4033d050bd71ede288d1707954d3dea4
feat(open-api): get authorized apps. ## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/service/ConsumerService.java
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.openapi.service; import com.ctrip.framework.apollo.common.exception.BadRequestException; import com.ctrip.framework.apollo.openapi.entity.Consumer; import com.ctrip.framework.apollo.openapi.entity.ConsumerAudit; import com.ctrip.framework.apollo.openapi.entity.ConsumerRole; import com.ctrip.framework.apollo.openapi.entity.ConsumerToken; import com.ctrip.framework.apollo.openapi.repository.ConsumerAuditRepository; import com.ctrip.framework.apollo.openapi.repository.ConsumerRepository; import com.ctrip.framework.apollo.openapi.repository.ConsumerRoleRepository; import com.ctrip.framework.apollo.openapi.repository.ConsumerTokenRepository; import com.ctrip.framework.apollo.portal.component.config.PortalConfig; import com.ctrip.framework.apollo.portal.entity.bo.UserInfo; import com.ctrip.framework.apollo.portal.entity.po.Role; import com.ctrip.framework.apollo.portal.service.RolePermissionService; import com.ctrip.framework.apollo.portal.spi.UserInfoHolder; import com.ctrip.framework.apollo.portal.spi.UserService; import com.ctrip.framework.apollo.portal.util.RoleUtils; import com.google.common.base.Charsets; import com.google.common.base.Joiner; import com.google.common.base.Preconditions; import com.google.common.base.Strings; import com.google.common.hash.Hashing; import org.apache.commons.lang.time.FastDateFormat; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; import java.util.Date; import java.util.List; /** * @author Jason Song([email protected]) */ @Service public class ConsumerService { private static final FastDateFormat TIMESTAMP_FORMAT = FastDateFormat.getInstance("yyyyMMddHHmmss"); private static final Joiner KEY_JOINER = Joiner.on("|"); private final UserInfoHolder userInfoHolder; private final ConsumerTokenRepository consumerTokenRepository; private final ConsumerRepository consumerRepository; private final ConsumerAuditRepository consumerAuditRepository; private final ConsumerRoleRepository consumerRoleRepository; private final PortalConfig portalConfig; private final RolePermissionService rolePermissionService; private final UserService userService; public ConsumerService( final UserInfoHolder userInfoHolder, final ConsumerTokenRepository consumerTokenRepository, final ConsumerRepository consumerRepository, final ConsumerAuditRepository consumerAuditRepository, final ConsumerRoleRepository consumerRoleRepository, final PortalConfig portalConfig, final RolePermissionService rolePermissionService, final UserService userService) { this.userInfoHolder = userInfoHolder; this.consumerTokenRepository = consumerTokenRepository; this.consumerRepository = consumerRepository; this.consumerAuditRepository = consumerAuditRepository; this.consumerRoleRepository = consumerRoleRepository; this.portalConfig = portalConfig; this.rolePermissionService = rolePermissionService; this.userService = userService; } public Consumer createConsumer(Consumer consumer) { String appId = consumer.getAppId(); Consumer managedConsumer = consumerRepository.findByAppId(appId); if (managedConsumer != null) { throw new BadRequestException("Consumer already exist"); } String ownerName = consumer.getOwnerName(); UserInfo owner = userService.findByUserId(ownerName); if (owner == null) { throw new BadRequestException(String.format("User does not exist. UserId = %s", ownerName)); } consumer.setOwnerEmail(owner.getEmail()); String operator = userInfoHolder.getUser().getUserId(); consumer.setDataChangeCreatedBy(operator); consumer.setDataChangeLastModifiedBy(operator); return consumerRepository.save(consumer); } public ConsumerToken generateAndSaveConsumerToken(Consumer consumer, Date expires) { Preconditions.checkArgument(consumer != null, "Consumer can not be null"); ConsumerToken consumerToken = generateConsumerToken(consumer, expires); consumerToken.setId(0); return consumerTokenRepository.save(consumerToken); } public ConsumerToken getConsumerTokenByAppId(String appId) { Consumer consumer = consumerRepository.findByAppId(appId); if (consumer == null) { return null; } return consumerTokenRepository.findByConsumerId(consumer.getId()); } public Long getConsumerIdByToken(String token) { if (Strings.isNullOrEmpty(token)) { return null; } ConsumerToken consumerToken = consumerTokenRepository.findTopByTokenAndExpiresAfter(token, new Date()); return consumerToken == null ? null : consumerToken.getConsumerId(); } public Consumer getConsumerByConsumerId(long consumerId) { return consumerRepository.findById(consumerId).orElse(null); } public List<ConsumerRole> assignNamespaceRoleToConsumer(String token, String appId, String namespaceName) { return assignNamespaceRoleToConsumer(token, appId, namespaceName, null); } @Transactional public List<ConsumerRole> assignNamespaceRoleToConsumer(String token, String appId, String namespaceName, String env) { Long consumerId = getConsumerIdByToken(token); if (consumerId == null) { throw new BadRequestException("Token is Illegal"); } Role namespaceModifyRole = rolePermissionService.findRoleByRoleName(RoleUtils.buildModifyNamespaceRoleName(appId, namespaceName, env)); Role namespaceReleaseRole = rolePermissionService.findRoleByRoleName(RoleUtils.buildReleaseNamespaceRoleName(appId, namespaceName, env)); if (namespaceModifyRole == null || namespaceReleaseRole == null) { throw new BadRequestException("Namespace's role does not exist. Please check whether namespace has created."); } long namespaceModifyRoleId = namespaceModifyRole.getId(); long namespaceReleaseRoleId = namespaceReleaseRole.getId(); ConsumerRole managedModifyRole = consumerRoleRepository.findByConsumerIdAndRoleId(consumerId, namespaceModifyRoleId); ConsumerRole managedReleaseRole = consumerRoleRepository.findByConsumerIdAndRoleId(consumerId, namespaceReleaseRoleId); if (managedModifyRole != null && managedReleaseRole != null) { return Arrays.asList(managedModifyRole, managedReleaseRole); } String operator = userInfoHolder.getUser().getUserId(); ConsumerRole namespaceModifyConsumerRole = createConsumerRole(consumerId, namespaceModifyRoleId, operator); ConsumerRole namespaceReleaseConsumerRole = createConsumerRole(consumerId, namespaceReleaseRoleId, operator); ConsumerRole createdModifyConsumerRole = consumerRoleRepository.save(namespaceModifyConsumerRole); ConsumerRole createdReleaseConsumerRole = consumerRoleRepository.save(namespaceReleaseConsumerRole); return Arrays.asList(createdModifyConsumerRole, createdReleaseConsumerRole); } @Transactional public ConsumerRole assignAppRoleToConsumer(String token, String appId) { Long consumerId = getConsumerIdByToken(token); if (consumerId == null) { throw new BadRequestException("Token is Illegal"); } Role masterRole = rolePermissionService.findRoleByRoleName(RoleUtils.buildAppMasterRoleName(appId)); if (masterRole == null) { throw new BadRequestException("App's role does not exist. Please check whether app has created."); } long roleId = masterRole.getId(); ConsumerRole managedModifyRole = consumerRoleRepository.findByConsumerIdAndRoleId(consumerId, roleId); if (managedModifyRole != null) { return managedModifyRole; } String operator = userInfoHolder.getUser().getUserId(); ConsumerRole consumerRole = createConsumerRole(consumerId, roleId, operator); return consumerRoleRepository.save(consumerRole); } @Transactional public void createConsumerAudits(Iterable<ConsumerAudit> consumerAudits) { consumerAuditRepository.saveAll(consumerAudits); } @Transactional public ConsumerToken createConsumerToken(ConsumerToken entity) { entity.setId(0); //for protection return consumerTokenRepository.save(entity); } private ConsumerToken generateConsumerToken(Consumer consumer, Date expires) { long consumerId = consumer.getId(); String createdBy = userInfoHolder.getUser().getUserId(); Date createdTime = new Date(); ConsumerToken consumerToken = new ConsumerToken(); consumerToken.setConsumerId(consumerId); consumerToken.setExpires(expires); consumerToken.setDataChangeCreatedBy(createdBy); consumerToken.setDataChangeCreatedTime(createdTime); consumerToken.setDataChangeLastModifiedBy(createdBy); consumerToken.setDataChangeLastModifiedTime(createdTime); generateAndEnrichToken(consumer, consumerToken); return consumerToken; } void generateAndEnrichToken(Consumer consumer, ConsumerToken consumerToken) { Preconditions.checkArgument(consumer != null); if (consumerToken.getDataChangeCreatedTime() == null) { consumerToken.setDataChangeCreatedTime(new Date()); } consumerToken.setToken(generateToken(consumer.getAppId(), consumerToken .getDataChangeCreatedTime(), portalConfig.consumerTokenSalt())); } String generateToken(String consumerAppId, Date generationTime, String consumerTokenSalt) { return Hashing.sha1().hashString(KEY_JOINER.join(consumerAppId, TIMESTAMP_FORMAT.format (generationTime), consumerTokenSalt), Charsets.UTF_8).toString(); } ConsumerRole createConsumerRole(Long consumerId, Long roleId, String operator) { ConsumerRole consumerRole = new ConsumerRole(); consumerRole.setConsumerId(consumerId); consumerRole.setRoleId(roleId); consumerRole.setDataChangeCreatedBy(operator); consumerRole.setDataChangeLastModifiedBy(operator); return consumerRole; } }
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.openapi.service; import com.ctrip.framework.apollo.common.exception.BadRequestException; import com.ctrip.framework.apollo.openapi.entity.Consumer; import com.ctrip.framework.apollo.openapi.entity.ConsumerAudit; import com.ctrip.framework.apollo.openapi.entity.ConsumerRole; import com.ctrip.framework.apollo.openapi.entity.ConsumerToken; import com.ctrip.framework.apollo.openapi.repository.ConsumerAuditRepository; import com.ctrip.framework.apollo.openapi.repository.ConsumerRepository; import com.ctrip.framework.apollo.openapi.repository.ConsumerRoleRepository; import com.ctrip.framework.apollo.openapi.repository.ConsumerTokenRepository; import com.ctrip.framework.apollo.portal.component.config.PortalConfig; import com.ctrip.framework.apollo.portal.entity.bo.UserInfo; import com.ctrip.framework.apollo.portal.entity.po.Role; import com.ctrip.framework.apollo.portal.repository.RoleRepository; import com.ctrip.framework.apollo.portal.service.RolePermissionService; import com.ctrip.framework.apollo.portal.spi.UserInfoHolder; import com.ctrip.framework.apollo.portal.spi.UserService; import com.ctrip.framework.apollo.portal.util.RoleUtils; import com.google.common.base.Charsets; import com.google.common.base.Joiner; import com.google.common.base.Preconditions; import com.google.common.base.Strings; import com.google.common.hash.Hashing; import java.util.HashSet; import java.util.Set; import java.util.stream.Collectors; import org.apache.commons.lang.time.FastDateFormat; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; import java.util.Date; import java.util.List; /** * @author Jason Song([email protected]) */ @Service public class ConsumerService { private static final FastDateFormat TIMESTAMP_FORMAT = FastDateFormat.getInstance("yyyyMMddHHmmss"); private static final Joiner KEY_JOINER = Joiner.on("|"); private final UserInfoHolder userInfoHolder; private final ConsumerTokenRepository consumerTokenRepository; private final ConsumerRepository consumerRepository; private final ConsumerAuditRepository consumerAuditRepository; private final ConsumerRoleRepository consumerRoleRepository; private final PortalConfig portalConfig; private final RolePermissionService rolePermissionService; private final UserService userService; private final RoleRepository roleRepository; public ConsumerService( final UserInfoHolder userInfoHolder, final ConsumerTokenRepository consumerTokenRepository, final ConsumerRepository consumerRepository, final ConsumerAuditRepository consumerAuditRepository, final ConsumerRoleRepository consumerRoleRepository, final PortalConfig portalConfig, final RolePermissionService rolePermissionService, final UserService userService, final RoleRepository roleRepository) { this.userInfoHolder = userInfoHolder; this.consumerTokenRepository = consumerTokenRepository; this.consumerRepository = consumerRepository; this.consumerAuditRepository = consumerAuditRepository; this.consumerRoleRepository = consumerRoleRepository; this.portalConfig = portalConfig; this.rolePermissionService = rolePermissionService; this.userService = userService; this.roleRepository = roleRepository; } public Consumer createConsumer(Consumer consumer) { String appId = consumer.getAppId(); Consumer managedConsumer = consumerRepository.findByAppId(appId); if (managedConsumer != null) { throw new BadRequestException("Consumer already exist"); } String ownerName = consumer.getOwnerName(); UserInfo owner = userService.findByUserId(ownerName); if (owner == null) { throw new BadRequestException(String.format("User does not exist. UserId = %s", ownerName)); } consumer.setOwnerEmail(owner.getEmail()); String operator = userInfoHolder.getUser().getUserId(); consumer.setDataChangeCreatedBy(operator); consumer.setDataChangeLastModifiedBy(operator); return consumerRepository.save(consumer); } public ConsumerToken generateAndSaveConsumerToken(Consumer consumer, Date expires) { Preconditions.checkArgument(consumer != null, "Consumer can not be null"); ConsumerToken consumerToken = generateConsumerToken(consumer, expires); consumerToken.setId(0); return consumerTokenRepository.save(consumerToken); } public ConsumerToken getConsumerTokenByAppId(String appId) { Consumer consumer = consumerRepository.findByAppId(appId); if (consumer == null) { return null; } return consumerTokenRepository.findByConsumerId(consumer.getId()); } public Long getConsumerIdByToken(String token) { if (Strings.isNullOrEmpty(token)) { return null; } ConsumerToken consumerToken = consumerTokenRepository.findTopByTokenAndExpiresAfter(token, new Date()); return consumerToken == null ? null : consumerToken.getConsumerId(); } public Consumer getConsumerByConsumerId(long consumerId) { return consumerRepository.findById(consumerId).orElse(null); } public List<ConsumerRole> assignNamespaceRoleToConsumer(String token, String appId, String namespaceName) { return assignNamespaceRoleToConsumer(token, appId, namespaceName, null); } @Transactional public List<ConsumerRole> assignNamespaceRoleToConsumer(String token, String appId, String namespaceName, String env) { Long consumerId = getConsumerIdByToken(token); if (consumerId == null) { throw new BadRequestException("Token is Illegal"); } Role namespaceModifyRole = rolePermissionService.findRoleByRoleName(RoleUtils.buildModifyNamespaceRoleName(appId, namespaceName, env)); Role namespaceReleaseRole = rolePermissionService.findRoleByRoleName(RoleUtils.buildReleaseNamespaceRoleName(appId, namespaceName, env)); if (namespaceModifyRole == null || namespaceReleaseRole == null) { throw new BadRequestException("Namespace's role does not exist. Please check whether namespace has created."); } long namespaceModifyRoleId = namespaceModifyRole.getId(); long namespaceReleaseRoleId = namespaceReleaseRole.getId(); ConsumerRole managedModifyRole = consumerRoleRepository.findByConsumerIdAndRoleId(consumerId, namespaceModifyRoleId); ConsumerRole managedReleaseRole = consumerRoleRepository.findByConsumerIdAndRoleId(consumerId, namespaceReleaseRoleId); if (managedModifyRole != null && managedReleaseRole != null) { return Arrays.asList(managedModifyRole, managedReleaseRole); } String operator = userInfoHolder.getUser().getUserId(); ConsumerRole namespaceModifyConsumerRole = createConsumerRole(consumerId, namespaceModifyRoleId, operator); ConsumerRole namespaceReleaseConsumerRole = createConsumerRole(consumerId, namespaceReleaseRoleId, operator); ConsumerRole createdModifyConsumerRole = consumerRoleRepository.save(namespaceModifyConsumerRole); ConsumerRole createdReleaseConsumerRole = consumerRoleRepository.save(namespaceReleaseConsumerRole); return Arrays.asList(createdModifyConsumerRole, createdReleaseConsumerRole); } @Transactional public ConsumerRole assignAppRoleToConsumer(String token, String appId) { Long consumerId = getConsumerIdByToken(token); if (consumerId == null) { throw new BadRequestException("Token is Illegal"); } Role masterRole = rolePermissionService.findRoleByRoleName(RoleUtils.buildAppMasterRoleName(appId)); if (masterRole == null) { throw new BadRequestException("App's role does not exist. Please check whether app has created."); } long roleId = masterRole.getId(); ConsumerRole managedModifyRole = consumerRoleRepository.findByConsumerIdAndRoleId(consumerId, roleId); if (managedModifyRole != null) { return managedModifyRole; } String operator = userInfoHolder.getUser().getUserId(); ConsumerRole consumerRole = createConsumerRole(consumerId, roleId, operator); return consumerRoleRepository.save(consumerRole); } @Transactional public void createConsumerAudits(Iterable<ConsumerAudit> consumerAudits) { consumerAuditRepository.saveAll(consumerAudits); } @Transactional public ConsumerToken createConsumerToken(ConsumerToken entity) { entity.setId(0); //for protection return consumerTokenRepository.save(entity); } private ConsumerToken generateConsumerToken(Consumer consumer, Date expires) { long consumerId = consumer.getId(); String createdBy = userInfoHolder.getUser().getUserId(); Date createdTime = new Date(); ConsumerToken consumerToken = new ConsumerToken(); consumerToken.setConsumerId(consumerId); consumerToken.setExpires(expires); consumerToken.setDataChangeCreatedBy(createdBy); consumerToken.setDataChangeCreatedTime(createdTime); consumerToken.setDataChangeLastModifiedBy(createdBy); consumerToken.setDataChangeLastModifiedTime(createdTime); generateAndEnrichToken(consumer, consumerToken); return consumerToken; } void generateAndEnrichToken(Consumer consumer, ConsumerToken consumerToken) { Preconditions.checkArgument(consumer != null); if (consumerToken.getDataChangeCreatedTime() == null) { consumerToken.setDataChangeCreatedTime(new Date()); } consumerToken.setToken(generateToken(consumer.getAppId(), consumerToken .getDataChangeCreatedTime(), portalConfig.consumerTokenSalt())); } String generateToken(String consumerAppId, Date generationTime, String consumerTokenSalt) { return Hashing.sha1().hashString(KEY_JOINER.join(consumerAppId, TIMESTAMP_FORMAT.format (generationTime), consumerTokenSalt), Charsets.UTF_8).toString(); } ConsumerRole createConsumerRole(Long consumerId, Long roleId, String operator) { ConsumerRole consumerRole = new ConsumerRole(); consumerRole.setConsumerId(consumerId); consumerRole.setRoleId(roleId); consumerRole.setDataChangeCreatedBy(operator); consumerRole.setDataChangeLastModifiedBy(operator); return consumerRole; } public Set<String> findAppIdsAuthorizedByConsumerId(long consumerId) { List<ConsumerRole> consumerRoles = this.findConsumerRolesByConsumerId(consumerId); List<Long> roleIds = consumerRoles.stream().map(ConsumerRole::getRoleId) .collect(Collectors.toList()); Set<String> appIds = this.findAppIdsByRoleIds(roleIds); return appIds; } private List<ConsumerRole> findConsumerRolesByConsumerId(long consumerId) { List<ConsumerRole> consumerRoles = this.consumerRoleRepository.findByConsumerId(consumerId); return consumerRoles; } private Set<String> findAppIdsByRoleIds(List<Long> roleIds) { Iterable<Role> roleIterable = this.roleRepository.findAllById(roleIds); Set<String> appIds = new HashSet<>(); roleIterable.forEach(role -> { if (!role.isDeleted()) { String roleName = role.getRoleName(); String appId = RoleUtils.extractAppIdFromRoleName(roleName); appIds.add(appId); } }); return appIds; } }
1
apolloconfig/apollo
3,647
feat(open-api): get authorized apps
## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
Anilople
2021-04-24T06:40:38Z
2021-06-26T13:21:02Z
9a6f8e277f678fa583a23f551ed1648d5e13bdfa
f1eca02f4033d050bd71ede288d1707954d3dea4
feat(open-api): get authorized apps. ## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/AppController.java
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.openapi.v1.controller; import com.ctrip.framework.apollo.common.dto.ClusterDTO; import com.ctrip.framework.apollo.common.entity.App; import com.ctrip.framework.apollo.common.utils.BeanUtils; import com.ctrip.framework.apollo.portal.environment.Env; import com.ctrip.framework.apollo.openapi.dto.OpenAppDTO; import com.ctrip.framework.apollo.openapi.dto.OpenEnvClusterDTO; import com.ctrip.framework.apollo.openapi.util.OpenApiBeanUtils; import com.ctrip.framework.apollo.portal.component.PortalSettings; import com.ctrip.framework.apollo.portal.service.AppService; import com.ctrip.framework.apollo.portal.service.ClusterService; import com.google.common.collect.Sets; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; @RestController("openapiAppController") @RequestMapping("/openapi/v1") public class AppController { private final PortalSettings portalSettings; private final ClusterService clusterService; private final AppService appService; public AppController(final PortalSettings portalSettings, final ClusterService clusterService, final AppService appService) { this.portalSettings = portalSettings; this.clusterService = clusterService; this.appService = appService; } @GetMapping(value = "/apps/{appId}/envclusters") public List<OpenEnvClusterDTO> loadEnvClusterInfo(@PathVariable String appId){ List<OpenEnvClusterDTO> envClusters = new LinkedList<>(); List<Env> envs = portalSettings.getActiveEnvs(); for (Env env : envs) { OpenEnvClusterDTO envCluster = new OpenEnvClusterDTO(); envCluster.setEnv(env.name()); List<ClusterDTO> clusterDTOs = clusterService.findClusters(env, appId); envCluster.setClusters(BeanUtils.toPropertySet("name", clusterDTOs)); envClusters.add(envCluster); } return envClusters; } @GetMapping("/apps") public List<OpenAppDTO> findApps(@RequestParam(value = "appIds", required = false) String appIds) { final List<App> apps = new ArrayList<>(); if (StringUtils.isEmpty(appIds)) { apps.addAll(appService.findAll()); } else { apps.addAll(appService.findByAppIds(Sets.newHashSet(appIds.split(",")))); } return OpenApiBeanUtils.transformFromApps(apps); } }
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.openapi.v1.controller; import com.ctrip.framework.apollo.common.dto.ClusterDTO; import com.ctrip.framework.apollo.common.entity.App; import com.ctrip.framework.apollo.common.utils.BeanUtils; import com.ctrip.framework.apollo.openapi.entity.ConsumerRole; import com.ctrip.framework.apollo.openapi.service.ConsumerService; import com.ctrip.framework.apollo.openapi.util.ConsumerAuthUtil; import com.ctrip.framework.apollo.portal.environment.Env; import com.ctrip.framework.apollo.openapi.dto.OpenAppDTO; import com.ctrip.framework.apollo.openapi.dto.OpenEnvClusterDTO; import com.ctrip.framework.apollo.openapi.util.OpenApiBeanUtils; import com.ctrip.framework.apollo.portal.component.PortalSettings; import com.ctrip.framework.apollo.portal.service.AppService; import com.ctrip.framework.apollo.portal.service.ClusterService; import com.google.common.collect.Sets; import java.util.Set; import javax.servlet.http.HttpServletRequest; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; @RestController("openapiAppController") @RequestMapping("/openapi/v1") public class AppController { private final PortalSettings portalSettings; private final ClusterService clusterService; private final AppService appService; private final ConsumerAuthUtil consumerAuthUtil; private final ConsumerService consumerService; public AppController(final PortalSettings portalSettings, final ClusterService clusterService, final AppService appService, final ConsumerAuthUtil consumerAuthUtil, final ConsumerService consumerService) { this.portalSettings = portalSettings; this.clusterService = clusterService; this.appService = appService; this.consumerAuthUtil = consumerAuthUtil; this.consumerService = consumerService; } @GetMapping(value = "/apps/{appId}/envclusters") public List<OpenEnvClusterDTO> loadEnvClusterInfo(@PathVariable String appId){ List<OpenEnvClusterDTO> envClusters = new LinkedList<>(); List<Env> envs = portalSettings.getActiveEnvs(); for (Env env : envs) { OpenEnvClusterDTO envCluster = new OpenEnvClusterDTO(); envCluster.setEnv(env.name()); List<ClusterDTO> clusterDTOs = clusterService.findClusters(env, appId); envCluster.setClusters(BeanUtils.toPropertySet("name", clusterDTOs)); envClusters.add(envCluster); } return envClusters; } @GetMapping("/apps") public List<OpenAppDTO> findApps(@RequestParam(value = "appIds", required = false) String appIds) { final List<App> apps = new ArrayList<>(); if (StringUtils.isEmpty(appIds)) { apps.addAll(appService.findAll()); } else { apps.addAll(appService.findByAppIds(Sets.newHashSet(appIds.split(",")))); } return OpenApiBeanUtils.transformFromApps(apps); } /** * @return which apps can be operated by open api */ @GetMapping("/apps/authorized") public List<OpenAppDTO> findAppsAuthorized(HttpServletRequest request) { long consumerId = this.consumerAuthUtil.retrieveConsumerId(request); Set<String> appIds = this.consumerService.findAppIdsAuthorizedByConsumerId(consumerId); List<App> apps = this.appService.findByAppIds(appIds); List<OpenAppDTO> openAppDTOS = OpenApiBeanUtils.transformFromApps(apps); return openAppDTOS; } }
1
apolloconfig/apollo
3,647
feat(open-api): get authorized apps
## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
Anilople
2021-04-24T06:40:38Z
2021-06-26T13:21:02Z
9a6f8e277f678fa583a23f551ed1648d5e13bdfa
f1eca02f4033d050bd71ede288d1707954d3dea4
feat(open-api): get authorized apps. ## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/test/resources/sql/cleanup.sql
-- -- Copyright 2021 Apollo Authors -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- delete from Permission; delete from Role; delete from RolePermission; delete from UserRole; delete from AppNamespace; DELETE FROM Favorite; DELETE FROM ServerConfig; DELETE FROM App;
-- -- Copyright 2021 Apollo Authors -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- DELETE FROM `App`; DELETE FROM `AppNamespace`; -- DELETE FROM `Authorities`; DELETE FROM `Consumer`; DELETE FROM `ConsumerAudit`; DELETE FROM `ConsumerRole`; DELETE FROM `ConsumerToken`; DELETE FROM `Favorite`; DELETE FROM `Permission`; DELETE FROM `Role`; DELETE FROM `RolePermission`; DELETE FROM `ServerConfig`; DELETE FROM `UserRole`; DELETE FROM `Users`;
1
apolloconfig/apollo
3,647
feat(open-api): get authorized apps
## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
Anilople
2021-04-24T06:40:38Z
2021-06-26T13:21:02Z
9a6f8e277f678fa583a23f551ed1648d5e13bdfa
f1eca02f4033d050bd71ede288d1707954d3dea4
feat(open-api): get authorized apps. ## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/component/emailbuilder/MergeEmailBuilder.java
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.portal.component.emailbuilder; import com.ctrip.framework.apollo.portal.environment.Env; import com.ctrip.framework.apollo.portal.entity.bo.ReleaseHistoryBO; import org.springframework.stereotype.Component; @Component public class MergeEmailBuilder extends ConfigPublishEmailBuilder { private static final String EMAIL_SUBJECT = "[Apollo] 全量发布"; @Override protected String subject() { return EMAIL_SUBJECT; } @Override protected String emailContent(Env env, ReleaseHistoryBO releaseHistory) { return renderEmailCommonContent(env, releaseHistory); } @Override protected String getTemplateFramework() { return portalConfig.emailTemplateFramework(); } @Override protected String getDiffModuleTemplate() { return portalConfig.emailReleaseDiffModuleTemplate(); } }
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.portal.component.emailbuilder; import com.ctrip.framework.apollo.portal.environment.Env; import com.ctrip.framework.apollo.portal.entity.bo.ReleaseHistoryBO; import org.springframework.stereotype.Component; @Component public class MergeEmailBuilder extends ConfigPublishEmailBuilder { private static final String EMAIL_SUBJECT = "[Apollo] 全量发布"; @Override protected String subject() { return EMAIL_SUBJECT; } @Override protected String emailContent(Env env, ReleaseHistoryBO releaseHistory) { return renderEmailCommonContent(env, releaseHistory); } @Override protected String getTemplateFramework() { return portalConfig.emailTemplateFramework(); } @Override protected String getDiffModuleTemplate() { return portalConfig.emailReleaseDiffModuleTemplate(); } }
-1
apolloconfig/apollo
3,647
feat(open-api): get authorized apps
## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
Anilople
2021-04-24T06:40:38Z
2021-06-26T13:21:02Z
9a6f8e277f678fa583a23f551ed1648d5e13bdfa
f1eca02f4033d050bd71ede288d1707954d3dea4
feat(open-api): get authorized apps. ## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/repository/AppRepository.java
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.biz.repository; import com.ctrip.framework.apollo.common.entity.App; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.query.Param; import java.util.List; public interface AppRepository extends PagingAndSortingRepository<App, Long> { @Query("SELECT a from App a WHERE a.name LIKE %:name%") List<App> findByName(@Param("name") String name); App findByAppId(String appId); }
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.biz.repository; import com.ctrip.framework.apollo.common.entity.App; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.query.Param; import java.util.List; public interface AppRepository extends PagingAndSortingRepository<App, Long> { @Query("SELECT a from App a WHERE a.name LIKE %:name%") List<App> findByName(@Param("name") String name); App findByAppId(String appId); }
-1
apolloconfig/apollo
3,647
feat(open-api): get authorized apps
## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
Anilople
2021-04-24T06:40:38Z
2021-06-26T13:21:02Z
9a6f8e277f678fa583a23f551ed1648d5e13bdfa
f1eca02f4033d050bd71ede288d1707954d3dea4
feat(open-api): get authorized apps. ## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/vo/LockInfo.java
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.portal.entity.vo; public class LockInfo { private String lockOwner; private boolean isEmergencyPublishAllowed; public String getLockOwner() { return lockOwner; } public void setLockOwner(String lockOwner) { this.lockOwner = lockOwner; } public boolean isEmergencyPublishAllowed() { return isEmergencyPublishAllowed; } public void setEmergencyPublishAllowed(boolean emergencyPublishAllowed) { isEmergencyPublishAllowed = emergencyPublishAllowed; } }
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.portal.entity.vo; public class LockInfo { private String lockOwner; private boolean isEmergencyPublishAllowed; public String getLockOwner() { return lockOwner; } public void setLockOwner(String lockOwner) { this.lockOwner = lockOwner; } public boolean isEmergencyPublishAllowed() { return isEmergencyPublishAllowed; } public void setEmergencyPublishAllowed(boolean emergencyPublishAllowed) { isEmergencyPublishAllowed = emergencyPublishAllowed; } }
-1
apolloconfig/apollo
3,647
feat(open-api): get authorized apps
## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
Anilople
2021-04-24T06:40:38Z
2021-06-26T13:21:02Z
9a6f8e277f678fa583a23f551ed1648d5e13bdfa
f1eca02f4033d050bd71ede288d1707954d3dea4
feat(open-api): get authorized apps. ## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/UserInfoHolder.java
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.portal.spi; import com.ctrip.framework.apollo.portal.entity.bo.UserInfo; /** * Get access to the user's information, * different companies should have a different implementation */ public interface UserInfoHolder { UserInfo getUser(); }
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.portal.spi; import com.ctrip.framework.apollo.portal.entity.bo.UserInfo; /** * Get access to the user's information, * different companies should have a different implementation */ public interface UserInfoHolder { UserInfo getUser(); }
-1
apolloconfig/apollo
3,647
feat(open-api): get authorized apps
## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
Anilople
2021-04-24T06:40:38Z
2021-06-26T13:21:02Z
9a6f8e277f678fa583a23f551ed1648d5e13bdfa
f1eca02f4033d050bd71ede288d1707954d3dea4
feat(open-api): get authorized apps. ## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./scripts/sql/delta/v040-v050/apolloportaldb-v040-v050.sql
-- -- Copyright 2021 Apollo Authors -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- # delta schema to upgrade apollo portal db from v0.4.0 to v0.5.0 Use ApolloPortalDB; ALTER TABLE `AppNamespace` ADD KEY `IX_AppId` (`AppId`); ALTER TABLE `App` DROP INDEX `Name`; ALTER TABLE `App` ADD KEY `Name` (`Name`);
-- -- Copyright 2021 Apollo Authors -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- # delta schema to upgrade apollo portal db from v0.4.0 to v0.5.0 Use ApolloPortalDB; ALTER TABLE `AppNamespace` ADD KEY `IX_AppId` (`AppId`); ALTER TABLE `App` DROP INDEX `Name`; ALTER TABLE `App` ADD KEY `Name` (`Name`);
-1
apolloconfig/apollo
3,647
feat(open-api): get authorized apps
## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
Anilople
2021-04-24T06:40:38Z
2021-06-26T13:21:02Z
9a6f8e277f678fa583a23f551ed1648d5e13bdfa
f1eca02f4033d050bd71ede288d1707954d3dea4
feat(open-api): get authorized apps. ## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/OrganizationController.java
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.portal.controller; import com.ctrip.framework.apollo.portal.component.config.PortalConfig; import com.ctrip.framework.apollo.portal.entity.vo.Organization; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; /** * @author Jason Song([email protected]) */ @RestController @RequestMapping("/organizations") public class OrganizationController { private final PortalConfig portalConfig; public OrganizationController(final PortalConfig portalConfig) { this.portalConfig = portalConfig; } @RequestMapping public List<Organization> loadOrganization() { return portalConfig.organizations(); } }
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.portal.controller; import com.ctrip.framework.apollo.portal.component.config.PortalConfig; import com.ctrip.framework.apollo.portal.entity.vo.Organization; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; /** * @author Jason Song([email protected]) */ @RestController @RequestMapping("/organizations") public class OrganizationController { private final PortalConfig portalConfig; public OrganizationController(final PortalConfig portalConfig) { this.portalConfig = portalConfig; } @RequestMapping public List<Organization> loadOrganization() { return portalConfig.organizations(); } }
-1
apolloconfig/apollo
3,647
feat(open-api): get authorized apps
## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
Anilople
2021-04-24T06:40:38Z
2021-06-26T13:21:02Z
9a6f8e277f678fa583a23f551ed1648d5e13bdfa
f1eca02f4033d050bd71ede288d1707954d3dea4
feat(open-api): get authorized apps. ## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-client-config-data/src/main/java/com/ctrip/framework/apollo/config/data/ApolloClientConfigDataAutoConfiguration.java
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.config.data; import com.ctrip.framework.apollo.config.data.extension.initialize.ApolloClientPropertiesFactory; import com.ctrip.framework.apollo.config.data.extension.properties.ApolloClientProperties; import com.ctrip.framework.apollo.spring.config.ConfigPropertySourcesProcessor; import com.ctrip.framework.apollo.spring.config.PropertySourcesProcessor; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; /** * @author vdisk <[email protected]> */ @Configuration(proxyBeanMethods = false) public class ApolloClientConfigDataAutoConfiguration { @ConditionalOnMissingBean(ApolloClientProperties.class) @ConfigurationProperties(ApolloClientPropertiesFactory.PROPERTIES_PREFIX) @Bean public static ApolloClientProperties apolloWebClientSecurityProperties() { return new ApolloClientProperties(); } @ConditionalOnMissingBean(PropertySourcesProcessor.class) @Bean public static ConfigPropertySourcesProcessor configPropertySourcesProcessor() { return new ConfigPropertySourcesProcessor(); } }
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.config.data; import com.ctrip.framework.apollo.config.data.extension.initialize.ApolloClientPropertiesFactory; import com.ctrip.framework.apollo.config.data.extension.properties.ApolloClientProperties; import com.ctrip.framework.apollo.spring.config.ConfigPropertySourcesProcessor; import com.ctrip.framework.apollo.spring.config.PropertySourcesProcessor; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; /** * @author vdisk <[email protected]> */ @Configuration(proxyBeanMethods = false) public class ApolloClientConfigDataAutoConfiguration { @ConditionalOnMissingBean(ApolloClientProperties.class) @ConfigurationProperties(ApolloClientPropertiesFactory.PROPERTIES_PREFIX) @Bean public static ApolloClientProperties apolloWebClientSecurityProperties() { return new ApolloClientProperties(); } @ConditionalOnMissingBean(PropertySourcesProcessor.class) @Bean public static ConfigPropertySourcesProcessor configPropertySourcesProcessor() { return new ConfigPropertySourcesProcessor(); } }
-1
apolloconfig/apollo
3,647
feat(open-api): get authorized apps
## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
Anilople
2021-04-24T06:40:38Z
2021-06-26T13:21:02Z
9a6f8e277f678fa583a23f551ed1648d5e13bdfa
f1eca02f4033d050bd71ede288d1707954d3dea4
feat(open-api): get authorized apps. ## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/enums/ChangeType.java
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.portal.enums; public enum ChangeType { ADDED, MODIFIED, DELETED }
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.portal.enums; public enum ChangeType { ADDED, MODIFIED, DELETED }
-1
apolloconfig/apollo
3,647
feat(open-api): get authorized apps
## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
Anilople
2021-04-24T06:40:38Z
2021-06-26T13:21:02Z
9a6f8e277f678fa583a23f551ed1648d5e13bdfa
f1eca02f4033d050bd71ede288d1707954d3dea4
feat(open-api): get authorized apps. ## What's the purpose of this PR Let open api know that which applications it can operate. ## Which issue(s) this PR fixes: Relate to #3607 ## Brief changelog Add a new controller in portal Add a new method in ApolloOpenApiClient Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit tests to verify the code. - [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/FavoriteController.java
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.portal.controller; import com.ctrip.framework.apollo.portal.entity.po.Favorite; import com.ctrip.framework.apollo.portal.service.FavoriteService; import org.springframework.data.domain.Pageable; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.List; @RestController public class FavoriteController { private final FavoriteService favoriteService; public FavoriteController(final FavoriteService favoriteService) { this.favoriteService = favoriteService; } @PostMapping("/favorites") public Favorite addFavorite(@RequestBody Favorite favorite) { return favoriteService.addFavorite(favorite); } @GetMapping("/favorites") public List<Favorite> findFavorites(@RequestParam(value = "userId", required = false) String userId, @RequestParam(value = "appId", required = false) String appId, Pageable page) { return favoriteService.search(userId, appId, page); } @DeleteMapping("/favorites/{favoriteId}") public void deleteFavorite(@PathVariable long favoriteId) { favoriteService.deleteFavorite(favoriteId); } @PutMapping("/favorites/{favoriteId}") public void toTop(@PathVariable long favoriteId) { favoriteService.adjustFavoriteToFirst(favoriteId); } }
/* * Copyright 2021 Apollo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ctrip.framework.apollo.portal.controller; import com.ctrip.framework.apollo.portal.entity.po.Favorite; import com.ctrip.framework.apollo.portal.service.FavoriteService; import org.springframework.data.domain.Pageable; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.List; @RestController public class FavoriteController { private final FavoriteService favoriteService; public FavoriteController(final FavoriteService favoriteService) { this.favoriteService = favoriteService; } @PostMapping("/favorites") public Favorite addFavorite(@RequestBody Favorite favorite) { return favoriteService.addFavorite(favorite); } @GetMapping("/favorites") public List<Favorite> findFavorites(@RequestParam(value = "userId", required = false) String userId, @RequestParam(value = "appId", required = false) String appId, Pageable page) { return favoriteService.search(userId, appId, page); } @DeleteMapping("/favorites/{favoriteId}") public void deleteFavorite(@PathVariable long favoriteId) { favoriteService.deleteFavorite(favoriteId); } @PutMapping("/favorites/{favoriteId}") public void toTop(@PathVariable long favoriteId) { favoriteService.adjustFavoriteToFirst(favoriteId); } }
-1