View | Details | Raw Unified | Return to bug 257558
Collapse All | Expand All

(-)b/GIDs (-2 / +2 lines)
Lines 795-801 cassandra:*:851: Link Here
795
p0f:*:852:
795
p0f:*:852:
796
_geodns:*:853:
796
_geodns:*:853:
797
ebusd:*:854:
797
ebusd:*:854:
798
# free: 855
798
opensearch:*:855:
799
# free: 856
799
# free: 856
800
# free: 857
800
# free: 857
801
# free: 858
801
# free: 858
Lines 906-912 fluentd:*:963: Link Here
906
git_daemon:*:964:
906
git_daemon:*:964:
907
elasticsearch:*:965:
907
elasticsearch:*:965:
908
ossec:*:966:
908
ossec:*:966:
909
# free: 967
909
opensearch:*:967:
910
# free: 968
910
# free: 968
911
kippo:*:969:
911
kippo:*:969:
912
colord:*:970:
912
colord:*:970:
(-)b/UIDs (-1 / +1 lines)
Lines 800-806 cassandra:*:851:851::0:0:Cassandra DB Daemon User:/var/db/cassandra:/usr/sbin/no Link Here
800
p0f:*:852:852::0:0:p0f unprivileged user:/var/empty:/usr/sbin/nologin
800
p0f:*:852:852::0:0:p0f unprivileged user:/var/empty:/usr/sbin/nologin
801
_geodns:*:853:853::0:0:GeoDNS User:/var/empty:/usr/sbin/nologin
801
_geodns:*:853:853::0:0:GeoDNS User:/var/empty:/usr/sbin/nologin
802
ebusd:*:854:854::0:0:eBUS Daemon user:/nonexistent:/usr/sbin/nologin
802
ebusd:*:854:854::0:0:eBUS Daemon user:/nonexistent:/usr/sbin/nologin
803
# free: 855
803
opensearch:*:855:855::0:0:opensearch user:/nonexistent:/usr/sbin/nologin
804
# free: 856
804
# free: 856
805
# free: 857
805
# free: 857
806
# free: 858
806
# free: 858
(-)b/textproc/Makefile (+1 lines)
Lines 481-486 Link Here
481
    SUBDIR += odt2txt
481
    SUBDIR += odt2txt
482
    SUBDIR += openfts
482
    SUBDIR += openfts
483
    SUBDIR += openjade
483
    SUBDIR += openjade
484
    SUBDIR += opensearch
484
    SUBDIR += opensp
485
    SUBDIR += opensp
485
    SUBDIR += openvanilla-framework
486
    SUBDIR += openvanilla-framework
486
    SUBDIR += or-aspell
487
    SUBDIR += or-aspell
(-)b/textproc/opensearch/Makefile (+89 lines)
Added Link Here
1
# Created by: Sven R <freebsd@hackacad.net>
2
3
PORTNAME=	opensearch
4
PORTVERSION=	1.0.0
5
CATEGORIES=	textproc java devel
6
MASTER_SITES=	https://artifacts.opensearch.org/releases/bundle/${PORTNAME}/${PORTVERSION}/
7
PKGNAMESUFFIX=	1
8
DISTNAME=	${PORTNAME}-${PORTVERSION}-linux-x64
9
10
MAINTAINER=	freebsd@hackacad.net
11
COMMENT=	Full-text search engine for Java
12
13
LICENSE=	APACHE20
14
15
BUILD_DEPENDS=	jna>0:devel/jna
16
RUN_DEPENDS=	bash>0:shells/bash \
17
		jna>0:devel/jna
18
19
USES=		cpe shebangfix
20
USE_JAVA=	yes
21
JAVA_VERSION=	11+
22
USE_RC_SUBR=	${PORTNAME}
23
24
SHEBANG_FILES=  bin/opensearch bin/opensearch-cli \
25
                bin/opensearch-env bin/opensearch-env-from-file \
26
                bin/opensearch-keystore bin/opensearch-node \
27
                bin/opensearch-plugin bin/opensearch-shard \
28
                bin/performance-analyzer-agent-cli
29
30
CONFLICTS=	elasticsearch*
31
32
NO_ARCH=	yes
33
NO_BUILD=	yes
34
WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}
35
36
OPTIONS_DEFINE=	DOCS
37
38
.include <bsd.port.options.mk>
39
40
CONFIG_FILES=	opensearch.yml jvm.options log4j2.properties 
41
42
BINS=           opensearch opensearch-cli opensearch-env \
43
                opensearch-env-from-file opensearch-keystore \
44
                opensearch-node opensearch-plugin \
45
                opensearch-shard performance-analyzer-agent-cli
