instance_id
stringlengths
30
32
text
stringlengths
7.7k
116k
repo
stringclasses
1 value
base_commit
stringlengths
40
40
problem_statement
stringlengths
127
5.13k
hints_text
stringclasses
20 values
created_at
timestamp[us]
patch
stringlengths
767
94.8k
test_patch
stringlengths
527
58.5k
version
stringclasses
1 value
FAIL_TO_PASS
stringclasses
1 value
PASS_TO_PASS
stringclasses
1 value
environment_setup_commit
stringclasses
1 value
corona-warn-app__cwa-server-277
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Switch application*.properties files to Yaml Let's switch over to YAML for better readability. Affected files: common/persistence/src/test/resources/application.properties services/submission/src/main/resources/application.properties services/submission/src/test/resources/application.properties services/distribution/src/main/resources/application.properties services/distribution/src/test/resources/application.properties services/submission/src/main/resources/application-dev.properties services/distribution/src/main/resources/application-dev.properties services/submission/src/main/resources/application-cloud.properties services/distribution/src/main/resources/application-cloud.properties services/distribution/src/main/resources/application-testdata.properties </issue> <code> [start of README.md] 1 <h1 align="center"> 2 Corona-Warn-App Server 3 </h1> 4 5 <p align="center"> 6 <a href="https://github.com/corona-warn-app/cwa-server/commits/" title="Last Commit"><img src="https://img.shields.io/github/last-commit/corona-warn-app/cwa-server?style=flat"></a> 7 <a href="https://github.com/corona-warn-app/cwa-server/issues" title="Open Issues"><img src="https://img.shields.io/github/issues/corona-warn-app/cwa-server?style=flat"></a> 8 <a href="https://circleci.com/gh/corona-warn-app/cwa-server" title="Build Status"><img src="https://circleci.com/gh/corona-warn-app/cwa-server.svg?style=shield&circle-token=4ab059989d10709df19eb4b98ab7c121a25e981a"></a> 9 <a href="https://sonarcloud.io/dashboard?id=corona-warn-app_cwa-server" title="Quality Gate"><img src="https://sonarcloud.io/api/project_badges/measure?project=corona-warn-app_cwa-server&metric=alert_status"></a> 10 <a href="https://sonarcloud.io/component_measures?id=corona-warn-app_cwa-server&metric=Coverage&view=list" title="Coverage"><img src="https://sonarcloud.io/api/project_badges/measure?project=corona-warn-app_cwa-server&metric=coverage"></a> 11 <a href="https://github.com/corona-warn-app/cwa-server/blob/master/LICENSE" title="License"><img src="https://img.shields.io/badge/License-Apache%202.0-green.svg?style=flat"></a> 12 </p> 13 14 <p align="center"> 15 <a href="#development">Development</a> • 16 <a href="#service-apis">Service APIs</a> • 17 <a href="#documentation">Documentation</a> • 18 <a href="#support-and-feedback">Support</a> • 19 <a href="#how-to-contribute">Contribute</a> • 20 <a href="#contributors">Contributors</a> • 21 <a href="#repositories">Repositories</a> • 22 <a href="#licensing">Licensing</a> 23 </p> 24 25 The goal of this project is to develop the official Corona-Warn-App for Germany based on the exposure notification API from [Apple](https://www.apple.com/covid19/contacttracing/) and [Google](https://www.google.com/covid19/exposurenotifications/). The apps (for both iOS and Android) use Bluetooth technology to exchange anonymous encrypted data with other mobile phones (on which the app is also installed) in the vicinity of an app user's phone. The data is stored locally on each user's device, preventing authorities or other parties from accessing or controlling the data. This repository contains the **implementation of the server for encryption keys** for the Corona-Warn-App. This implementation is still a **work in progress**, and the code it contains is currently alpha-quality code. 26 27 In this documentation, Corona-Warn-App services are also referred to as CWA services. 28 29 ## Architecture Overview 30 31 You can find the architecture overview [here](/docs/architecture-overview.md), which will give you 32 a good starting point in how the backend services interact with other services, and what purpose 33 they serve. 34 35 ## Development 36 37 After you've checked out this repository, you can run the application in one of the following ways: 38 39 * As a [Docker](https://www.docker.com/)-based deployment on your local machine. You can run either: 40 * Single components using the respective Dockerfile or 41 * The full backend using the Docker Compose (which is considered the most convenient way) 42 * As a [Maven](https://maven.apache.org)-based build on your local machine. 43 If you want to develop something in a single component, this approach is preferable. 44 45 ### Docker-Based Deployment 46 47 If you want to use Docker-based deployment, you need to install Docker on your local machine. For more information about downloading and installing Docker, see the [official Docker documentation](https://docs.docker.com/get-docker/). 48 49 #### Running the Full CWA Backend Using Docker Compose 50 51 For your convenience, a full setup including the generation of test data has been prepared using [Docker Compose](https://docs.docker.com/compose/reference/overview/). To build the backend services, run ```docker-compose build``` in the repository's root directory. A default configuration file can be found under ```.env```in the root folder of the repository. The default values for the local Postgres and Zenko Cloudserver should be changed in this file before docker-compose is run. 52 53 Once the services are built, you can start the whole backend using ```docker-compose up```. 54 The distribution service runs once and then finishes. If you want to trigger additional distribution runs, run ```docker-compose run distribution```. 55 56 The docker-compose contains the following services: 57 58 Service | Description | Endpoint and Default Credentials 59 --------------|-------------|----------- 60 submission | The Corona-Warn-App submission service | http://localhost:8000 61 distribution | The Corona-Warn-App distribution service | NO ENDPOINT 62 postgres | A [postgres] database installation | postgres:8001 <br> Username: postgres <br> Password: postgres 63 pgadmin | A [pgadmin](https://www.pgadmin.org/) installation for the postgres database | http://localhost:8002 <br> Username: [email protected] <br> Password: password 64 cloudserver | [Zenko CloudServer] is a S3-compliant object store | http://localhost:8003/ <br> Access key: accessKey1 <br> Secret key: verySecretKey1 65 66 ##### Known Limitation 67 68 The docker-compose runs into a timing issue in some cases when the create-bucket target runs before the objectstore is available. The mitigation is easy: after running ```docker-compose up``` wait until all components are initialized and running. Afterwards, trigger the ```create-bucket``` service manually by running ```docker-compose run create-bucket```. If you want to trigger distribution runs, run ```docker-compose run distribution```. The timing issue will be fixed in a future release. 69 70 #### Running Single CWA Services Using Docker 71 72 If you would like to build and run a single CWA service, it's considered easiest to run them in a Docker environment. You can do this using the script provided in the respective CWA service directory. The Docker script first builds the CWA service and then creates an image for the runtime, which means that there are no additional dependencies for you to install. 73 74 To build and run the distribution service, run the following command: 75 76 ```bash 77 ./services/distribution/build_and_run.sh 78 ``` 79 80 To build and run the submission service, run the following command: 81 82 ```bash 83 ./services/submission/build_and_run.sh 84 ``` 85 86 The submission service is available on [localhost:8080](http://localhost:8080 ). 87 88 ### Maven-Based Build 89 90 If you want to actively develop in one of the CWA services, the Maven-based runtime is most suitable. 91 To prepare your machine to run the CWA project locally, we recommend that you first ensure that you've installed the following: 92 93 * Minimum JDK Version 11: [OpenJDK](https://openjdk.java.net/) / [SapMachine](https://sap.github.io/SapMachine/) 94 * [Maven 3.6](https://maven.apache.org/) 95 * [Postgres] 96 * [Zenko CloudServer] 97 98 #### Configure 99 100 After you made sure that the specified dependencies are running, configure them in the respective configuration files. 101 102 * Configure the Postgres connection in the [submission config](./services/submission/src/main/resources/application.properties) and in the [distribution config](./services/distribution/src/main/resources/application.properties) 103 * Configure the S3 compatible object storage in the [distribution config](./services/distribution/src/main/resources/application.properties) 104 * Configure the certificate and private key for the distribution service, the paths need to be prefixed with `file:` 105 * `VAULT_FILESIGNING_SECRET` should be the path to the private key, example available in `<repo-root>/docker-compose-test-secrets/private.pem` 106 * `VAULT_FILESIGNING_CERT` should be the path to the certificate, example available in `<repo-root>/docker-compose-test-secrets/certificate.cert` 107 108 #### Build 109 110 After you've checked out the repository, to build the project, run ```mvn install``` in your base directory. 111 112 #### Run 113 114 Navigate to the service you want to start and run the spring-boot:run target. The configured Postgres and the configured S3 compliant object storage are used as default. When you start the submission service, the endpoint is available on your local port 8080. 115 116 If you want to start the submission service, for example, you start it as follows: 117 118 ```bash 119 cd services/submission/ 120 mvn spring-boot:run 121 ``` 122 123 #### Debugging 124 125 To enable the `DEBUG` log level, you can run the application using the Spring `dev` profile. 126 127 ```bash 128 mvn spring-boot:run -Dspring-boot.run.profiles=dev 129 ``` 130 131 To be able to set breakpoints (e.g. in IntelliJ), it may be necessary to use the ```-Dspring-boot.run.fork=false``` parameter. 132 133 ## Service APIs 134 135 The API that is being exposed by the backend services is documented in an [OpenAPI](https://www.openapis.org/) specification. The specification files are available at the following locations: 136 137 Service | OpenAPI Specification 138 -------------|------------- 139 Submission Service | https://github.com/corona-warn-app/cwa-server/raw/master/services/submission/api_v1.json 140 Distribution Service | https://github.com/corona-warn-app/cwa-server/raw/master/services/distribution/api_v1.json 141 142 ## Documentation 143 144 The full documentation for the Corona-Warn-App can be found in the [cwa-documentation](https://github.com/corona-warn-app/cwa-documentation) repository. The documentation repository contains technical documents, architecture information, and whitepapers related to this implementation. 145 146 ## Support and Feedback 147 148 The following channels are available for discussions, feedback, and support requests: 149 150 | Type | Channel | 151 | ------------------------ | ------------------------------------------------------ | 152 | **General Discussion** | <a href="https://github.com/corona-warn-app/cwa-documentation/issues/new/choose" title="General Discussion"><img src="https://img.shields.io/github/issues/corona-warn-app/cwa-documentation/question.svg?style=flat-square"></a> </a> | 153 | **Concept Feedback** | <a href="https://github.com/corona-warn-app/cwa-documentation/issues/new/choose" title="Open Concept Feedback"><img src="https://img.shields.io/github/issues/corona-warn-app/cwa-documentation/architecture.svg?style=flat-square"></a> | 154 | **Backend Issue** | <a href="https://github.com/corona-warn-app/cwa-server/issues/new/choose" title="Open Backend Issue"><img src="https://img.shields.io/github/issues/corona-warn-app/cwa-server?style=flat-square"></a> | 155 | **Other Requests** | <a href="mailto:[email protected]" title="Email CWA Team"><img src="https://img.shields.io/badge/email-CWA%20team-green?logo=mail.ru&style=flat-square&logoColor=white"></a> | 156 157 ## How to Contribute 158 159 Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our [Contribution Guidelines](./CONTRIBUTING.md). By participating in this project, you agree to abide by its [Code of Conduct](./CODE_OF_CONDUCT.md) at all times. 160 161 ## Contributors 162 163 The German government has asked SAP and Deutsche Telekom to develop the Corona-Warn-App for Germany as open source software. Deutsche Telekom is providing the network and mobile technology and will operate and run the backend for the app in a safe, scalable and stable manner. SAP is responsible for the app development, its framework and the underlying platform. Therefore, development teams of SAP and Deutsche Telekom are contributing to this project. At the same time our commitment to open source means that we are enabling -in fact encouraging- all interested parties to contribute and become part of its developer community. 164 165 ## Repositories 166 167 The following public repositories are currently available for the Corona-Warn-App: 168 169 | Repository | Description | 170 | ------------------- | --------------------------------------------------------------------- | 171 | [cwa-documentation] | Project overview, general documentation, and white papers | 172 | [cwa-server] | Backend implementation for the Apple/Google exposure notification API| 173 174 [cwa-documentation]: https://github.com/corona-warn-app/cwa-documentation 175 [cwa-server]: https://github.com/corona-warn-app/cwa-server 176 [Postgres]: https://www.postgresql.org/ 177 [HSQLDB]: http://hsqldb.org/ 178 [Zenko CloudServer]: https://github.com/scality/cloudserver 179 180 ## Licensing 181 182 Copyright (c) 2020 SAP SE or an SAP affiliate company. 183 184 Licensed under the **Apache License, Version 2.0** (the "License"); you may not use this file except in compliance with the License. 185 186 You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0. 187 188 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](./LICENSE) for the specific language governing permissions and limitations under the License. 189 [end of README.md] [start of /dev/null] 1 [end of /dev/null] [start of README.md] 1 <h1 align="center"> 2 Corona-Warn-App Server 3 </h1> 4 5 <p align="center"> 6 <a href="https://github.com/corona-warn-app/cwa-server/commits/" title="Last Commit"><img src="https://img.shields.io/github/last-commit/corona-warn-app/cwa-server?style=flat"></a> 7 <a href="https://github.com/corona-warn-app/cwa-server/issues" title="Open Issues"><img src="https://img.shields.io/github/issues/corona-warn-app/cwa-server?style=flat"></a> 8 <a href="https://circleci.com/gh/corona-warn-app/cwa-server" title="Build Status"><img src="https://circleci.com/gh/corona-warn-app/cwa-server.svg?style=shield&circle-token=4ab059989d10709df19eb4b98ab7c121a25e981a"></a> 9 <a href="https://sonarcloud.io/dashboard?id=corona-warn-app_cwa-server" title="Quality Gate"><img src="https://sonarcloud.io/api/project_badges/measure?project=corona-warn-app_cwa-server&metric=alert_status"></a> 10 <a href="https://sonarcloud.io/component_measures?id=corona-warn-app_cwa-server&metric=Coverage&view=list" title="Coverage"><img src="https://sonarcloud.io/api/project_badges/measure?project=corona-warn-app_cwa-server&metric=coverage"></a> 11 <a href="https://github.com/corona-warn-app/cwa-server/blob/master/LICENSE" title="License"><img src="https://img.shields.io/badge/License-Apache%202.0-green.svg?style=flat"></a> 12 </p> 13 14 <p align="center"> 15 <a href="#development">Development</a> • 16 <a href="#service-apis">Service APIs</a> • 17 <a href="#documentation">Documentation</a> • 18 <a href="#support-and-feedback">Support</a> • 19 <a href="#how-to-contribute">Contribute</a> • 20 <a href="#contributors">Contributors</a> • 21 <a href="#repositories">Repositories</a> • 22 <a href="#licensing">Licensing</a> 23 </p> 24 25 The goal of this project is to develop the official Corona-Warn-App for Germany based on the exposure notification API from [Apple](https://www.apple.com/covid19/contacttracing/) and [Google](https://www.google.com/covid19/exposurenotifications/). The apps (for both iOS and Android) use Bluetooth technology to exchange anonymous encrypted data with other mobile phones (on which the app is also installed) in the vicinity of an app user's phone. The data is stored locally on each user's device, preventing authorities or other parties from accessing or controlling the data. This repository contains the **implementation of the server for encryption keys** for the Corona-Warn-App. This implementation is still a **work in progress**, and the code it contains is currently alpha-quality code. 26 27 In this documentation, Corona-Warn-App services are also referred to as CWA services. 28 29 ## Architecture Overview 30 31 You can find the architecture overview [here](/docs/architecture-overview.md), which will give you 32 a good starting point in how the backend services interact with other services, and what purpose 33 they serve. 34 35 ## Development 36 37 After you've checked out this repository, you can run the application in one of the following ways: 38 39 * As a [Docker](https://www.docker.com/)-based deployment on your local machine. You can run either: 40 * Single components using the respective Dockerfile or 41 * The full backend using the Docker Compose (which is considered the most convenient way) 42 * As a [Maven](https://maven.apache.org)-based build on your local machine. 43 If you want to develop something in a single component, this approach is preferable. 44 45 ### Docker-Based Deployment 46 47 If you want to use Docker-based deployment, you need to install Docker on your local machine. For more information about downloading and installing Docker, see the [official Docker documentation](https://docs.docker.com/get-docker/). 48 49 #### Running the Full CWA Backend Using Docker Compose 50 51 For your convenience, a full setup including the generation of test data has been prepared using [Docker Compose](https://docs.docker.com/compose/reference/overview/). To build the backend services, run ```docker-compose build``` in the repository's root directory. A default configuration file can be found under ```.env```in the root folder of the repository. The default values for the local Postgres and Zenko Cloudserver should be changed in this file before docker-compose is run. 52 53 Once the services are built, you can start the whole backend using ```docker-compose up```. 54 The distribution service runs once and then finishes. If you want to trigger additional distribution runs, run ```docker-compose run distribution```. 55 56 The docker-compose contains the following services: 57 58 Service | Description | Endpoint and Default Credentials 59 --------------|-------------|----------- 60 submission | The Corona-Warn-App submission service | http://localhost:8000 61 distribution | The Corona-Warn-App distribution service | NO ENDPOINT 62 postgres | A [postgres] database installation | postgres:8001 <br> Username: postgres <br> Password: postgres 63 pgadmin | A [pgadmin](https://www.pgadmin.org/) installation for the postgres database | http://localhost:8002 <br> Username: [email protected] <br> Password: password 64 cloudserver | [Zenko CloudServer] is a S3-compliant object store | http://localhost:8003/ <br> Access key: accessKey1 <br> Secret key: verySecretKey1 65 66 ##### Known Limitation 67 68 The docker-compose runs into a timing issue in some cases when the create-bucket target runs before the objectstore is available. The mitigation is easy: after running ```docker-compose up``` wait until all components are initialized and running. Afterwards, trigger the ```create-bucket``` service manually by running ```docker-compose run create-bucket```. If you want to trigger distribution runs, run ```docker-compose run distribution```. The timing issue will be fixed in a future release. 69 70 #### Running Single CWA Services Using Docker 71 72 If you would like to build and run a single CWA service, it's considered easiest to run them in a Docker environment. You can do this using the script provided in the respective CWA service directory. The Docker script first builds the CWA service and then creates an image for the runtime, which means that there are no additional dependencies for you to install. 73 74 To build and run the distribution service, run the following command: 75 76 ```bash 77 ./services/distribution/build_and_run.sh 78 ``` 79 80 To build and run the submission service, run the following command: 81 82 ```bash 83 ./services/submission/build_and_run.sh 84 ``` 85 86 The submission service is available on [localhost:8080](http://localhost:8080 ). 87 88 ### Maven-Based Build 89 90 If you want to actively develop in one of the CWA services, the Maven-based runtime is most suitable. 91 To prepare your machine to run the CWA project locally, we recommend that you first ensure that you've installed the following: 92 93 * Minimum JDK Version 11: [OpenJDK](https://openjdk.java.net/) / [SapMachine](https://sap.github.io/SapMachine/) 94 * [Maven 3.6](https://maven.apache.org/) 95 * [Postgres] 96 * [Zenko CloudServer] 97 98 #### Configure 99 100 After you made sure that the specified dependencies are running, configure them in the respective configuration files. 101 102 * Configure the Postgres connection in the [submission config](./services/submission/src/main/resources/application.properties) and in the [distribution config](./services/distribution/src/main/resources/application.properties) 103 * Configure the S3 compatible object storage in the [distribution config](./services/distribution/src/main/resources/application.properties) 104 * Configure the certificate and private key for the distribution service, the paths need to be prefixed with `file:` 105 * `VAULT_FILESIGNING_SECRET` should be the path to the private key, example available in `<repo-root>/docker-compose-test-secrets/private.pem` 106 * `VAULT_FILESIGNING_CERT` should be the path to the certificate, example available in `<repo-root>/docker-compose-test-secrets/certificate.cert` 107 108 #### Build 109 110 After you've checked out the repository, to build the project, run ```mvn install``` in your base directory. 111 112 #### Run 113 114 Navigate to the service you want to start and run the spring-boot:run target. The configured Postgres and the configured S3 compliant object storage are used as default. When you start the submission service, the endpoint is available on your local port 8080. 115 116 If you want to start the submission service, for example, you start it as follows: 117 118 ```bash 119 cd services/submission/ 120 mvn spring-boot:run 121 ``` 122 123 #### Debugging 124 125 To enable the `DEBUG` log level, you can run the application using the Spring `dev` profile. 126 127 ```bash 128 mvn spring-boot:run -Dspring-boot.run.profiles=dev 129 ``` 130 131 To be able to set breakpoints (e.g. in IntelliJ), it may be necessary to use the ```-Dspring-boot.run.fork=false``` parameter. 132 133 ## Service APIs 134 135 The API that is being exposed by the backend services is documented in an [OpenAPI](https://www.openapis.org/) specification. The specification files are available at the following locations: 136 137 Service | OpenAPI Specification 138 -------------|------------- 139 Submission Service | https://github.com/corona-warn-app/cwa-server/raw/master/services/submission/api_v1.json 140 Distribution Service | https://github.com/corona-warn-app/cwa-server/raw/master/services/distribution/api_v1.json 141 142 ## Documentation 143 144 The full documentation for the Corona-Warn-App can be found in the [cwa-documentation](https://github.com/corona-warn-app/cwa-documentation) repository. The documentation repository contains technical documents, architecture information, and whitepapers related to this implementation. 145 146 ## Support and Feedback 147 148 The following channels are available for discussions, feedback, and support requests: 149 150 | Type | Channel | 151 | ------------------------ | ------------------------------------------------------ | 152 | **General Discussion** | <a href="https://github.com/corona-warn-app/cwa-documentation/issues/new/choose" title="General Discussion"><img src="https://img.shields.io/github/issues/corona-warn-app/cwa-documentation/question.svg?style=flat-square"></a> </a> | 153 | **Concept Feedback** | <a href="https://github.com/corona-warn-app/cwa-documentation/issues/new/choose" title="Open Concept Feedback"><img src="https://img.shields.io/github/issues/corona-warn-app/cwa-documentation/architecture.svg?style=flat-square"></a> | 154 | **Backend Issue** | <a href="https://github.com/corona-warn-app/cwa-server/issues/new/choose" title="Open Backend Issue"><img src="https://img.shields.io/github/issues/corona-warn-app/cwa-server?style=flat-square"></a> | 155 | **Other Requests** | <a href="mailto:[email protected]" title="Email CWA Team"><img src="https://img.shields.io/badge/email-CWA%20team-green?logo=mail.ru&style=flat-square&logoColor=white"></a> | 156 157 ## How to Contribute 158 159 Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our [Contribution Guidelines](./CONTRIBUTING.md). By participating in this project, you agree to abide by its [Code of Conduct](./CODE_OF_CONDUCT.md) at all times. 160 161 ## Contributors 162 163 The German government has asked SAP and Deutsche Telekom to develop the Corona-Warn-App for Germany as open source software. Deutsche Telekom is providing the network and mobile technology and will operate and run the backend for the app in a safe, scalable and stable manner. SAP is responsible for the app development, its framework and the underlying platform. Therefore, development teams of SAP and Deutsche Telekom are contributing to this project. At the same time our commitment to open source means that we are enabling -in fact encouraging- all interested parties to contribute and become part of its developer community. 164 165 ## Repositories 166 167 The following public repositories are currently available for the Corona-Warn-App: 168 169 | Repository | Description | 170 | ------------------- | --------------------------------------------------------------------- | 171 | [cwa-documentation] | Project overview, general documentation, and white papers | 172 | [cwa-server] | Backend implementation for the Apple/Google exposure notification API| 173 174 [cwa-documentation]: https://github.com/corona-warn-app/cwa-documentation 175 [cwa-server]: https://github.com/corona-warn-app/cwa-server 176 [Postgres]: https://www.postgresql.org/ 177 [HSQLDB]: http://hsqldb.org/ 178 [Zenko CloudServer]: https://github.com/scality/cloudserver 179 180 ## Licensing 181 182 Copyright (c) 2020 SAP SE or an SAP affiliate company. 183 184 Licensed under the **Apache License, Version 2.0** (the "License"); you may not use this file except in compliance with the License. 185 186 You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0. 187 188 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](./LICENSE) for the specific language governing permissions and limitations under the License. 189 [end of README.md] [start of services/distribution/src/main/resources/application-cloud.properties] 1 spring.flyway.enabled=true 2 spring.flyway.locations=classpath:db/migration/postgres 3 4 spring.datasource.driver-class-name=org.postgresql.Driver 5 spring.datasource.url=jdbc:postgresql://${POSTGRESQL_SERVICE_HOST}:${POSTGRESQL_SERVICE_PORT}/${POSTGRESQL_DATABASE} 6 spring.datasource.username=${POSTGRESQL_USER} 7 spring.datasource.password=${POSTGRESQL_PASSWORD} 8 9 services.distribution.paths.output=/tmp/distribution [end of services/distribution/src/main/resources/application-cloud.properties] [start of services/distribution/src/main/resources/application-dev.properties] 1 logging.level.org.springframework.web=DEBUG 2 logging.level.app.coronawarn=DEBUG [end of services/distribution/src/main/resources/application-dev.properties] [start of services/distribution/src/main/resources/application-testdata.properties] 1 services.distribution.testdata.seed=123456 2 services.distribution.testdata.exposures-per-hour=1000 [end of services/distribution/src/main/resources/application-testdata.properties] [start of services/distribution/src/main/resources/application.properties] 1 logging.level.org.springframework.web=INFO 2 logging.level.app.coronawarn=INFO 3 spring.main.web-application-type=NONE 4 5 services.distribution.retention-days=14 6 services.distribution.output-file-name=index 7 services.distribution.tek-export.file-name=export.bin 8 services.distribution.tek-export.file-header=EK Export v1 9 services.distribution.tek-export.file-header-width=16 10 11 services.distribution.paths.output=out 12 services.distribution.paths.privatekey=${VAULT_FILESIGNING_SECRET} 13 services.distribution.paths.certificate=${VAULT_FILESIGNING_CERT} 14 15 services.distribution.api.version-path=version 16 services.distribution.api.version-v1=v1 17 services.distribution.api.country-path=country 18 services.distribution.api.country-germany=DE 19 services.distribution.api.date-path=date 20 services.distribution.api.hour-path=hour 21 services.distribution.api.diagnosis-keys-path=diagnosis-keys 22 services.distribution.api.parameters-path=configuration 23 services.distribution.api.parameters-exposure-configuration-file-name=exposure_configuration 24 services.distribution.api.parameters-risk-score-classification-file-name=risk_score_classification 25 26 services.distribution.signature.app-bundle-id=de.rki.coronawarnapp 27 services.distribution.signature.android-package=de.rki.coronawarnapp 28 services.distribution.signature.verification-key-id= 29 services.distribution.signature.verification-key-version= 30 services.distribution.signature.algorithm-oid=1.2.840.10045.4.3.2 31 services.distribution.signature.algorithm-name=SHA256withECDSA 32 services.distribution.signature.file-name=export.sig 33 services.distribution.signature.security-provider=BC 34 35 # Configuration for the S3 compatible object storage hosted by Telekom in Germany 36 services.distribution.objectstore.access-key=${CWA_OBJECTSTORE_ACCESSKEY:accessKey1} 37 services.distribution.objectstore.secret-key=${CWA_OBJECTSTORE_SECRETKEY:verySecretKey1} 38 services.distribution.objectstore.endpoint=${CWA_OBJECTSTORE_ENDPOINT:http\://localhost\:8003} 39 services.distribution.objectstore.bucket=${CWA_OBJECTSTORE_BUCKET:cwa} 40 services.distribution.objectstore.port=${CWA_OBJECTSTORE_PORT:8003} 41 services.distribution.objectstore.set-public-read-acl-on-put-object=true 42 43 # Postgres configuration 44 spring.jpa.hibernate.ddl-auto=validate 45 46 spring.flyway.enabled=true 47 spring.flyway.locations=classpath:db/migration/postgres 48 49 spring.datasource.driver-class-name=org.postgresql.Driver 50 spring.datasource.url=jdbc:postgresql://${POSTGRESQL_SERVICE_HOST:localhost}:${POSTGRESQL_SERVICE_PORT:5432}/${POSTGRESQL_DATABASE:cwa} 51 spring.datasource.username=${POSTGRESQL_USER:postgres} 52 spring.datasource.password=${POSTGRESQL_PASSWORD:postgres} 53 [end of services/distribution/src/main/resources/application.properties] [start of services/submission/src/main/resources/application-cloud.properties] 1 spring.flyway.locations=classpath:db/migration/postgres 2 3 spring.datasource.driver-class-name=org.postgresql.Driver 4 spring.datasource.url=jdbc:postgresql://${POSTGRESQL_SERVICE_HOST}:${POSTGRESQL_SERVICE_PORT}/${POSTGRESQL_DATABASE} 5 spring.datasource.username=${POSTGRESQL_USER} 6 spring.datasource.password=${POSTGRESQL_PASSWORD} [end of services/submission/src/main/resources/application-cloud.properties] [start of services/submission/src/main/resources/application-config-test.properties] 1 services.submission.initial_fake_delay_milliseconds=100.0 2 services.submission.fake_delay_moving_average_samples=1.0 3 services.submission.retention-days=10 4 services.submission.payload.max-number-of-keys=1000 [end of services/submission/src/main/resources/application-config-test.properties] [start of services/submission/src/main/resources/application-dev.properties] 1 logging.level.org.springframework.web=DEBUG 2 [end of services/submission/src/main/resources/application-dev.properties] [start of services/submission/src/main/resources/application.properties] 1 logging.level.org.springframework.web=INFO 2 3 # The initial value of the moving average for fake request delays. 4 services.submission.initial_fake_delay_milliseconds=10 5 # The number of samples for the calculation of the moving average for fake request delays. 6 services.submission.fake_delay_moving_average_samples=10 7 8 services.submission.retention-days=14 9 services.submission.payload.max-number-of-keys=14 10 11 spring.jpa.hibernate.ddl-auto=validate 12 spring.flyway.enabled=true 13 14 spring.flyway.locations=classpath:db/migration/postgres 15 16 # Postgres configuration 17 spring.datasource.driver-class-name=org.postgresql.Driver 18 spring.datasource.url=jdbc:postgresql://${POSTGRESQL_SERVICE_HOST:localhost}:${POSTGRESQL_SERVICE_PORT:5432}/${POSTGRESQL_DATABASE:cwa} 19 spring.datasource.username=${POSTGRESQL_USER:postgres} 20 spring.datasource.password=${POSTGRESQL_PASSWORD:postgres} 21 [end of services/submission/src/main/resources/application.properties] </code> Here is an example of a patch file. It consists of changes to the code base. It specifies the file names, the line numbers of each change, and the removed and added lines. A single patch file can contain changes to multiple files. <patch> --- a/file.py +++ b/file.py @@ -1,27 +1,35 @@ def euclidean(a, b): - while b: - a, b = b, a % b - return a + if b == 0: + return a + return euclidean(b, a % b) def bresenham(x0, y0, x1, y1): points = [] dx = abs(x1 - x0) dy = abs(y1 - y0) - sx = 1 if x0 < x1 else -1 - sy = 1 if y0 < y1 else -1 - err = dx - dy + x, y = x0, y0 + sx = -1 if x0 > x1 else 1 + sy = -1 if y0 > y1 else 1 - while True: - points.append((x0, y0)) - if x0 == x1 and y0 == y1: - break - e2 = 2 * err - if e2 > -dy: + if dx > dy: + err = dx / 2.0 + while x != x1: + points.append((x, y)) err -= dy - x0 += sx - if e2 < dx: - err += dx - y0 += sy + if err < 0: + y += sy + err += dx + x += sx + else: + err = dy / 2.0 + while y != y1: + points.append((x, y)) + err -= dx + if err < 0: + x += sx + err += dy + y += sy + points.append((x, y)) return points </patch> I need you to solve the provded issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the format shown above. Respond below:
corona-warn-app/cwa-server
576fd8b20079374458ffb650fe63ca6002e84a39
Switch application*.properties files to Yaml Let's switch over to YAML for better readability. Affected files: common/persistence/src/test/resources/application.properties services/submission/src/main/resources/application.properties services/submission/src/test/resources/application.properties services/distribution/src/main/resources/application.properties services/distribution/src/test/resources/application.properties services/submission/src/main/resources/application-dev.properties services/distribution/src/main/resources/application-dev.properties services/submission/src/main/resources/application-cloud.properties services/distribution/src/main/resources/application-cloud.properties services/distribution/src/main/resources/application-testdata.properties
2020-05-23T21:07:14
<patch> diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ <a href="https://github.com/corona-warn-app/cwa-server/commits/" title="Last Commit"><img src="https://img.shields.io/github/last-commit/corona-warn-app/cwa-server?style=flat"></a> <a href="https://github.com/corona-warn-app/cwa-server/issues" title="Open Issues"><img src="https://img.shields.io/github/issues/corona-warn-app/cwa-server?style=flat"></a> <a href="https://circleci.com/gh/corona-warn-app/cwa-server" title="Build Status"><img src="https://circleci.com/gh/corona-warn-app/cwa-server.svg?style=shield&circle-token=4ab059989d10709df19eb4b98ab7c121a25e981a"></a> - <a href="https://sonarcloud.io/dashboard?id=corona-warn-app_cwa-server" title="Quality Gate"><img src="https://sonarcloud.io/api/project_badges/measure?project=corona-warn-app_cwa-server&metric=alert_status"></a> + <a href="https://sonarcloud.io/dashboard?id=corona-warn-app_cwa-server" title="Quality Gate"><img src="https://sonarcloud.io/api/project_badges/measure?project=corona-warn-app_cwa-server&metric=alert_status"></a> <a href="https://sonarcloud.io/component_measures?id=corona-warn-app_cwa-server&metric=Coverage&view=list" title="Coverage"><img src="https://sonarcloud.io/api/project_badges/measure?project=corona-warn-app_cwa-server&metric=coverage"></a> <a href="https://github.com/corona-warn-app/cwa-server/blob/master/LICENSE" title="License"><img src="https://img.shields.io/badge/License-Apache%202.0-green.svg?style=flat"></a> </p> @@ -57,7 +57,7 @@ The docker-compose contains the following services: Service | Description | Endpoint and Default Credentials --------------|-------------|----------- -submission | The Corona-Warn-App submission service | http://localhost:8000 +submission | The Corona-Warn-App submission service | http://localhost:8000 distribution | The Corona-Warn-App distribution service | NO ENDPOINT postgres | A [postgres] database installation | postgres:8001 <br> Username: postgres <br> Password: postgres pgadmin | A [pgadmin](https://www.pgadmin.org/) installation for the postgres database | http://localhost:8002 <br> Username: [email protected] <br> Password: password @@ -99,8 +99,8 @@ To prepare your machine to run the CWA project locally, we recommend that you fi After you made sure that the specified dependencies are running, configure them in the respective configuration files. -* Configure the Postgres connection in the [submission config](./services/submission/src/main/resources/application.properties) and in the [distribution config](./services/distribution/src/main/resources/application.properties) -* Configure the S3 compatible object storage in the [distribution config](./services/distribution/src/main/resources/application.properties) +* Configure the Postgres connection in the [submission config](./services/submission/src/main/resources/application.yaml) and in the [distribution config](./services/distribution/src/main/resources/application.yaml) +* Configure the S3 compatible object storage in the [distribution config](./services/distribution/src/main/resources/application.yaml) * Configure the certificate and private key for the distribution service, the paths need to be prefixed with `file:` * `VAULT_FILESIGNING_SECRET` should be the path to the private key, example available in `<repo-root>/docker-compose-test-secrets/private.pem` * `VAULT_FILESIGNING_CERT` should be the path to the certificate, example available in `<repo-root>/docker-compose-test-secrets/certificate.cert` @@ -181,7 +181,7 @@ The following public repositories are currently available for the Corona-Warn-Ap Copyright (c) 2020 SAP SE or an SAP affiliate company. -Licensed under the **Apache License, Version 2.0** (the "License"); you may not use this file except in compliance with the License. +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 https://www.apache.org/licenses/LICENSE-2.0. diff --git a/services/distribution/src/main/resources/application-cloud.properties b/services/distribution/src/main/resources/application-cloud.properties deleted file mode 100644 --- a/services/distribution/src/main/resources/application-cloud.properties +++ /dev/null @@ -1,9 +0,0 @@ -spring.flyway.enabled=true -spring.flyway.locations=classpath:db/migration/postgres - -spring.datasource.driver-class-name=org.postgresql.Driver -spring.datasource.url=jdbc:postgresql://${POSTGRESQL_SERVICE_HOST}:${POSTGRESQL_SERVICE_PORT}/${POSTGRESQL_DATABASE} -spring.datasource.username=${POSTGRESQL_USER} -spring.datasource.password=${POSTGRESQL_PASSWORD} - -services.distribution.paths.output=/tmp/distribution \ No newline at end of file diff --git a/services/distribution/src/main/resources/application-cloud.yaml b/services/distribution/src/main/resources/application-cloud.yaml new file mode 100644 --- /dev/null +++ b/services/distribution/src/main/resources/application-cloud.yaml @@ -0,0 +1,22 @@ +--- +spring: + flyway: + enabled: true + locations: classpath:db/migration/postgres + datasource: + driver-class-name: org.postgresql.Driver + url: jdbc:postgresql://${POSTGRESQL_SERVICE_HOST}:${POSTGRESQL_SERVICE_PORT}/${POSTGRESQL_DATABASE} + username: ${POSTGRESQL_USER} + password: ${POSTGRESQL_PASSWORD} + +services: + distribution: + paths: + output: /tmp/distribution + objectstore: + access-key: ${CWA_OBJECTSTORE_ACCESSKEY} + secret-key: ${CWA_OBJECTSTORE_SECRETKEY} + endpoint: ${CWA_OBJECTSTORE_ENDPOINT} + bucket: ${CWA_OBJECTSTORE_BUCKET} + port: ${CWA_OBJECTSTORE_PORT} + set-public-read-acl-on-put-object: false diff --git a/services/distribution/src/main/resources/application-dev.properties b/services/distribution/src/main/resources/application-dev.properties deleted file mode 100644 --- a/services/distribution/src/main/resources/application-dev.properties +++ /dev/null @@ -1,2 +0,0 @@ -logging.level.org.springframework.web=DEBUG -logging.level.app.coronawarn=DEBUG \ No newline at end of file diff --git a/services/distribution/src/main/resources/application-dev.yaml b/services/distribution/src/main/resources/application-dev.yaml new file mode 100644 --- /dev/null +++ b/services/distribution/src/main/resources/application-dev.yaml @@ -0,0 +1,8 @@ +--- +logging: + level: + org: + springframework: + web: DEBUG + app: + coronawarn: DEBUG diff --git a/services/distribution/src/main/resources/application-testdata.properties b/services/distribution/src/main/resources/application-testdata.properties deleted file mode 100644 --- a/services/distribution/src/main/resources/application-testdata.properties +++ /dev/null @@ -1,2 +0,0 @@ -services.distribution.testdata.seed=123456 -services.distribution.testdata.exposures-per-hour=1000 \ No newline at end of file diff --git a/services/distribution/src/main/resources/application-testdata.yaml b/services/distribution/src/main/resources/application-testdata.yaml new file mode 100644 --- /dev/null +++ b/services/distribution/src/main/resources/application-testdata.yaml @@ -0,0 +1,6 @@ +--- +services: + distribution: + testdata: + seed: 123456 + exposures-per-hour: 1000 diff --git a/services/distribution/src/main/resources/application.properties b/services/distribution/src/main/resources/application.properties deleted file mode 100644 --- a/services/distribution/src/main/resources/application.properties +++ /dev/null @@ -1,52 +0,0 @@ -logging.level.org.springframework.web=INFO -logging.level.app.coronawarn=INFO -spring.main.web-application-type=NONE - -services.distribution.retention-days=14 -services.distribution.output-file-name=index -services.distribution.tek-export.file-name=export.bin -services.distribution.tek-export.file-header=EK Export v1 -services.distribution.tek-export.file-header-width=16 - -services.distribution.paths.output=out -services.distribution.paths.privatekey=${VAULT_FILESIGNING_SECRET} -services.distribution.paths.certificate=${VAULT_FILESIGNING_CERT} - -services.distribution.api.version-path=version -services.distribution.api.version-v1=v1 -services.distribution.api.country-path=country -services.distribution.api.country-germany=DE -services.distribution.api.date-path=date -services.distribution.api.hour-path=hour -services.distribution.api.diagnosis-keys-path=diagnosis-keys -services.distribution.api.parameters-path=configuration -services.distribution.api.parameters-exposure-configuration-file-name=exposure_configuration -services.distribution.api.parameters-risk-score-classification-file-name=risk_score_classification - -services.distribution.signature.app-bundle-id=de.rki.coronawarnapp -services.distribution.signature.android-package=de.rki.coronawarnapp -services.distribution.signature.verification-key-id= -services.distribution.signature.verification-key-version= -services.distribution.signature.algorithm-oid=1.2.840.10045.4.3.2 -services.distribution.signature.algorithm-name=SHA256withECDSA -services.distribution.signature.file-name=export.sig -services.distribution.signature.security-provider=BC - -# Configuration for the S3 compatible object storage hosted by Telekom in Germany -services.distribution.objectstore.access-key=${CWA_OBJECTSTORE_ACCESSKEY:accessKey1} -services.distribution.objectstore.secret-key=${CWA_OBJECTSTORE_SECRETKEY:verySecretKey1} -services.distribution.objectstore.endpoint=${CWA_OBJECTSTORE_ENDPOINT:http\://localhost\:8003} -services.distribution.objectstore.bucket=${CWA_OBJECTSTORE_BUCKET:cwa} -services.distribution.objectstore.port=${CWA_OBJECTSTORE_PORT:8003} -services.distribution.objectstore.set-public-read-acl-on-put-object=true - -# Postgres configuration -spring.jpa.hibernate.ddl-auto=validate - -spring.flyway.enabled=true -spring.flyway.locations=classpath:db/migration/postgres - -spring.datasource.driver-class-name=org.postgresql.Driver -spring.datasource.url=jdbc:postgresql://${POSTGRESQL_SERVICE_HOST:localhost}:${POSTGRESQL_SERVICE_PORT:5432}/${POSTGRESQL_DATABASE:cwa} -spring.datasource.username=${POSTGRESQL_USER:postgres} -spring.datasource.password=${POSTGRESQL_PASSWORD:postgres} diff --git a/services/distribution/src/main/resources/application.yaml b/services/distribution/src/main/resources/application.yaml new file mode 100644 --- /dev/null +++ b/services/distribution/src/main/resources/application.yaml @@ -0,0 +1,66 @@ +--- +logging: + level: + org: + springframework: + web: INFO + app: + coronawarn: INFO + +services: + distribution: + output-file-name: index + retention-days: 14 + paths: + output: out + privatekey: ${VAULT_FILESIGNING_SECRET} + certificate: ${VAULT_FILESIGNING_CERT} + tek-export: + file-name: export.bin + file-header: EK Export v1 + file-header-width: 16 + api: + version-path: version + version-v1: v1 + country-path: country + country-germany: DE + date-path: date + hour-path: hour + diagnosis-keys-path: diagnosis-keys + parameters-path: configuration + parameters-exposure-configuration-file-name: exposure_configuration + parameters-risk-score-classification-file-name: risk_score_classification + signature: + app-bundle-id: de.rki.coronawarnapp + android-package: de.rki.coronawarnapp + verification-key-id: + verification-key-version: + algorithm-oid: 1.2.840.10045.4.3.2 + algorithm-name: SHA256withECDSA + file-name: export.sig + security-provider: BC + # Configuration for the S3 compatible object storage hosted by Telekom in Germany + objectstore: + access-key: ${CWA_OBJECTSTORE_ACCESSKEY:accessKey1} + secret-key: ${CWA_OBJECTSTORE_SECRETKEY:verySecretKey1} + endpoint: ${CWA_OBJECTSTORE_ENDPOINT:http\://localhost\:8003} + bucket: ${CWA_OBJECTSTORE_BUCKET:cwa} + port: ${CWA_OBJECTSTORE_PORT:8003} + set-public-read-acl-on-put-object: true + +spring: + main: + web-application-type: NONE +# Postgres configuration + jpa: + hibernate: + ddl-auto: validate + flyway: + enabled: true + locations: classpath:db/migration/postgres + + datasource: + driver-class-name: org.postgresql.Driver + url: jdbc:postgresql://${POSTGRESQL_SERVICE_HOST:localhost}:${POSTGRESQL_SERVICE_PORT:5432}/${POSTGRESQL_DATABASE:cwa} + username: ${POSTGRESQL_USER:postgres} + password: ${POSTGRESQL_PASSWORD:postgres} diff --git a/services/submission/src/main/resources/application-cloud.properties b/services/submission/src/main/resources/application-cloud.properties deleted file mode 100644 --- a/services/submission/src/main/resources/application-cloud.properties +++ /dev/null @@ -1,6 +0,0 @@ -spring.flyway.locations=classpath:db/migration/postgres - -spring.datasource.driver-class-name=org.postgresql.Driver -spring.datasource.url=jdbc:postgresql://${POSTGRESQL_SERVICE_HOST}:${POSTGRESQL_SERVICE_PORT}/${POSTGRESQL_DATABASE} -spring.datasource.username=${POSTGRESQL_USER} -spring.datasource.password=${POSTGRESQL_PASSWORD} \ No newline at end of file diff --git a/services/submission/src/main/resources/application-cloud.yaml b/services/submission/src/main/resources/application-cloud.yaml new file mode 100644 --- /dev/null +++ b/services/submission/src/main/resources/application-cloud.yaml @@ -0,0 +1,9 @@ +--- +spring: + flyway: + locations: classpath:db/migration/postgres + datasource: + driver-class-name: org.postgresql.Driver + url: jdbc:postgresql://${POSTGRESQL_SERVICE_HOST}:${POSTGRESQL_SERVICE_PORT}/${POSTGRESQL_DATABASE} + username: ${POSTGRESQL_USER} + password: ${POSTGRESQL_PASSWORD} diff --git a/services/submission/src/main/resources/application-config-test.properties b/services/submission/src/main/resources/application-config-test.properties deleted file mode 100644 --- a/services/submission/src/main/resources/application-config-test.properties +++ /dev/null @@ -1,4 +0,0 @@ -services.submission.initial_fake_delay_milliseconds=100.0 -services.submission.fake_delay_moving_average_samples=1.0 -services.submission.retention-days=10 -services.submission.payload.max-number-of-keys=1000 \ No newline at end of file diff --git a/services/submission/src/main/resources/application-dev.properties b/services/submission/src/main/resources/application-dev.properties deleted file mode 100644 --- a/services/submission/src/main/resources/application-dev.properties +++ /dev/null @@ -1 +0,0 @@ -logging.level.org.springframework.web=DEBUG diff --git a/services/submission/src/main/resources/application-dev.yaml b/services/submission/src/main/resources/application-dev.yaml new file mode 100644 --- /dev/null +++ b/services/submission/src/main/resources/application-dev.yaml @@ -0,0 +1,6 @@ +--- +logging: + level: + org: + springframework: + web: DEBUG diff --git a/services/submission/src/main/resources/application.properties b/services/submission/src/main/resources/application.properties deleted file mode 100644 --- a/services/submission/src/main/resources/application.properties +++ /dev/null @@ -1,20 +0,0 @@ -logging.level.org.springframework.web=INFO - -# The initial value of the moving average for fake request delays. -services.submission.initial_fake_delay_milliseconds=10 -# The number of samples for the calculation of the moving average for fake request delays. -services.submission.fake_delay_moving_average_samples=10 - -services.submission.retention-days=14 -services.submission.payload.max-number-of-keys=14 - -spring.jpa.hibernate.ddl-auto=validate -spring.flyway.enabled=true - -spring.flyway.locations=classpath:db/migration/postgres - -# Postgres configuration -spring.datasource.driver-class-name=org.postgresql.Driver -spring.datasource.url=jdbc:postgresql://${POSTGRESQL_SERVICE_HOST:localhost}:${POSTGRESQL_SERVICE_PORT:5432}/${POSTGRESQL_DATABASE:cwa} -spring.datasource.username=${POSTGRESQL_USER:postgres} -spring.datasource.password=${POSTGRESQL_PASSWORD:postgres} diff --git a/services/submission/src/main/resources/application.yaml b/services/submission/src/main/resources/application.yaml new file mode 100644 --- /dev/null +++ b/services/submission/src/main/resources/application.yaml @@ -0,0 +1,30 @@ +--- +logging: + level: + org: + springframework: + web: INFO + +# The initial value of the moving average for fake request delays. +services: + submission: + initial-fake-delay-milliseconds: 10 + # The number of samples for the calculation of the moving average for fake request delays. + fake-delay-moving-average-samples: 10 + retention-days: 14 + payload: + max-number-of-keys: 14 + +spring: + jpa: + hibernate: + ddl-auto: validate + flyway: + enabled: true + locations: classpath:db/migration/postgres +# Postgres configuration + datasource: + driver-class-name: org.postgresql.Driver + url: jdbc:postgresql://${POSTGRESQL_SERVICE_HOST:localhost}:${POSTGRESQL_SERVICE_PORT:5432}/${POSTGRESQL_DATABASE:cwa} + username: ${POSTGRESQL_USER:postgres} + password: ${POSTGRESQL_PASSWORD:postgres} </patch>
diff --git a/common/persistence/src/test/resources/application.properties b/common/persistence/src/test/resources/application.properties deleted file mode 100644 --- a/common/persistence/src/test/resources/application.properties +++ /dev/null @@ -1,6 +0,0 @@ -spring.flyway.enabled=false -spring.jpa.hibernate.ddl-auto=create -spring.jpa.properties.hibernate.show_sql=false -spring.main.banner-mode=off -logging.level.org.springframework=off -logging.level.root=off \ No newline at end of file diff --git a/common/persistence/src/test/resources/application.yaml b/common/persistence/src/test/resources/application.yaml new file mode 100644 --- /dev/null +++ b/common/persistence/src/test/resources/application.yaml @@ -0,0 +1,17 @@ +--- +spring: + flyway: + enabled: false + jpa: + hibernate: + ddl-auto: create + properties: + hibernate: + show-sql: false + main: + banner-mode: off +logging: + level: + org: + springframework: off + root: off diff --git a/services/distribution/src/test/java/app/coronawarn/server/services/distribution/assembly/component/CryptoProviderTest.java b/services/distribution/src/test/java/app/coronawarn/server/services/distribution/assembly/component/CryptoProviderTest.java --- a/services/distribution/src/test/java/app/coronawarn/server/services/distribution/assembly/component/CryptoProviderTest.java +++ b/services/distribution/src/test/java/app/coronawarn/server/services/distribution/assembly/component/CryptoProviderTest.java @@ -28,7 +28,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit.jupiter.SpringExtension; @EnableConfigurationProperties(value = DistributionServiceConfig.class) diff --git a/services/distribution/src/test/java/app/coronawarn/server/services/distribution/assembly/diagnosiskeys/structure/directory/DiagnosisKeysDirectoryTest.java b/services/distribution/src/test/java/app/coronawarn/server/services/distribution/assembly/diagnosiskeys/structure/directory/DiagnosisKeysDirectoryTest.java --- a/services/distribution/src/test/java/app/coronawarn/server/services/distribution/assembly/diagnosiskeys/structure/directory/DiagnosisKeysDirectoryTest.java +++ b/services/distribution/src/test/java/app/coronawarn/server/services/distribution/assembly/diagnosiskeys/structure/directory/DiagnosisKeysDirectoryTest.java @@ -50,7 +50,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit.jupiter.SpringExtension; @EnableConfigurationProperties(value = DistributionServiceConfig.class) diff --git a/services/distribution/src/test/java/app/coronawarn/server/services/distribution/config/DistributionServiceConfigTest.java b/services/distribution/src/test/java/app/coronawarn/server/services/distribution/config/DistributionServiceConfigTest.java deleted file mode 100644 --- a/services/distribution/src/test/java/app/coronawarn/server/services/distribution/config/DistributionServiceConfigTest.java +++ /dev/null @@ -1,91 +0,0 @@ -package app.coronawarn.server.services.distribution.config; - -import static org.springframework.test.util.AssertionErrors.assertNotNull; -import static org.springframework.test.util.AssertionErrors.assertNull; - -import static org.assertj.core.api.Assertions.assertThat; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit.jupiter.SpringExtension; - -@ExtendWith(SpringExtension.class) -@EnableConfigurationProperties(value = DistributionServiceConfig.class) -@TestPropertySource("classpath:application.properties") -public class DistributionServiceConfigTest { - - @Autowired - private DistributionServiceConfig dsc; - - private final Properties properties = new Properties(); - - @BeforeEach - public void setup() throws IOException { - InputStream is = getClass().getClassLoader().getResourceAsStream("application.properties"); - properties.load(is); - } - - @AfterEach - public void tearDown() { - properties.clear(); - } - - @Test - void whenDistributionConfigBeanCreatedThenPropertiesLoadedCorrectly() { - - assertNotNull("Configuration should not be null", dsc); - assertNotNull("Paths should not be null", dsc.getPaths()); - assertNull("TestData should be null", dsc.getTestData()); - assertNotNull("Signature should not be null", dsc.getSignature()); - assertNotNull("API should not be null", dsc.getApi()); - - Map<String, String> cp = new HashMap<>(); - cp.put("services.distribution.retention-days", dsc.getRetentionDays().toString()); - cp.put("services.distribution.output-file-name", dsc.getOutputFileName()); - cp.put("services.distribution.tek-export.file-name", dsc.getTekExport().getFileName()); - cp.put("services.distribution.tek-export.file-header", dsc.getTekExport().getFileHeader()); - cp.put("services.distribution.tek-export.file-header-width", dsc.getTekExport().getFileHeaderWidth().toString()); - cp.put("services.distribution.paths.privatekey", dsc.getPaths().getPrivateKey()); - cp.put("services.distribution.paths.certificate", dsc.getPaths().getCertificate()); - cp.put("services.distribution.paths.output", dsc.getPaths().getOutput()); - cp.put("services.distribution.signature.app-bundle-id", dsc.getSignature().getAppBundleId()); - cp.put("services.distribution.signature.android-package", dsc.getSignature().getAndroidPackage()); - cp.put("services.distribution.signature.verification-key-id", dsc.getSignature().getVerificationKeyId()); - cp.put("services.distribution.signature.verification-key-version", dsc.getSignature().getVerificationKeyVersion()); - cp.put("services.distribution.signature.algorithm-oid", dsc.getSignature().getAlgorithmOid()); - cp.put("services.distribution.signature.algorithm-name", dsc.getSignature().getAlgorithmName()); - cp.put("services.distribution.signature.file-name", dsc.getSignature().getFileName()); - cp.put("services.distribution.signature.security-provider", dsc.getSignature().getSecurityProvider()); - cp.put("services.distribution.api.version-path", dsc.getApi().getVersionPath()); - cp.put("services.distribution.api.version-v1", dsc.getApi().getVersionV1()); - cp.put("services.distribution.api.country-path", dsc.getApi().getCountryPath()); - cp.put("services.distribution.api.country-germany", dsc.getApi().getCountryGermany()); - cp.put("services.distribution.api.date-path", dsc.getApi().getDatePath()); - cp.put("services.distribution.api.hour-path", dsc.getApi().getHourPath()); - cp.put("services.distribution.api.diagnosis-keys-path", dsc.getApi().getDiagnosisKeysPath()); - cp.put("services.distribution.api.parameters-path", dsc.getApi().getParametersPath()); - cp.put("services.distribution.api.parameters-exposure-configuration-file-name", - dsc.getApi().getParametersExposureConfigurationFileName()); - cp.put("services.distribution.api.parameters-risk-score-classification-file-name", - dsc.getApi().getParametersRiskScoreClassificationFileName()); - cp.put("services.distribution.objectstore.access-key", dsc.getObjectStore().getAccessKey()); - cp.put("services.distribution.objectstore.secret-key", dsc.getObjectStore().getSecretKey()); - cp.put("services.distribution.objectstore.endpoint", dsc.getObjectStore().getEndpoint()); - cp.put("services.distribution.objectstore.bucket", dsc.getObjectStore().getBucket()); - cp.put("services.distribution.objectstore.port", dsc.getObjectStore().getPort().toString()); - cp.put("services.distribution.objectstore.set-public-read-acl-on-put-object", - dsc.getObjectStore().isSetPublicReadAclOnPutObject().toString()); - - cp.forEach((key, value) -> assertThat(properties.getProperty(key)).isEqualTo(value)); - } - -} diff --git a/services/distribution/src/test/resources/application.properties b/services/distribution/src/test/resources/application.properties deleted file mode 100644 --- a/services/distribution/src/test/resources/application.properties +++ /dev/null @@ -1,47 +0,0 @@ -logging.level.org.springframework=off -logging.level.root=info -spring.main.banner-mode=off - -services.distribution.retention-days=14 -services.distribution.output-file-name=index -services.distribution.tek-export.file-name=export.bin -services.distribution.tek-export.file-header=EK Export v1 -services.distribution.tek-export.file-header-width=16 - -services.distribution.paths.output=out -services.distribution.paths.privatekey=classpath:certificates/client/private.pem -services.distribution.paths.certificate=classpath:certificates/chain/certificate.crt - -services.distribution.api.version-path=version -services.distribution.api.version-v1=v1 -services.distribution.api.country-path=country -services.distribution.api.country-germany=DE -services.distribution.api.date-path=date -services.distribution.api.hour-path=hour -services.distribution.api.diagnosis-keys-path=diagnosis-keys -services.distribution.api.parameters-path=configuration -services.distribution.api.parameters-exposure-configuration-file-name=exposure_configuration -services.distribution.api.parameters-risk-score-classification-file-name=risk_score_classification - -services.distribution.signature.app-bundle-id=de.rki.coronawarnapp -services.distribution.signature.android-package=de.rki.coronawarnapp -services.distribution.signature.verification-key-id= -services.distribution.signature.verification-key-version= -services.distribution.signature.algorithm-oid=1.2.840.10045.4.3.2 -services.distribution.signature.algorithm-name=SHA256withECDSA -services.distribution.signature.file-name=export.sig -services.distribution.signature.security-provider=BC - -spring.flyway.enabled=true -# default case is H2 - value will be overwritten by profile cloud or postgres -spring.flyway.locations=classpath:db/migration/h2 - -spring.jpa.hibernate.ddl-auto=validate - -# S3 object store configuration -services.distribution.objectstore.access-key=accessKey1 -services.distribution.objectstore.secret-key=verySecretKey1 -services.distribution.objectstore.endpoint=http\://localhost\:8003 -services.distribution.objectstore.bucket=cwa -services.distribution.objectstore.port=8003 -services.distribution.objectstore.set-public-read-acl-on-put-object=true diff --git a/services/distribution/src/test/resources/application.yaml b/services/distribution/src/test/resources/application.yaml new file mode 100644 --- /dev/null +++ b/services/distribution/src/test/resources/application.yaml @@ -0,0 +1,57 @@ +--- +logging: + level: + org: + springframework: off + root: info + +services: + distribution: + output-file-name: index + retention-days: 14 + paths: + output: out + privatekey: classpath:certificates/client/private.pem + certificate: classpath:certificates/chain/certificate.crt + tek-export: + file-name: export.bin + file-header: EK Export v1 + file-header-width: 16 + api: + version-path: version + version-v1: v1 + country-path: country + country-germany: DE + date-path: date + hour-path: hour + diagnosis-keys-path: diagnosis-keys + parameters-path: configuration + parameters-exposure-configuration-file-name: exposure_configuration + parameters-risk-score-classification-file-name: risk_score_classification + signature: + app-bundle-id: de.rki.coronawarnapp + android-package: de.rki.coronawarnapp + verification-key-id: + verification-key-version: + algorithm-oid: 1.2.840.10045.4.3.2 + algorithm-name: SHA256withECDSA + file-name: export.sig + security-provider: BC + # S3 object store configuration + objectstore: + access-key: ${CWA_OBJECTSTORE_ACCESSKEY:accessKey1} + secret-key: ${CWA_OBJECTSTORE_SECRETKEY:verySecretKey1} + endpoint: ${WA_OBJECTSTORE_ENDPOINT:http\://localhost\:8003} + bucket: ${CWA_OBJECTSTORE_BUCKET:cwa} + port: ${CWA_OBJECTSTORE_PORT:8003} + set-public-read-acl-on-put-object: true +spring: + main: + banner-mode: off + flyway: + enabled: true +# default case is H2 - value will be overwritten by profile cloud or postgres + locations: classpath:db/migration/h2 + jpa: + hibernate: + ddl-auto: validate diff --git a/services/submission/src/test/java/app/coronawarn/server/services/submission/config/SubmissionServiceConfigTest.java b/services/submission/src/test/java/app/coronawarn/server/services/submission/config/SubmissionServiceConfigTest.java deleted file mode 100644 --- a/services/submission/src/test/java/app/coronawarn/server/services/submission/config/SubmissionServiceConfigTest.java +++ /dev/null @@ -1,59 +0,0 @@ -package app.coronawarn.server.services.submission.config; - -import static org.springframework.test.util.AssertionErrors.assertEquals; -import static org.springframework.test.util.AssertionErrors.assertNotNull; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit.jupiter.SpringExtension; - -@ExtendWith(SpringExtension.class) -@EnableConfigurationProperties(value = SubmissionServiceConfig.class) -@TestPropertySource("classpath:application-config-test.properties") -public class SubmissionServiceConfigTest { - - @Autowired - private SubmissionServiceConfig config; - - private final Properties properties = new Properties(); - - @BeforeEach - public void setup() throws IOException { - InputStream is = getClass().getClassLoader() - .getResourceAsStream("application-config-test.properties"); - properties.load(is); - } - - @AfterEach - public void tearDown() { - properties.clear(); - } - - @Test - void whenDistributionConfigBeanCreatedThenPropertiesLoadedCorrectly() { - - assertNotNull("Configuration should not be null", config); - - assertEquals("Fake Delay value should be loaded correctly.", - properties.getProperty("services.submission.initial_fake_delay_milliseconds"), - String.valueOf(config.getInitialFakeDelayMilliseconds())); - assertEquals("Fake Delay Moving Average value should be loaded correctly.", - properties.getProperty("services.submission.fake_delay_moving_average_samples"), - String.valueOf(config.getFakeDelayMovingAverageSamples())); - assertEquals("Retention Days should be loaded correctly.", - properties.getProperty("services.submission.retention-days"), - String.valueOf(config.getRetentionDays())); - assertEquals("Max Number of Days value should be loaded correctly.", - properties.getProperty("services.submission.payload.max-number-of-keys"), - String.valueOf(config.getMaxNumberOfKeys())); - - } -} \ No newline at end of file diff --git a/services/submission/src/test/resources/application.properties b/services/submission/src/test/resources/application.properties deleted file mode 100644 --- a/services/submission/src/test/resources/application.properties +++ /dev/null @@ -1,15 +0,0 @@ -logging.level.org.springframework=off -logging.level.root=off -spring.main.banner-mode=off - -services.submission.initial_fake_delay_milliseconds=1 -services.submission.fake_delay_moving_average_samples=1 - -spring.flyway.enabled=true -# default case is H2 - value will be overwritten by profile cloud or postgres -spring.flyway.locations=classpath:db/migration/h2 - -spring.jpa.hibernate.ddl-auto=validate - -services.submission.retention-days=14 -services.submission.payload.max-number-of-keys=14 diff --git a/services/submission/src/test/resources/application.yaml b/services/submission/src/test/resources/application.yaml new file mode 100644 --- /dev/null +++ b/services/submission/src/test/resources/application.yaml @@ -0,0 +1,25 @@ +--- +logging: + level: + org: + springframework: off + root: off +spring: + main: + banner-mode: off + flyway: + enabled: true + # default case is H2 - value will be overwritten by profile cloud or postgres + locations: classpath:db/migration/h2 + + jpa: + hibernate: + ddl-auto: validate + +services: + submission: + initial-fake-delay-milliseconds: 1 + fake-delay-moving-average-samples: 1 + retention-days: 14 + payload: + max-number-of-keys: 14
corona-warn-app__cwa-server-1965
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> min-android 1.5.1 differs from production 1.0.4 value ## Describe the bug The `min-android` value served on https://svc90.main.px.t-online.de/version/v1/configuration/country/DE/app_config is `1.0.4` which differs from the value `1.5.1` stored in https://github.com/corona-warn-app/cwa-server/blob/main/services/distribution/src/main/resources/application.yaml#L144 If CWA Android 1.4.0 is started, there is no prompt shown to the user that the app should be updated. ## Expected behaviour The `min-android` value served on https://svc90.main.px.t-online.de/version/v1/configuration/country/DE/app_config should be the same as the value stored in https://github.com/corona-warn-app/cwa-server/blob/main/services/distribution/src/main/resources/application.yaml#L144 which is currently `1.5.1`. If `min-android` with the value of `1.5.1` were in production then starting CWA Android 1.4.0 should produce a prompt to update the app. ## Steps to reproduce the issue 1. In Android Studio check out CWA Android app release/1.4.x 2. Run CWA on Pixel 3a API 33 Android device emulator in Debug mode 3. Open Logcat in Android Studio and enter search term "UpdateChecker" The log shows the following: ``` UpdateChecker de.rki.coronawarnapp.dev E minVersionStringFromServer:1.0.4 UpdateChecker de.rki.coronawarnapp.dev E Current app version:1.4.0 UpdateChecker de.rki.coronawarnapp.dev E needs update:false ``` Alternatively install old released versions from https://www.apkmirror.com/apk/robert-koch-institut/corona-warn-app/. As soon as a version < 1.0.4 is started, e.g. 1.0.0 or 1.0.2, a message "Update available" is output. ![Update available](https://user-images.githubusercontent.com/66998419/202911146-6b74b2e4-7a8d-462d-8f19-6e10762719e2.jpg) If version 1.0.4 is installed and started, no update message is output. This is consistent with min-Android being set to `1.0.4` in production. ## Technical details - Android Studio Dolphin | 2021.3.1 Patch 1 - Pixel 3a API 33 Android device emulator - CWA Android 1.4.0 (note that this version was not released. Version 1.5 followed version 1.3) ## Possible Fix Clarify what the minimum enforced version of CWA Android in production is supposed to be and ensure alignment of https://github.com/corona-warn-app/cwa-server/blob/main/services/distribution/src/main/resources/application.yaml with the values used in production. </issue> <code> [start of README.md] 1 <!-- markdownlint-disable MD041 --> 2 <h1 align="center"> 3 Corona-Warn-App Server 4 </h1> 5 6 <p align="center"> 7 <a href="https://github.com/corona-warn-app/cwa-server/commits/" title="Last Commit"><img src="https://img.shields.io/github/last-commit/corona-warn-app/cwa-server?style=flat"></a> 8 <a href="https://github.com/corona-warn-app/cwa-server/issues" title="Open Issues"><img src="https://img.shields.io/github/issues/corona-warn-app/cwa-server?style=flat"></a> 9 <a href="https://circleci.com/gh/corona-warn-app/cwa-server" title="Build Status"><img src="https://circleci.com/gh/corona-warn-app/cwa-server.svg?style=shield&circle-token=4ab059989d10709df19eb4b98ab7c121a25e981a"></a> 10 <a href="https://sonarcloud.io/dashboard?id=corona-warn-app_cwa-server" title="Quality Gate"><img src="https://sonarcloud.io/api/project_badges/measure?project=corona-warn-app_cwa-server&metric=alert_status"></a> 11 <a href="https://sonarcloud.io/component_measures?id=corona-warn-app_cwa-server&metric=Coverage&view=list" title="Coverage"><img src="https://sonarcloud.io/api/project_badges/measure?project=corona-warn-app_cwa-server&metric=coverage"></a> 12 <a href="https://github.com/corona-warn-app/cwa-server/blob/HEAD/LICENSE" title="License"><img src="https://img.shields.io/badge/License-Apache%202.0-green.svg?style=flat"></a> 13 <a href="https://api.reuse.software/info/github.com/corona-warn-app/cwa-server" title="REUSE Status"><img src="https://api.reuse.software/badge/github.com/corona-warn-app/cwa-server"></a> 14 </p> 15 16 <p align="center"> 17 <a href="#development">Development</a> • 18 <a href="#service-apis">Service APIs</a> • 19 <a href="#documentation">Documentation</a> • 20 <a href="#support-and-feedback">Support</a> • 21 <a href="#how-to-contribute">Contribute</a> • 22 <a href="#contributors">Contributors</a> • 23 <a href="#repositories">Repositories</a> • 24 <a href="#licensing">Licensing</a> 25 </p> 26 27 The goal of this project is to develop the official Corona-Warn-App for Germany based on the exposure notification API from [Apple](https://www.apple.com/covid19/contacttracing/) and [Google](https://www.google.com/covid19/exposurenotifications/). The apps (for both iOS and Android) use Bluetooth technology to exchange anonymous encrypted data with other mobile phones (on which the app is also installed) in the vicinity of an app user's phone. The data is stored locally on each user's device, preventing authorities or other parties from accessing or controlling the data. This repository contains the **implementation of the server for encryption keys** for the Corona-Warn-App. 28 29 In this documentation, Corona-Warn-App services are also referred to as CWA services. 30 31 ## Architecture Overview 32 33 You can find the architecture overview [here](/docs/ARCHITECTURE.md), which will give you 34 a good starting point in how the backend services interact with other services, and what purpose 35 they serve. 36 37 ## Development 38 39 After you've checked out this repository, you can run the application in one of the following ways: 40 41 * As a [Docker](https://www.docker.com/)-based deployment on your local machine. You can run either: 42 * Single components using the respective Dockerfile or 43 * The full backend using the Docker Compose (which is considered the most convenient way) 44 * As a [Maven](https://maven.apache.org)-based build on your local machine. 45 If you want to develop something in a single component, this approach is preferable. 46 47 ### Docker-Based Deployment 48 49 If you want to use Docker-based deployment, you need to install Docker on your local machine. For more information about downloading and installing Docker, see the [official Docker documentation](https://docs.docker.com/get-docker/). 50 51 #### Running the Full CWA Backend Using Docker Compose 52 53 For your convenience, a full setup for local development and testing purposes, including the generation of test data has been prepared using [Docker Compose](https://docs.docker.com/compose/reference/overview/). To build the backend services, run ```docker-compose build``` in the repository's root directory. A default configuration file can be found under ```.env``` in the root folder of the repository. If the endpoints are to be exposed to the network the default values in this file should be changed before docker-compose is run. 54 55 Once the services are built, you can start the whole backend using ```docker-compose up```. 56 The distribution service runs once and then finishes. If you want to trigger additional distribution runs, run ```docker-compose run distribution```. 57 58 The docker-compose contains the following services: 59 60 Service | Description | Endpoint and Default Credentials 61 ------------------|-------------|----------- 62 submission | The Corona-Warn-App submission service | `http://localhost:8000` <br> `http://localhost:8006` (for actuator endpoint) 63 distribution | The Corona-Warn-App distribution service | NO ENDPOINT 64 postgres | A [postgres] database installation | `localhost:8001` <br> `postgres:5432` (from containerized pgadmin) <br> Username: postgres <br> Password: postgres 65 pgadmin | A [pgadmin](https://www.pgadmin.org/) installation for the postgres database | `http://localhost:8002` <br> Username: [email protected] <br> Password: password 66 cloudserver | [Zenko CloudServer] is a S3-compliant object store | `http://localhost:8003/` <br> Access key: accessKey1 <br> Secret key: verySecretKey1 67 verification-fake | A very simple fake implementation for the tan verification. | `http://localhost:8004/version/v1/tan/verify` <br> The only valid tan is `edc07f08-a1aa-11ea-bb37-0242ac130002`. 68 69 ##### Known Limitation 70 71 In rare cases the docker-compose runs into a timing issue if the distribution service starts before the bucket of the objectstore was created. This is not a big issue as you can simply run ```docker-compose run distribution``` to trigger additional distribution runs after the objectstore was initialized. 72 73 #### Running Single CWA Services Using Docker 74 75 If you would like to build and run a single CWA service, it's considered easiest to run them in a Docker environment. You can do this using the script provided in the respective CWA service directory. The Docker script first builds the CWA service and then creates an image for the runtime, which means that there are no additional dependencies for you to install. 76 77 To build and run the distribution service, run the following command: 78 79 ```bash 80 ./services/distribution/build_and_run.sh 81 ``` 82 83 To build and run the submission service, run the following command: 84 85 ```bash 86 ./services/submission/build_and_run.sh 87 ``` 88 89 The submission service is available on [localhost:8080](http://localhost:8080 ). 90 91 ### Maven-Based Build 92 93 If you want to actively develop in one of the CWA services, the Maven-based runtime is most suitable. 94 To prepare your machine to run the CWA project locally, we recommend that you first ensure that you've installed the following: 95 96 * Minimum JDK Version 11: [OpenJDK](https://openjdk.java.net/) / [SapMachine](https://sap.github.io/SapMachine/) 97 * [Maven 3.6](https://maven.apache.org/) 98 * [Postgres] 99 * [Zenko CloudServer] 100 101 If you are already running a local Postgres, you need to create a database `cwa` and run the following setup scripts: 102 103 * Create the different CWA roles first by executing [create-roles.sql](./setup/setup-roles.sql). 104 * Create local database users for the specific roles by running [create-users.sql](./local-setup/create-users.sql). 105 * It is recommended to also run [enable-test-data-docker-compose.sql](./local-setup/enable-test-data-docker-compose.sql) 106 , which enables the test data generation profile. If you already had CWA running before and an existing `diagnosis-key` 107 table on your database, you need to run [enable-test-data.sql](./local-setup/enable-test-data.sql) instead. 108 109 You can also use `docker-compose` to start Postgres and Zenko. If you do that, you have to 110 set the following environment-variables when running the Spring project: 111 112 For the distribution module: 113 114 ```bash 115 POSTGRESQL_SERVICE_PORT=8001 116 VAULT_FILESIGNING_SECRET=</path/to/your/private_key> 117 SPRING_PROFILES_ACTIVE=signature-dev,disable-ssl-client-postgres 118 ``` 119 120 For the submission module: 121 122 ```bash 123 POSTGRESQL_SERVICE_PORT=8001 124 SPRING_PROFILES_ACTIVE=disable-ssl-client-postgres 125 ``` 126 127 #### Configure 128 129 After you made sure that the specified dependencies are running, configure them in the respective configuration files. 130 131 * Configure the Postgres connection in the [submission config](./services/submission/src/main/resources/application.yaml) and in the [distribution config](./services/distribution/src/main/resources/application.yaml) 132 * Configure the S3 compatible object storage in the [distribution config](./services/distribution/src/main/resources/application.yaml) 133 * Configure the private key for the distribution service, the path need to be prefixed with `file:` 134 * `VAULT_FILESIGNING_SECRET` should be the path to the private key, example available in `<repo-root>/docker-compose-test-secrets/private.pem` 135 136 #### Build 137 138 After you've checked out the repository, to build the project, run ```mvn install``` in your base directory. 139 140 #### Run 141 142 Navigate to the service you want to start and run the spring-boot:run target. The configured Postgres and the configured S3 compliant object storage are used as default. When you start the submission service, the endpoint is available on your local port 8080. 143 144 If you want to start the submission service, for example, you start it as follows: 145 146 ```bash 147 cd services/submission/ 148 mvn spring-boot:run 149 ``` 150 151 #### Debugging 152 153 To enable the `DEBUG` log level, you can run the application using the Spring `debug` profile. 154 155 ```bash 156 mvn spring-boot:run -Dspring.profiles.active=debug 157 ``` 158 159 To be able to set breakpoints (e.g. in IntelliJ), it may be necessary to use the ```-Dspring-boot.run.fork=false``` parameter. 160 161 ## Service APIs 162 163 The API that is being exposed by the backend services is documented in an [OpenAPI](https://www.openapis.org/) specification. The specification files are available at the following locations: 164 165 Service | OpenAPI Specification 166 --------------------------|------------- 167 Submission Service | [services/submission/api_v1.json](https://github.com/corona-warn-app/cwa-server/raw/HEAD/services/submission/api_v1.json) 168 Distribution Service | [services/distribution/api_v1.json](https://github.com/corona-warn-app/cwa-server/raw/HEAD/services/distribution/api_v1.json) 169 170 ## Spring Profiles 171 172 ### Distribution 173 174 See [Distribution Service - Spring Profiles](/docs/DISTRIBUTION.md#spring-profiles). 175 176 ### Submission 177 178 See [Submission Service - Spring Profiles](/docs/SUBMISSION.md#spring-profiles). 179 180 ## Documentation 181 182 The full documentation for the Corona-Warn-App can be found in the [cwa-documentation](https://github.com/corona-warn-app/cwa-documentation) repository. The documentation repository contains technical documents, architecture information, and whitepapers related to this implementation. 183 184 The documentation for cwa-server can be found under the [/docs](./docs) folder. 185 186 The JavaDoc documentation for cwa-server is hosted by Github Pages at [https://corona-warn-app.github.io/cwa-server](https://corona-warn-app.github.io/cwa-server). 187 188 ## Support and Feedback 189 190 The following channels are available for discussions, feedback, and support requests: 191 192 | Type | Channel | 193 | ------------------------ | ------------------------------------------------------ | 194 | **General Discussion** | <a href="https://github.com/corona-warn-app/cwa-documentation/issues/new/choose" title="General Discussion"><img src="https://img.shields.io/github/issues/corona-warn-app/cwa-documentation/question.svg?style=flat-square"></a> </a> | 195 | **Concept Feedback** | <a href="https://github.com/corona-warn-app/cwa-documentation/issues/new/choose" title="Open Concept Feedback"><img src="https://img.shields.io/github/issues/corona-warn-app/cwa-documentation/architecture.svg?style=flat-square"></a> | 196 | **Backend Issue** | <a href="https://github.com/corona-warn-app/cwa-server/issues/new/choose" title="Open Backend Issue"><img src="https://img.shields.io/github/issues/corona-warn-app/cwa-server?style=flat-square"></a> | 197 | **Other Requests** | <a href="mailto:[email protected]" title="Email CWA Team"><img src="https://img.shields.io/badge/email-CWA%20team-green?logo=mail.ru&style=flat-square&logoColor=white"></a> | 198 199 ## How to Contribute 200 201 Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our [Contribution Guidelines](./CONTRIBUTING.md). By participating in this project, you agree to abide by its [Code of Conduct](./CODE_OF_CONDUCT.md) at all times. 202 203 ## Contributors 204 205 The German government has asked SAP and Deutsche Telekom to develop the Corona-Warn-App for Germany as open source software. Deutsche Telekom is providing the network and mobile technology and will operate and run the backend for the app in a safe, scalable and stable manner. SAP is responsible for the app development, its framework and the underlying platform. Therefore, development teams of SAP and Deutsche Telekom are contributing to this project. At the same time our commitment to open source means that we are enabling -in fact encouraging- all interested parties to contribute and become part of its developer community. 206 207 ## Repositories 208 209 A list of all public repositories from the Corona-Warn-App can be found [here](https://github.com/corona-warn-app/cwa-documentation/blob/master/README.md#repositories). 210 211 ## Licensing 212 213 Copyright (c) 2020-2022 SAP SE or an SAP affiliate company and Corona-Warn-App contributors. 214 215 Licensed under the **Apache License, Version 2.0** (the "License"); you may not use this file except in compliance with the License. 216 217 You may obtain a copy of the License from [here](./LICENSE). 218 219 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](./LICENSE) for the specific language governing permissions and limitations under the License. 220 221 Please see the [detailed licensing information](https://api.reuse.software/info/github.com/corona-warn-app/cwa-ppa-server) via the [REUSE Tool](https://reuse.software/) for more details. 222 223 [Postgres]: https://www.postgresql.org/ 224 225 [Zenko CloudServer]: https://www.zenko.io/cloudserver/ 226 [end of README.md] [start of services/distribution/src/main/resources/application.yaml] 1 --- 2 logging: 3 level: 4 org: 5 springframework: 6 web: INFO 7 app: 8 coronawarn: INFO 9 com: 10 netflix: 11 config: 12 sources: 13 URLConfigurationSource: ERROR 14 15 services: 16 distribution: 17 # Infection threshold in percentage. 18 infection-threshold: ${INFECTION_THRESHOLD:1} 19 # The name of the distribution output file. 20 output-file-name: index 21 # The name of the distribution output file v2. 22 output-file-name-v2: index-v2 23 # The number of days to retain diagnosis keys and trace time warnings for both database persistency layer and files stored on the object store. 24 retention-days: 14 25 # The number of days for diagnosis keys (based upon submission timestamp) to publish on CDN. 26 days-to-publish: ${DAYS_TO_PUBLISH:10} 27 # The number of minutes that diagnosis keys must have been expired for (since the end of the rolling interval window) before they can be distributed. 28 expiry-policy-minutes: 120 29 # The minimum number of diagnosis keys per bundle. 30 shifting-policy-threshold: 140 31 # The maximum number of keys per bundle. 32 maximum-number-of-keys-per-bundle: 600000 33 # Indicates whether the current incomplete day will be included in the distribution (used for testing purposes). 34 include-incomplete-days: false 35 # Indicates whether the current incomplete hour will be included in the distribution (used for testing purposes). 36 include-incomplete-hours: false 37 # The naming of the eu package that provides all keys in a single package. 38 eu-package-name: EUR 39 # Indicates whether the shifting and expiry policies are applied to all supported countries during distribution. 40 apply-policies-for-all-countries: false 41 card-id-sequence: ${STATS_CARD_ID_SEQUENCE:[12,999,10,2,8,9,1,3,4,5,6,11,7]} 42 # Local paths, that are used during the export creation. 43 connection-pool-size: 200 44 default-archive-name: export.bin 45 # Minimum value allowed for the diagnosis keys TRLs. 46 minimum-trl-value-allowed: ${MINIMUM_TRL_VALUE_ALLOWED:3} 47 paths: 48 # The output path. 49 output: out 50 # The location of the private key. 51 privatekey: ${VAULT_FILESIGNING_SECRET} 52 # Configuration for the exported archive, that is saved on the S3-compatible storage. 53 tek-export: 54 # The TEK file name included in the zip archive, containing the list of diagnosis keys. 55 file-name: export.bin 56 # The TEK file header. 57 file-header: EK Export v1 58 # The fixed (ensured by right whitespace padding) TEK file header width. 59 file-header-width: 16 60 # Configuration for the API which is used by the mobile app to query diagnosis keys. 61 api: 62 version-path: version 63 version-v1: v1 64 version-v2: v2 65 country-path: country 66 origin-country: ${ORIGIN_COUNTRY:DE} 67 date-path: date 68 hour-path: hour 69 diagnosis-keys-path: diagnosis-keys 70 trace-warnings-path: twp 71 parameters-path: configuration 72 app-config-file-name: app_config 73 app-config-v2-android-file-name: app_config_android 74 app-config-v2-ios-file-name: app_config_ios 75 statistics-file-name: stats 76 local-statistics-file-name: local_stats 77 # Signature configuration, used for signing the exports. 78 signature: 79 # The alias with which to identify public key to be used for verification. 80 verification-key-id: 262 81 # The key version for rollovers. 82 verification-key-version: v1 83 # The ASN.1 OID for algorithm identifier. 84 algorithm-oid: 1.2.840.10045.4.3.2 85 # The algorithm name. 86 algorithm-name: SHA256withECDSA 87 # The signature file name included in the zip archive. 88 file-name: export.sig 89 # The security provider. 90 security-provider: BC 91 # Configuration for the S3 compatible object storage hosted by Telekom in Germany. 92 objectstore: 93 access-key: ${CWA_OBJECTSTORE_ACCESSKEY:accessKey1} 94 secret-key: ${CWA_OBJECTSTORE_SECRETKEY:verySecretKey1} 95 endpoint: ${CWA_OBJECTSTORE_ENDPOINT:http://localhost} 96 bucket: ${CWA_OBJECTSTORE_BUCKET:cwa} 97 port: ${CWA_OBJECTSTORE_PORT:8003} 98 # Indicates whether the S3 Access Control List (ACL) header should be set to 'public-read' on put object. 99 set-public-read-acl-on-put-object: true 100 # The number of maximum retry attempts used for configuring Spring @Retryable annotation. 101 retry-attempts: 3 102 # The backoff period in milliseconds used for configuring Spring @Retryable annotation. 103 retry-backoff: 2000 104 # The maximum number of failed operations before giving up. 105 max-number-of-failed-operations: 5 106 # The ThreadPoolTaskExecutor's maximum thread pool size. 107 max-number-of-s3-threads: 4 108 # Allows distribution to overwrite files which are published on the object store 109 force-update-keyfiles: ${FORCE_UPDATE_KEYFILES:false} 110 # The number of days to retain hourly diagnosis keys file in S3. Database entries are still managed by the standard retention policy. 111 hour-file-retention-days: 2 112 # Configuration for the publishing of app statistics 113 statistics: 114 statistic-path: ${STATISTICS_FILE_NAME:json/v1/cwa_reporting_public_data.json} 115 local-statistic-path: ${LOCAL_STATISTICS_FILE_NAME:json/v1/cwa_reporting_public_data_region.json} 116 access-key: ${STATISTICS_FILE_ACCESS_KEY_ID:} 117 secret-key: ${STATISTICS_FILE_SECRET_ACCESS_KEY:} 118 endpoint: ${STATISTICS_FILE_S3_ENDPOINT:} 119 bucket: ${STATISTICS_FILE_S3_BUCKET:obs-cwa-public-dev} 120 pandemic-radar-url: ${STATISTICS_PANDEMIC_RADAR_URL:https://www.rki.de/DE/Content/InfAZ/N/Neuartiges_Coronavirus/Situationsberichte/COVID-19-Trends/COVID-19-Trends.html?__blob=publicationFile#/home} 121 122 app-features: 123 - label: unencrypted-checkins-enabled 124 value: ${EVREG_UNENCRYPTED_CHECKINS_ENABLED:0} 125 - label: validation-service-android-min-version-code 126 value: ${VALIDATION_SERVICE_ANDROID_MIN_VERSION_CODE:0} 127 - label: validation-service-ios-min-version-major 128 value: ${VALIDATION_SERVICE_IOS_MIN_VERSION_MAJOR:0} 129 - label: validation-service-ios-min-version-minor 130 value: ${VALIDATION_SERVICE_IOS_MIN_VERSION_MINOR:0} 131 - label: validation-service-ios-min-version-patch 132 value: ${VALIDATION_SERVICE_IOS_MIN_VERSION_PATCH:0} 133 - label: dcc-person-count-max 134 value: ${DCC_PERSON_COUNT_MAX:20} 135 - label: dcc-person-warn-threshold 136 value: ${DCC_PERSON_WARN_THRESHOLD:4} 137 - label: dcc-admission-check-scenarios-enabled 138 value: ${DCC_ADMISSION_CHECK_SCENARIOS_ENABLED:0} 139 supported-countries: ${SUPPORTED_COUNTRIES} 140 app-versions: 141 latest-ios: ${IOS_LATEST_VERSION:1.5.3} 142 min-ios: ${IOS_MIN_VERSION:1.5.3} 143 latest-android: ${ANDROID_LATEST_VERSION:1.5.1} 144 min-android: ${ANDROID_MIN_VERSION:1.5.1} 145 # With ENF v2 Android apps are versioned by Version Code and not by Semantic Versioning 146 min-android-version-code: ${ANDROID_MIN_VERSION_CODE:48} 147 latest-android-version-code: ${ANDROID_LATEST_VERSION_CODE:48} 148 app-config-parameters: 149 dgcParameters: 150 testCertificateParameters: 151 # validation rule for waitAfterPublicKeyRegistrationInSeconds: 152 # * must be a number 153 # * >= 0 154 # * <= 60 155 waitAfterPublicKeyRegistrationInSeconds: ${DGC_TC_WAIT_AFTER_PUBLIC_KEY_REGISTRATION_IN_SECONDS:10} 156 # validation rule for waitForRetryInSeconds: 157 # * must be a number 158 # * >= 0 159 # * <= 60 160 waitForRetryInSeconds: ${DGC_TC_WAIT_FOR_RETRY_IN_SECONDS:10} 161 expiration-threshold-in-days: ${DGC_EXPIRATION_THRESHOLD_IN_DAYS:27} 162 block-list-parameters: 163 # the value shall be parsed as a JSON string to 164 # generate the individual items, e.g. 165 # '[{"indices":[0],"hash":"9B09CAFEC0A6808411C348880C9C2D920646DFB980B5C959DC6EBF8A19B98120","validFrom":1636040446},{"indices":[0,2],"hash":"7D5D5B336E903086D64D1207EC6E957A4B1301026699011026F84A5156317C2B","validFrom":1638369640}]' 166 # note that `hash` shall be parsed from a hex string to a byte sequence 167 blocked-uvci-chunks: ${DGC_BLOCKED_UVCI_CHUNKS:[]} 168 ios-dgc-reissue-service-public-key-digest: ${IOS_DGC_REISSUE_SERVICE_PUBLIC_KEY_DIGEST:} 169 android-dgc-reissue-service-public-key-digest: ${ANDROID_DGC_REISSUE_SERVICE_PUBLIC_KEY_DIGEST:} 170 ios-key-download-parameters: 171 revoked-day-packages: ${KEY_DOWNLOAD_REVOKED_DAY_PACKAGES:[]} 172 revoked-hour-packages: ${KEY_DOWNLOAD_REVOKED_HOUR_PACKAGES:[]} 173 android-key-download-parameters: 174 revoked-day-packages: ${KEY_DOWNLOAD_REVOKED_DAY_PACKAGES:[]} 175 revoked-hour-packages: ${KEY_DOWNLOAD_REVOKED_HOUR_PACKAGES:[]} 176 download-timeout-in-seconds: ${ANDROID_KEY_DOWNLOAD_DOWNLOAD_TIMEOUT_IN_SECONDS:60} 177 overall-timeout-in-seconds: ${ANDROID_KEY_DOWNLOAD_OVERALL_TIMEOUT_IN_SECONDS:480} 178 ios-exposure-detection-parameters: 179 max-exposure-detections-per-interval: ${IOS_EXPOSURE_DETECTION_MAX_ED_PER_INTERVAL:6} 180 android-exposure-detection-parameters: 181 max-exposure-detections-per-interval: ${ANDROID_EXPOSURE_DETECTION_MAX_ED_PER_INTERVAL:6} 182 overall-timeout-in-seconds: ${ANDROID_EXPOSURE_DETECTION_OVERALL_TIMEOUT_IN_SECONDS:900} 183 ios-event-driven-user-survey-parameters: 184 otp-query-parameter-name: ${EDUS_OTP_QUERY_PARAMETER_NAME:otp} 185 survey-on-high-risk-enabled: ${EDUS_SURVEY_ON_HIGH_RISK_ENABLED:true} 186 survey-on-high-risk-url: ${EDUS_SURVEY_ON_HIGH_RISK_URL:https://befragungen.rki.de/CWABasisbefragung} 187 android-event-driven-user-survey-parameters: 188 otp-query-parameter-name: ${EDUS_OTP_QUERY_PARAMETER_NAME:otp} 189 survey-on-high-risk-enabled: ${EDUS_SURVEY_ON_HIGH_RISK_ENABLED:false} 190 survey-on-high-risk-url: ${EDUS_SURVEY_ON_HIGH_RISK_URL:https://befragungen.rki.de/CWABasisbefragung} 191 require-basic-integrity: ${EDUS_PPAC_REQUIRE_BASIC_INTEGRITY:true} 192 require-cts-profile-match: ${EDUS_PPAC_REQUIRE_CTS_PROFILE_MATCH:true} 193 require-evaluation-type-basic: ${EDUS_PPAC_REQUIRE_EVALUATION_TYPE_BASIC:false} 194 require-evaluation-type-hardware-backed: ${EDUS_PPAC_REQUIRE_EVALUATION_TYPE_HARDWARE_BACKED:true} 195 ios-privacy-preserving-analytics-parameters: 196 probability-to-submit: ${PPA_PROBABILITY_TO_SUBMT:1} 197 probability-to-submit-exposure-windows: ${PPA_PROBABILOITY_TO_SUBMIT_EXPOSURE_WINDOWS:1} 198 hours-since-test-registration-to-submit-test-result-metadata: ${PPA_HOURS_SINCE_TEST_RESULT_TO_SUBMIT_KEY_RESULT_METADATA:165} 199 hours-since-test-to-submit-key-submission-metadata: ${PPA_HOURS_SINCE_TEST_RESULT_TO_SUBMIT_KEY_SUBMISSION_METADATA:36} 200 android-privacy-preserving-analytics-parameters: 201 probability-to-submit: ${PPA_PROBABILITY_TO_SUBMT:1} 202 probability-to-submit-exposure-windows: ${PPA_PROBABILOITY_TO_SUBMIT_EXPOSURE_WINDOWS:1} 203 hours-since-test-registration-to-submit-test-result-metadata: ${PPA_HOURS_SINCE_TEST_RESULT_TO_SUBMIT_KEY_RESULT_METADATA:165} 204 hours-since-test-to-submit-key-submission-metadata: ${PPA_HOURS_SINCE_TEST_RESULT_TO_SUBMIT_KEY_SUBMISSION_METADATA:36} 205 require-basic-integrity: ${PPA_PPAC_REQUIRE_BASIC_INTEGRITY:false} 206 require-cts-profile-match: ${PPA_PPAC_REQUIRE_CTS_PROFILE_MATCH:false} 207 require-evaluation-type-basic: ${PPA_PPAC_REQUIRE_EVALUATION_TYPE_BASIC:false} 208 require-evaluation-type-hardware-backed: ${PPA_PPAC_REQUIRE_EVALUATION_TYPE_HARDWARE_BACKED:false} 209 ios-qr-code-poster-template: 210 published-archive-name: qr_code_poster_template_ios 211 template: ${EVREG_QR_CODE_POSTER_TEMPLATE_IOS_FILE:} 212 offsetX: ${EVREG_QR_CODE_POSTER_TEMPLATE_IOS_OFFSET_X:97} 213 offsetY: ${EVREG_QR_CODE_POSTER_TEMPLATE_IOS_OFFSET_Y:82} 214 qr-code-side-length: ${EVREG_QR_CODE_POSTER_TEMPLATE_IOS_QR_CODE_SIDE_LENGTH:400} 215 description-text-box: 216 offsetX: ${EVREG_QR_CODE_POSTER_TEMPLATE_IOS_DESCRIPTION_OFFSET_X:80} 217 offsetY: ${EVREG_QR_CODE_POSTER_TEMPLATE_IOS_DESCRIPTION_OFFSET_Y:510} 218 width: ${EVREG_QR_CODE_POSTER_TEMPLATE_IOS_DESCRIPTION_WIDTH:420} 219 height: ${EVREG_QR_CODE_POSTER_TEMPLATE_IOS_DESCRIPTION_HEIGHT:15} 220 fontSize: ${EVREG_QR_CODE_POSTER_TEMPLATE_IOS_DESCRIPTION_FONT_SIZE:10} 221 fontColor: ${EVREG_QR_CODE_POSTER_TEMPLATE_IOS_DESCRIPTION_FONT_COLOR:#000000} 222 address-text-box: 223 offsetX: ${EVREG_QR_CODE_POSTER_TEMPLATE_IOS_ADDRESS_OFFSET_X:80} 224 offsetY: ${EVREG_QR_CODE_POSTER_TEMPLATE_IOS_ADDRESS_OFFSET_Y:525} 225 width: ${EVREG_QR_CODE_POSTER_TEMPLATE_IOS_ADDRESS_WIDTH:420} 226 height: ${EVREG_QR_CODE_POSTER_TEMPLATE_IOS_ADDRESS_HEIGHT:15} 227 fontSize: ${EVREG_QR_CODE_POSTER_TEMPLATE_IOS_ADDRESS_FONT_SIZE:10} 228 fontColor: ${EVREG_QR_CODE_POSTER_TEMPLATE_IOS_ADDRESS_FONT_COLOR:#000000} 229 android-qr-code-poster-template: 230 published-archive-name: qr_code_poster_template_android 231 template: ${EVREG_QR_CODE_POSTER_TEMPLATE_ANDROID_FILE:} 232 offsetX: ${EVREG_QR_CODE_POSTER_TEMPLATE_ANDROID_OFFSET_X:0.16} 233 offsetY: ${EVREG_QR_CODE_POSTER_TEMPLATE_ANDROID_OFFSET_Y:0.095} 234 qr-code-side-length: ${EVREG_QR_CODE_POSTER_TEMPLATE_ANDROID_QR_CODE_SIDE_LENGTH:1000} 235 description-text-box: 236 offsetX: ${EVREG_QR_CODE_POSTER_TEMPLATE_ANDROID_DESCRIPTION_OFFSET_X:0.132} 237 offsetY: ${EVREG_QR_CODE_POSTER_TEMPLATE_ANDROID_DESCRIPTION_OFFSET_Y:0.61} 238 width: ${EVREG_QR_CODE_POSTER_TEMPLATE_ANDROID_DESCRIPTION_WIDTH:100} 239 height: ${EVREG_QR_CODE_POSTER_TEMPLATE_ANDROID_DESCRIPTION_HEIGHT:20} 240 font-size: ${EVREG_QR_CODE_POSTER_TEMPLATE_ANDROID_DESCRIPTION_FONT_SIZE:10} 241 font-color: ${EVREG_QR_CODE_POSTER_TEMPLATE_ANDROID_DESCRIPTION_FONT_COLOR:#000000} 242 presence-tracing-parameters: 243 qr-code-error-correction-level: ${EVREG_QR_CODE_ERROR_CORRECTION_LEVEL:0} 244 plausible-deniability-parameters: 245 probability-to-fake-check-ins-if-no-check-ins: ${EVREG_PROBABILITY_TO_FAKE_CHECK_INS_IF_NO_CHECK_INS:0} 246 probability-to-fake-check-ins-if-some-check-ins: ${EVREG_PROBABILITY_TO_FAKE_CHECK_INS_IF_SOME_CHECK_INS:0.005} 247 digital-green-certificate: 248 mah-json-path: ${DIGITAL_GREEN_CERTIFICATE_MAH_JSON_PATH:} 249 prophylaxis-json-path: ${DIGITAL_GREEN_CERTIFICATE_PROPHYLAXIS_JSON_PATH:} 250 medicinal-products-json-path: ${DIGITAL_GREEN_CERTIFICATE_MEDICINAL_PRODUCTS_JSON_PATH:} 251 disease-agent-targeted-path: ${DIGITAL_GREEN_CERTIFICATE_DISEASE_AGENT_TARGETED_JSON_PATH:} 252 test-manf-path: ${DIGITAL_GREEN_CERTIFICATE_TEST_MANF_JSON_PATH:} 253 test-result-path: ${DIGITAL_GREEN_CERTIFICATE_TEST_RESULT_JSON_PATH:} 254 test-type-path: ${DIGITAL_GREEN_CERTIFICATE_TEST_TYPE_JSON_PATH:} 255 dgc-directory: ${DIGITAL_GREEN_CERTIFICATE_DIRECTORY:ehn-dgc} 256 valuesets-file-name: ${DIGITAL_GREEN_CERTIFICATE_VALUESETS_FILE_NAME:value-sets} 257 supported-languages: ${DIGITAL_GREEN_CERTIFICATE_SUPPORTED_LANGUAGES:de, en, bg, pl, ro, tr, uk} 258 booster-notification: ${BOOSTER_NOTIFICATION_DIRECTORY:booster-notification-rules} 259 export-archive-name: ${DIGITAL_GREEN_CERTIFICATE_ARCHIVE_NAME:export.bin} 260 allow-list: ${DCC_VALIDATION_SERVICE_ALLOWLIST} 261 allow-list-signature: ${DCC_VALIDATION_SERVICE_ALLOWLIST_SIGNATURE} 262 allow-list-certificate: ${DCC_VALIDATION_SERVICE_ALLOWLIST_CERTIFICATE} 263 ccl-directory: ${COMMON_COVID_LOGIC:ccl} 264 ccl-allow-list: ${CCL_ALLOW_LIST:CCL-DE-0001} 265 dsc-client: 266 public-key: ${DSC_PUBLIC_KEY:MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEIxHvrv8jQx9OEzTZbsx1prQVQn/3ex0gMYf6GyaNBW0QKLMjrSDeN6HwSPM0QzhvhmyQUixl6l88A7Zpu5OWSw==} 267 base-url: ${DSC_BASE_PATH:https://de.dscg.ubirch.com} 268 dsc-list-path: ${DSC_LIST_PATH:/trustList/DSC/} 269 ssl: 270 trust-store: ${DSC_TRUST_STORE:../../docker-compose-test-secrets/dsc_truststore} 271 trust-store-password: ${DSC_TRUST_STORE_PASSWORD:123456} 272 client: 273 public-key: ${DCC_PUBLIC_KEY:MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEnQmn1s+sTWqFPuRhqFRide7HD52SrsD01ZdX4cxN1r0pnZ0Zh7JNwZxmXlOQW5NDVlPdHq2QcD06gmP/10QizA==} 274 retry-period: 2 275 max-retry-period: 5 276 max-retry-attempts: 2 277 base-url: ${BUSSINESS_RULES_BASE_PATH:https://distribution.dcc-rules.de/} 278 country-list-path: ${BUSSINESS_RULES_COUNTRY_LIST_PATH:/countrylist} 279 value-sets-path: ${BUSSINESS_RULES_VALUE_SETS_PATH:/valuesets} 280 rules-path: ${BUSSINESS_RULES_RULES_PATH:/rules} 281 bn-rules-path: ${BUSSINESS_RULES_BN_RULES_PATH:/bnrules} 282 ccl-rules-path: ${COMMON_COVID_LOGIC:/cclrules} 283 ssl: 284 trust-store: ${DCC_TRUST_STORE:../../docker-compose-test-secrets/dcc_truststore} 285 trust-store-password: ${DCC_TRUST_STORE_PASSWORD:123456} 286 dcc-revocation: 287 client: 288 public-key: ${DCC_REVOCATION_LIST_PUBLIC_KEY:MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE6Ft4aTjScTpsvY0tg2Lx0AK0Ih3Z2VKXnyBvoZxngB9cXmNtTg+Va3fY3QJduf+OXaWsE34xvMTIHxw+MpOLkw==} 289 base-url: ${DCC_REV_BASE_PATH:https://de.crl.dscg.ubirch.com} 290 ssl: 291 trust-store: ${DCC_REV_TRUST_STORE:../../docker-compose-test-secrets/dcc_rev_truststore} 292 trust-store-password: ${DCC_REV_TRUST_STORE_PASSWORD:testtest} 293 retry-period: 2 294 max-retry-period: 5 295 max-retry-attempts: 2 296 dcc-list-path: /chunk.lst 297 dcc-revocation-directory: dcc-rl 298 certificate: ${DCC_REVOCATION_LIST_CERTIFICATE} 299 spring: 300 main: 301 web-application-type: NONE 302 # Postgres configuration 303 flyway: 304 enabled: true 305 locations: classpath:/db/migration, classpath:/db/specific/{vendor} 306 password: ${POSTGRESQL_PASSWORD_FLYWAY:local_setup_flyway} 307 user: ${POSTGRESQL_USER_FLYWAY:local_setup_flyway} 308 309 datasource: 310 driver-class-name: org.postgresql.Driver 311 url: jdbc:postgresql://${POSTGRESQL_SERVICE_HOST}:${POSTGRESQL_SERVICE_PORT}/${POSTGRESQL_DATABASE}?ssl=true&sslmode=verify-full&sslrootcert=${SSL_POSTGRES_CERTIFICATE_PATH}&sslcert=${SSL_DISTRIBUTION_CERTIFICATE_PATH}&sslkey=${SSL_DISTRIBUTION_PRIVATE_KEY_PATH} 312 username: ${POSTGRESQL_USER_DISTRIBUTION:local_setup_distribution} 313 password: ${POSTGRESQL_PASSWORD_DISTRIBUTION:local_setup_distribution} 314 [end of services/distribution/src/main/resources/application.yaml] </code> Here is an example of a patch file. It consists of changes to the code base. It specifies the file names, the line numbers of each change, and the removed and added lines. A single patch file can contain changes to multiple files. <patch> --- a/file.py +++ b/file.py @@ -1,27 +1,35 @@ def euclidean(a, b): - while b: - a, b = b, a % b - return a + if b == 0: + return a + return euclidean(b, a % b) def bresenham(x0, y0, x1, y1): points = [] dx = abs(x1 - x0) dy = abs(y1 - y0) - sx = 1 if x0 < x1 else -1 - sy = 1 if y0 < y1 else -1 - err = dx - dy + x, y = x0, y0 + sx = -1 if x0 > x1 else 1 + sy = -1 if y0 > y1 else 1 - while True: - points.append((x0, y0)) - if x0 == x1 and y0 == y1: - break - e2 = 2 * err - if e2 > -dy: + if dx > dy: + err = dx / 2.0 + while x != x1: + points.append((x, y)) err -= dy - x0 += sx - if e2 < dx: - err += dx - y0 += sy + if err < 0: + y += sy + err += dx + x += sx + else: + err = dy / 2.0 + while y != y1: + points.append((x, y)) + err -= dx + if err < 0: + x += sx + err += dy + y += sy + points.append((x, y)) return points </patch> I need you to solve the provded issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the format shown above. Respond below:
corona-warn-app/cwa-server
f20af0764008b8ef07ba67c3b26693115035c43f
min-android 1.5.1 differs from production 1.0.4 value ## Describe the bug The `min-android` value served on https://svc90.main.px.t-online.de/version/v1/configuration/country/DE/app_config is `1.0.4` which differs from the value `1.5.1` stored in https://github.com/corona-warn-app/cwa-server/blob/main/services/distribution/src/main/resources/application.yaml#L144 If CWA Android 1.4.0 is started, there is no prompt shown to the user that the app should be updated. ## Expected behaviour The `min-android` value served on https://svc90.main.px.t-online.de/version/v1/configuration/country/DE/app_config should be the same as the value stored in https://github.com/corona-warn-app/cwa-server/blob/main/services/distribution/src/main/resources/application.yaml#L144 which is currently `1.5.1`. If `min-android` with the value of `1.5.1` were in production then starting CWA Android 1.4.0 should produce a prompt to update the app. ## Steps to reproduce the issue 1. In Android Studio check out CWA Android app release/1.4.x 2. Run CWA on Pixel 3a API 33 Android device emulator in Debug mode 3. Open Logcat in Android Studio and enter search term "UpdateChecker" The log shows the following: ``` UpdateChecker de.rki.coronawarnapp.dev E minVersionStringFromServer:1.0.4 UpdateChecker de.rki.coronawarnapp.dev E Current app version:1.4.0 UpdateChecker de.rki.coronawarnapp.dev E needs update:false ``` Alternatively install old released versions from https://www.apkmirror.com/apk/robert-koch-institut/corona-warn-app/. As soon as a version < 1.0.4 is started, e.g. 1.0.0 or 1.0.2, a message "Update available" is output. ![Update available](https://user-images.githubusercontent.com/66998419/202911146-6b74b2e4-7a8d-462d-8f19-6e10762719e2.jpg) If version 1.0.4 is installed and started, no update message is output. This is consistent with min-Android being set to `1.0.4` in production. ## Technical details - Android Studio Dolphin | 2021.3.1 Patch 1 - Pixel 3a API 33 Android device emulator - CWA Android 1.4.0 (note that this version was not released. Version 1.5 followed version 1.3) ## Possible Fix Clarify what the minimum enforced version of CWA Android in production is supposed to be and ensure alignment of https://github.com/corona-warn-app/cwa-server/blob/main/services/distribution/src/main/resources/application.yaml with the values used in production.
- FYI: I opened https://github.com/corona-warn-app/cwa-server/issues/1963 asking the team to check for other differences between this repositories `main` branch & the production environment. Also I would expect `min-android-version-code` / `minVersionCode=48` and not `31` to be served.
2022-11-21T14:08:50
<patch> diff --git a/services/distribution/src/main/resources/application.yaml b/services/distribution/src/main/resources/application.yaml --- a/services/distribution/src/main/resources/application.yaml +++ b/services/distribution/src/main/resources/application.yaml @@ -140,11 +140,11 @@ services: app-versions: latest-ios: ${IOS_LATEST_VERSION:1.5.3} min-ios: ${IOS_MIN_VERSION:1.5.3} - latest-android: ${ANDROID_LATEST_VERSION:1.5.1} - min-android: ${ANDROID_MIN_VERSION:1.5.1} + latest-android: ${ANDROID_LATEST_VERSION:1.0.4} + min-android: ${ANDROID_MIN_VERSION:1.0.4} # With ENF v2 Android apps are versioned by Version Code and not by Semantic Versioning - min-android-version-code: ${ANDROID_MIN_VERSION_CODE:48} - latest-android-version-code: ${ANDROID_LATEST_VERSION_CODE:48} + min-android-version-code: ${ANDROID_MIN_VERSION_CODE:31} + latest-android-version-code: ${ANDROID_LATEST_VERSION_CODE:31} app-config-parameters: dgcParameters: testCertificateParameters: </patch>
diff --git a/services/distribution/src/test/resources/application-allow-list-invalid.yaml b/services/distribution/src/test/resources/application-allow-list-invalid.yaml --- a/services/distribution/src/test/resources/application-allow-list-invalid.yaml +++ b/services/distribution/src/test/resources/application-allow-list-invalid.yaml @@ -83,10 +83,10 @@ services: app-versions: latest-ios: ${IOS_LATEST_VERSION:1.5.3} min-ios: ${IOS_MIN_VERSION:1.5.3} - latest-android: ${ANDROID_LATEST_VERSION:1.5.1} - min-android: ${ANDROID_MIN_VERSION:1.5.1} - min-android-version-code: ${ANDROID_MIN_VERSION_CODE:48} - latest-android-version-code: ${ANDROID_LATEST_VERSION_CODE:48} + latest-android: ${ANDROID_LATEST_VERSION:1.0.4} + min-android: ${ANDROID_MIN_VERSION:1.0.4} + min-android-version-code: ${ANDROID_MIN_VERSION_CODE:31} + latest-android-version-code: ${ANDROID_LATEST_VERSION_CODE:31} app-config-parameters: dgcParameters: testCertificateParameters: diff --git a/services/distribution/src/test/resources/application.yaml b/services/distribution/src/test/resources/application.yaml --- a/services/distribution/src/test/resources/application.yaml +++ b/services/distribution/src/test/resources/application.yaml @@ -98,10 +98,10 @@ services: app-versions: latest-ios: ${IOS_LATEST_VERSION:1.5.3} min-ios: ${IOS_MIN_VERSION:1.5.3} - latest-android: ${ANDROID_LATEST_VERSION:1.5.1} - min-android: ${ANDROID_MIN_VERSION:1.5.1} - min-android-version-code: ${ANDROID_MIN_VERSION_CODE:48} - latest-android-version-code: ${ANDROID_LATEST_VERSION_CODE:48} + latest-android: ${ANDROID_LATEST_VERSION:1.0.4} + min-android: ${ANDROID_MIN_VERSION:1.0.4} + min-android-version-code: ${ANDROID_MIN_VERSION_CODE:31} + latest-android-version-code: ${ANDROID_LATEST_VERSION_CODE:31} app-config-parameters: dgcParameters: testCertificateParameters:
corona-warn-app__cwa-server-406
"You will be provided with a partial code base and an issue statement explaining a problem to resolv(...TRUNCATED)
corona-warn-app/cwa-server
fd114fd04e36c36c8081e0286e3f3fd27170777e
"Aggregate File Creation: Skip packages if payload too small\nChange the aggregate file creation log(...TRUNCATED)
"Maybe combine with #140 \n**Alternative suggestion: Pad packages with random dummy keys if too smal(...TRUNCATED)
2020-06-01T17:31:01
"<patch>\ndiff --git a/README.md b/README.md\n--- a/README.md\n+++ b/README.md\n@@ -148,7 +148,7 @@ (...TRUNCATED)
"diff --git a/services/distribution/src/test/java/app/coronawarn/server/services/distribution/assemb(...TRUNCATED)
corona-warn-app__cwa-server-232
"You will be provided with a partial code base and an issue statement explaining a problem to resolv(...TRUNCATED)
corona-warn-app/cwa-server
9a5ae8bbf8872b63578dcca32b3258c012a63866
"Open MinIO read access\n## Current Implementation\r\nReceiving files from local MinIO requires acce(...TRUNCATED)
2020-05-21T13:53:01
"<patch>\ndiff --git a/.env b/.env\n--- a/.env\n+++ b/.env\n@@ -10,9 +10,9 @@ POSTGRES_PASSWORD=post(...TRUNCATED)
"diff --git a/services/distribution/src/test/resources/application.properties b/services/distributio(...TRUNCATED)
corona-warn-app__cwa-server-783
"You will be provided with a partial code base and an issue statement explaining a problem to resolv(...TRUNCATED)
corona-warn-app/cwa-server
3b67b75657b26418691e024e049af7f3494c787b
"Improve logging of the submission validation process\n<!--\r\nThanks for proposing an enhancement (...TRUNCATED)
2020-09-16T09:58:13
"<patch>\ndiff --git a/common/persistence/src/main/java/app/coronawarn/server/common/persistence/dom(...TRUNCATED)
"diff --git a/common/persistence/src/test/java/app/coronawarn/server/common/persistence/service/Diag(...TRUNCATED)
corona-warn-app__cwa-server-387
"You will be provided with a partial code base and an issue statement explaining a problem to resolv(...TRUNCATED)
corona-warn-app/cwa-server
db3d5faa1fe2702ef32ee0e3a965d0097c394df7
"Use typed client and entities for tan verification\n## Current Implementation\r\nThe current tan ve(...TRUNCATED)
"I like those suggestions. The introduction of a value object for a TAN is something I thought about(...TRUNCATED)
2020-05-30T17:08:20
"<patch>\ndiff --git a/THIRD-PARTY-NOTICES b/THIRD-PARTY-NOTICES\n--- a/THIRD-PARTY-NOTICES\n+++ b/T(...TRUNCATED)
"diff --git a/services/submission/src/test/java/app/coronawarn/server/services/submission/verificati(...TRUNCATED)
corona-warn-app__cwa-server-260
"You will be provided with a partial code base and an issue statement explaining a problem to resolv(...TRUNCATED)
corona-warn-app/cwa-server
218e0c75d3890fd6c1166fc63ce287f3b9d51fa7
"Exposure configuration parameters not validated\nThe exposure configuration parameters are currentl(...TRUNCATED)
2020-05-22T19:20:31
"<patch>\ndiff --git a/common/protocols/src/main/proto/app/coronawarn/server/common/protocols/intern(...TRUNCATED)
"diff --git a/services/distribution/src/test/java/app/coronawarn/server/services/distribution/assemb(...TRUNCATED)
corona-warn-app__cwa-server-441
"You will be provided with a partial code base and an issue statement explaining a problem to resolv(...TRUNCATED)
corona-warn-app/cwa-server
2165f162938409e6401c926d8643835a114ab887
"Application Configuration: Attenuation Duration Enhancements\nWe need two additional configuration (...TRUNCATED)
"@michael-burwig \nProposed .proto file:\r\n```\r\nsyntax = \"proto3\";\r\npackage app.coronawarn.se(...TRUNCATED)
2020-06-03T19:38:59
"<patch>\ndiff --git a/common/protocols/src/main/proto/app/coronawarn/server/common/protocols/intern(...TRUNCATED)
"diff --git a/services/distribution/src/test/java/app/coronawarn/server/services/distribution/assemb(...TRUNCATED)
corona-warn-app__cwa-server-541
"You will be provided with a partial code base and an issue statement explaining a problem to resolv(...TRUNCATED)
corona-warn-app/cwa-server
27ba812e04d6f842e15999adfbe388137b0c316b
"SSL: Set a profile to willingly decrease security\nCurrently, we have the profiles `ssl-server`, `s(...TRUNCATED)
2020-06-11T13:35:23
"<patch>\ndiff --git a/README.md b/README.md\n--- a/README.md\n+++ b/README.md\n@@ -113,12 +113,14 @(...TRUNCATED)
"diff --git a/services/submission/src/test/java/app/coronawarn/server/services/submission/ServerAppl(...TRUNCATED)
corona-warn-app__cwa-server-424
"You will be provided with a partial code base and an issue statement explaining a problem to resolv(...TRUNCATED)
corona-warn-app/cwa-server
2be284e0518658dcb7ef8d1df5515fd5f962e242
"Application Configuration: Add version update support\nWe would like to keep the mobile application(...TRUNCATED)
2020-06-02T19:03:56
"<patch>\ndiff --git a/common/protocols/src/main/proto/app/coronawarn/server/common/protocols/intern(...TRUNCATED)
"diff --git a/services/distribution/src/test/java/app/coronawarn/server/services/distribution/assemb(...TRUNCATED)

Dataset Card for "SWE-bench__style-3__fs-oracle"

More Information needed

Downloads last month
36
Edit dataset card