From 64df54e6011af7f976549b9da41f5f0d318ab6e0 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Mon, 29 Jun 2020 13:57:43 +0200 Subject: [PATCH 1/5] fixes broken migration with an empty security.xml --- CHANGELOG.md | 1 + .../security/XmlSecurityV1UpdateStep.java | 5 ++-- .../security/XmlSecurityV1UpdateStepTest.java | 25 +++++++++++++---- .../scm/update/security/emptySecurityV1.xml | 28 +++++++++++++++++++ 4 files changed, 52 insertions(+), 7 deletions(-) create mode 100644 scm-webapp/src/test/resources/sonia/scm/update/security/emptySecurityV1.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index 09947917d0..5d101790c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed installation of debian packages on distros without preinstalled `at` ([#1216](https://github.com/scm-manager/scm-manager/issues/1216) and [#1217](https://github.com/scm-manager/scm-manager/pull/1217)) +- Fixed broken migration with empty security.xml ([#1219](https://github.com/scm-manager/scm-manager/issues/1219) and [#1221](https://github.com/scm-manager/scm-manager/pull/1221)) ## [2.1.1] - 2020-06-23 ### Fixed diff --git a/scm-webapp/src/main/java/sonia/scm/update/security/XmlSecurityV1UpdateStep.java b/scm-webapp/src/main/java/sonia/scm/update/security/XmlSecurityV1UpdateStep.java index 11d90712d1..11a4a17fac 100644 --- a/scm-webapp/src/main/java/sonia/scm/update/security/XmlSecurityV1UpdateStep.java +++ b/scm-webapp/src/main/java/sonia/scm/update/security/XmlSecurityV1UpdateStep.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - + package sonia.scm.update.security; import org.slf4j.Logger; @@ -44,6 +44,7 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import java.io.File; import java.nio.file.Path; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.function.Consumer; @@ -179,7 +180,7 @@ public class XmlSecurityV1UpdateStep implements UpdateStep { @XmlRootElement(name = "configuration") private static class V1Security { @XmlElement(name = "entry") - private List entries; + private List entries = new ArrayList<>(); } @XmlAccessorType(XmlAccessType.FIELD) diff --git a/scm-webapp/src/test/java/sonia/scm/update/security/XmlSecurityV1UpdateStepTest.java b/scm-webapp/src/test/java/sonia/scm/update/security/XmlSecurityV1UpdateStepTest.java index 559b181199..9dc506e919 100644 --- a/scm-webapp/src/test/java/sonia/scm/update/security/XmlSecurityV1UpdateStepTest.java +++ b/scm-webapp/src/test/java/sonia/scm/update/security/XmlSecurityV1UpdateStepTest.java @@ -43,6 +43,7 @@ import java.net.URL; import java.nio.file.Files; import java.nio.file.Path; import java.util.List; +import java.util.Map; import static java.util.stream.Collectors.toList; import static org.assertj.core.api.Assertions.assertThat; @@ -107,15 +108,17 @@ class XmlSecurityV1UpdateStepTest { @Nested class WithExistingSecurityXml { + private Path configDir; + @BeforeEach void createSecurityV1XML(@TempDir Path tempDir) throws IOException { - Path configDir = tempDir.resolve("config"); + configDir = tempDir.resolve("config"); Files.createDirectories(configDir); - copyTestDatabaseFile(configDir, "securityV1.xml"); } @Test - void shouldMapV1PermissionsFromSecurityV1XML() throws JAXBException { + void shouldMapV1PermissionsFromSecurityV1XML() throws IOException, JAXBException { + copyTestDatabaseFile(configDir, "securityV1.xml"); updateStep.doUpdate(); List assignedPermission = assignedPermissionStore.getAll().values() @@ -127,15 +130,27 @@ class XmlSecurityV1UpdateStepTest { assertThat(assignedPermission).contains("test"); } + @Test + void shouldNotFailOnEmptyV1SecurityXml() throws IOException, JAXBException { + copyTestDatabaseFile(configDir, "emptySecurityV1.xml", "securityV1.xml"); + updateStep.doUpdate(); + assertThat(assignedPermissionStore.getAll()).isEmpty(); + } + } private void copyTestDatabaseFile(Path configDir, String fileName) throws IOException { - URL url = Resources.getResource("sonia/scm/update/security/" + fileName); - Files.copy(url.openStream(), configDir.resolve(fileName)); + copyTestDatabaseFile(configDir, fileName, fileName); + } + + private void copyTestDatabaseFile(Path configDir, String sourceFileName, String targetFileName) throws IOException { + URL url = Resources.getResource("sonia/scm/update/security/" + sourceFileName); + Files.copy(url.openStream(), configDir.resolve(targetFileName)); } @Test void shouldNotFailForMissingConfigDir() throws JAXBException { updateStep.doUpdate(); + assertThat(assignedPermissionStore.getAll()).isEmpty(); } } diff --git a/scm-webapp/src/test/resources/sonia/scm/update/security/emptySecurityV1.xml b/scm-webapp/src/test/resources/sonia/scm/update/security/emptySecurityV1.xml new file mode 100644 index 0000000000..c6c16aee28 --- /dev/null +++ b/scm-webapp/src/test/resources/sonia/scm/update/security/emptySecurityV1.xml @@ -0,0 +1,28 @@ + + + + From 528432c2be357b1cac720e255ea87efa823a150d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= Date: Tue, 30 Jun 2020 07:48:36 +0200 Subject: [PATCH 2/5] Fix versions --- lerna.json | 2 +- scm-plugins/scm-git-plugin/package.json | 4 ++-- scm-plugins/scm-hg-plugin/package.json | 4 ++-- scm-plugins/scm-legacy-plugin/package.json | 4 ++-- scm-plugins/scm-svn-plugin/package.json | 4 ++-- scm-ui/ui-components/package.json | 2 +- scm-ui/ui-plugins/package.json | 4 ++-- scm-ui/ui-webapp/package.json | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lerna.json b/lerna.json index ffa2cdc5ad..e17c5bcb57 100644 --- a/lerna.json +++ b/lerna.json @@ -5,5 +5,5 @@ ], "npmClient": "yarn", "useWorkspaces": true, - "version": "2.1.1" + "version": "2.2.0-SNAPSHOT" } diff --git a/scm-plugins/scm-git-plugin/package.json b/scm-plugins/scm-git-plugin/package.json index f406d25659..846f96276c 100644 --- a/scm-plugins/scm-git-plugin/package.json +++ b/scm-plugins/scm-git-plugin/package.json @@ -1,7 +1,7 @@ { "name": "@scm-manager/scm-git-plugin", "private": true, - "version": "2.1.1", + "version": "2.2.0-SNAPSHOT", "license": "MIT", "main": "./src/main/js/index.ts", "scripts": { @@ -20,6 +20,6 @@ }, "prettier": "@scm-manager/prettier-config", "dependencies": { - "@scm-manager/ui-plugins": "^2.1.1" + "@scm-manager/ui-plugins": "^2.2.0-SNAPSHOT" } } diff --git a/scm-plugins/scm-hg-plugin/package.json b/scm-plugins/scm-hg-plugin/package.json index 8cd1e03641..b36c0e6f29 100644 --- a/scm-plugins/scm-hg-plugin/package.json +++ b/scm-plugins/scm-hg-plugin/package.json @@ -1,7 +1,7 @@ { "name": "@scm-manager/scm-hg-plugin", "private": true, - "version": "2.1.1", + "version": "2.2.0-SNAPSHOT", "license": "MIT", "main": "./src/main/js/index.ts", "scripts": { @@ -19,6 +19,6 @@ }, "prettier": "@scm-manager/prettier-config", "dependencies": { - "@scm-manager/ui-plugins": "^2.1.1" + "@scm-manager/ui-plugins": "^2.2.0-SNAPSHOT" } } diff --git a/scm-plugins/scm-legacy-plugin/package.json b/scm-plugins/scm-legacy-plugin/package.json index 1b9335e950..395f888c0f 100644 --- a/scm-plugins/scm-legacy-plugin/package.json +++ b/scm-plugins/scm-legacy-plugin/package.json @@ -1,7 +1,7 @@ { "name": "@scm-manager/scm-legacy-plugin", "private": true, - "version": "2.1.1", + "version": "2.2.0-SNAPSHOT", "license": "MIT", "main": "./src/main/js/index.tsx", "scripts": { @@ -19,6 +19,6 @@ }, "prettier": "@scm-manager/prettier-config", "dependencies": { - "@scm-manager/ui-plugins": "^2.1.1" + "@scm-manager/ui-plugins": "^2.2.0-SNAPSHOT" } } diff --git a/scm-plugins/scm-svn-plugin/package.json b/scm-plugins/scm-svn-plugin/package.json index 43854a0082..66b453d0a9 100644 --- a/scm-plugins/scm-svn-plugin/package.json +++ b/scm-plugins/scm-svn-plugin/package.json @@ -1,7 +1,7 @@ { "name": "@scm-manager/scm-svn-plugin", "private": true, - "version": "2.1.1", + "version": "2.2.0-SNAPSHOT", "license": "MIT", "main": "./src/main/js/index.ts", "scripts": { @@ -19,6 +19,6 @@ }, "prettier": "@scm-manager/prettier-config", "dependencies": { - "@scm-manager/ui-plugins": "^2.1.1" + "@scm-manager/ui-plugins": "^2.2.0-SNAPSHOT" } } diff --git a/scm-ui/ui-components/package.json b/scm-ui/ui-components/package.json index 7bbd35e789..60f9437650 100644 --- a/scm-ui/ui-components/package.json +++ b/scm-ui/ui-components/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/ui-components", - "version": "2.1.1", + "version": "2.2.0-SNAPSHOT", "description": "UI Components for SCM-Manager and its plugins", "main": "src/index.ts", "files": [ diff --git a/scm-ui/ui-plugins/package.json b/scm-ui/ui-plugins/package.json index 6ca49827fd..e48e8258b3 100644 --- a/scm-ui/ui-plugins/package.json +++ b/scm-ui/ui-plugins/package.json @@ -1,12 +1,12 @@ { "name": "@scm-manager/ui-plugins", - "version": "2.1.1", + "version": "2.2.0-SNAPSHOT", "license": "MIT", "bin": { "ui-plugins": "./bin/ui-plugins.js" }, "dependencies": { - "@scm-manager/ui-components": "^2.1.1", + "@scm-manager/ui-components": "^2.2.0-SNAPSHOT", "@scm-manager/ui-extensions": "^2.1.0", "classnames": "^2.2.6", "query-string": "^5.0.1", diff --git a/scm-ui/ui-webapp/package.json b/scm-ui/ui-webapp/package.json index c9aa79a570..ab7a419cd8 100644 --- a/scm-ui/ui-webapp/package.json +++ b/scm-ui/ui-webapp/package.json @@ -1,9 +1,9 @@ { "name": "@scm-manager/ui-webapp", - "version": "2.1.1", + "version": "2.2.0-SNAPSHOT", "private": true, "dependencies": { - "@scm-manager/ui-components": "^2.1.1", + "@scm-manager/ui-components": "^2.2.0-SNAPSHOT", "@scm-manager/ui-extensions": "^2.1.0", "classnames": "^2.2.5", "history": "^4.10.1", From 4438ff712a69d353a9d8ff95fdc9997e9d1f5777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= Date: Tue, 30 Jun 2020 08:01:06 +0200 Subject: [PATCH 3/5] Fix links --- README.md | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 543956310a..18836ccfd7 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ repositories over http. - Very easy installation - No need to hack configuration files, SCM-Manager is completely - configureable from its Web-Interface -- No Apache and no database installation is required + configurable from its Web-Interface +- No Apache and no database installation required - Central user, group and permission management - Out of the box support for Git, Mercurial and Subversion - Full RESTFul Web Service API (JSON and XML) @@ -19,34 +19,32 @@ repositories over http. - Useful plugins available - Licensed under the MIT-License -This branch (default) is for the development of SCM-Manager 2.x. If you are interested in the development of version 1.x, please checkout the 1.x branch. +This branch (`default`) is for the development of SCM-Manager 2.x. If you are interested in the development of version +1.x, please checkout the branch `support/1.x`. ## News -- **2018-09-25** - [SCM-Manager 2 gets a boost by Cloudogu - GmbH](https://www.scm-manager.org/scm-manager-2/scm-manager-2-gets-a-boost-by-cloudogu-gmbh/) -- **2018-05-04** - SCM-Manager 1.60 released - ([download](http://www.scm-manager.org/download/) \| - [release notes](release-notes.md)) -- **2018-04-11** - SCM-Manager 1.59 released - -[All news](http://www.scm-manager.org/news/) +All news regarding SCM-Manager will be published in our [blog](https://www.scm-manager.org/blog/). ## Mailing List - - [archive](http://groups.google.com/group/scmmanager) \| - [subscribe](mailto:scmmanager+subscribe@googlegroups.com) - \| + [subscribe](mailto:scmmanager+subscribe@googlegroups.com) \| [unsubscribe](mailto:scmmanager+unsubscribe@googlegroups.com) ## Documentation -You can find the complete documentation in the [docs/](docs/Home.md) directory. +You can find the complete documentation on our [homepage](https://www.scm-manager.org/docs/). ## Need help? -Looking for more guidance? Full documentation lives [in the SCM-Manager repository](https://github.com/scm-manager/scm-manager/blob/develop/docs/Home.md). Do you have further ideas or need support? +Looking for more guidance? Full documentation lives on our [homepage](https://www.scm-manager.org/docs/) or the +dedicated pages for our [plugins](https://www.scm-manager.org/plugins/). Do you have further ideas or need support? -- **Community Support** - Contact the SCM-Manager support team for questions about SCM-Manager, to report bugs or to request features through the official channels. [Find more about this here](https://www.scm-manager.org/support/). +- **Community Support** - Contact the SCM-Manager support team for questions about SCM-Manager, to report bugs or to + request features through the official channels. [Find more about this here](https://www.scm-manager.org/support/). -- **Enterprise Support** - Do you require support with the integration of SCM-Manager into your processes, with the customization of the tool or simply a service level agreement (SLA)? **Contact our development partner Cloudogu! Their team is looking forward to discussing your individual requirements with you and will be more than happy to give you a quote.** [Request Enterprise Support](https://cloudogu.com/en/scm-manager-enterprise/). +- **Enterprise Support** - Do you require support with the integration of SCM-Manager into your processes, with the + customization of the tool or simply a service level agreement (SLA)? **Contact our development partner Cloudogu! + Their team is looking forward to discussing your individual requirements with you and will be more than happy to + give you a quote.** [Request Enterprise Support](https://cloudogu.com/en/scm-manager-enterprise/). From f0aac8db117087d7fc4ed5cea9ca8d3f26190e0c Mon Sep 17 00:00:00 2001 From: Florian Scholdei <45232454+fscholdei@users.noreply.github.com> Date: Tue, 30 Jun 2020 09:20:11 +0200 Subject: [PATCH 4/5] Correct default develop branch in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 18836ccfd7..0a7fd405e6 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ repositories over http. - Useful plugins available - Licensed under the MIT-License -This branch (`default`) is for the development of SCM-Manager 2.x. If you are interested in the development of version +This branch (`develop`) is for the development of SCM-Manager 2.x. If you are interested in the development of version 1.x, please checkout the branch `support/1.x`. ## News From d26873f9c6366eaddf271a61f761db6a365e64ec Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Wed, 1 Jul 2020 07:09:51 +0200 Subject: [PATCH 5/5] adds missing architecture to debian installation documentation --- CHANGELOG.md | 1 + docs/en/installation/debian.md | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d101790c7..7eb88e6c62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed installation of debian packages on distros without preinstalled `at` ([#1216](https://github.com/scm-manager/scm-manager/issues/1216) and [#1217](https://github.com/scm-manager/scm-manager/pull/1217)) - Fixed broken migration with empty security.xml ([#1219](https://github.com/scm-manager/scm-manager/issues/1219) and [#1221](https://github.com/scm-manager/scm-manager/pull/1221)) +- Added missing architecture to debian installation documentation ([#1230](https://github.com/scm-manager/scm-manager/pull/1230)) ## [2.1.1] - 2020-06-23 ### Fixed diff --git a/docs/en/installation/debian.md b/docs/en/installation/debian.md index 79344139b3..fb4e7d0a06 100644 --- a/docs/en/installation/debian.md +++ b/docs/en/installation/debian.md @@ -9,7 +9,7 @@ displayToc: true The following code block will configure an apt repository for scm-manager and install it. ```bash -echo 'deb https://packages.scm-manager.org/repository/apt-v2-releases/ stable main' | sudo tee /etc/apt/sources.list.d/scm-manager.list +echo 'deb [arch=all] https://packages.scm-manager.org/repository/apt-v2-releases/ stable main' | sudo tee /etc/apt/sources.list.d/scm-manager.list sudo apt-key adv --recv-keys --keyserver hkps://keys.openpgp.org 0x975922F193B07D6E sudo apt-get update sudo apt-get install scm-server @@ -24,7 +24,7 @@ To install SCM-Manager as a debian package (.deb), we have to configure an apt r Create a file at `/etc/apt/sources.list.d/scm-manager.list` with the following content: ```text -deb https://packages.scm-manager.org/repository/apt-v2-releases/ stable main +deb [arch=all] https://packages.scm-manager.org/repository/apt-v2-releases/ stable main ``` This will add the apt repository of the scm-manager stable releases to the list of your apt repositories.