46
47
SIGAR_ARCH=	${ARCH:S|i386|x86|}
48
SEARCHUSER?=	opensearch
49
SEARCHGROUP?=	${SEARCHUSER}
50
USERS=		${SEARCHUSER}
51
GROUPS=		${SEARCHGROUP}
52
53
SUB_FILES=	pkg-message
54
SUB_LIST=	ETCDIR=${ETCDIR} \
55
		JAVA_HOME=${JAVA_HOME}
56
57
post-patch:
58
	${RM} ${WRKSRC}/lib/jna-*.jar
59
60
do-install:
61
	${MKDIR} ${STAGEDIR}${PREFIX}/etc/opensearch
62
.for f in ${CONFIG_FILES}
63
	${INSTALL} ${WRKSRC}/config/${f} ${STAGEDIR}${ETCDIR}/${f}.sample
64
.endfor
65
	${MKDIR} ${STAGEDIR}${PREFIX}/lib/opensearch/bin
66
.for f in ${BINS}
67
	${INSTALL_SCRIPT} ${WRKSRC}/bin/${f} ${STAGEDIR}${PREFIX}/lib/opensearch/bin
68
.endfor
69
	${MKDIR} ${STAGEDIR}${PREFIX}/lib/opensearch/lib
70
	(cd ${WRKSRC}/lib && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/lib/opensearch/lib/ "-name *\.jar")
71
72
	${MKDIR} ${STAGEDIR}${PREFIX}/lib/opensearch/modules
73
	(cd ${WRKSRC}/modules && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/lib/opensearch/modules/)
74
	${MKDIR} ${STAGEDIR}${PREFIX}/lib/opensearch/plugins
75
	${MKDIR} ${STAGEDIR}${PREFIX}/libexec/opensearch
76
	${INSTALL} -lrs ${STAGEDIR}${ETCDIR} ${STAGEDIR}${PREFIX}/lib/opensearch/config
77
	${LN} -s ${JAVASHAREDIR}/classes/jna.jar ${STAGEDIR}${PREFIX}/lib/opensearch/lib/jna.jar
78
79
post-install:
80
	${ECHO} "@sample ${ETCDIR}/opensearch.yml.sample" >> ${TMPPLIST}
81
	${ECHO} "@sample ${ETCDIR}/jvm.options.sample" >> ${TMPPLIST}
82
	${ECHO} "@sample ${ETCDIR}/log4j2.properties.sample" >> ${TMPPLIST}
83
	${FIND} -s ${STAGEDIR}${PREFIX}/lib/opensearch -not -type d | ${SORT} | \
84
		${SED} -e 's#^${STAGEDIR}${PREFIX}/##' >> ${TMPPLIST}
85
	${ECHO} "@dir lib/opensearch/plugins" >> ${TMPPLIST}
86
	${ECHO} "@dir libexec/opensearch" >> ${TMPPLIST}
87
	${ECHO} "@dir(opensearch,opensearch,0755) ${ETCDIR}" >> ${TMPPLIST}
