Skip to content

Commit 217d090

Browse files
committed
Merge branch 'master' into ccr
* master: Fix message content in users tool (#30293) [DOCS] Fixes links to breaking changes [DOCS] Adds new installation package details (#29590) Revert "Build: Move gradle wrapper jar to a dot dir (#30146)"
2 parents eb4281e + 66daaaa commit 217d090

File tree

15 files changed

+85
-48
lines changed

15 files changed

+85
-48
lines changed

build.gradle

+18-11
Original file line numberDiff line numberDiff line change
@@ -440,18 +440,25 @@ task run(type: Run) {
440440
impliesSubProjects = true
441441
}
442442

443-
task wrapper(type: Wrapper) {
444-
distributionType = DistributionType.ALL
445-
jarFile = file('.gradle-wrapper/gradle-wrapper.jar')
446-
doLast {
447-
final DistributionLocator locator = new DistributionLocator()
448-
final GradleVersion version = GradleVersion.version(gradleVersion)
449-
final URI distributionUri = locator.getDistributionFor(version, distributionType.name().toLowerCase(Locale.ENGLISH))
450-
final URI sha256Uri = new URI(distributionUri.toString() + ".sha256")
451-
final String sha256Sum = new String(sha256Uri.toURL().bytes)
452-
final String existingProperties = getPropertiesFile().getText('UTF-8')
453-
getPropertiesFile().setText("${existingProperties}distributionSha256Sum=${sha256Sum}\n", 'UTF-8')
443+
task wrapper(type: Wrapper)
444+
445+
gradle.projectsEvaluated {
446+
447+
allprojects {
448+
tasks.withType(Wrapper) { Wrapper wrapper ->
449+
wrapper.distributionType = DistributionType.ALL
450+
451+
wrapper.doLast {
452+
final DistributionLocator locator = new DistributionLocator()
453+
final GradleVersion version = GradleVersion.version(wrapper.gradleVersion)
454+
final URI distributionUri = locator.getDistributionFor(version, wrapper.distributionType.name().toLowerCase(Locale.ENGLISH))
455+
final URI sha256Uri = new URI(distributionUri.toString() + ".sha256")
456+
final String sha256Sum = new String(sha256Uri.toURL().bytes)
457+
wrapper.getPropertiesFile() << "distributionSha256Sum=${sha256Sum}\n"
458+
}
459+
}
454460
}
461+
455462
}
456463

457464
static void assertLinesInFile(final Path path, final List<String> expectedLines) {

docs/reference/setup/install.asciidoc

+1-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ Elasticsearch on Windows. MSIs may be downloaded from the Elasticsearch website.
3838
`docker`::
3939

4040
Images are available for running Elasticsearch as Docker containers. They may be
41-
downloaded from the Elastic Docker Registry. The default image ships with
42-
{xpack-ref}/index.html[X-Pack] pre-installed.
41+
downloaded from the Elastic Docker Registry.
4342
+
4443
{ref}/docker.html[Install {es} with Docker]
4544

docs/reference/setup/install/deb.asciidoc

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
=== Install Elasticsearch with Debian Package
33

44
The Debian package for Elasticsearch can be <<install-deb,downloaded from our website>>
5-
or from our <<deb-repo,APT repository>>. It can be used to install
5+
or from our <<deb-repo,APT repository>>. It can be used to install
66
Elasticsearch on any Debian-based system such as Debian and Ubuntu.
77

8+
include::license.asciidoc[]
9+
810
The latest stable version of Elasticsearch can be found on the
911
link:/downloads/elasticsearch[Download Elasticsearch] page. Other versions can
1012
be found on the link:/downloads/past-releases[Past Releases page].
@@ -125,6 +127,10 @@ sudo dpkg -i elasticsearch-{version}.deb
125127
--------------------------------------------
126128
<1> Compares the SHA of the downloaded Debian package and the published checksum, which should output
127129
`elasticsearch-{version}.deb: OK`.
130+
131+
Alternatively, you can download the following package, which contains only
132+
features that are available under the Apache 2.0 license:
133+
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-{version}.deb
128134

129135
endif::[]
130136

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
This package is free to use under the Elastic license. It contains open source
2+
and free commercial features and access to paid commercial features.
3+
{stack-ov}/license-management.html[Start a 30-day trial] to try out all of the
4+
paid commercial features. See the
5+
https://www.elastic.co/subscriptions[Subscriptions] page for information about
6+
Elastic license levels.

docs/reference/setup/install/rpm.asciidoc

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ and Oracle Enterprise.
99
NOTE: RPM install is not supported on distributions with old versions of RPM,
1010
such as SLES 11 and CentOS 5. Please see <<zip-targz>> instead.
1111

12+
include::license.asciidoc[]
13+
1214
The latest stable version of Elasticsearch can be found on the
1315
link:/downloads/elasticsearch[Download Elasticsearch] page. Other versions can
1416
be found on the link:/downloads/past-releases[Past Releases page].
@@ -110,6 +112,10 @@ sudo rpm --install elasticsearch-{version}.rpm
110112
--------------------------------------------
111113
<1> Compares the SHA of the downloaded RPM and the published checksum, which should output
112114
`elasticsearch-{version}.rpm: OK`.
115+
116+
Alternatively, you can download the following package, which contains only
117+
features that are available under the Apache 2.0 license:
118+
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-{version}.rpm
113119

114120
endif::[]
115121

docs/reference/setup/install/windows.asciidoc

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ the included `elasticsearch.exe` executable.
1010
TIP: Elasticsearch has historically been installed on Windows using the <<zip-windows, .zip>> archive.
1111
You can continue using the `.zip` approach if you prefer.
1212

13+
include::license.asciidoc[]
14+
1315
The latest stable version of Elasticsearch can be found on the
1416
link:/downloads/elasticsearch[Download Elasticsearch] page.
1517
Other versions can be found on the
@@ -32,6 +34,10 @@ ifeval::["{release-state}"!="unreleased"]
3234

3335
Download the `.msi` package for Elasticsearch v{version} from https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.msi
3436

37+
Alternatively, you can download the following package, which contains only
38+
features that are available under the Apache 2.0 license:
39+
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-{version}.msi
40+
3541
endif::[]
3642

3743
[[install-msi-gui]]

docs/reference/setup/install/zip-targz.asciidoc

+10
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Elasticsearch is provided as a `.zip` and as a `.tar.gz` package. These
55
packages can be used to install Elasticsearch on any system and are the
66
easiest package format to use when trying out Elasticsearch.
77

8+
include::license.asciidoc[]
9+
810
The latest stable version of Elasticsearch can be found on the
911
link:/downloads/elasticsearch[Download Elasticsearch] page.
1012
Other versions can be found on the
@@ -40,6 +42,10 @@ cd elasticsearch-{version}/ <2>
4042
`elasticsearch-{version}.zip: OK`.
4143
<2> This directory is known as `$ES_HOME`.
4244

45+
Alternatively, you can download the following package, which contains only
46+
features that are available under the Apache 2.0 license:
47+
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-{version}.zip
48+
4349
endif::[]
4450

4551

@@ -68,6 +74,10 @@ cd elasticsearch-{version}/ <2>
6874
`elasticsearch-{version}.tar.gz: OK`.
6975
<2> This directory is known as `$ES_HOME`.
7076

77+
Alternatively, you can download the following package, which includes only
78+
Apache 2.0 licensed code:
79+
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-{version}.tar.gz
80+
7181
endif::[]
7282

7383
ifdef::include-xpack[]

docs/reference/setup/install/zip-windows.asciidoc

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ TIP: Elasticsearch has historically been installed on Windows using the `.zip` a
99
An <<windows, MSI installer package>> is available that provides the easiest getting started
1010
experience for Windows. You can continue using the `.zip` approach if you prefer.
1111

12+
include::license.asciidoc[]
13+
1214
The latest stable version of Elasticsearch can be found on the
1315
link:/downloads/elasticsearch[Download Elasticsearch] page.
1416
Other versions can be found on the
@@ -31,6 +33,10 @@ ifeval::["{release-state}"!="unreleased"]
3133

3234
Download the `.zip` archive for Elasticsearch v{version} from: https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.zip
3335

36+
Alternatively, you can download the following package, which contains only
37+
features that are available under the Apache 2.0 license:
38+
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-{version}.zip
39+
3440
Unzip it with your favourite unzip tool. This will create a folder called
3541
+elasticsearch-{version}+, which we will refer to as `%ES_HOME%`. In a terminal
3642
window, `cd` to the `%ES_HOME%` directory, for instance:
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
12
distributionBase=GRADLE_USER_HOME
23
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
4-
zipStoreBase=GRADLE_USER_HOME
54
zipStorePath=wrapper/dists
5+
zipStoreBase=GRADLE_USER_HOME
66
distributionSha256Sum=203f4537da8b8075e38c036a6d14cb71b1149de5bf0a8f6db32ac2833a1d1294

gradlew

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ case "`uname`" in
6464
;;
6565
esac
6666

67-
CLASSPATH=$APP_HOME/.gradle-wrapper/gradle-wrapper.jar
67+
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
6868

6969
# Determine the Java command to use to start the JVM.
7070
if [ -n "$JAVA_HOME" ] ; then

gradlew.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ set CMD_LINE_ARGS=%*
6363
:execute
6464
@rem Setup the command line
6565

66-
set CLASSPATH=%APP_HOME%\.gradle-wrapper\gradle-wrapper.jar
66+
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
6767

6868
@rem Execute Gradle
6969
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

x-pack/docs/en/release-notes/xpack-breaking.asciidoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ your application from one version of {xpack} to another.
1212
See also:
1313

1414
* <<breaking-changes,{es} Breaking Changes>>
15-
* {kibana-ref}/breaking-changes-xkb.html[{kib} {xpack} Breaking Changes]
16-
* {logstash-ref}/breaking-changes-xls.html[Logstash {xpack} Breaking Changes]
15+
* {kibana-ref}/breaking-changes.html[{kib} Breaking Changes]
16+
* {logstash-ref}/breaking-changes.html[Logstash Breaking Changes]
1717

1818
--
1919

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/file/tool/UsersTool.java

+15-24
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@
1717
import org.elasticsearch.common.settings.Settings;
1818
import org.elasticsearch.common.util.set.Sets;
1919
import org.elasticsearch.env.Environment;
20-
import org.elasticsearch.xpack.core.XPackField;
2120
import org.elasticsearch.xpack.core.XPackSettings;
2221
import org.elasticsearch.xpack.core.security.authc.support.Hasher;
23-
import org.elasticsearch.xpack.security.authz.store.FileRolesStore;
2422
import org.elasticsearch.xpack.core.security.authz.store.ReservedRolesStore;
2523
import org.elasticsearch.xpack.core.security.support.Validation;
2624
import org.elasticsearch.xpack.core.security.support.Validation.Users;
2725
import org.elasticsearch.xpack.security.authc.file.FileUserPasswdStore;
2826
import org.elasticsearch.xpack.security.authc.file.FileUserRolesStore;
27+
import org.elasticsearch.xpack.security.authz.store.FileRolesStore;
2928
import org.elasticsearch.xpack.security.support.FileAttributesChecker;
3029

3130
import java.nio.file.Files;
@@ -47,7 +46,7 @@ public static void main(String[] args) throws Exception {
4746
}
4847

4948
UsersTool() {
50-
super("Manages elasticsearch native users");
49+
super("Manages elasticsearch file users");
5150
subcommands.put("useradd", newAddUserCommand());
5251
subcommands.put("userdel", newDeleteUserCommand());
5352
subcommands.put("passwd", newPasswordCommand());
@@ -82,7 +81,7 @@ static class AddUserCommand extends EnvironmentAwareCommand {
8281
private final OptionSpec<String> arguments;
8382

8483
AddUserCommand() {
85-
super("Adds a native user");
84+
super("Adds a file user");
8685

8786
this.passwordOption = parser.acceptsAll(Arrays.asList("p", "password"),
8887
"The user password")
@@ -96,11 +95,8 @@ static class AddUserCommand extends EnvironmentAwareCommand {
9695
@Override
9796
protected void printAdditionalHelp(Terminal terminal) {
9897
terminal.println("Adds a file based user to elasticsearch (via internal realm). The user will");
99-
terminal.println("be added to the users file and its roles will be added to the");
100-
terminal.println("users_roles file. If non-default files are used (different file");
101-
terminal.println("locations are configured in elasticsearch.yml) the appropriate files");
102-
terminal.println("will be resolved from the settings and the user and its roles will be");
103-
terminal.println("added to them.");
98+
terminal.println("be added to the \"users\" file and its roles will be added to the");
99+
terminal.println("\"users_roles\" file in the elasticsearch config directory.");
104100
terminal.println("");
105101
}
106102

@@ -123,7 +119,7 @@ protected void execute(Terminal terminal, OptionSet options, Environment env) th
123119

124120
Map<String, char[]> users = FileUserPasswdStore.parseFile(passwordFile, null, env.settings());
125121
if (users == null) {
126-
throw new UserException(ExitCodes.CONFIG, "Configuration file [users] is missing");
122+
throw new UserException(ExitCodes.CONFIG, "Configuration file [" + passwordFile + "] is missing");
127123
}
128124
if (users.containsKey(username)) {
129125
throw new UserException(ExitCodes.CODE_ERROR, "User [" + username + "] already exists");
@@ -155,11 +151,8 @@ static class DeleteUserCommand extends EnvironmentAwareCommand {
155151
@Override
156152
protected void printAdditionalHelp(Terminal terminal) {
157153
terminal.println("Removes an existing file based user from elasticsearch. The user will be");
158-
terminal.println("removed from the users file and its roles will be removed from the");
159-
terminal.println("users_roles file. If non-default files are used (different file");
160-
terminal.println("locations are configured in elasticsearch.yml) the appropriate files");
161-
terminal.println("will be resolved from the settings and the user and its roles will be");
162-
terminal.println("removed from them.");
154+
terminal.println("removed from the \"users\" file and its roles will be removed from the");
155+
terminal.println("\"users_roles\" file in the elasticsearch config directory.");
163156
terminal.println("");
164157
}
165158

@@ -173,7 +166,7 @@ protected void execute(Terminal terminal, OptionSet options, Environment env) th
173166

174167
Map<String, char[]> users = FileUserPasswdStore.parseFile(passwordFile, null, env.settings());
175168
if (users == null) {
176-
throw new UserException(ExitCodes.CONFIG, "Configuration file [users] is missing");
169+
throw new UserException(ExitCodes.CONFIG, "Configuration file [" + passwordFile + "] is missing");
177170
}
178171
if (users.containsKey(username) == false) {
179172
throw new UserException(ExitCodes.NO_USER, "User [" + username + "] doesn't exist");
@@ -213,12 +206,10 @@ static class PasswordCommand extends EnvironmentAwareCommand {
213206

214207
@Override
215208
protected void printAdditionalHelp(Terminal terminal) {
216-
terminal.println("The passwd command changes passwords for files based users. The tool");
209+
terminal.println("The passwd command changes passwords for file based users. The tool");
217210
terminal.println("prompts twice for a replacement password. The second entry is compared");
218211
terminal.println("against the first and both are required to match in order for the");
219-
terminal.println("password to be changed. If non-default users file is used (a different");
220-
terminal.println("file location is configured in elasticsearch.yml) the appropriate file");
221-
terminal.println("will be resolved from the settings.");
212+
terminal.println("password to be changed.");
222213
terminal.println("");
223214
}
224215

@@ -232,7 +223,7 @@ protected void execute(Terminal terminal, OptionSet options, Environment env) th
232223
FileAttributesChecker attributesChecker = new FileAttributesChecker(file);
233224
Map<String, char[]> users = new HashMap<>(FileUserPasswdStore.parseFile(file, null, env.settings()));
234225
if (users == null) {
235-
throw new UserException(ExitCodes.CONFIG, "Configuration file [users] is missing");
226+
throw new UserException(ExitCodes.CONFIG, "Configuration file [" + file + "] is missing");
236227
}
237228
if (users.containsKey(username) == false) {
238229
throw new UserException(ExitCodes.NO_USER, "User [" + username + "] doesn't exist");
@@ -345,19 +336,19 @@ static void listUsersAndRoles(Terminal terminal, Environment env, String usernam
345336
Path userRolesFilePath = FileUserRolesStore.resolveFile(env);
346337
Map<String, String[]> userRoles = FileUserRolesStore.parseFile(userRolesFilePath, null);
347338
if (userRoles == null) {
348-
throw new UserException(ExitCodes.CONFIG, "Configuration file [users_roles] is missing");
339+
throw new UserException(ExitCodes.CONFIG, "Configuration file [" + userRolesFilePath + "] is missing");
349340
}
350341

351342
Path userFilePath = FileUserPasswdStore.resolveFile(env);
352343
Map<String, char[]> users = FileUserPasswdStore.parseFile(userFilePath, null, env.settings());
353344
if (users == null) {
354-
throw new UserException(ExitCodes.CONFIG, "Configuration file [users] is missing");
345+
throw new UserException(ExitCodes.CONFIG, "Configuration file [" + userFilePath + "] is missing");
355346
}
356347

357348
Path rolesFilePath = FileRolesStore.resolveFile(env);
358349
Set<String> knownRoles = Sets.union(FileRolesStore.parseFileForRoleNames(rolesFilePath, null), ReservedRolesStore.names());
359350
if (knownRoles == null) {
360-
throw new UserException(ExitCodes.CONFIG, "Configuration file [roles.xml] is missing");
351+
throw new UserException(ExitCodes.CONFIG, "Configuration file [" + rolesFilePath + "] is missing");
361352
}
362353

363354
if (username != null) {

x-pack/qa/security-tools-tests/src/test/java/org/elasticsearch/xpack/security/authc/file/tool/UsersToolTests.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ public void testUserAddNoConfig() throws Exception {
499499
execute("useradd", pathHomeParameter, fileTypeParameter, "username", "-p", SecuritySettingsSourceField.TEST_PASSWORD);
500500
});
501501
assertEquals(ExitCodes.CONFIG, e.exitCode);
502-
assertThat(e.getMessage(), containsString("Configuration file [users] is missing"));
502+
assertThat(e.getMessage(), containsString("Configuration file [eshome/config/users] is missing"));
503503
}
504504

505505
public void testUserListNoConfig() throws Exception {
@@ -511,7 +511,7 @@ public void testUserListNoConfig() throws Exception {
511511
execute("list", pathHomeParameter, fileTypeParameter);
512512
});
513513
assertEquals(ExitCodes.CONFIG, e.exitCode);
514-
assertThat(e.getMessage(), containsString("Configuration file [users] is missing"));
514+
assertThat(e.getMessage(), containsString("Configuration file [eshome/config/users] is missing"));
515515
}
516516

517517
public void testUserDelNoConfig() throws Exception {
@@ -523,7 +523,7 @@ public void testUserDelNoConfig() throws Exception {
523523
execute("userdel", pathHomeParameter, fileTypeParameter, "username");
524524
});
525525
assertEquals(ExitCodes.CONFIG, e.exitCode);
526-
assertThat(e.getMessage(), containsString("Configuration file [users] is missing"));
526+
assertThat(e.getMessage(), containsString("Configuration file [eshome/config/users] is missing"));
527527
}
528528

529529
public void testListUserRolesNoConfig() throws Exception {
@@ -535,6 +535,6 @@ public void testListUserRolesNoConfig() throws Exception {
535535
execute("roles", pathHomeParameter, fileTypeParameter, "username");
536536
});
537537
assertEquals(ExitCodes.CONFIG, e.exitCode);
538-
assertThat(e.getMessage(), containsString("Configuration file [users_roles] is missing"));
538+
assertThat(e.getMessage(), containsString("Configuration file [eshome/config/users_roles] is missing"));
539539
}
540540
}

0 commit comments

Comments
 (0)