Skip to content

Commit 6e9962b

Browse files
committed
Rename packages to wazuh-indexer
1 parent 0e5d273 commit 6e9962b

26 files changed

+256
-256
lines changed

buildSrc/src/main/java/org/opensearch/gradle/internal/InternalDistributionArchiveSetupPlugin.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ private void configureGeneralTaskDefaults(Project project) {
156156
project.getTasks().withType(AbstractArchiveTask.class).configureEach(t -> {
157157
String subdir = archiveTaskToSubprojectName(t.getName());
158158
t.getDestinationDirectory().set(project.file(subdir + "/build/distributions"));
159-
t.getArchiveBaseName().set("opensearch-min");
159+
t.getArchiveBaseName().set("wazuh-indexer-min");
160160
});
161161
}
162162

buildSrc/src/main/java/org/opensearch/gradle/internal/InternalDistributionBwcSetupPlugin.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private void registerBwcArtifacts(Project bwcProject, DistributionProject distri
123123
String expandedDistConfiguration = "expanded-" + projectName;
124124
bwcProject.getConfigurations().create(expandedDistConfiguration);
125125
bwcProject.getArtifacts().add(expandedDistConfiguration, distributionProject.getExpandedDistDirectory(), artifact -> {
126-
artifact.setName("opensearch");
126+
artifact.setName("wazuh-indexer");
127127
artifact.builtBy(buildBwcTask);
128128
artifact.setType("directory");
129129
});
@@ -132,7 +132,7 @@ private void registerBwcArtifacts(Project bwcProject, DistributionProject distri
132132

133133
private void registerDistributionArchiveArtifact(Project bwcProject, DistributionProject distributionProject, String buildBwcTask) {
134134
String artifactFileName = distributionProject.getDistFile().getName();
135-
String artifactName = "opensearch";
135+
String artifactName = "wazuh-indexer";
136136

137137
String suffix = artifactFileName.endsWith("tar.gz") ? "tar.gz" : artifactFileName.substring(artifactFileName.length() - 3);
138138
int archIndex = artifactFileName.indexOf("x64");
@@ -248,12 +248,12 @@ private static class DistributionProject {
248248
if (version.onOrAfter("1.1.0")) {
249249
this.distFile = new File(
250250
checkoutDir,
251-
baseDir + "/" + name + "/build/distributions/opensearch-min-" + version + "-SNAPSHOT" + classifier + "." + extension
251+
baseDir + "/" + name + "/build/distributions/wazuh-indexer-min-" + version + "-SNAPSHOT" + classifier + "." + extension
252252
);
253253
} else {
254254
this.distFile = new File(
255255
checkoutDir,
256-
baseDir + "/" + name + "/build/distributions/opensearch-" + version + "-SNAPSHOT" + classifier + "." + extension
256+
baseDir + "/" + name + "/build/distributions/wazuh-indexer-" + version + "-SNAPSHOT" + classifier + "." + extension
257257
);
258258
}
259259
// we only ported this down to the 7.x branch.

distribution/build.gradle

+16-16
Original file line numberDiff line numberDiff line change
@@ -523,27 +523,27 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
523523
* <dt>path.conf</dt>
524524
* <dd>The default directory from which to load configuration. This is used in
525525
* the packaging scripts, but in that context it is always
526-
* /etc/opensearch. Its also used in bin/opensearch-plugin, where it is
527-
* /etc/opensearch for the os packages but $OPENSEARCH_HOME/config otherwise.</dd>
526+
* /etc/wazuh-indexer. Its also used in bin/opensearch-plugin, where it is
527+
* /etc/wazuh-indexer for the os packages but $OPENSEARCH_HOME/config otherwise.</dd>
528528
* <dt>path.env</dt>
529529
* <dd>The env file sourced before bin/opensearch to set environment
530-
* variables. Think /etc/defaults/opensearch.</dd>
530+
* variables. Think /etc/defaults/wazuh-indexer.</dd>
531531
* <dt>heap.min and heap.max</dt>
532532
* <dd>Default min and max heap</dd>
533533
* <dt>scripts.footer</dt>
534534
* <dd>Footer appended to control scripts embedded in the distribution that is
535535
* (almost) entirely there for cosmetic reasons.</dd>
536536
* <dt>stopping.timeout</dt>
537-
* <dd>RPM's init script needs to wait for opensearch to stop before
537+
* <dd>RPM's init script needs to wait for wazuh-indexer to stop before
538538
* returning from stop and it needs a maximum time to wait. This is it. One
539539
* day. DEB retries forever.</dd>
540540
* </dl>
541541
*/
542542
subprojects {
543543
ext.expansionsForDistribution = { distributionType, jdk ->
544544
final String defaultHeapSize = "1g"
545-
final String packagingPathData = "path.data: /var/lib/opensearch"
546-
final String pathLogs = "/var/log/opensearch"
545+
final String packagingPathData = "path.data: /var/lib/wazuh-indexer"
546+
final String pathLogs = "/var/log/wazuh-indexer"
547547
final String packagingPathLogs = "path.logs: ${pathLogs}"
548548
final String packagingLoggc = "${pathLogs}/gc.log"
549549

@@ -558,8 +558,8 @@ subprojects {
558558
'project.version': version,
559559

560560
'path.conf': [
561-
'deb': '/etc/opensearch',
562-
'rpm': '/etc/opensearch',
561+
'deb': '/etc/wazuh-indexer',
562+
'rpm': '/etc/wazuh-indexer',
563563
'def': '"$OPENSEARCH_HOME"/config'
564564
],
565565
'path.data': [
@@ -568,15 +568,15 @@ subprojects {
568568
'def': '#path.data: /path/to/data'
569569
],
570570
'path.env': [
571-
'deb': '/etc/default/opensearch',
572-
'rpm': '/etc/sysconfig/opensearch',
571+
'deb': '/etc/default/wazuh-indexer',
572+
'rpm': '/etc/sysconfig/wazuh-indexer',
573573
/* There isn't one of these files for tar or zip but its important to
574574
make an empty string here so the script can properly skip it. */
575575
'def': 'if [ -z "$OPENSEARCH_PATH_CONF" ]; then OPENSEARCH_PATH_CONF="$OPENSEARCH_HOME"/config; done',
576576
],
577577
'source.path.env': [
578-
'deb': 'source /etc/default/opensearch',
579-
'rpm': 'source /etc/sysconfig/opensearch',
578+
'deb': 'source /etc/default/wazuh-indexer',
579+
'rpm': 'source /etc/sysconfig/wazuh-indexer',
580580
'def': 'if [ -z "$OPENSEARCH_PATH_CONF" ]; then OPENSEARCH_PATH_CONF="$OPENSEARCH_HOME"/config; fi',
581581
],
582582
'path.logs': [
@@ -594,14 +594,14 @@ subprojects {
594594
'heap.max': defaultHeapSize,
595595

596596
'heap.dump.path': [
597-
'deb': "-XX:HeapDumpPath=/var/lib/opensearch",
598-
'rpm': "-XX:HeapDumpPath=/var/lib/opensearch",
597+
'deb': "-XX:HeapDumpPath=/var/lib/wazuh-indexer",
598+
'rpm': "-XX:HeapDumpPath=/var/lib/wazuh-indexer",
599599
'def': "-XX:HeapDumpPath=data"
600600
],
601601

602602
'error.file': [
603-
'deb': "-XX:ErrorFile=/var/log/opensearch/hs_err_pid%p.log",
604-
'rpm': "-XX:ErrorFile=/var/log/opensearch/hs_err_pid%p.log",
603+
'deb': "-XX:ErrorFile=/usr/share/wazuh-indexer/hs_err_pid%p.log",
604+
'rpm': "-XX:ErrorFile=/usr/share/wazuh-indexer/hs_err_pid%p.log",
605605
'def': "-XX:ErrorFile=logs/hs_err_pid%p.log"
606606
],
607607

distribution/docker/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ ext.expansions = { Architecture architecture, DockerBase base, boolean local ->
6060
classifier = "linux-\$(arch)"
6161
}
6262

63-
final String opensearch = "opensearch-min-${VersionProperties.getOpenSearch()}-${classifier}.tar.gz"
63+
final String opensearch = "wazuh-indexer-min-${VersionProperties.getOpenSearch()}-${classifier}.tar.gz"
6464

6565
/* Both the following Dockerfile commands put the resulting artifact at
6666
* the same location, regardless of classifier, so that the commands that

distribution/docker/docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ services:
1818
- node.store.allow_mmap=false
1919
volumes:
2020
- ./build/repo:/tmp/opensearch-repo
21-
- ./build/logs/1:/usr/share/opensearch/logs
21+
- ./build/logs/1:/usr/share/wazuh-indexer/logs
2222
ports:
2323
- "9200"
2424
ulimits:
@@ -42,7 +42,7 @@ services:
4242
- node.store.allow_mmap=false
4343
volumes:
4444
- ./build/repo:/tmp/opensearch-repo
45-
- ./build/logs/2:/usr/share/opensearch/logs
45+
- ./build/logs/2:/usr/share/wazuh-indexer/logs
4646
ports:
4747
- "9200"
4848
ulimits:
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
set -e -o pipefail
33

4-
cd /usr/share/opensearch/bin/
4+
cd /usr/share/wazuh-indexer/bin/
55

6-
/usr/local/bin/docker-entrypoint.sh | tee > /usr/share/opensearch/logs/console.log
6+
/usr/local/bin/docker-entrypoint.sh | tee > /usr/share/wazuh-indexer/logs/console.log

distribution/docker/src/docker/Dockerfile

+12-12
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ RUN set -eux ; \\
4040
mv \${tini_bin} /tini ; \\
4141
chmod +x /tini
4242
43-
RUN mkdir /usr/share/opensearch
44-
WORKDIR /usr/share/opensearch
43+
RUN mkdir /usr/share/wazuh-indexer
44+
WORKDIR /usr/share/wazuh-indexer
4545
4646
${source_opensearch}
4747
4848
RUN tar zxf /opt/opensearch.tar.gz --strip-components=1
49-
RUN sed -i -e 's/OPENSEARCH_DISTRIBUTION_TYPE=tar/OPENSEARCH_DISTRIBUTION_TYPE=docker/' /usr/share/opensearch/bin/opensearch-env
49+
RUN sed -i -e 's/OPENSEARCH_DISTRIBUTION_TYPE=tar/OPENSEARCH_DISTRIBUTION_TYPE=docker/' /usr/share/wazuh-indexer/bin/opensearch-env
5050
RUN mkdir -p config config/jvm.options.d data logs
5151
RUN chmod 0775 config config/jvm.options.d data logs
5252
COPY config/opensearch.yml config/log4j2.properties config/
@@ -74,27 +74,27 @@ RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-* && \\
7474
done; \\
7575
(exit \$exit_code)
7676
77-
RUN groupadd -g 1000 opensearch && \\
78-
adduser -u 1000 -g 1000 -G 0 -d /usr/share/opensearch opensearch && \\
79-
chmod 0775 /usr/share/opensearch && \\
80-
chown -R 1000:0 /usr/share/opensearch
77+
RUN groupadd -g 1000 wazuh-indexer && \\
78+
adduser -u 1000 -g 1000 -G 0 -d /usr/share/wazuh-indexer wazuh-indexer && \\
79+
chmod 0775 /usr/share/wazuh-indexer && \\
80+
chown -R 1000:0 /usr/share/wazuh-indexer
8181
82-
WORKDIR /usr/share/opensearch
83-
COPY --from=builder --chown=1000:0 /usr/share/opensearch /usr/share/opensearch
82+
WORKDIR /usr/share/wazuh-indexer
83+
COPY --from=builder --chown=1000:0 /usr/share/wazuh-indexer /usr/share/wazuh-indexer
8484
COPY --from=builder --chown=0:0 /tini /tini
8585
8686
# Replace OpenJDK's built-in CA certificate keystore with the one from the OS
8787
# vendor. The latter is superior in several ways.
8888
# REF: https://github.com/elastic/elasticsearch-docker/issues/171
89-
RUN ln -sf /etc/pki/ca-trust/extracted/java/cacerts /usr/share/opensearch/jdk/lib/security/cacerts
89+
RUN ln -sf /etc/pki/ca-trust/extracted/java/cacerts /usr/share/wazuh-indexer/jdk/lib/security/cacerts
9090

91-
ENV PATH /usr/share/opensearch/bin:\$PATH
91+
ENV PATH /usr/share/wazuh-indexer/bin:\$PATH
9292

9393
COPY bin/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
9494

9595
# The JDK's directories' permissions don't allow `java` to be executed under a different
9696
# group to the default. Fix this.
97-
RUN find /usr/share/opensearch/jdk -type d -exec chmod 0755 '{}' \\; && \\
97+
RUN find /usr/share/wazuh-indexer/jdk -type d -exec chmod 0755 '{}' \\; && \\
9898
chmod g=u /etc/passwd && \\
9999
chmod 0775 /usr/local/bin/docker-entrypoint.sh
100100

distribution/docker/src/docker/bin/docker-entrypoint.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ fi
4646
# This is also sourced in opensearch-env, and is only needed here
4747
# as well because we use ELASTIC_PASSWORD below. Sourcing this script
4848
# is idempotent.
49-
source /usr/share/opensearch/bin/opensearch-env-from-file
49+
source /usr/share/wazuh-indexer/bin/opensearch-env-from-file
5050

5151
if [[ -f bin/opensearch-users ]]; then
5252
# Check for the ELASTIC_PASSWORD environment variable to set the
@@ -56,7 +56,7 @@ if [[ -f bin/opensearch-users ]]; then
5656
# enabled, but we have no way of knowing which node we are yet. We'll just
5757
# honor the variable if it's present.
5858
if [[ -n "$ELASTIC_PASSWORD" ]]; then
59-
[[ -f /usr/share/opensearch/config/opensearch.keystore ]] || (run_as_other_user_if_needed opensearch-keystore create)
59+
[[ -f /usr/share/wazuh-indexer/config/opensearch.keystore ]] || (run_as_other_user_if_needed opensearch-keystore create)
6060
if ! (run_as_other_user_if_needed opensearch-keystore has-passwd --silent) ; then
6161
# keystore is unencrypted
6262
if ! (run_as_other_user_if_needed opensearch-keystore list | grep -q '^bootstrap.password$'); then
@@ -76,8 +76,8 @@ fi
7676
if [[ "$(id -u)" == "0" ]]; then
7777
# If requested and running as root, mutate the ownership of bind-mounts
7878
if [[ -n "$TAKE_FILE_OWNERSHIP" ]]; then
79-
chown -R 1000:0 /usr/share/opensearch/{data,logs}
79+
chown -R 1000:0 /usr/share/wazuh-indexer/{data,logs}
8080
fi
8181
fi
8282

83-
run_as_other_user_if_needed /usr/share/opensearch/bin/opensearch <<<"$KEYSTORE_PASSWORD"
83+
run_as_other_user_if_needed /usr/share/wazuh-indexer/bin/opensearch <<<"$KEYSTORE_PASSWORD"

0 commit comments

Comments
 (0)