88
89
.include <bsd.port.mk>
(-)b/textproc/opensearch/distinfo (+3 lines)
Added Link Here
1
TIMESTAMP = 1627635430
2
SHA256 (opensearch-1.0.0-linux-x64.tar.gz) = 6e865341c8cab5ab9665f5e279ca381c2b9b7f929fc6cf528c43440e68000c41
3
SIZE (opensearch-1.0.0-linux-x64.tar.gz) = 431092974
(-)b/textproc/opensearch/files/opensearch.in (+115 lines)
Added Link Here
1
#!/bin/sh
2
3
# PROVIDE: opensearch
4
# REQUIRE: DAEMON
5
# BEFORE: LOGIN
6
# KEYWORD: shutdown
7
#
8
# Add the following line to /etc/rc.conf to enable opensearch:
9
#
10
# opensearch_enable="YES"
11
#
12
# opensearch_user (username): Set to opensearch by default.
13
#               Set it to required username.
14
# opensearch_group (group):   Set to opensearch by default.
15
#               Set it to required group.
16
# opensearch_config (path):   Set to %%PREFIX%%/etc/opensearch/opensearch.yml by default.
17
#               Set it to the config file location.
18
# opensearch_java_home (path): Set to %%JAVA_HOME%% by default.
19
#               Set it to the root of the JDK to use.
20
#
21
. /etc/rc.subr
22
23
name=opensearch
24
rcvar=opensearch_enable
25
26
load_rc_config ${name}
27
28
: ${opensearch_enable:=NO}
29
: ${opensearch_user=opensearch}
30
: ${opensearch_group=opensearch}
31
: ${opensearch_config=%%PREFIX%%/etc/opensearch}
32
: ${opensearch_login_class=root}
33
: ${opensearch_java_home="%%JAVA_HOME%%"}
34
35
required_files="${opensearch_config}/opensearch.yml"
36
_pidprefix=/var/run/opensearch/opensearch
37
pidfile=${_pidprefix}.pid
38
procname=${opensearch_java_home}/bin/java
39
40
extra_commands="console status"
41
console_cmd=opensearch_console
42
start_precmd=opensearch_precmd
43
command=%%PREFIX%%/lib/opensearch/bin/opensearch
44
command_args="-d --pidfile=${pidfile}"
45
46
export OPENSEARCH_PATH_CONF=${opensearch_config}
47
export OPENSEARCH_JAVA_HOME=${opensearch_java_home}
48
49
opensearch_precmd()
50
{
51
    /usr/bin/install -d -o ${opensearch_user} -g ${opensearch_group} -m 755 ${pidfile%/*}
52
    /usr/bin/install -d -o ${opensearch_user} -g ${opensearch_group} -m 755 /var/db/opensearch
53
    /usr/bin/install -d -o ${opensearch_user} -g ${opensearch_group} -m 755 /var/log/opensearch
54
}
55
56
opensearch_console()
57
{
58
    command_args=""
59
    run_rc_command "start"
60
}
61
62
if [ -n "$2" ]; then
63
    profile="$2"
64
    if [ "x${opensearch_profiles}" != "x" ]; then
65
        eval opensearch_config="\${opensearch_${profile}_config:-}"
66
        if [ "x${opensearch_config}" = "x" ]; then
67
            echo "You must define a configuration  (opensearch_${profile}_config)"
68
            exit 1
69
        fi
70
	export OPENSEARCH_PATH_CONF=${opensearch_config}
71
        required_files="${opensearch_config}/opensearch.yml"
72
        required_files="${opensearch_config}/jvm.options"
73
        eval opensearch_enable="\${opensearch_${profile}_enable:-${opensearch_enable}}"
74
        pidfile="${_pidprefix}.${profile}.pid"
75
	command_args="-d --pidfile=${pidfile}"
76
	echo "===> opensearch profile: ${profile}"
77
    else
78
        echo "$0: extra argument ignored"
79
    fi
80
else
81
    if [ "x${opensearch_profiles}" != "x" -a "x$1" != "x" ]; then
82
        for profile in ${opensearch_profiles}; do
83
            eval _enable="\${opensearch_${profile}_enable}"
84
            case "x${_enable:-${opensearch_enable}}" in
85
            x|x[Nn][Oo]|x[Nn][Oo][Nn][Ee])
86
                continue
87
                ;;
88
            x[Yy][Ee][Ss])
89
                ;;
90
            *)
91
                if test -z "$_enable"; then
92
                    _var=opensearch_enable
93
                else
94
                    _var=opensearch_"${profile}"_enable
95
                fi
96
                echo "Bad value" \
97
                    "'${_enable:-${opensearch_enable}}'" \
98
                    "for ${_var}. " \
99
                    "Profile ${profile} skipped."
100
                continue
101
                ;;
102
            esac
103
            %%PREFIX%%/etc/rc.d/opensearch $1 ${profile}
104
            retcode="$?"
105
            if [ "0${retcode}" -ne 0 ]; then
106
                failed="${profile} (${retcode}) ${failed:-}"
107
            else
108
                success="${profile} ${success:-}"
109
            fi
110
        done
111
        exit 0
112
    fi
113
fi
114
115
run_rc_command "$1"
(-)b/textproc/opensearch/files/patch-bin_opensearch-env (+17 lines)
Added Link Here
1
--- bin/opensearch-env.orig	2021-07-30 13:39:40 UTC
2
+++ bin/opensearch-env
3
@@ -40,13 +40,7 @@ if [ ! -z "$JAVA_HOME" ]; then
4
   JAVA="$JAVA_HOME/bin/java"
5
   JAVA_TYPE="JAVA_HOME"
6
 else
7
-  if [ "$(uname -s)" = "Darwin" ]; then
8
-    # macOS has a different structure
9
-    JAVA="$OPENSEARCH_HOME/jdk.app/Contents/Home/bin/java"
10
-  else
11
-    JAVA="$OPENSEARCH_HOME/jdk/bin/java"
12
-  fi
13
-  JAVA_TYPE="bundled jdk"
14
+  JAVA="/usr/local/bin/java"
15
 fi
16
 
17
 if [ ! -x "$JAVA" ]; then
(-)b/textproc/opensearch/files/patch-config_jvm.options (+23 lines)
Added Link Here
1
--- config/jvm.options.orig	2021-07-30 14:01:34 UTC
2
+++ config/jvm.options
3
@@ -61,17 +61,17 @@
4
 -XX:HeapDumpPath=data
5
 
6
 # specify an alternative path for JVM fatal error logs
7
--XX:ErrorFile=logs/hs_err_pid%p.log
8
+-XX:ErrorFile=/hs_err_pid%p.log
9
 
10
 ## JDK 8 GC logging
11
 8:-XX:+PrintGCDetails
12
 8:-XX:+PrintGCDateStamps
13
 8:-XX:+PrintTenuringDistribution
14
 8:-XX:+PrintGCApplicationStoppedTime
15
-8:-Xloggc:logs/gc.log
16
+8:-Xloggc:${OPENSEARCH_TMPDIR}/gc.log
17
 8:-XX:+UseGCLogFileRotation
18
 8:-XX:NumberOfGCLogFiles=32
19
 8:-XX:GCLogFileSize=64m
20
 
21
 # JDK 9+ GC logging
22
-9-:-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m
23
+9-:-Xlog:gc*,gc+age=trace,safepoint:file=${OPENSEARCH_TMPDIR}/gc.log:utctime,pid,tags:filecount=32,filesize=64m
(-)b/textproc/opensearch/files/patch-config_opensearch.yml (+39 lines)
Added Link Here
1
--- config/opensearch.yml.orig	2021-07-02 23:22:08 UTC
2
+++ config/opensearch.yml
3
@@ -31,10 +31,12 @@
4
 # Path to directory where to store the data (separate multiple locations by comma):
5
 #
6
 #path.data: /path/to/data
7
+path.data: /var/db/opensearch
8
 #
9
 # Path to log files:
10
 #
11
 #path.logs: /path/to/logs
12
+path.logs: /var/log/opensearch
13
 #
14
 # ----------------------------------- Memory -----------------------------------
15
 #
16
@@ -86,3 +88,23 @@
17
 # Require explicit names when deleting indices:
18
 #
19
 #action.destructive_requires_name: true
20
+## Sample configuration for TLS:
21
+##plugins.security.ssl.transport.pemcert_filepath: esnode.pem
22
+##plugins.security.ssl.transport.pemkey_filepath: esnode-key.pem
23
+##plugins.security.ssl.transport.pemtrustedcas_filepath: root-ca.pem
24
+##plugins.security.ssl.transport.enforce_hostname_verification: false
25
+##plugins.security.ssl.http.enabled: true
26
+##plugins.security.ssl.http.pemcert_filepath: esnode.pem
27
+##plugins.security.ssl.http.pemkey_filepath: esnode-key.pem
28
+##plugins.security.ssl.http.pemtrustedcas_filepath: root-ca.pem
29
+##plugins.security.allow_unsafe_democertificates: true
30
+##plugins.security.allow_default_init_securityindex: true
31
+##plugins.security.authcz.admin_dn:
32
+##  - CN=kirk,OU=client,O=client,L=test, C=#
33
+##plugins.security.audit.type: internal_opensearch
34
+##plugins.security.enable_snapshot_restore_privilege: true
35
+##plugins.security.check_snapshot_restore_write_privileges: true
36
+##plugins.security.restapi.roles_enabled: ["all_access", "security_rest_api_access"]
37
+##plugins.security.system_indices.enabled: true
38
+##plugins.security.system_indices.indices: [".opendistro-alerting-config", ".opendistro-alerting-alert*", ".opendistro-anomaly-results*", ".opendistro-anomaly-detector*", ".opendistro-anomaly-checkpoints", ".opendistro-anomaly-detection-state", ".opendistro-reports-*", ".opendistro-notifications-*", ".opendistro-notebooks", ".opendistro-asynchronous-search-response*"]
39
+#
(-)b/textproc/opensearch/files/pkg-message.in (+20 lines)
Added Link Here
1
[
2
{ type: install
3
  message: <<EOM
4
Please see %%ETCDIR%% for sample versions of
5
opensearch.yml and logging.yml.
6
7
OpenSearch requires memory locking of large amounts of RAM.
8
You may need to set:
9
10
sysctl security.bsd.unprivileged_mlock=1
11
12
When running within a jail, it's highly advisable to set:
13
14
enforce_statfs = 1
15
16
for the jail running opensearch instance.
17
18
EOM
19
}
20
]
(-)b/textproc/opensearch/pkg-descr (+4 lines)
Added Link Here
1
OpenSearch is a fork of Elasticsearch which aims to be a Distributed, 
2
RESTful, Search Engine built on top of Apache Lucene. 
3
4
WWW: http://opensearch.org

Return to bug 257558