Merge branch 'develop' of github.com:scm-manager/scm-manager into develop
@@ -10,7 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Add repository export for Subversion ([#1488](https://github.com/scm-manager/scm-manager/pull/1488))
|
||||
- Provide more options for Helm chart ([#1485](https://github.com/scm-manager/scm-manager/pull/1485))
|
||||
- Option to create a permanent link to a source file ([#1489](https://github.com/scm-manager/scm-manager/pull/1489))
|
||||
- add markdown codeblock renderer extension point ([#1492](https://github.com/scm-manager/scm-manager/pull/1492))
|
||||
- Add markdown codeblock renderer extension point ([#1492](https://github.com/scm-manager/scm-manager/pull/1492))
|
||||
- Add Java version to plugin center url ([#1494](https://github.com/scm-manager/scm-manager/pull/1494))
|
||||
|
||||
## [2.12.0] - 2020-12-17
|
||||
### Added
|
||||
|
||||
|
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 255 KiB |
|
Before Width: | Height: | Size: 259 KiB After Width: | Height: | Size: 261 KiB |
|
Before Width: | Height: | Size: 300 KiB After Width: | Height: | Size: 349 KiB |
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 254 KiB |
|
Before Width: | Height: | Size: 256 KiB After Width: | Height: | Size: 258 KiB |
|
Before Width: | Height: | Size: 286 KiB After Width: | Height: | Size: 333 KiB |
2
pom.xml
@@ -919,7 +919,7 @@
|
||||
<servlet.version>3.1.0</servlet.version>
|
||||
|
||||
<jaxrs.version>2.1.1</jaxrs.version>
|
||||
<resteasy.version>4.5.8.Final</resteasy.version>
|
||||
<resteasy.version>4.5.8.SP1</resteasy.version>
|
||||
<jersey-client.version>1.19.4</jersey-client.version>
|
||||
<jackson.version>2.12.0</jackson.version>
|
||||
<guice.version>4.2.3</guice.version>
|
||||
|
||||
@@ -67,7 +67,7 @@ public class ScmConfiguration implements Configuration {
|
||||
* Default plugin url
|
||||
*/
|
||||
public static final String DEFAULT_PLUGINURL =
|
||||
"https://plugin-center-api.scm-manager.org/api/v1/plugins/{version}?os={os}&arch={arch}";
|
||||
"https://plugin-center-api.scm-manager.org/api/v1/plugins/{version}?os={os}&arch={arch}&jre={jre}";
|
||||
|
||||
/**
|
||||
* SCM Manager release feed url
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
package sonia.scm.util;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
@@ -94,6 +94,10 @@ public final class SystemUtil
|
||||
return platform.getName();
|
||||
}
|
||||
|
||||
public static String getJre() {
|
||||
return System.getProperty("java.version");
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
|
||||
@@ -86,6 +86,7 @@
|
||||
"error-message": "'me' ist nicht definiert"
|
||||
},
|
||||
"password": {
|
||||
"subtitle": "Passwort ändern",
|
||||
"label": "Passwort",
|
||||
"newPassword": "Neues Passwort",
|
||||
"currentPassword": "Aktuelles Passwort",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"setPermissions": {
|
||||
"button": "Berechtigungen speichern",
|
||||
"subtitle": "Berechtigungen setzen",
|
||||
"button": "Berechtigungen setzen",
|
||||
"setPermissionsSuccessful": "Berechtigungen erfolgreich gespeichert"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
}
|
||||
},
|
||||
"singleUserPassword": {
|
||||
"subtitle": "Passwort setzen",
|
||||
"button": "Passwort setzen",
|
||||
"setPasswordSuccessful": "Das Passwort wurde erfolgreich gespeichert."
|
||||
},
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
"error-message": "'me' is undefined"
|
||||
},
|
||||
"password": {
|
||||
"subtitle": "Change Password",
|
||||
"label": "Password",
|
||||
"newPassword": "New Password",
|
||||
"currentPassword": "Current Password",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"setPermissions": {
|
||||
"subtitle": "Set Permissions",
|
||||
"button": "Set Permissions",
|
||||
"setPermissionsSuccessful": "Permissions set successfully"
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
}
|
||||
},
|
||||
"singleUserPassword": {
|
||||
"subtitle": "Set Password",
|
||||
"button": "Set Password",
|
||||
"setPasswordSuccessful": "Password successfully set"
|
||||
},
|
||||
|
||||
@@ -28,7 +28,8 @@ import {
|
||||
Level,
|
||||
Notification,
|
||||
PasswordConfirmation,
|
||||
SubmitButton
|
||||
SubmitButton,
|
||||
Subtitle
|
||||
} from "@scm-manager/ui-components";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
import { Me } from "@scm-manager/ui-types";
|
||||
@@ -55,9 +56,6 @@ class ChangeUserPassword extends React.Component<Props, State> {
|
||||
oldPassword: "",
|
||||
password: "",
|
||||
loading: false,
|
||||
passwordConfirmationError: false,
|
||||
validatePasswordError: false,
|
||||
validatePassword: "",
|
||||
passwordChanged: false,
|
||||
passwordValid: false
|
||||
};
|
||||
@@ -127,6 +125,7 @@ class ChangeUserPassword extends React.Component<Props, State> {
|
||||
|
||||
return (
|
||||
<form onSubmit={this.submit}>
|
||||
<Subtitle subtitle={t("password.subtitle")} />
|
||||
{message}
|
||||
<div className="columns">
|
||||
<div className="column">
|
||||
|
||||
@@ -25,7 +25,7 @@ import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
import { Link } from "@scm-manager/ui-types";
|
||||
import { ErrorNotification, Level, Notification, SubmitButton } from "@scm-manager/ui-components";
|
||||
import { ErrorNotification, Level, Notification, SubmitButton, Subtitle } from "@scm-manager/ui-components";
|
||||
import { getLink } from "../../modules/indexResource";
|
||||
import { loadPermissionsForEntity, setPermissions } from "./handlePermissions";
|
||||
import PermissionsWrapper from "./PermissionsWrapper";
|
||||
@@ -134,6 +134,7 @@ class SetPermissions extends React.Component<Props, State> {
|
||||
|
||||
return (
|
||||
<form onSubmit={this.submit}>
|
||||
<Subtitle subtitle={t("setPermissions.subtitle")} />
|
||||
{message}
|
||||
{this.renderPermissions()}
|
||||
<Level
|
||||
|
||||
@@ -24,7 +24,14 @@
|
||||
import React from "react";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
import { User } from "@scm-manager/ui-types";
|
||||
import { ErrorNotification, Level, Notification, PasswordConfirmation, SubmitButton } from "@scm-manager/ui-components";
|
||||
import {
|
||||
ErrorNotification,
|
||||
Subtitle,
|
||||
Level,
|
||||
Notification,
|
||||
PasswordConfirmation,
|
||||
SubmitButton
|
||||
} from "@scm-manager/ui-components";
|
||||
import { setPassword } from "./setPassword";
|
||||
|
||||
type Props = WithTranslation & {
|
||||
@@ -46,9 +53,6 @@ class SetUserPassword extends React.Component<Props, State> {
|
||||
this.state = {
|
||||
password: "",
|
||||
loading: false,
|
||||
passwordConfirmationError: false,
|
||||
validatePasswordError: false,
|
||||
validatePassword: "",
|
||||
passwordChanged: false,
|
||||
passwordValid: false
|
||||
};
|
||||
@@ -85,14 +89,16 @@ class SetUserPassword extends React.Component<Props, State> {
|
||||
const { password } = this.state;
|
||||
this.setLoadingState();
|
||||
setPassword(user._links.password.href, password)
|
||||
.then(result => {
|
||||
.then((result) => {
|
||||
if (result.error) {
|
||||
this.setErrorState(result.error);
|
||||
} else {
|
||||
this.setSuccessfulState();
|
||||
}
|
||||
})
|
||||
.catch(err => {});
|
||||
.catch((err) => {
|
||||
this.setErrorState(err);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -116,6 +122,7 @@ class SetUserPassword extends React.Component<Props, State> {
|
||||
|
||||
return (
|
||||
<form onSubmit={this.submit}>
|
||||
<Subtitle subtitle={t("singleUserPassword.subtitle")} />
|
||||
{message}
|
||||
<PasswordConfirmation
|
||||
passwordChanged={this.passwordChanged}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
package sonia.scm.plugin;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
@@ -71,9 +71,11 @@ public class PluginCenter {
|
||||
private String buildPluginUrl(String url) {
|
||||
String os = HttpUtil.encode(SystemUtil.getOS());
|
||||
String arch = SystemUtil.getArch();
|
||||
String javaVersion = SystemUtil.getJre();
|
||||
return url.replace("{version}", context.getVersion())
|
||||
.replace("{os}", os)
|
||||
.replace("{arch}", arch);
|
||||
.replace("{arch}", arch)
|
||||
.replace("{jre}", javaVersion);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package sonia.scm.update.plugin;
|
||||
|
||||
import sonia.scm.config.ScmConfiguration;
|
||||
import sonia.scm.migration.UpdateStep;
|
||||
import sonia.scm.plugin.Extension;
|
||||
import sonia.scm.store.ConfigurationStore;
|
||||
import sonia.scm.store.ConfigurationStoreFactory;
|
||||
import sonia.scm.version.Version;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import static sonia.scm.util.Util.isEmpty;
|
||||
import static sonia.scm.version.Version.parse;
|
||||
|
||||
@Extension
|
||||
public class PluginCenterJreVersionUpdateStep implements UpdateStep {
|
||||
|
||||
private final ConfigurationStoreFactory configurationStoreFactory;
|
||||
|
||||
@Inject
|
||||
public PluginCenterJreVersionUpdateStep(ConfigurationStoreFactory configurationStoreFactory) {
|
||||
this.configurationStoreFactory = configurationStoreFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doUpdate() {
|
||||
ConfigurationStore<ScmConfiguration> configurationStore = configurationStoreFactory
|
||||
.withType(ScmConfiguration.class)
|
||||
.withName("config")
|
||||
.build();
|
||||
configurationStore.getOptional()
|
||||
.ifPresent(config -> appendJreVersionParameter(configurationStore, config));
|
||||
}
|
||||
|
||||
private void appendJreVersionParameter(ConfigurationStore<ScmConfiguration> configurationStore, ScmConfiguration config) {
|
||||
String oldPluginUrl = config.getPluginUrl();
|
||||
if (!isEmpty(oldPluginUrl) && oldPluginUrl.contains("?")&& oldPluginUrl.contains("?os={os}")) {
|
||||
config.setPluginUrl(oldPluginUrl + "&jre={jre}");
|
||||
configurationStore.set(config);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Version getTargetVersion() {
|
||||
return parse("2.0.1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAffectedDataType() {
|
||||
return "sonia.scm.plugin-center";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package sonia.scm.update.plugin;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import sonia.scm.config.ScmConfiguration;
|
||||
import sonia.scm.store.ConfigurationStore;
|
||||
import sonia.scm.store.InMemoryConfigurationStoreFactory;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static sonia.scm.config.ScmConfiguration.DEFAULT_PLUGINURL;
|
||||
|
||||
class PluginCenterJreVersionUpdateStepTest {
|
||||
|
||||
InMemoryConfigurationStoreFactory configurationStoreFactory = new InMemoryConfigurationStoreFactory();
|
||||
ConfigurationStore<ScmConfiguration> configurationStore = configurationStoreFactory.withType(ScmConfiguration.class).withName("config").build();
|
||||
|
||||
@Test
|
||||
void shouldKeepCustomPluginCenterUrl() {
|
||||
String customPluginUrl = "http://some.old/url";
|
||||
mockPluginUrl(customPluginUrl);
|
||||
|
||||
new PluginCenterJreVersionUpdateStep(configurationStoreFactory)
|
||||
.doUpdate();
|
||||
|
||||
assertThat(configurationStore.get().getPluginUrl()).isEqualTo(customPluginUrl);
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldUpdatePluginCenterUrlsWithQueryParameters() {
|
||||
String oldDefaultPluginUrl = "https://plugin-center-api.scm-manager.org/api/v1/plugins/{version}?os={os}&arch={arch}";
|
||||
mockPluginUrl(oldDefaultPluginUrl);
|
||||
|
||||
new PluginCenterJreVersionUpdateStep(configurationStoreFactory)
|
||||
.doUpdate();
|
||||
|
||||
assertThat(configurationStore.get().getPluginUrl()).isEqualTo(DEFAULT_PLUGINURL);
|
||||
}
|
||||
|
||||
private void mockPluginUrl(String pluginUrl) {
|
||||
ScmConfiguration scmConfiguration = new ScmConfiguration();
|
||||
scmConfiguration.setPluginUrl(pluginUrl);
|
||||
configurationStore.set(scmConfiguration);
|
||||
}
|
||||
|
||||
}
|
||||