├── .gitignore ├── .mvn ├── README.md ├── jvm.config └── wrapper │ └── maven-wrapper.properties ├── README.md ├── docs └── images │ └── intellij-run-config.png ├── manifests ├── 2.2.json ├── 2.3.json ├── 2.4.json ├── 2.5.json ├── 3.0.json ├── 3.1.json ├── 3.2.json ├── 3.3.json ├── 4.0.json ├── 4.1.json ├── 4.2.json ├── 4.3.json ├── 5.0.json ├── 5.1.json ├── 5.2.json ├── 6.0.json ├── 6.1.json └── master.json ├── mvnw ├── pom.xml-tmpl ├── runner ├── .gitignore ├── README.md ├── bin │ ├── dev-cleanup.sh │ ├── dev-docker-compose.sh │ ├── dev-exec.sh │ ├── dev-server.sh │ ├── dev-services.sh │ ├── dev-web.sh │ ├── dev.sh │ └── include.sh ├── docker │ ├── .gitignore │ ├── docker-compose.yml │ └── images │ │ ├── dev-server-runner │ │ ├── Dockerfile │ │ ├── build-and-run.sh │ │ ├── clean.sh │ │ ├── docker-entrypoint.sh │ │ └── maven-settings.xml │ │ └── dev-web-runner │ │ ├── Dockerfile │ │ ├── build-and-run.sh │ │ ├── clean.sh │ │ └── docker-entrypoint.sh └── pom.xml-tmpl └── src └── main └── assembly ├── component-graylog.xml-tmpl ├── graylog-datanode.xml-tmpl └── graylog.xml-tmpl /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Java template 3 | *.class 4 | 5 | # Mobile Tools for Java (J2ME) 6 | .mtj.tmp/ 7 | 8 | # Package Files # 9 | *.jar 10 | *.war 11 | *.ear 12 | 13 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 14 | hs_err_pid* 15 | ### Maven template 16 | target/ 17 | build-pom.xml 18 | pom.xml.tag 19 | pom.xml.releaseBackup 20 | pom.xml.versionsBackup 21 | pom.xml.next 22 | release.properties 23 | dependency-reduced-pom.xml 24 | buildNumber.properties 25 | .mvn/timing.properties 26 | ### JetBrains template 27 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio 28 | 29 | *.iml 30 | 31 | ## Directory-based project format: 32 | .idea/ 33 | # if you remove the above rule, at least ignore the following: 34 | 35 | # User-specific stuff: 36 | # .idea/workspace.xml 37 | # .idea/tasks.xml 38 | # .idea/dictionaries 39 | 40 | # Sensitive or high-churn files: 41 | # .idea/dataSources.ids 42 | # .idea/dataSources.xml 43 | # .idea/sqlDataSources.xml 44 | # .idea/dynamic.xml 45 | # .idea/uiDesigner.xml 46 | 47 | # Gradle: 48 | # .idea/gradle.xml 49 | # .idea/libraries 50 | 51 | # Mongo Explorer plugin: 52 | # .idea/mongoSettings.xml 53 | 54 | ## File-based project format: 55 | *.ipr 56 | *.iws 57 | 58 | ## Plugin-specific files: 59 | 60 | # IntelliJ 61 | /out/ 62 | 63 | # mpeltonen/sbt-idea plugin 64 | .idea_modules/ 65 | 66 | # JIRA plugin 67 | atlassian-ide-plugin.xml 68 | 69 | # Crashlytics plugin (for Android Studio and IntelliJ) 70 | com_crashlytics_export_strings.xml 71 | crashlytics.properties 72 | crashlytics-build.properties 73 | 74 | # Generated XML files 75 | /pom.xml 76 | /runner/pom.xml 77 | /src/main/assembly/*.xml 78 | 79 | # graylog-project CLI files 80 | /.graylog-project-manifest-state 81 | /.graylog-project-cli.yaml 82 | -------------------------------------------------------------------------------- /.mvn/README.md: -------------------------------------------------------------------------------- 1 | ## How to create/update the maven wrapper 2 | 3 | `mvn wrapper:wrapper -Dtype=only-script -Dmaven=` 4 | -------------------------------------------------------------------------------- /.mvn/jvm.config: -------------------------------------------------------------------------------- 1 | --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED 2 | --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED 3 | --add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED 4 | --add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED 5 | --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED 6 | --add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED 7 | --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED 8 | --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED 9 | --add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED 10 | --add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED 11 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | wrapperVersion=3.3.2 18 | distributionType=only-script 19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Graylog Project 2 | =============== 3 | 4 | The purpose of this project is to make it easier to develop Graylog and its 5 | plugins. 6 | 7 | Graylog consists of the core [server](https://github.com/Graylog2/graylog2-server) 8 | project and several plugins (e.g. the [collector plugin](https://github.com/Graylog2/graylog-plugin-collector)) 9 | which are all separate [maven](https://maven.apache.org/) projects. 10 | 11 | To make it possible to build all of those project with a single `./mvnw package` 12 | command, we built this meta project which pulls in the core server and all 13 | plugins into a single maven reactor. 14 | 15 | The [graylog-project CLI](https://github.com/Graylog2/graylog-project-cli) tool 16 | is used to manage this meta project and is a requirement. 17 | 18 | ## Setup 19 | 20 | 1. Ensure GitHub SSH access (process described [here](https://docs.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent); can be tested with `ssh -T git@github.com`) 21 | 1. Install the latest version of the graylog-project CLI tool 22 | 1. Bootstrap the graylog-project repository 23 | 1. Import the graylog-project repository into your IDE 24 | 25 | 26 | ### Install CLI Tool 27 | 28 | Go to the [releases](https://github.com/Graylog2/graylog-project-cli/releases) 29 | page of the CLI tool and download the latest version for your platform. 30 | 31 | Put the binary somewhere into your PATH. 32 | 33 | Example: 34 | 35 | ``` 36 | $ mkdir -p $HOME/bin 37 | $ cp graylog-project.linux $HOME/bin/graylog-project 38 | $ chmod +x $HOME/bin/graylog-project 39 | ``` 40 | 41 | If you use the example above, please make sure your `$HOME/bin` is in your PATH! 42 | 43 | ### Bootstrap 44 | 45 | Use the `graylog-project` tool to bootstrap the graylog-project repository via 46 | the `graylog-project bootstrap github://Graylog2/graylog-project.git` command. 47 | 48 | Example: 49 | 50 | ``` 51 | $ graylog-project bootstrap github://Graylog2/graylog-project.git 52 | git clone git@github.com:Graylog2/graylog-project.git graylog-project 53 | Cloning into 'graylog-project'... 54 | git checkout master 55 | Already on 'master' 56 | Your branch is up-to-date with 'origin/master'. 57 | Repository: git@github.com:Graylog2/graylog2-server.git 58 | Cloning git@github.com:Graylog2/graylog2-server.git into graylog-project-repos/graylog2-server 59 | git clone git@github.com:Graylog2/graylog2-server.git graylog-project-repos/graylog2-server 60 | Cloning into 'graylog-project-repos/graylog2-server'... 61 | Checkout revision: master 62 | git branch master origin/master 63 | git checkout master 64 | Already on 'master' 65 | Your branch is up-to-date with 'origin/master'. 66 | Repository: git@github.com:Graylog2/graylog-plugin-anonymous-usage-statistics.git 67 | Cloning git@github.com:Graylog2/graylog-plugin-anonymous-usage-statistics.git into graylog-project-repos/graylog-plugin-anonymous-usage-statistics 68 | git clone git@github.com:Graylog2/graylog-plugin-anonymous-usage-statistics.git graylog-project-repos/graylog-plugin-anonymous-usage-statistics 69 | Cloning into 'graylog-project-repos/graylog-plugin-anonymous-usage-statistics'... 70 | Checkout revision: master 71 | git branch master origin/master 72 | git checkout master 73 | Already on 'master' 74 | Your branch is up-to-date with 'origin/master'. 75 | Repository: git@github.com:Graylog2/graylog-plugin-map-widget.git 76 | Cloning git@github.com:Graylog2/graylog-plugin-map-widget.git into graylog-project-repos/graylog-plugin-map-widget 77 | git clone git@github.com:Graylog2/graylog-plugin-map-widget.git graylog-project-repos/graylog-plugin-map-widget 78 | Cloning into 'graylog-project-repos/graylog-plugin-map-widget'... 79 | Checkout revision: master 80 | git branch master origin/master 81 | git checkout master 82 | Already on 'master' 83 | Your branch is up-to-date with 'origin/master'. 84 | 85 | [...] 86 | 87 | Generating pom.xml file from template pom.xml-tmpl 88 | Generating runner/pom.xml file from template runner/pom.xml-tmpl 89 | Generating src/main/assembly/server-tarball.xml file from template src/main/assembly/server-tarball.xml-tmpl 90 | Writing manifest state to .graylog-project-manifest-state 91 | ``` 92 | 93 | #### Checking out a particular version 94 | 95 | The project contains various manifest files specifying the version of Graylog project repositories to be checked out. The `manifests/master.json` file is used by default. The `--manifest` argument allows you to check out a different version: 96 | ``` 97 | graylog-project bootstrap github://Graylog2/graylog-project.git --manifest manifests/4.2.json 98 | ``` 99 | 100 | The `X.Y.json` manifests will checkout the current code from that branch in Github. The resulting build artifact will be an `X.Y-SNAPSHOT` version. 101 | 102 | ### IDE Import 103 | 104 | Now you can import the `graylog-project` folder into your IDE of choice. 105 | 106 | At Graylog we are using [IntelliJ IDEA](https://www.jetbrains.com/idea/) so we 107 | are using that for the following example. 108 | 109 | After importing the project into your IDE, create a server run configuration: 110 | 111 | [![IntelliJ Run Config](/docs/images/intellij-run-config.png)](https://raw.githubusercontent.com/Graylog2/graylog-project/master/docs/images/intellij-run-config.png) 112 | 113 | - Make sure to use the **runner** module for the *Use classpath of module* option 114 | - Use the **graylog2-server** directory as *Working directory* 115 | - In *Program arguments* use `server -f graylog.conf --local` 116 | (`--local` to avoid sending usage stats and running version checks) 117 | 118 | This allows the listed plugins to be on the same classpath and thus loaded 119 | directly without having to go through mvn package and symlinking/copying into 120 | Graylog's plugins folder. 121 | 122 | ### Server Configuration File 123 | 124 | Create a `graylog.conf` file inside the `graylog2-server` directory based on 125 | the `misc/graylog.conf` example configuration. 126 | 127 | ### Initial Build 128 | 129 | Before you can run the server from the IDE, you have to run an initial build 130 | to create some assets. 131 | 132 | ``` 133 | $ ./mvnw compile 134 | ``` 135 | 136 | This will build the backend and frontend parts. 137 | 138 | For a faster compile, you can skip building the frontend, building javadocs, and running tests: 139 | 140 | ``` 141 | ./mvnw -Dmaven.javadoc.skip=true -DskipTests -Dskip.web.build compile 142 | ``` 143 | 144 | 145 | ## Usage 146 | 147 | ### Elasticsearch & MongoDB 148 | 149 | Before you start the server, make sure you have an Elasticsearch and MongoDB 150 | service running. If you're just testing this out and you don't care about persistent data, you can run: 151 | 152 | ``` 153 | sudo sysctl -w vm.max_map_count=262144 154 | docker run -d -p 27017:27017 --name mongo mongo:latest 155 | docker run -d -p 9200:9200 -p 9300:9300 elasticsearch:7.10.2 156 | ``` 157 | 158 | Make sure that `graylog.conf` contains the correct connection details for Elasticsearch and MongoDB. 159 | 160 | 161 | ### Server Start 162 | 163 | Now you should be able to start the server from your IDE by using the 164 | run configuration that you created before. 165 | 166 | ### Web Interface Start 167 | 168 | For development we are using the webpack-dev-server. You can start it by 169 | using the following command inside the `graylog2-server/graylog2-web-interface` 170 | directory. 171 | 172 | ``` 173 | $ ./node/yarn/dist/bin/yarn start 174 | ``` 175 | 176 | If you are running the 2.4 branch or earlier, you have to use npm to start the 177 | development webserver: 178 | 179 | ``` 180 | $ ./node/npm run start 181 | ``` 182 | 183 | The web interface is now reachable via [http://localhost:8080/](http://localhost:8080/). 184 | 185 | ### Working with Proxy 186 | 187 | To be able to run builds in environments that needs proxy settings to access the internet, first run `mvn` with the option to disable proxy by-pass to yarn. 188 | 189 | ``` 190 | ./mvnw -Dfrontend.yarn.yarnInheritsProxyConfigFromMaven=false 191 | ``` 192 | 193 | Add the Proxy settings to the users *.yarnrc*: 194 | 195 | ``` 196 | proxy "https://:@proxy.in.lan:8080" 197 | https-proxy "https://:@proxy.in.lan:8080" 198 | ``` 199 | -------------------------------------------------------------------------------- /docs/images/intellij-run-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Graylog2/graylog-project/3c2fb51535c29a123c72c5e32020603dfdefaa85/docs/images/intellij-run-config.png -------------------------------------------------------------------------------- /manifests/2.2.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": [ 3 | { 4 | "repository": "git@github.com:Graylog2/graylog2-server.git", 5 | "revision": "2.2", 6 | "server": true, 7 | "submodules": [ 8 | { 9 | "path": "graylog2-server" 10 | }, 11 | { 12 | "path": "graylog2-web-interface" 13 | } 14 | ] 15 | }, 16 | { 17 | "repository": "git@github.com:Graylog2/graylog-plugin-anonymous-usage-statistics.git", 18 | "revision": "2.2", 19 | "assemblies": ["graylog"] 20 | }, 21 | { 22 | "repository": "git@github.com:Graylog2/graylog-plugin-map-widget.git", 23 | "revision": "2.2", 24 | "assemblies": ["graylog"] 25 | }, 26 | { 27 | "repository": "git@github.com:Graylog2/graylog-plugin-pipeline-processor.git", 28 | "revision": "2.2", 29 | "submodules" : [ 30 | { 31 | "path": "plugin", 32 | "assemblies": ["graylog"] 33 | } 34 | ] 35 | }, 36 | { 37 | "repository": "git@github.com:Graylog2/graylog-plugin-collector.git", 38 | "revision": "2.2", 39 | "assemblies": ["graylog"] 40 | }, 41 | { 42 | "repository": "git@github.com:Graylog2/graylog-plugin-enterprise-integration.git", 43 | "revision": "2.2", 44 | "assemblies": ["graylog"] 45 | }, 46 | { 47 | "repository": "git@github.com:Graylog2/graylog-plugin-beats.git", 48 | "revision": "2.2", 49 | "assemblies": ["graylog"] 50 | } 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /manifests/2.3.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": [ 3 | { 4 | "repository": "git@github.com:Graylog2/graylog2-server.git", 5 | "revision": "2.3", 6 | "server": true, 7 | "submodules": [ 8 | { 9 | "path": "graylog2-server" 10 | }, 11 | { 12 | "path": "graylog2-web-interface" 13 | } 14 | ] 15 | }, 16 | { 17 | "repository": "git@github.com:Graylog2/graylog-plugin-anonymous-usage-statistics.git", 18 | "revision": "2.3", 19 | "assemblies": ["graylog"] 20 | }, 21 | { 22 | "repository": "git@github.com:Graylog2/graylog-plugin-map-widget.git", 23 | "revision": "2.3", 24 | "assemblies": ["graylog"] 25 | }, 26 | { 27 | "repository": "git@github.com:Graylog2/graylog-plugin-pipeline-processor.git", 28 | "revision": "2.3", 29 | "submodules" : [ 30 | { 31 | "path": "plugin", 32 | "assemblies": ["graylog"] 33 | } 34 | ] 35 | }, 36 | { 37 | "repository": "git@github.com:Graylog2/graylog-plugin-collector.git", 38 | "revision": "2.3", 39 | "assemblies": ["graylog"] 40 | }, 41 | { 42 | "repository": "git@github.com:Graylog2/graylog-plugin-enterprise-integration.git", 43 | "revision": "2.3", 44 | "assemblies": ["graylog"] 45 | }, 46 | { 47 | "repository": "git@github.com:Graylog2/graylog-plugin-beats.git", 48 | "revision": "2.3", 49 | "assemblies": ["graylog"] 50 | } 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /manifests/2.4.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": [ 3 | { 4 | "repository": "git@github.com:Graylog2/graylog2-server.git", 5 | "revision": "2.4", 6 | "server": true, 7 | "submodules": [ 8 | { 9 | "path": "graylog2-server" 10 | }, 11 | { 12 | "path": "graylog2-web-interface" 13 | } 14 | ] 15 | }, 16 | { 17 | "repository": "git@github.com:Graylog2/graylog-plugin-map-widget.git", 18 | "revision": "2.4", 19 | "assemblies": ["graylog"] 20 | }, 21 | { 22 | "repository": "git@github.com:Graylog2/graylog-plugin-pipeline-processor.git", 23 | "revision": "2.4", 24 | "submodules" : [ 25 | { 26 | "path": "plugin", 27 | "assemblies": ["graylog"] 28 | } 29 | ] 30 | }, 31 | { 32 | "repository": "git@github.com:Graylog2/graylog-plugin-collector.git", 33 | "revision": "2.4", 34 | "assemblies": ["graylog"] 35 | }, 36 | { 37 | "repository": "git@github.com:Graylog2/graylog-plugin-enterprise-integration.git", 38 | "revision": "2.4", 39 | "assemblies": ["graylog"] 40 | }, 41 | { 42 | "repository": "git@github.com:Graylog2/graylog-plugin-beats.git", 43 | "revision": "2.4", 44 | "assemblies": ["graylog"] 45 | }, 46 | { 47 | "repository": "git@github.com:Graylog2/graylog-plugin-aws.git", 48 | "revision": "2.4", 49 | "assemblies": ["graylog"] 50 | }, 51 | { 52 | "repository": "git@github.com:Graylog2/graylog-plugin-threatintel.git", 53 | "revision": "2.4", 54 | "assemblies": ["graylog"] 55 | }, 56 | { 57 | "repository": "git@github.com:Graylog2/graylog-plugin-netflow.git", 58 | "revision": "2.4", 59 | "assemblies": ["graylog"] 60 | }, 61 | { 62 | "repository": "git@github.com:Graylog2/graylog-plugin-cef.git", 63 | "revision": "2.4", 64 | "assemblies": ["graylog"] 65 | } 66 | ] 67 | } 68 | -------------------------------------------------------------------------------- /manifests/2.5.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": [ 3 | { 4 | "repository": "git@github.com:Graylog2/graylog2-server.git", 5 | "revision": "2.5", 6 | "server": true, 7 | "submodules": [ 8 | { 9 | "path": "graylog2-server" 10 | }, 11 | { 12 | "path": "graylog2-web-interface" 13 | } 14 | ] 15 | }, 16 | { 17 | "repository": "git@github.com:Graylog2/graylog-plugin-map-widget.git", 18 | "revision": "2.5", 19 | "assemblies": ["graylog"] 20 | }, 21 | { 22 | "repository": "git@github.com:Graylog2/graylog-plugin-pipeline-processor.git", 23 | "revision": "2.5", 24 | "submodules" : [ 25 | { 26 | "path": "plugin", 27 | "assemblies": ["graylog"] 28 | } 29 | ] 30 | }, 31 | { 32 | "repository": "git@github.com:Graylog2/graylog-plugin-collector.git", 33 | "revision": "2.5", 34 | "assemblies": ["graylog"] 35 | }, 36 | { 37 | "repository": "git@github.com:Graylog2/graylog-plugin-enterprise-integration.git", 38 | "revision": "2.5", 39 | "assemblies": ["graylog"] 40 | }, 41 | { 42 | "repository": "git@github.com:Graylog2/graylog-plugin-beats.git", 43 | "revision": "2.5", 44 | "assemblies": ["graylog"] 45 | }, 46 | { 47 | "repository": "git@github.com:Graylog2/graylog-plugin-aws.git", 48 | "revision": "2.5", 49 | "assemblies": ["graylog"] 50 | }, 51 | { 52 | "repository": "git@github.com:Graylog2/graylog-plugin-threatintel.git", 53 | "revision": "2.5", 54 | "assemblies": ["graylog"] 55 | }, 56 | { 57 | "repository": "git@github.com:Graylog2/graylog-plugin-netflow.git", 58 | "revision": "2.5", 59 | "assemblies": ["graylog"] 60 | }, 61 | { 62 | "repository": "git@github.com:Graylog2/graylog-plugin-cef.git", 63 | "revision": "2.5", 64 | "assemblies": ["graylog"] 65 | } 66 | ] 67 | } 68 | -------------------------------------------------------------------------------- /manifests/3.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": [ 3 | { 4 | "repository": "git@github.com:Graylog2/graylog2-server.git", 5 | "revision": "3.0", 6 | "server": true, 7 | "submodules": [ 8 | { 9 | "path": "graylog2-server" 10 | }, 11 | { 12 | "path": "graylog2-web-interface" 13 | } 14 | ] 15 | }, 16 | { 17 | "repository": "git@github.com:Graylog2/graylog-plugin-collector.git", 18 | "revision": "3.0", 19 | "assemblies": ["graylog"] 20 | }, 21 | { 22 | "repository": "git@github.com:Graylog2/graylog-plugin-aws.git", 23 | "revision": "3.0", 24 | "assemblies": ["graylog"] 25 | }, 26 | { 27 | "repository": "git@github.com:Graylog2/graylog-plugin-threatintel.git", 28 | "revision": "3.0", 29 | "assemblies": ["graylog"] 30 | }, 31 | { 32 | "repository": "git@github.com:Graylog2/graylog-plugin-integrations.git", 33 | "revision": "3.0", 34 | "assemblies": ["graylog-integrations"] 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /manifests/3.1.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": [ 3 | { 4 | "repository": "git@github.com:Graylog2/graylog2-server.git", 5 | "revision": "3.1", 6 | "server": true, 7 | "submodules": [ 8 | { 9 | "path": "graylog2-server" 10 | }, 11 | { 12 | "path": "graylog2-web-interface" 13 | } 14 | ] 15 | }, 16 | { 17 | "repository": "git@github.com:Graylog2/graylog-plugin-collector.git", 18 | "revision": "3.1", 19 | "assemblies": ["graylog"] 20 | }, 21 | { 22 | "repository": "git@github.com:Graylog2/graylog-plugin-aws.git", 23 | "revision": "3.1", 24 | "assemblies": ["graylog"] 25 | }, 26 | { 27 | "repository": "git@github.com:Graylog2/graylog-plugin-threatintel.git", 28 | "revision": "3.1", 29 | "assemblies": ["graylog"] 30 | }, 31 | { 32 | "repository": "git@github.com:Graylog2/graylog-plugin-integrations.git", 33 | "revision": "3.1", 34 | "assemblies": ["graylog-integrations"] 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /manifests/3.2.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": [ 3 | { 4 | "repository": "git@github.com:Graylog2/graylog2-server.git", 5 | "revision": "3.2", 6 | "server": true, 7 | "submodules": [ 8 | { 9 | "path": "graylog2-server" 10 | }, 11 | { 12 | "path": "graylog2-web-interface" 13 | } 14 | ] 15 | }, 16 | { 17 | "repository": "git@github.com:Graylog2/graylog-plugin-collector.git", 18 | "revision": "3.2", 19 | "assemblies": ["graylog"] 20 | }, 21 | { 22 | "repository": "git@github.com:Graylog2/graylog-plugin-aws.git", 23 | "revision": "3.2", 24 | "assemblies": ["graylog"] 25 | }, 26 | { 27 | "repository": "git@github.com:Graylog2/graylog-plugin-threatintel.git", 28 | "revision": "3.2", 29 | "assemblies": ["graylog"] 30 | }, 31 | { 32 | "repository": "git@github.com:Graylog2/graylog-plugin-integrations.git", 33 | "revision": "3.2", 34 | "assemblies": ["graylog-integrations"] 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /manifests/3.3.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": [ 3 | { 4 | "repository": "git@github.com:Graylog2/graylog2-server.git", 5 | "revision": "3.3", 6 | "server": true, 7 | "submodules": [ 8 | { 9 | "path": "graylog2-server" 10 | }, 11 | { 12 | "path": "graylog2-web-interface" 13 | } 14 | ] 15 | }, 16 | { 17 | "repository": "git@github.com:Graylog2/graylog-plugin-collector.git", 18 | "revision": "3.3", 19 | "assemblies": ["graylog"] 20 | }, 21 | { 22 | "repository": "git@github.com:Graylog2/graylog-plugin-aws.git", 23 | "revision": "3.3", 24 | "assemblies": ["graylog"] 25 | }, 26 | { 27 | "repository": "git@github.com:Graylog2/graylog-plugin-threatintel.git", 28 | "revision": "3.3", 29 | "assemblies": ["graylog"] 30 | }, 31 | { 32 | "repository": "git@github.com:Graylog2/graylog-plugin-integrations.git", 33 | "revision": "3.3", 34 | "assemblies": ["graylog-integrations"] 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /manifests/4.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": [ 3 | { 4 | "repository": "git@github.com:Graylog2/graylog2-server.git", 5 | "revision": "4.0", 6 | "server": true, 7 | "submodules": [ 8 | { 9 | "path": "graylog2-server" 10 | }, 11 | { 12 | "path": "graylog2-web-interface" 13 | } 14 | ] 15 | }, 16 | { 17 | "repository": "git@github.com:Graylog2/graylog-plugin-collector.git", 18 | "revision": "4.0", 19 | "assemblies": ["graylog"] 20 | }, 21 | { 22 | "repository": "git@github.com:Graylog2/graylog-plugin-aws.git", 23 | "revision": "4.0", 24 | "assemblies": ["graylog"] 25 | }, 26 | { 27 | "repository": "git@github.com:Graylog2/graylog-plugin-threatintel.git", 28 | "revision": "4.0", 29 | "assemblies": ["graylog"] 30 | }, 31 | { 32 | "repository": "git@github.com:Graylog2/graylog-plugin-integrations.git", 33 | "revision": "4.0", 34 | "assemblies": ["graylog-integrations"] 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /manifests/4.1.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": [ 3 | { 4 | "repository": "git@github.com:Graylog2/graylog2-server.git", 5 | "revision": "4.1", 6 | "server": true, 7 | "submodules": [ 8 | { 9 | "path": "graylog2-server" 10 | }, 11 | { 12 | "path": "graylog2-web-interface" 13 | } 14 | ] 15 | }, 16 | { 17 | "repository": "git@github.com:Graylog2/graylog-plugin-collector.git", 18 | "revision": "4.1", 19 | "assemblies": ["graylog"] 20 | }, 21 | { 22 | "repository": "git@github.com:Graylog2/graylog-plugin-aws.git", 23 | "revision": "4.1", 24 | "assemblies": ["graylog"] 25 | }, 26 | { 27 | "repository": "git@github.com:Graylog2/graylog-plugin-threatintel.git", 28 | "revision": "4.1", 29 | "assemblies": ["graylog"] 30 | }, 31 | { 32 | "repository": "git@github.com:Graylog2/graylog-plugin-integrations.git", 33 | "revision": "4.1", 34 | "assemblies": ["graylog-integrations"] 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /manifests/4.2.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": [ 3 | { 4 | "repository": "git@github.com:Graylog2/graylog2-server.git", 5 | "revision": "4.2", 6 | "server": true, 7 | "submodules": [ 8 | { 9 | "path": "graylog2-server" 10 | }, 11 | { 12 | "path": "graylog2-web-interface" 13 | } 14 | ] 15 | }, 16 | { 17 | "repository": "git@github.com:Graylog2/graylog-plugin-collector.git", 18 | "revision": "4.2", 19 | "assemblies": ["graylog"] 20 | }, 21 | { 22 | "repository": "git@github.com:Graylog2/graylog-plugin-aws.git", 23 | "revision": "4.2", 24 | "assemblies": ["graylog"] 25 | }, 26 | { 27 | "repository": "git@github.com:Graylog2/graylog-plugin-threatintel.git", 28 | "revision": "4.2", 29 | "assemblies": ["graylog"] 30 | }, 31 | { 32 | "repository": "git@github.com:Graylog2/graylog-plugin-integrations.git", 33 | "revision": "4.2", 34 | "assemblies": ["graylog-integrations"] 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /manifests/4.3.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": [ 3 | { 4 | "repository": "git@github.com:Graylog2/graylog2-server.git", 5 | "revision": "4.3", 6 | "server": true, 7 | "submodules": [ 8 | { 9 | "path": "graylog2-server" 10 | }, 11 | { 12 | "path": "graylog2-web-interface" 13 | }, 14 | { 15 | "path": "graylog-storage-elasticsearch6" 16 | }, 17 | { 18 | "path": "graylog-storage-elasticsearch7" 19 | }, 20 | { 21 | "path": "distribution", 22 | "assemblies": ["graylog"], 23 | "assembly_attachment": "graylog-server-tarball" 24 | } 25 | ] 26 | }, 27 | { 28 | "repository": "git@github.com:Graylog2/graylog-plugin-collector.git", 29 | "revision": "4.3", 30 | "assemblies": ["graylog"] 31 | }, 32 | { 33 | "repository": "git@github.com:Graylog2/graylog-plugin-aws.git", 34 | "revision": "4.3", 35 | "assemblies": ["graylog"] 36 | }, 37 | { 38 | "repository": "git@github.com:Graylog2/graylog-plugin-threatintel.git", 39 | "revision": "4.3", 40 | "assemblies": ["graylog"] 41 | }, 42 | { 43 | "repository": "git@github.com:Graylog2/graylog-plugin-integrations.git", 44 | "revision": "4.3", 45 | "assemblies": ["graylog-integrations-plugins"] 46 | } 47 | ] 48 | } 49 | -------------------------------------------------------------------------------- /manifests/5.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "assembly_platforms": ["linux-x64", "linux-aarch64"], 3 | "modules": [ 4 | { 5 | "repository": "git@github.com:Graylog2/graylog2-server.git", 6 | "revision": "5.0", 7 | "server": true, 8 | "submodules": [ 9 | { 10 | "path": "graylog2-server" 11 | }, 12 | { 13 | "path": "graylog2-web-interface" 14 | }, 15 | { 16 | "path": "graylog-storage-elasticsearch7" 17 | }, 18 | { 19 | "path": "graylog-storage-opensearch2" 20 | }, 21 | { 22 | "path": "distribution", 23 | "assemblies": ["graylog"], 24 | "assembly_attachment": "graylog-server-tarball" 25 | } 26 | ] 27 | }, 28 | { 29 | "repository": "git@github.com:Graylog2/graylog-plugin-collector.git", 30 | "revision": "5.0", 31 | "assemblies": ["graylog"] 32 | }, 33 | { 34 | "repository": "git@github.com:Graylog2/graylog-plugin-aws.git", 35 | "revision": "5.0", 36 | "assemblies": ["graylog"] 37 | }, 38 | { 39 | "repository": "git@github.com:Graylog2/graylog-plugin-threatintel.git", 40 | "revision": "5.0", 41 | "assemblies": ["graylog"] 42 | }, 43 | { 44 | "repository": "git@github.com:Graylog2/graylog-plugin-integrations.git", 45 | "revision": "5.0", 46 | "assemblies": ["graylog"] 47 | } 48 | ] 49 | } 50 | -------------------------------------------------------------------------------- /manifests/5.1.json: -------------------------------------------------------------------------------- 1 | { 2 | "assembly_platforms": ["linux-x64", "linux-aarch64"], 3 | "modules": [ 4 | { 5 | "repository": "git@github.com:Graylog2/graylog2-server.git", 6 | "revision": "5.1", 7 | "server": true, 8 | "submodules": [ 9 | { 10 | "path": "graylog2-server" 11 | }, 12 | { 13 | "path": "graylog2-web-interface" 14 | }, 15 | { 16 | "path": "graylog-storage-elasticsearch7" 17 | }, 18 | { 19 | "path": "graylog-storage-opensearch2" 20 | }, 21 | { 22 | "path": "distribution", 23 | "assemblies": ["graylog"], 24 | "assembly_attachment": "graylog-server-tarball" 25 | }, 26 | { 27 | "path": "data-node", 28 | "assemblies": ["graylog-datanode"], 29 | "assembly_attachment": "datanode-tarball" 30 | } 31 | ] 32 | }, 33 | { 34 | "repository": "git@github.com:Graylog2/graylog-plugin-collector.git", 35 | "revision": "5.1", 36 | "assemblies": ["graylog"] 37 | }, 38 | { 39 | "repository": "git@github.com:Graylog2/graylog-plugin-aws.git", 40 | "revision": "5.1", 41 | "assemblies": ["graylog"] 42 | }, 43 | { 44 | "repository": "git@github.com:Graylog2/graylog-plugin-integrations.git", 45 | "revision": "5.1", 46 | "assemblies": ["graylog"] 47 | } 48 | ] 49 | } 50 | -------------------------------------------------------------------------------- /manifests/5.2.json: -------------------------------------------------------------------------------- 1 | { 2 | "assembly_platforms": ["linux-x64", "linux-aarch64"], 3 | "modules": [ 4 | { 5 | "repository": "git@github.com:Graylog2/graylog2-server.git", 6 | "revision": "5.2", 7 | "server": true, 8 | "submodules": [ 9 | { 10 | "path": "graylog2-server" 11 | }, 12 | { 13 | "path": "graylog2-web-interface" 14 | }, 15 | { 16 | "path": "graylog-storage-elasticsearch7" 17 | }, 18 | { 19 | "path": "graylog-storage-opensearch2" 20 | }, 21 | { 22 | "path": "distribution", 23 | "assemblies": ["graylog"], 24 | "assembly_attachment": "graylog-server-tarball" 25 | }, 26 | { 27 | "path": "data-node", 28 | "assemblies": ["graylog-datanode"], 29 | "assembly_attachment": "datanode-tarball" 30 | } 31 | ] 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /manifests/6.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "assembly_platforms": ["linux-x64", "linux-aarch64"], 3 | "modules": [ 4 | { 5 | "repository": "git@github.com:Graylog2/graylog2-server.git", 6 | "revision": "6.0", 7 | "server": true, 8 | "submodules": [ 9 | { 10 | "path": "graylog2-server" 11 | }, 12 | { 13 | "path": "graylog2-web-interface" 14 | }, 15 | { 16 | "path": "graylog-storage-elasticsearch7" 17 | }, 18 | { 19 | "path": "graylog-storage-opensearch2" 20 | }, 21 | { 22 | "path": "distribution", 23 | "assemblies": ["graylog"], 24 | "assembly_attachment": "graylog-server-tarball" 25 | }, 26 | { 27 | "path": "data-node", 28 | "assemblies": ["graylog-datanode"], 29 | "assembly_attachment": "datanode-tarball" 30 | } 31 | ] 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /manifests/6.1.json: -------------------------------------------------------------------------------- 1 | { 2 | "assembly_platforms": ["linux-x64", "linux-aarch64"], 3 | "modules": [ 4 | { 5 | "repository": "git@github.com:Graylog2/graylog2-server.git", 6 | "revision": "6.1", 7 | "server": true, 8 | "submodules": [ 9 | { 10 | "path": "graylog2-server" 11 | }, 12 | { 13 | "path": "graylog2-web-interface" 14 | }, 15 | { 16 | "path": "graylog-storage-elasticsearch7" 17 | }, 18 | { 19 | "path": "graylog-storage-opensearch2" 20 | }, 21 | { 22 | "path": "distribution", 23 | "assemblies": ["graylog"], 24 | "assembly_attachment": "graylog-server-tarball" 25 | }, 26 | { 27 | "path": "data-node", 28 | "assemblies": ["graylog-datanode"], 29 | "assembly_attachment": "datanode-tarball" 30 | } 31 | ] 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /manifests/master.json: -------------------------------------------------------------------------------- 1 | { 2 | "assembly_platforms": ["linux-x64", "linux-aarch64"], 3 | "modules": [ 4 | { 5 | "repository": "git@github.com:Graylog2/graylog2-server.git", 6 | "revision": "master", 7 | "server": true, 8 | "submodules": [ 9 | { 10 | "path": "graylog2-server" 11 | }, 12 | { 13 | "path": "graylog2-web-interface" 14 | }, 15 | { 16 | "path": "graylog-storage-elasticsearch7" 17 | }, 18 | { 19 | "path": "graylog-storage-opensearch2" 20 | }, 21 | { 22 | "path": "distribution", 23 | "assemblies": ["graylog"], 24 | "assembly_attachment": "graylog-server-tarball" 25 | }, 26 | { 27 | "path": "data-node", 28 | "assemblies": ["graylog-datanode"], 29 | "assembly_attachment": "datanode-tarball" 30 | } 31 | ] 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Apache Maven Wrapper startup batch script, version 3.3.2 23 | # 24 | # Optional ENV vars 25 | # ----------------- 26 | # JAVA_HOME - location of a JDK home dir, required when download maven via java source 27 | # MVNW_REPOURL - repo url base for downloading maven distribution 28 | # MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven 29 | # MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output 30 | # ---------------------------------------------------------------------------- 31 | 32 | set -euf 33 | [ "${MVNW_VERBOSE-}" != debug ] || set -x 34 | 35 | # OS specific support. 36 | native_path() { printf %s\\n "$1"; } 37 | case "$(uname)" in 38 | CYGWIN* | MINGW*) 39 | [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" 40 | native_path() { cygpath --path --windows "$1"; } 41 | ;; 42 | esac 43 | 44 | # set JAVACMD and JAVACCMD 45 | set_java_home() { 46 | # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched 47 | if [ -n "${JAVA_HOME-}" ]; then 48 | if [ -x "$JAVA_HOME/jre/sh/java" ]; then 49 | # IBM's JDK on AIX uses strange locations for the executables 50 | JAVACMD="$JAVA_HOME/jre/sh/java" 51 | JAVACCMD="$JAVA_HOME/jre/sh/javac" 52 | else 53 | JAVACMD="$JAVA_HOME/bin/java" 54 | JAVACCMD="$JAVA_HOME/bin/javac" 55 | 56 | if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then 57 | echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 58 | echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 59 | return 1 60 | fi 61 | fi 62 | else 63 | JAVACMD="$( 64 | 'set' +e 65 | 'unset' -f command 2>/dev/null 66 | 'command' -v java 67 | )" || : 68 | JAVACCMD="$( 69 | 'set' +e 70 | 'unset' -f command 2>/dev/null 71 | 'command' -v javac 72 | )" || : 73 | 74 | if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then 75 | echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 76 | return 1 77 | fi 78 | fi 79 | } 80 | 81 | # hash string like Java String::hashCode 82 | hash_string() { 83 | str="${1:-}" h=0 84 | while [ -n "$str" ]; do 85 | char="${str%"${str#?}"}" 86 | h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) 87 | str="${str#?}" 88 | done 89 | printf %x\\n $h 90 | } 91 | 92 | verbose() { :; } 93 | [ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } 94 | 95 | die() { 96 | printf %s\\n "$1" >&2 97 | exit 1 98 | } 99 | 100 | trim() { 101 | # MWRAPPER-139: 102 | # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds. 103 | # Needed for removing poorly interpreted newline sequences when running in more 104 | # exotic environments such as mingw bash on Windows. 105 | printf "%s" "${1}" | tr -d '[:space:]' 106 | } 107 | 108 | # parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties 109 | while IFS="=" read -r key value; do 110 | case "${key-}" in 111 | distributionUrl) distributionUrl=$(trim "${value-}") ;; 112 | distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;; 113 | esac 114 | done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties" 115 | [ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties" 116 | 117 | case "${distributionUrl##*/}" in 118 | maven-mvnd-*bin.*) 119 | MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ 120 | case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in 121 | *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; 122 | :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; 123 | :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; 124 | :Linux*x86_64*) distributionPlatform=linux-amd64 ;; 125 | *) 126 | echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 127 | distributionPlatform=linux-amd64 128 | ;; 129 | esac 130 | distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" 131 | ;; 132 | maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; 133 | *) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; 134 | esac 135 | 136 | # apply MVNW_REPOURL and calculate MAVEN_HOME 137 | # maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ 138 | [ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" 139 | distributionUrlName="${distributionUrl##*/}" 140 | distributionUrlNameMain="${distributionUrlName%.*}" 141 | distributionUrlNameMain="${distributionUrlNameMain%-bin}" 142 | MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}" 143 | MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" 144 | 145 | exec_maven() { 146 | unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : 147 | exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" 148 | } 149 | 150 | if [ -d "$MAVEN_HOME" ]; then 151 | verbose "found existing MAVEN_HOME at $MAVEN_HOME" 152 | exec_maven "$@" 153 | fi 154 | 155 | case "${distributionUrl-}" in 156 | *?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; 157 | *) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; 158 | esac 159 | 160 | # prepare tmp dir 161 | if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then 162 | clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } 163 | trap clean HUP INT TERM EXIT 164 | else 165 | die "cannot create temp dir" 166 | fi 167 | 168 | mkdir -p -- "${MAVEN_HOME%/*}" 169 | 170 | # Download and Install Apache Maven 171 | verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." 172 | verbose "Downloading from: $distributionUrl" 173 | verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" 174 | 175 | # select .zip or .tar.gz 176 | if ! command -v unzip >/dev/null; then 177 | distributionUrl="${distributionUrl%.zip}.tar.gz" 178 | distributionUrlName="${distributionUrl##*/}" 179 | fi 180 | 181 | # verbose opt 182 | __MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' 183 | [ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v 184 | 185 | # normalize http auth 186 | case "${MVNW_PASSWORD:+has-password}" in 187 | '') MVNW_USERNAME='' MVNW_PASSWORD='' ;; 188 | has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; 189 | esac 190 | 191 | if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then 192 | verbose "Found wget ... using wget" 193 | wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" 194 | elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then 195 | verbose "Found curl ... using curl" 196 | curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" 197 | elif set_java_home; then 198 | verbose "Falling back to use Java to download" 199 | javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" 200 | targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" 201 | cat >"$javaSource" <<-END 202 | public class Downloader extends java.net.Authenticator 203 | { 204 | protected java.net.PasswordAuthentication getPasswordAuthentication() 205 | { 206 | return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); 207 | } 208 | public static void main( String[] args ) throws Exception 209 | { 210 | setDefault( new Downloader() ); 211 | java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); 212 | } 213 | } 214 | END 215 | # For Cygwin/MinGW, switch paths to Windows format before running javac and java 216 | verbose " - Compiling Downloader.java ..." 217 | "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" 218 | verbose " - Running Downloader.java ..." 219 | "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" 220 | fi 221 | 222 | # If specified, validate the SHA-256 sum of the Maven distribution zip file 223 | if [ -n "${distributionSha256Sum-}" ]; then 224 | distributionSha256Result=false 225 | if [ "$MVN_CMD" = mvnd.sh ]; then 226 | echo "Checksum validation is not supported for maven-mvnd." >&2 227 | echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 228 | exit 1 229 | elif command -v sha256sum >/dev/null; then 230 | if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then 231 | distributionSha256Result=true 232 | fi 233 | elif command -v shasum >/dev/null; then 234 | if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then 235 | distributionSha256Result=true 236 | fi 237 | else 238 | echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 239 | echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 240 | exit 1 241 | fi 242 | if [ $distributionSha256Result = false ]; then 243 | echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 244 | echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 245 | exit 1 246 | fi 247 | fi 248 | 249 | # unzip and move 250 | if command -v unzip >/dev/null; then 251 | unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" 252 | else 253 | tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" 254 | fi 255 | printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url" 256 | mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" 257 | 258 | clean || : 259 | exec_maven "$@" 260 | -------------------------------------------------------------------------------- /pom.xml-tmpl: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | org.graylog 8 | graylog-project 9 | {{ .Server.Version }} 10 | pom 11 | 12 | 13 | scm:git:git@github.com:Graylog2/graylog-project.git 14 | scm:git:git@github.com:Graylog2/graylog-project.git 15 | https://github.com/Graylog2/graylog-project 16 | HEAD 17 | 18 | 19 | 20 | runner 21 | 22 | {{- range $module := .Modules }} 23 | {{ .RelativePath }} 24 | {{- end }} 25 | 26 | 27 | 28 | UTF-8 29 | UTF-8 30 | false 31 | yyyyMMddHHmmss 32 | true 33 | true 34 | true 35 | true 36 | true 37 | 38 | 39 | 40 | 41 | 42 | ${maven.build.timestamp} 43 | 44 | 45 | 46 | 47 | 49 | 50 | org.graylog 51 | graylog-parent 52 | {{ .Server.Version }} 53 | pom 54 | import 55 | 56 | 57 | 58 | 59 | 60 | {{- range $dependency := .Dependencies }} 61 | 62 | {{ $dependency.GroupId }} 63 | {{ $dependency.ArtifactId }} 64 | {{ $dependency.Version }} 65 | 66 | {{- end }} 67 | 68 | 69 | 70 | 71 | 72 | maven-assembly-plugin 73 | 3.7.1 74 | false 75 | 76 | {{- range $name, $data := .Assemblies }} 77 | 78 | generate-{{ $name }}-artifact 79 | package 80 | 81 | single 82 | 83 | 84 | {{ $name }}-${project.version}-${maven.build.timestamp}${assembly.suffix} 85 | ${project.build.directory}/artifacts/{{ $name }} 86 | 87 | src/main/assembly/{{ $name }}.xml 88 | 89 | 90 | 91 | {{- end }} 92 | 93 | 94 | false 95 | false 96 | true 97 | gnu 98 | 99 | 100 | 101 | com.mycila 102 | license-maven-plugin 103 | 4.5 104 | 105 | true 106 | 107 | 108 | 109 | 110 | check 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | release 120 | 121 | 122 | 123 | org.apache.maven.plugins 124 | maven-assembly-plugin 125 | 126 | {{- range $name, $data := .Assemblies }} 127 | 128 | generate-{{ $name }}-artifact 129 | 130 | {{ $name }}-${project.version} 131 | 132 | 133 | {{- end }} 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /runner/.gitignore: -------------------------------------------------------------------------------- 1 | /data/ 2 | -------------------------------------------------------------------------------- /runner/README.md: -------------------------------------------------------------------------------- 1 | Run Graylog Development Server 2 | ============================== 3 | 4 | This Graylog development setup provides the following services as Docker 5 | containers: 6 | 7 | - Graylog server ([http://localhost:9000/](http://localhost:9000/)) 8 | - Builds the server from the checked out sources 9 | - Pre-configured for email sending to the MailHog service 10 | - Default "admin" password is `admin` 11 | - MongoDB (default: `127.0.0.1:27017`) 12 | - Elasticsearch (default: [http://localhost:9200/](http://localhost:9200/)) 13 | - OpenSearch when `SEARCH_BACKEND` is set to `opensearch` 14 | - [Kibana](https://www.elastic.co/kibana/) (default: [http://localhost:5601/](http://localhost:5601/)) 15 | - [MailHog](https://github.com/mailhog/MailHog) (default: [http://localhost:8025/](http://localhost:8025/)) 16 | 17 | The `runner/data` directory is mounted as `/data` in the Graylog server container 18 | and can be used to make files available to the server. 19 | 20 | The following ports are exposed from the Graylog server container and can be 21 | used to start inputs: 22 | 23 | - `2055/udp` - NetFlow 24 | - `4739/udp` - IPFIX 25 | - `5044/tcp` - Beats 26 | - `5140/udp` - Syslog UDP 27 | - `5140/tcp` - Syslog TCP 28 | - `5555/udp` - Raw TCP 29 | - `5555/tcp` - Raw UDP 30 | - `12201/udp` - GELF UDP 31 | - `12201/tcp` - GELF TCP 32 | - `13001/tcp` - Custom 1 TCP 33 | - `13002/tcp` - Custom 2 TCP 34 | - `13003/tcp` - Custom 3 TCP 35 | - `13004/tcp` - Custom 4 TCP 36 | - `13001/udp` - Custom 1 UDP 37 | - `13002/udp` - Custom 2 UDP 38 | - `13003/udp` - Custom 3 UDP 39 | - `13004/udp` - Custom 4 UDP 40 | - `13301/tcp` - Cloud Forwarder messages 41 | - `13302/tcp` - Cloud Forwarder configuration 42 | 43 | The "Custom" ports can be used to start any inputs. 44 | 45 | ## Requirements 46 | 47 | Make sure you have the following software installed and ready to use: 48 | 49 | - [Docker](https://www.docker.com/get-started) 50 | - [docker-compose](https://docs.docker.com/compose/install/) 51 | - [nodejs](https://nodejs.org/) 52 | - [yarn](https://classic.yarnpkg.com/) (use version 1.x!) 53 | - macOS: 54 | - `realpath` program from coreutils (`brew install coreutils`) 55 | 56 | ## Run Development Server + Elasticsearch and MongoDB 57 | 58 | ```sh 59 | cd /path/to/graylog-project 60 | 61 | graylog-project run dev 62 | ``` 63 | 64 | ## Run Development Server + OpenSearch and MongoDB 65 | 66 | ```sh 67 | cd /path/to/graylog-project 68 | 69 | export SEARCH_BACKEND=opensearch 70 | graylog-project run dev 71 | ``` 72 | 73 | By default the Graylog API service is listening on port `9000`. 74 | 75 | Make sure to checkout more examples and options by running `graylog-project run -h`. 76 | 77 | ### Run Clean Maven Build 78 | 79 | If you want to force a clean maven build, you can use the `--clean` flag. 80 | 81 | ```sh 82 | cd /path/to/graylog-project 83 | 84 | graylog-project run dev --clean 85 | ``` 86 | 87 | ### Include Production Web Interface Assets 88 | 89 | If you want to also build the production web interface assets, you can 90 | use the `--web` flag. 91 | 92 | ```sh 93 | cd /path/to/graylog-project 94 | 95 | graylog-project run dev --web 96 | ``` 97 | 98 | ### Rebuild Development Server Docker Image 99 | 100 | The run command automatically builds the Docker image to run the server 101 | container. If you want to force a rebuild of the container, for example 102 | when something in the image has changed, you can use the `--build-images` 103 | (or `-B`) flag. 104 | 105 | ```sh 106 | cd /path/to/graylog-project 107 | 108 | graylog-project run dev --build 109 | ``` 110 | 111 | ## Run Development Server and Elasticsearch + MongoDB separately 112 | 113 | In one shell run: 114 | 115 | ```sh 116 | cd /path/to/graylog-project 117 | 118 | graylog-project run dev:services 119 | ``` 120 | 121 | In another shell run: 122 | 123 | ```sh 124 | cd /path/to/graylog-project 125 | 126 | graylog-project run dev:server # Also takes --web and --clean flags 127 | ``` 128 | 129 | ## Run Web Development Server 130 | 131 | If you want to run the web development server in a container as well, you can 132 | use the following command. 133 | 134 | ```sh 135 | cd /path/to/graylog-project 136 | 137 | graylog-project run dev:web 138 | ``` 139 | 140 | ## Custom Environment Configuration 141 | 142 | It's possible to override or set new environment variables for the Docker Compose 143 | services by creating a `runner/docker/.env` file. That file is automatically 144 | loaded by Docker Compose. 145 | 146 | Example: 147 | 148 | ``` 149 | echo "GRAYLOG_API_HTTP_PORT=9009" | tee -a runner/docker/.env 150 | ``` 151 | 152 | ## Custom Server Configuration 153 | 154 | After the first development server start, there will be a `runner/data/graylog.conf` 155 | file. Feel free to add custom configuration options to that file. 156 | 157 | The following settings are overridden in the environment and will have no 158 | effect in the `runner/data/graylog.conf` file: 159 | 160 | - `data_dir` 161 | - `elasticsearch_hosts` 162 | - `http_bind_address` 163 | - `http_external_uri` 164 | - `lb_recognition_period_seconds` 165 | - `message_journal_dir` 166 | - `mongodb_uri` 167 | - `node_id_file` 168 | - `report_disable_sandbox` 169 | - `telemetry_enabled` 170 | - `transport_email_enabled` 171 | - `transport_email_hostname` 172 | - `transport_email_port` 173 | - `transport_email_use_auth` 174 | - `transport_email_web_interface_url` 175 | - `versionchecks` 176 | 177 | ## Cleanup Containers 178 | 179 | To remove all containers you can use the cleanup command. This will keep 180 | the volumes so your MongoDB data and Elasticsearch indices still exist. 181 | 182 | ```sh 183 | cd /path/to/graylog-project 184 | 185 | graylog-project run dev:cleanup 186 | ``` 187 | 188 | To also remove the MongoDB and Elasticsearch data, you can use the 189 | `--volumes` (or `-V`) flag. After running this command, all you data is gone. 190 | 191 | ```sh 192 | cd /path/to/graylog-project 193 | 194 | graylog-project run dev:cleanup --volumes 195 | ``` 196 | 197 | ## Troubleshooting 198 | 199 | ### Debug Mode 200 | 201 | If something doesn't start correctly, you can use the `--debug` flag to get 202 | some debug output. 203 | 204 | ```sh 205 | cd /path/to/graylog-project 206 | 207 | graylog-project run dev --debug 208 | ``` 209 | -------------------------------------------------------------------------------- /runner/bin/dev-cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | . "$(dirname $0)/include.sh" 6 | 7 | SEARCH_BACKEND="${SEARCH_BACKEND:-elasticsearch}" 8 | 9 | # Runs docker-compose down to remove all containers 10 | exec docker compose \ 11 | -f "${docker_root}/docker-compose.yml" \ 12 | --profile "$SEARCH_BACKEND" \ 13 | down --remove-orphans $compose_down_opts 14 | -------------------------------------------------------------------------------- /runner/bin/dev-docker-compose.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | . "$(dirname $0)/include.sh" 6 | 7 | # Executes docker-compose 8 | exec docker compose \ 9 | -f "${docker_root}/docker-compose.yml" \ 10 | "$@" 11 | -------------------------------------------------------------------------------- /runner/bin/dev-exec.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | . "$(dirname $0)/include.sh" 6 | 7 | # Starts the server + all services 8 | exec docker compose \ 9 | -f "${docker_root}/docker-compose.yml" \ 10 | exec "$@" 11 | -------------------------------------------------------------------------------- /runner/bin/dev-server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | . "$(dirname $0)/include.sh" 6 | 7 | SEARCH_BACKEND="${SEARCH_BACKEND:-elasticsearch}" 8 | 9 | # Starts only the server 10 | exec docker compose \ 11 | -f "${docker_root}/docker-compose.yml" \ 12 | --profile "$SEARCH_BACKEND" \ 13 | up --abort-on-container-exit --no-deps $compose_up_opts \ 14 | graylog 15 | -------------------------------------------------------------------------------- /runner/bin/dev-services.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | . "$(dirname $0)/include.sh" 6 | 7 | SEARCH_BACKEND="${SEARCH_BACKEND:-elasticsearch}" 8 | 9 | exec docker compose \ 10 | -f "${docker_root}/docker-compose.yml" \ 11 | --profile "$SEARCH_BACKEND" \ 12 | up --abort-on-container-exit $compose_up_opts \ 13 | mongodb \ 14 | "$SEARCH_BACKEND" \ 15 | "${SEARCH_BACKEND}-monitor" \ 16 | mailserver 17 | -------------------------------------------------------------------------------- /runner/bin/dev-web.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | . "$(dirname $0)/include.sh" 6 | 7 | SEARCH_BACKEND="${SEARCH_BACKEND:-elasticsearch}" 8 | 9 | # Starts only the web interface 10 | exec docker compose \ 11 | -f "${docker_root}/docker-compose.yml" \ 12 | --profile "$SEARCH_BACKEND" \ 13 | up --abort-on-container-exit $compose_up_opts \ 14 | web 15 | -------------------------------------------------------------------------------- /runner/bin/dev.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | . "$(dirname $0)/include.sh" 6 | 7 | # Disable logging for all services but Graylog 8 | export SERVICE_LOGGER="${SERVICE_LOGGER:-none}" 9 | 10 | SEARCH_BACKEND="${SEARCH_BACKEND:-elasticsearch}" 11 | 12 | # Starts the server + all services 13 | exec docker compose \ 14 | -f "${docker_root}/docker-compose.yml" \ 15 | --profile "$SEARCH_BACKEND" \ 16 | up --abort-on-container-exit $compose_up_opts \ 17 | mongodb \ 18 | "$SEARCH_BACKEND" \ 19 | "${SEARCH_BACKEND}-monitor" \ 20 | mailserver \ 21 | graylog 22 | -------------------------------------------------------------------------------- /runner/bin/include.sh: -------------------------------------------------------------------------------- 1 | # macOS doesn't have realpath... - Just ask users to install it 2 | if ! type realpath >/dev/null 2>/dev/null; then 3 | echo "ERROR: \"realpath\" is not available" 4 | echo "" 5 | echo "On macOS please install coreutils (brew install coreutils)" 6 | exit 1 7 | fi 8 | 9 | project_root=$(realpath "$(dirname $(realpath $0))/../..") 10 | default_project_repos_root=$(realpath "${project_root}/../graylog-project-repos") 11 | project_repos_root="${GPC_REPOSITORY_ROOT:-$default_project_repos_root}" 12 | runner_root="${project_root}/runner" 13 | docker_root="${runner_root}/docker" 14 | data_root="${runner_root}/data" 15 | project_name_file="${data_root}/.docker-compose-project-name" 16 | 17 | export PROJECT_ROOT="$project_root" 18 | export PROJECT_REPOS_ROOT="$project_repos_root" 19 | export PROJECT_DATA_ROOT="$data_root" 20 | export DEBUG="${DEBUG:-}" 21 | 22 | if [ -n "$DEBUG" ]; then 23 | echo "==> PROJECT_ROOT=$PROJECT_ROOT" 24 | ls -l "$PROJECT_ROOT" 25 | echo "==> PROJECT_REPOS_ROOT=$PROJECT_REPOS_ROOT" 26 | ls -l "$PROJECT_REPOS_ROOT" 27 | echo "==> PROJECT_DATA_ROOT=$PROJECT_DATA_ROOT" 28 | ls -l "$PROJECT_DATA_ROOT" 29 | fi 30 | 31 | mkdir -p "$data_root" 32 | mkdir -p "$HOME/.m2/repository" # Make sure the maven cache exists locally 33 | 34 | cd "$docker_root" 35 | 36 | if [ ! -f "$project_name_file" ]; then 37 | # Use the first 10 characters of the shasum for the full project 38 | # root directory as part of the compose project name. 39 | # This ensures that multiple graylog-project checkouts don't use 40 | # the same name. 41 | project_id=$(echo $runner_root | shasum -a 256 | fold -w 10 | head -1) 42 | echo "graylog_project_$project_id" > "$project_name_file" 43 | fi 44 | 45 | # We cannot use the default compose project name because if the user has 46 | # multiple graylog-project checkouts, the name would be the same. 47 | export COMPOSE_PROJECT_NAME=$(cat "$project_name_file") 48 | 49 | if [ -z "$COMPOSE_PROJECT_NAME" ]; then 50 | echo "ERROR: COMPOSE_PROJECT_NAME cannot be empty" 51 | exit 1 52 | fi 53 | 54 | compose_up_opts="" 55 | if [ -n "$DOCKER_COMPOSE_BUILD_IMAGES" ]; then 56 | compose_up_opts="--build" 57 | fi 58 | 59 | compose_down_opts="" 60 | if [ -n "$DOCKER_COMPOSE_CLEANUP_VOLUMES" ]; then 61 | compose_down_opts="-v" 62 | fi 63 | -------------------------------------------------------------------------------- /runner/docker/.gitignore: -------------------------------------------------------------------------------- 1 | /.env 2 | -------------------------------------------------------------------------------- /runner/docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | x-common-labels: 2 | &common-labels 3 | org.graylog.project.root: "${PROJECT_ROOT:?Missing PROJECT_ROOT in environment}" 4 | 5 | x-common-logging: 6 | &common-logging 7 | driver: "${SERVICE_LOGGER:-json-file}" 8 | options: 9 | max-size: "50m" 10 | max-file: "10" 11 | 12 | networks: 13 | default: 14 | labels: 15 | org.graylog.project.root: "${PROJECT_ROOT:?Missing PROJECT_ROOT in environment}" 16 | 17 | services: 18 | graylog: 19 | build: 20 | context: "images/dev-server-runner" 21 | 22 | depends_on: 23 | - "mongodb" 24 | - "${SEARCH_BACKEND:-elasticsearch}" 25 | - "${SEARCH_BACKEND:-elasticsearch}-monitor" 26 | - "mailserver" 27 | 28 | environment: 29 | # Pass the following variables to the container 30 | GRAYLOG_BUILD_SKIP_WEB: "${GRAYLOG_BUILD_SKIP_WEB:-true}" 31 | GRAYLOG_BUILD_CLEAN: "${GRAYLOG_BUILD_CLEAN:-false}" 32 | 33 | # Defaults: 34 | GRAYLOG_MONGODB_URI: "mongodb://mongodb/graylog" 35 | GRAYLOG_ELASTICSEARCH_HOSTS: "http://${SEARCH_BACKEND:-elasticsearch}:9200" 36 | GRAYLOG_HTTP_BIND_ADDRESS: "0.0.0.0:9000" 37 | GRAYLOG_HTTP_PUBLISH_URI: "http://localhost:${GRAYLOG_API_HTTP_PORT:-9000}/" 38 | GRAYLOG_HTTP_EXTERNAL_URI: "http://localhost:${GRAYLOG_API_HTTP_PORT:-9000}/" 39 | GRAYLOG_HTTP_ENABLE_CORS: "true" 40 | GRAYLOG_LB_RECOGNITION_PERIOD_SECONDS: "0" 41 | GRAYLOG_VERSIONCHECKS: "false" 42 | GRAYLOG_TELEMETRY_ENABLED: "false" 43 | GRAYLOG_DATA_DIR: "/data/node-01" 44 | GRAYLOG_PLUGIN_DIR: "/graylog/graylog-project/runner/plugins" 45 | GRAYLOG_MESSAGE_JOURNAL_DIR: "/data/node-01/journal" 46 | GRAYLOG_NODE_ID_FILE: "/data/node-01/node-id" 47 | GRAYLOG_TRANSPORT_EMAIL_ENABLED: "true" 48 | GRAYLOG_TRANSPORT_EMAIL_HOSTNAME: "mailserver" 49 | GRAYLOG_TRANSPORT_EMAIL_PORT: "1025" 50 | GRAYLOG_TRANSPORT_EMAIL_USE_AUTH: "false" 51 | GRAYLOG_TRANSPORT_EMAIL_WEB_INTERFACE_URL: "http://localhost:${GRAYLOG_API_HTTP_PORT:-9000}/" 52 | GRAYLOG_TRANSPORT_EMAIL_FROM_EMAIL: "graylog-dev-server@localhost" 53 | # To make reporting (headless_shell) work inside a Docker container 54 | GRAYLOG_REPORT_DISABLE_SANDBOX: "true" 55 | # Put the server in development mode so it doesn't complain about missing 56 | # production web assets on startup. 57 | DEVELOPMENT: "true" 58 | DEBUG: "${DEBUG:-}" 59 | # Cache npm packages when building the web interface 60 | YARN_CACHE_FOLDER: "${YARN_CACHE_FOLDER:-/cache/yarn}" 61 | 62 | # This needs to be bumped after changes to images/dev-server-runner to make 63 | # sure docker-compose will automatically rebuild the image. 64 | image: "graylog/dev-server-runner:11" 65 | 66 | hostname: "graylog-dev-server" 67 | 68 | init: true # To make sure we reap child processs (e.g. headless_shell) 69 | 70 | labels: 71 | org.graylog.project.root: "${PROJECT_ROOT:?Missing PROJECT_ROOT in environment}" 72 | 73 | logging: 74 | driver: "json-file" 75 | options: 76 | max-size: "50m" 77 | max-file: "10" 78 | 79 | ports: 80 | - "${GRAYLOG_API_HTTP_PORT:-9000}:9000" 81 | - "127.0.0.1:5005:5005/tcp" # IDE debugging 82 | - "${GRAYLOG_INPUT_LISTEN_IP:-127.0.0.1}:2055:2055/udp" # NetFlow 83 | - "${GRAYLOG_INPUT_LISTEN_IP:-127.0.0.1}:5044:4739/udp" # IPFIX 84 | - "${GRAYLOG_INPUT_LISTEN_IP:-127.0.0.1}:5044:5044/tcp" # Beats 85 | - "${GRAYLOG_INPUT_LISTEN_IP:-127.0.0.1}:5140:5140/udp" # Syslog UDP 86 | - "${GRAYLOG_INPUT_LISTEN_IP:-127.0.0.1}:5140:5140/tcp" # Syslog TCP 87 | - "${GRAYLOG_INPUT_LISTEN_IP:-127.0.0.1}:5555:5555/udp" # Raw UDP 88 | - "${GRAYLOG_INPUT_LISTEN_IP:-127.0.0.1}:5555:5555/tcp" # Raw TCP 89 | - "${GRAYLOG_INPUT_LISTEN_IP:-127.0.0.1}:12201:12201/udp" # GELF UDP 90 | - "${GRAYLOG_INPUT_LISTEN_IP:-127.0.0.1}:12201:12201/tcp" # GELF TCP 91 | - "${GRAYLOG_INPUT_LISTEN_IP:-127.0.0.1}:13001:13001/udp" # Custom 1 UDP 92 | - "${GRAYLOG_INPUT_LISTEN_IP:-127.0.0.1}:13002:13002/udp" # Custom 2 UDP 93 | - "${GRAYLOG_INPUT_LISTEN_IP:-127.0.0.1}:13003:13003/udp" # Custom 3 UDP 94 | - "${GRAYLOG_INPUT_LISTEN_IP:-127.0.0.1}:13004:13004/udp" # Custom 4 UDP 95 | - "${GRAYLOG_INPUT_LISTEN_IP:-127.0.0.1}:13001:13001/tcp" # Custom 1 TCP 96 | - "${GRAYLOG_INPUT_LISTEN_IP:-127.0.0.1}:13002:13002/tcp" # Custom 2 TCP 97 | - "${GRAYLOG_INPUT_LISTEN_IP:-127.0.0.1}:13003:13003/tcp" # Custom 3 TCP 98 | - "${GRAYLOG_INPUT_LISTEN_IP:-127.0.0.1}:13004:13004/tcp" # Custom 4 TCP 99 | - "${GRAYLOG_INPUT_LISTEN_IP:-127.0.0.1}:13301:13301/tcp" # Cloud Forwarder messages 100 | - "${GRAYLOG_INPUT_LISTEN_IP:-127.0.0.1}:13302:13302/tcp" # Cloud Forwarder configuration 101 | 102 | volumes: 103 | - "${PROJECT_ROOT:?Missing PROJECT_ROOT in environment}:/graylog/graylog-project" 104 | - "${PROJECT_REPOS_ROOT:?Missing PROJECT_REPOS_ROOT in environment}:/graylog/graylog-project-repos" 105 | - "${PROJECT_DATA_ROOT:?Missing PROJECT_DATA_ROOT in environment}:/data" 106 | - "$HOME/.m2/repository:/cache/maven" 107 | - "$HOME/.m2/wrapper:/graylog/.m2/wrapper" 108 | - "cache:/cache" 109 | 110 | mongodb: 111 | image: "mongo:${MONGODB_VERSION:-7.0}" 112 | labels: *common-labels 113 | logging: *common-logging 114 | ports: 115 | - "127.0.0.1:${MONGODB_PORT:-27017}:27017" 116 | volumes: 117 | - "${MONGODB_CONFIG_VOLUME:-mongodbconfig}:/data/configdb" 118 | - "${MONGODB_DATA_VOLUME:-mongodb}:/data/db" 119 | 120 | elasticsearch: 121 | environment: 122 | - "ES_JAVA_OPTS=-Xms512m -Xmx512m -Dlog4j2.formatMsgNoLookups=true" 123 | - "discovery.type=single-node" 124 | - "logger.deprecation.level=warn" 125 | - "action.auto_create_index=false" 126 | image: "${ELASTICSEARCH_IMAGE_NAME:-docker.elastic.co/elasticsearch/elasticsearch-oss}:${ELASTICSEARCH_VERSION:-7.10.2}" 127 | labels: *common-labels 128 | logging: *common-logging 129 | ports: 130 | - "127.0.0.1:${ELASTICSEARCH_PORT:-9200}:9200" 131 | profiles: 132 | - "elasticsearch" 133 | volumes: 134 | - "${ELASTICSEARCH_DATA_VOLUME:-elasticsearch}:/usr/share/elasticsearch/data" 135 | 136 | elasticsearch-monitor: 137 | environment: 138 | - "ELASTICSEARCH_HOSTS=http://elasticsearch:9200/" 139 | image: "${KIBANA_IMAGE_NAME:-docker.elastic.co/kibana/kibana-oss}:${ELASTICSEARCH_VERSION:-7.10.2}" 140 | labels: *common-labels 141 | logging: *common-logging 142 | ports: 143 | - "127.0.0.1:${KIBANA_PORT:-5601}:5601" 144 | profiles: 145 | - "elasticsearch" 146 | 147 | opensearch: 148 | environment: 149 | - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" 150 | - "discovery.type=single-node" 151 | - "action.auto_create_index=false" 152 | - "DISABLE_INSTALL_DEMO_CONFIG=true" # disables execution of install_demo_configuration.sh bundled with security plugin, which installs demo certificates and security configurations to OpenSearch 153 | - "DISABLE_SECURITY_PLUGIN=true" # disables security plugin entirely in OpenSearch by setting plugins.security.disabled: true in opensearch.yml 154 | - "bootstrap.memory_lock=true" # along with the memlock settings below, disables swapping 155 | - "node.name=opensearch-node" 156 | image: "opensearchproject/opensearch:${OPENSEARCH_VERSION:-1.3.13}" 157 | labels: *common-labels 158 | logging: *common-logging 159 | ports: 160 | - "127.0.0.1:${ELASTICSEARCH_PORT:-9200}:9200" 161 | - "127.0.0.1:9600:9600" # required for Performance Analyzer 162 | profiles: 163 | - "opensearch" 164 | ulimits: 165 | memlock: 166 | soft: -1 167 | hard: -1 168 | nofile: 169 | soft: 65536 # maximum number of open files for the OpenSearch user, set to at least 65536 on modern systems 170 | hard: 65536 171 | volumes: 172 | - "${OPENSEARCH_DATA_VOLUME:-opensearch}:/usr/share/opensearch/data" 173 | 174 | opensearch-monitor: 175 | environment: 176 | - "DISABLE_SECURITY_DASHBOARDS_PLUGIN=true" # disables security dashboards plugin in OpenSearch Dashboards 177 | - 'OPENSEARCH_HOSTS=["http://opensearch:${ELASTICSEARCH_PORT:-9200}"]' # must be a string with no spaces when specified as an environment variable 178 | image: "opensearchproject/opensearch-dashboards:${OPENSEARCH_VERSION:-1.3.13}" 179 | labels: *common-labels 180 | logging: *common-logging 181 | ports: 182 | - "127.0.0.1:5601:5601" 183 | profiles: 184 | - "opensearch" 185 | 186 | mailserver: 187 | environment: 188 | MH_STORAGE: "memory" 189 | MH_SMTP_BIND_ADDR: "0.0.0.0:1025" 190 | image: "mailhog/mailhog:${MAILHOG_VERSION:-latest}" 191 | labels: *common-labels 192 | logging: *common-logging 193 | ports: 194 | - "127.0.0.1:${MAILHOG_PORT:-8025}:8025" 195 | 196 | web: 197 | build: 198 | context: "images/dev-web-runner" 199 | 200 | environment: 201 | YARN_CACHE_FOLDER: "${YARN_CACHE_FOLDER:-/cache/yarn}" 202 | GRAYLOG_BUILD_CLEAN: "${GRAYLOG_BUILD_CLEAN:-false}" 203 | 204 | # This needs to be bumped after changes to images/dev-web-runner to make 205 | # sure docker-compose will automatically rebuild the image. 206 | image: "graylog/dev-web-runner:7" 207 | 208 | init: true # To make sure we reap child processs 209 | 210 | labels: *common-labels 211 | 212 | logging: 213 | driver: "json-file" 214 | options: 215 | max-size: "50m" 216 | max-file: "10" 217 | 218 | ports: 219 | - "127.0.0.1:${GRAYLOG_WEB_HTTP_PORT:-8080}:8080" 220 | 221 | volumes: 222 | - "${PROJECT_ROOT:?Missing PROJECT_ROOT in environment}:/graylog/graylog-project" 223 | - "${PROJECT_REPOS_ROOT:?Missing PROJECT_REPOS_ROOT in environment}:/graylog/graylog-project-repos" 224 | - "cache:/cache" 225 | 226 | volumes: 227 | mongodbconfig: 228 | labels: *common-labels 229 | mongodb: 230 | labels: *common-labels 231 | elasticsearch: 232 | labels: *common-labels 233 | opensearch: 234 | labels: *common-labels 235 | cache: 236 | labels: *common-labels 237 | -------------------------------------------------------------------------------- /runner/docker/images/dev-server-runner/Dockerfile: -------------------------------------------------------------------------------- 1 | # Build layer 2 | FROM debian:buster-slim AS build 3 | 4 | ENV DEBIAN_FRONTEND noninteractive 5 | 6 | RUN apt-get update && apt-get install --no-install-recommends --assume-yes 'gosu=1.10-*' uuid-runtime pwgen curl ca-certificates 7 | RUN curl -sL -o /usr/bin/graylog-project https://github.com/Graylog2/graylog-project-cli/releases/latest/download/graylog-project.linux && \ 8 | chmod +x /usr/bin/graylog-project 9 | 10 | 11 | # Final layer 12 | FROM maven:3.9-eclipse-temurin-17 13 | 14 | ENV DEBIAN_FRONTEND noninteractive 15 | 16 | COPY --from=build /usr/sbin/gosu /usr/sbin/gosu 17 | COPY --from=build /usr/bin/uuidgen /usr/bin/uuidgen 18 | COPY --from=build /usr/bin/pwgen /usr/bin/pwgen 19 | COPY --from=build /usr/bin/graylog-project /usr/bin/graylog-project 20 | COPY docker-entrypoint.sh / 21 | COPY build-and-run.sh / 22 | COPY clean.sh / 23 | COPY maven-settings.xml /graylog/ 24 | 25 | # We need JDK 17 and 8 in the image to allow the compilation of pre-5.0 Graylog versions 26 | RUN apt-get update \ 27 | && apt-get install -y --no-install-recommends \ 28 | openjdk-8-jdk-headless \ 29 | && apt-get clean \ 30 | && rm -rf /var/lib/apt/lists/* 31 | 32 | VOLUME ["/graylog/graylog-project", "/graylog/graylog-project-repos", "/data"] 33 | 34 | WORKDIR /graylog/graylog-project 35 | 36 | ENTRYPOINT ["/docker-entrypoint.sh"] 37 | CMD ["build-and-run"] 38 | -------------------------------------------------------------------------------- /runner/docker/images/dev-server-runner/build-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eo pipefail 4 | 5 | if [ -n "$DEBUG" ]; then 6 | set -x 7 | ls -l 8 | echo "########################" 9 | ls -l .. 10 | echo "########################" 11 | ls -l ../graylog-project-repos 12 | echo "########################" 13 | ls -l /graylog/graylog-project-repos 14 | echo "########################" 15 | graylog-project status 16 | echo "########################" 17 | graylog-project exec "ls -l" 18 | fi 19 | 20 | # Detect if we have to use Java 8 21 | if grep -q maven.compiler.source.1.8 /graylog/graylog-project-repos/graylog2-server/pom.xml; then 22 | echo "===> Using Java 8" 23 | export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-$(dpkg --print-architecture)" 24 | fi 25 | 26 | goals="" 27 | if [ "$GRAYLOG_BUILD_CLEAN" = "true" ]; then 28 | echo "===> Cleaning up" 29 | goals="clean" 30 | fi 31 | 32 | flags="" 33 | if [ "$GRAYLOG_BUILD_SKIP_WEB" = "true" ]; then 34 | flags="-Dskip.web.build" 35 | else 36 | # Make sure the server is using the production artifacts 37 | unset DEVELOPMENT 38 | fi 39 | 40 | # Detect if we can use the maven wrapper 41 | if [ -f ./mvnw ]; then 42 | mvn=./mvnw 43 | else 44 | mvn=mvn 45 | fi 46 | 47 | echo "===> Running build" 48 | # Build and generate classpath file: (we use the test goal even though we skip tests to avoid a test-jar error) 49 | $mvn $flags \ 50 | -s /graylog/maven-settings.xml \ 51 | -Dmaven.javadoc.skip=true \ 52 | -DskipTests \ 53 | -Dforbiddenapis.skip=true \ 54 | -DincludeScope=runtime \ 55 | -Dmdep.outputFile=target/classpath.txt \ 56 | $goals test \ 57 | org.apache.maven.plugins:maven-dependency-plugin:3.2.0:build-classpath 58 | 59 | 60 | mkdir -p $(dirname "$GRAYLOG_NODE_ID_FILE") 61 | 62 | if [ ! -f "$GRAYLOG_NODE_ID_FILE" ]; then 63 | echo "===> Generating: $GRAYLOG_NODE_ID_FILE" 64 | uuidgen > "$GRAYLOG_NODE_ID_FILE" 65 | fi 66 | 67 | if [ ! -f "/data/graylog.conf" ]; then 68 | echo "===> Creating /data/graylog.conf" 69 | 70 | cat <<-__CONFIG > /data/graylog.conf 71 | password_secret = $(pwgen -N 1 -s 96) 72 | 73 | # Default password is "admin" 74 | root_password_sha2 = 8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918 75 | 76 | ## Add custom config below 77 | __CONFIG 78 | fi 79 | 80 | if [ ! -f "/data/feature-flags.config" ]; then 81 | echo "===> Creating /data/feature-flags.config" 82 | 83 | cat <<-__FEATUREFLAGS > /data/feature-flags.config 84 | # Add custom feature flags in Java properties syntax 85 | __FEATUREFLAGS 86 | fi 87 | 88 | echo "===> Running graylog server" 89 | classpath=$(< runner/target/classpath.txt) 90 | exec java \ 91 | -Dio.netty.leakDetection.level=paranoid \ 92 | -Dlog4j2.formatMsgNoLookups=true \ 93 | -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:5005 \ 94 | -Xms1g \ 95 | -Xmx1g \ 96 | -server \ 97 | -XX:-OmitStackTraceInFastThrow \ 98 | -classpath "$classpath" \ 99 | org.graylog2.bootstrap.Main \ 100 | server -f /data/graylog.conf -np --local -ff /data/feature-flags.config 101 | -------------------------------------------------------------------------------- /runner/docker/images/dev-server-runner/clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eo pipefail 4 | 5 | echo "===> Running clean" 6 | mvn clean 7 | -------------------------------------------------------------------------------- /runner/docker/images/dev-server-runner/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eo pipefail 4 | 5 | if [ -n "$DEBUG" ]; then 6 | set -x 7 | fi 8 | 9 | # Allow execution of different commands 10 | if [ "$1" != "build-and-run" -a "$1" != "clean" ]; then 11 | exec "$@" 12 | fi 13 | 14 | check_env() { 15 | local key="$1" 16 | local value="$2" 17 | 18 | if [ -z "$value" ]; then 19 | echo "ERROR: Missing $key environment variable" 20 | exit 1 21 | fi 22 | } 23 | 24 | # Make sure we have all require environment variables 25 | check_env "GRAYLOG_NODE_ID_FILE" "$GRAYLOG_NODE_ID_FILE" 26 | check_env "GRAYLOG_MONGODB_URI" "$GRAYLOG_MONGODB_URI" 27 | check_env "GRAYLOG_ELASTICSEARCH_HOSTS" "$GRAYLOG_ELASTICSEARCH_HOSTS" 28 | check_env "YARN_CACHE_FOLDER" "$YARN_CACHE_FOLDER" 29 | 30 | mkdir -p "$YARN_CACHE_FOLDER" 31 | 32 | # A file that will always exists and is owned by the user 33 | canary_file="/graylog/graylog-project/.git/config" 34 | 35 | if [ ! -f "$canary_file" ]; then 36 | echo "ERROR: Missing volume mount" 37 | exit 1 38 | fi 39 | 40 | user="nobody" 41 | group="nogroup" 42 | uid=$(stat -c "%u" "$canary_file") 43 | gid=$(stat -c "%g" "$canary_file") 44 | 45 | # Adjust uid and gid of user and group to match the canary permissions. 46 | # If a user for the uid and gid already exists, use that user instead of 47 | # the default user. 48 | if getent group $gid >/dev/null; then 49 | group="$(getent group "$gid" | cut -d : -f 1)" 50 | else 51 | groupmod -g "$gid" "$group" 52 | fi 53 | if getent passwd $uid >/dev/null; then 54 | user="$(getent passwd "$uid" | cut -d : -f 1)" 55 | else 56 | usermod -u "$uid" -g "$gid" -d "/graylog" "$user" >/dev/null 57 | fi 58 | 59 | echo "==> Using user \"${user}:${group}\" (${uid}:${gid})" 60 | 61 | chown -R ${uid}:${gid} /cache /data 62 | 63 | if [ "$1" = "clean" ]; then 64 | exec gosu "${uid}:${gid}" /clean.sh 65 | fi 66 | 67 | exec gosu "${uid}:${gid}" /build-and-run.sh 68 | -------------------------------------------------------------------------------- /runner/docker/images/dev-server-runner/maven-settings.xml: -------------------------------------------------------------------------------- 1 | 5 | /cache/maven/ 6 | 7 | -------------------------------------------------------------------------------- /runner/docker/images/dev-web-runner/Dockerfile: -------------------------------------------------------------------------------- 1 | # Build layer 2 | FROM debian:buster-slim AS build 3 | 4 | ENV DEBIAN_FRONTEND noninteractive 5 | 6 | RUN apt-get update && apt-get install --no-install-recommends --assume-yes 'gosu=1.10-*' curl ca-certificates 7 | RUN curl -sL -o /usr/bin/graylog-project https://github.com/Graylog2/graylog-project-cli/releases/latest/download/graylog-project.linux && \ 8 | chmod +x /usr/bin/graylog-project 9 | 10 | 11 | # Final layer 12 | FROM node:20-buster 13 | 14 | COPY --from=build /usr/sbin/gosu /usr/sbin/gosu 15 | COPY --from=build /usr/bin/graylog-project /usr/bin/graylog-project 16 | COPY docker-entrypoint.sh / 17 | COPY build-and-run.sh / 18 | COPY clean.sh / 19 | 20 | VOLUME ["/graylog/graylog-project", "/graylog/graylog-project-repos", "/cache"] 21 | 22 | WORKDIR /graylog/graylog-project 23 | 24 | ENTRYPOINT ["/docker-entrypoint.sh"] 25 | CMD ["build-and-run"] 26 | -------------------------------------------------------------------------------- /runner/docker/images/dev-web-runner/build-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eo pipefail 4 | 5 | server_root="/graylog/graylog-project-repos/graylog2-server/graylog2-server" 6 | 7 | # The API definition generator doesn't exist pre-5.0 8 | if [ -f "$server_root/src/main/java/org/graylog/api/GenerateApiDefinition.java" ]; then 9 | api_json_file="$server_root/target/swagger/api.json" 10 | 11 | while [ ! -f "$api_json_file" ]; do 12 | echo "WARNING: Please run \"run dev\" or \"mvn compile\" to generate the required TypeScript files. Waiting..." 13 | sleep 5 14 | done 15 | fi 16 | 17 | echo "===> Running yarn install" 18 | graylog-project yarn install 19 | 20 | 21 | cd /graylog/graylog-project-repos/graylog2-server/graylog2-web-interface 22 | 23 | echo "===> Running yarn generate:apidefs" 24 | yarn run generate:apidefs 25 | 26 | echo "===> Running yarn build" 27 | yarn build 28 | 29 | echo "===> Running web dev server" 30 | export GRAYLOG_API_URL="http://graylog:9000" 31 | exec yarn start --host=0.0.0.0 --port=8080 32 | -------------------------------------------------------------------------------- /runner/docker/images/dev-web-runner/clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eo pipefail 4 | 5 | echo "===> Running clean" 6 | graylog-project npm-clean 7 | -------------------------------------------------------------------------------- /runner/docker/images/dev-web-runner/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eo pipefail 4 | 5 | # Allow execution of different commands 6 | if [ "$1" != "build-and-run" -a "$1" != "clean" ]; then 7 | exec "$@" 8 | fi 9 | 10 | check_env() { 11 | local key="$1" 12 | local value="$2" 13 | 14 | if [ -z "$value" ]; then 15 | echo "ERROR: Missing $key environment variable" 16 | exit 1 17 | fi 18 | } 19 | 20 | # Make sure we have all require environment variables 21 | check_env "YARN_CACHE_FOLDER" "$YARN_CACHE_FOLDER" 22 | 23 | mkdir -p "$YARN_CACHE_FOLDER" 24 | 25 | # A file that will always exists and is owned by the user 26 | canary_file="/graylog/graylog-project/.git/config" 27 | 28 | if [ ! -f "$canary_file" ]; then 29 | echo "ERROR: Missing volume mount" 30 | exit 1 31 | fi 32 | 33 | user="node" 34 | group="node" 35 | uid=$(stat -c "%u" "$canary_file") 36 | gid=$(stat -c "%g" "$canary_file") 37 | 38 | # Adjust uid and gid of user and group to match the canary permissions. 39 | # If a user for the uid and gid already exists, use that user instead of 40 | # the default user. 41 | if getent group $gid >/dev/null; then 42 | group="$(getent group "$gid" | cut -d : -f 1)" 43 | else 44 | groupmod -g "$gid" "$group" 45 | fi 46 | if getent passwd $uid >/dev/null; then 47 | user="$(getent passwd "$uid" | cut -d : -f 1)" 48 | else 49 | usermod -u "$uid" -g "$gid" -d "/graylog" "$user" >/dev/null 50 | fi 51 | 52 | echo "==> Using user \"${user}:${group}\" (${uid}:${gid})" 53 | 54 | chown -R ${uid}:${gid} /cache 55 | 56 | if [ "$1" = "clean" ]; then 57 | exec gosu "$user" /clean.sh 58 | fi 59 | 60 | if [ "$GRAYLOG_BUILD_CLEAN" = "true" ]; then 61 | gosu "$user" /clean.sh 62 | fi 63 | 64 | exec gosu "$user" /build-and-run.sh 65 | -------------------------------------------------------------------------------- /runner/pom.xml-tmpl: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | org.graylog 9 | graylog-project 10 | {{ .Server.Version }} 11 | 12 | 13 | runner 14 | {{ .Server.Version }} 15 | 16 | 17 | true 18 | true 19 | true 20 | true 21 | true 22 | 23 | 24 | 25 | 26 | 27 | org.graylog.repackaged 28 | download-maven-plugin 29 | 30 | true 31 | 32 | 33 | 34 | maven-assembly-plugin 35 | 36 | true 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/main/assembly/component-graylog.xml-tmpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | {{- range $assembly := index .Assemblies "graylog" }} 8 | 9 | true 10 | 11 | {{ $assembly }} 12 | 13 | 14 | {{- if $assembly.Attachment }} 15 | {{ $assembly.Attachment }} 16 | false 17 | true 18 | 19 | 20 | sbom/** 21 | 22 | 23 | {{- else }} 24 | false 25 | plugin 26 | false 27 | {{- end }} 28 | 29 | 30 | {{- end }} 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/main/assembly/graylog-datanode.xml-tmpl: -------------------------------------------------------------------------------- 1 | 2 | 5 | graylog-datanode 6 | 7 | tar.gz 8 | 9 | true 10 | 11 | {{- range $assembly := index .Assemblies "graylog-datanode" }} 12 | 13 | true 14 | 15 | {{ $assembly }} 16 | 17 | 18 | {{- if $assembly.Attachment }} 19 | {{ $assembly.Attachment }} 20 | false 21 | true 22 | {{- else }} 23 | false 24 | plugin 25 | false 26 | {{- end }} 27 | 28 | 29 | {{- end }} 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/main/assembly/graylog.xml-tmpl: -------------------------------------------------------------------------------- 1 | 2 | 5 | graylog 6 | 7 | tar.gz 8 | 9 | true 10 | 11 | src/main/assembly/component-graylog.xml 12 | 13 | 14 | --------------------------------------------------------------------------------