-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apollo assembly optimization #5035
Changes from all commits
72f014f
b0223c2
b518cc6
aae21a1
4b5ebee
d0fbd74
cb48902
7bcc979
baf16c2
af7f56e
c22644a
73d45a7
ab86efe
d248136
8caeaa2
b9b055a
d1590b5
3000fa8
889943f
1782d58
497fb9f
2888dbf
ea07f15
84a54cc
41b010f
074376b
4a6837f
d773cd7
7663dd3
7930dc3
6763f62
1fe8c27
cc438b8
b485a29
e2de672
08da155
7fc7246
001119f
5fba666
852feff
3ce7c39
f305489
34c2596
224bd7a
435348a
0397d90
ee487c8
e24336a
31657f3
bbe2163
d0aa029
5d212c3
6e4ad6d
497e36e
1080e41
bce70ef
d0e409e
1313fc3
db9a48a
c8b3765
08ffbb7
10f65ae
b1e370a
768c250
4d72047
a8398e5
4941f4f
06afabb
d68ed97
e8b44ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright 2024 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.adminservice; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.core.annotation.Order; | ||
import org.springframework.security.config.annotation.web.builders.HttpSecurity; | ||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; | ||
|
||
@Profile("assembly") | ||
@Configuration | ||
public class AdminServiceAssemblyConfiguration { | ||
|
||
Check warning on line 28 in apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/AdminServiceAssemblyConfiguration.java Codecov / codecov/patchapollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/AdminServiceAssemblyConfiguration.java#L27-L28
|
||
@Order(101) | ||
@Configuration | ||
static class AdminServiceSecurityConfigurer extends WebSecurityConfigurerAdapter { | ||
|
||
@Override | ||
protected void configure(HttpSecurity http) throws Exception { | ||
http.csrf().disable(); | ||
http.httpBasic(); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# | ||
# Copyright 2024 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. | ||
# | ||
apollo.eureka.server.enabled=false | ||
eureka.client.enabled=false | ||
spring.cloud.discovery.enabled=false | ||
|
||
apollo.service.registry.enabled=true | ||
apollo.service.registry.cluster=default | ||
apollo.service.registry.heartbeatIntervalInSecond=10 | ||
|
||
apollo.service.discovery.enabled=true | ||
# health check by heartbeat, heartbeat time before 61s ago will be seemed as unhealthy | ||
apollo.service.discovery.healthCheckIntervalInSecond = 61 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# | ||
# Copyright 2024 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. | ||
# | ||
# Config DataSource | ||
spring.config-datasource.url=jdbc:h2:mem:~/apollo-config-db;mode=mysql;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1;BUILTIN_ALIAS_OVERRIDE=TRUE;DATABASE_TO_UPPER=FALSE | ||
#spring.config-datasource.username= | ||
#spring.config-datasource.password= | ||
spring.sql.config-init.schema-locations=@@repository@@/profiles/@@platform@@@@suffix@@/apolloconfigdb.sql | ||
spring.sql.config-init.mode=embedded | ||
# Portal DataSource | ||
spring.portal-datasource.url=jdbc:h2:mem:~/apollo-portal-db;mode=mysql;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1;BUILTIN_ALIAS_OVERRIDE=TRUE;DATABASE_TO_UPPER=FALSE | ||
#spring.portal-datasource.username= | ||
#spring.portal-datasource.password= | ||
spring.sql.portal-init.schema-locations=@@repository@@/profiles/@@platform@@@@suffix@@/apolloportaldb.sql | ||
spring.sql.portal-init.mode=embedded | ||
|
||
# Resolve Multi DataSource JMX name conflict | ||
spring.jmx.unique-names=true | ||
|
||
# H2 datasource | ||
spring.jpa.hibernate.ddl-auto=none | ||
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl | ||
spring.jpa.properties.hibernate.show_sql=false | ||
spring.jpa.properties.hibernate.metadata_builder_contributor=com.ctrip.framework.apollo.common.jpa.SqlFunctionsMetadataBuilderContributor | ||
spring.h2.console.enabled=true | ||
spring.h2.console.settings.web-allow-others=true | ||
|
||
# Sql logging | ||
#logging.level.org.hibernate.SQL=DEBUG | ||
|
||
# Default env | ||
apollo.portal.envs=local | ||
|
||
# Spring session | ||
spring.session.store-type=none |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright 2024 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; | ||
|
||
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Primary; | ||
import org.springframework.context.annotation.Profile; | ||
|
||
@Profile("assembly") | ||
@Configuration | ||
public class ApolloBizAssemblyConfiguration { | ||
|
||
@Primary | ||
@ConfigurationProperties(prefix = "spring.config-datasource") | ||
@Bean | ||
public static DataSourceProperties dataSourceProperties() { | ||
return new DataSourceProperties(); | ||
Check warning on line 34 in apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/ApolloBizAssemblyConfiguration.java Codecov / codecov/patchapollo-biz/src/main/java/com/ctrip/framework/apollo/biz/ApolloBizAssemblyConfiguration.java#L34
|
||
} | ||
} |
Check failure
Code scanning / CodeQL
Disabled Spring CSRF protection High