Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add README template for the different images #209

Draft
wants to merge 1 commit into
base: 4.3
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions README-base.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# {% block title %}{% endblock %} Docker Image

[![Docker Stars](https://img.shields.io/docker/stars/graylog/{% block image_name %}{% endblock %}.svg)][hub] [![Docker Pulls](https://img.shields.io/docker/pulls/graylog/{{ self.image_name() }}.svg)][hub]

[hub]: https://hub.docker.com/r/graylog/{{ self.image_name() }}/

The latest stable version of {{ self.title() }} is **`{{ graylog.major_version }}.{{ graylog.minor_version }}.{{ graylog.patch_version }}`**.

## What is {{ self.title() }}?

{{ self.title() }} is a centralized logging solution that enables aggregating and searching through logs. It provides a powerful query language, a processing pipeline for data transformation, alerting abilities, and much more. It is fully extensible through a REST API. Add-ons can be downloaded from the [Graylog Marketplace](https://marketplace.graylog.org/).


## Image Details

There are several different image variants available, with variants for Java 8 and 11 on platforms `linux/amd64` and `linux/arm64`. All images run on Debian 11.

#### `graylog/{{ self.image_name() }}`

{% block content %}
{% endblock %}

> Note: There is no 'latest' tag. You'll need to specify which version you want.

## Architecture

Take a look at the minimal [Graylog architecture](https://docs.graylog.org/docs/architecture) to get the big picture of a Graylog setup. In essence, Graylog needs to talk to MongoDB to store configuration data as well as Elasticsearch to store the actual log data.


## Configuration

Please refer to the [Graylog Docker documentation](https://docs.graylog.org/docs/docker) for a comprehensive overview and detailed description of the {{ self.title() }} Docker image.

If you want to quickly spin up an instance for testing, you can use our [Docker Compose template](https://github.com/Graylog2/docker-compose).

Notably, this image **requires** that two important configuration options be set (although in practice you will likely need to set more):
1. `password_secret` (environment variable `GRAYLOG_PASSWORD_SECRET`)
* A secret that is used for password encryption and salting.
* Must be at least 16 characters, however using at least 64 characters is strongly recommended.
* Must be the same on all Graylog nodes in the cluster.
* May be generated with something like: `pwgen -N 1 -s 96`
2. `root_password_sha2` (environment variable `GRAYLOG_ROOT_PASSWORD_SHA2`)
* A SHA2 hash of a password you will use for your initial login as Graylog's root user.
* The default username is `admin`. This value is customizable via configuration option `root_username` (environment variable `GRAYLOG_ROOT_USERNAME`).
* In general, these credentials will only be needed to initially set up the system or reconfigure the system in the event of an authentication backend failure.
* This password cannot be changed using the API or via the Web interface.
* May be generated with something like: `echo -n "Enter Password: " && head -1 </dev/stdin | tr -d '\n' | sha256sum | cut -d" " -f1`


Every [Graylog configuration option](https://docs.graylog.org/docs/server-conf) can be set via environment variable. To get the environment variable name for a given configuration option, simply prefix the option name with `GRAYLOG_` and put it all in upper case. Another option is to store the configuration file outside of the container and edit it directly.

This image includes the [wait-for-it](https://github.com/vishnubob/wait-for-it) script, which allows you to have Docker wait for Elasticsearch to start up before starting Graylog. For example, if you are using Docker Compose you could override the entrypoint for Graylog like this:

`entrypoint: /usr/bin/tini -- wait-for-it elasticsearch:9200 -- /docker-entrypoint.sh`

## Documentation

Documentation for Graylog is hosted [here](https://docs.graylog.org/). Please read through the docs and familiarize yourself with the functionality before opening an [issue on GitHub](https://github.com/Graylog2/graylog2-server/issues).

## License

{% block license %}{% endblock %}

This Docker image is licensed under the Apache 2.0 license, see [LICENSE](LICENSE).
18 changes: 18 additions & 0 deletions README-enterprise.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% extends "README-base.j2" %}

{% block title %}Graylog Enterprise{% endblock %}
{% block image_name %}graylog-enterprise{% endblock %}

{% block content %}
This is the [Graylog Enterprise](https://hub.docker.com/r/graylog/graylog-enterprise/) image. It contains the commercial [Graylog Enterprise](https://www.graylog.org/products/enterprise) product.

| Java Version | Platform | Tags |
|---|---|---|
| OpenJDK 8 | `linux/amd64` | `{{ graylog.major_version }}.{{ graylog.minor_version }}`, `{{ graylog.major_version }}.{{ graylog.minor_version }}.{{ graylog.patch_version }}`, `{{ graylog.major_version }}.{{ graylog.minor_version }}.{{ graylog.patch_version }}-{{ graylog.release }}` |
| OpenJDK 11 | `linux/amd64` | `{{ graylog.major_version }}.{{ graylog.minor_version }}-jre11`, `{{ graylog.major_version }}.{{ graylog.minor_version }}.{{ graylog.patch_version }}-jre11`, `{{ graylog.major_version }}.{{ graylog.minor_version }}.{{ graylog.patch_version }}-{{ graylog.release }}-jre11` |
{% endblock %}

{% block license %}
See the Graylog Enterprise [License and Support Agreement](https://www.graylog.org/enterprise-license).
{% endblock %}

36 changes: 36 additions & 0 deletions README-forwarder.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Graylog Forwarder Docker Image

[![Docker Stars](https://img.shields.io/docker/stars/graylog/graylog-forwarder.svg)][hub] [![Docker Pulls](https://img.shields.io/docker/pulls/graylog/graylog-forwarder.svg)][hub]

[hub]: https://hub.docker.com/r/graylog/graylog-forwarder/

The latest stable version of Graylog Forwarder is **`{{ forwarder.version }}`**.

## What is Graylog Forwarder?

The Graylog Forwarder is a standalone agent for sending send log data to Graylog Cloud or an on-premise Graylog Server cluster. The Forwarder is typically run as a service to continuously stream data to the destination Graylog cluster.

## Image Details

There are platform images available for `linux/amd64` and `linux/arm64`. All images run on Debian 11.

#### `graylog/graylog-forwarder`

This image runs the [Graylog Forwarder](https://hub.docker.com/r/graylog/graylog-forwarder/). Documentation on the Forwarder can be found [here](https://docs.graylog.org/docs/forwarder).

The latest stable version is **`{{ forwarder.version }}`**, with support for Java 8 on platform `linux/amd64` and `linux/arm64`.

| Java Version | Platform | Tags |
|---|---|---|
| OpenJDK 8 | `linux/amd64`, `linux/arm64` | `{{ forwarder.version }}`, `forwarder-{{ forwarder.version }}-{{ forwarder.release }}` |


## Configuration

Please refer to the [Graylog Forwarder documentation](https://hub.docker.com/r/graylog/graylog-forwarder/) for a configuration overview.

## License

See the Graylog Enterprise Forwarder [License and Support Agreement](https://www.graylog.org/enterprise-license).

This Docker image is licensed under the Apache 2.0 license, see [LICENSE](LICENSE).
17 changes: 17 additions & 0 deletions README-oss.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% extends "README-base.j2" %}

{% block title %}Graylog{% endblock %}
{% block image_name %}graylog{% endblock %}

{% block content %}
This is the open source [Graylog ](https://hub.docker.com/r/graylog/graylog/) image. It contains [Graylog](https://github.com/Graylog2/graylog2-server) as well as the [Integrations](https://docs.graylog.org/docs/integrations) plugin.

| Java Version | Platform | Tags |
|---|---|---|
| OpenJDK 8 | `linux/amd64`, `linux/arm64` | `{{ graylog.major_version }}.{{ graylog.minor_version }}`, `{{ graylog.major_version }}.{{ graylog.minor_version }}.{{ graylog.patch_version }}`, `{{ graylog.major_version }}.{{ graylog.minor_version }}.{{ graylog.patch_version }}-{{ graylog.release }}` |
| OpenJDK 11 | `linux/amd64`, `linux/arm64` | `{{ graylog.major_version }}.{{ graylog.minor_version }}-jre11`, `{{ graylog.major_version }}.{{ graylog.minor_version }}.{{ graylog.patch_version }}-jre11`, `{{ graylog.major_version }}.{{ graylog.minor_version }}.{{ graylog.patch_version }}-{{ graylog.release }}-jre11` |
{% endblock %}

{% block license %}
Graylog itself is licensed under the Server Side Public License (SSPL), see [license information](https://www.mongodb.com/licensing/server-side-public-license).
{% endblock %}
13 changes: 10 additions & 3 deletions release.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
help="Get Forwarder image version.", action='store_true')
parser.add_argument('--generate-readme',
help="Generate a new README.md with the latest tags", action='store_true')
parser.add_argument('--template', type=str)

if len(sys.argv) == 1:
parser.print_help(sys.stderr)
Expand All @@ -36,9 +37,15 @@
str(version_parsed['forwarder']['release']), end='')

if args.generate_readme:
from jinja2 import Template
with open('README.j2', 'r') as template_file:
j2_template = Template(template_file.read())
template_file = args.template

if not template_file:
print('ERROR: Missing --template option')
sys.exit(1)

from jinja2 import Environment, FileSystemLoader
env = Environment(loader=FileSystemLoader('.'))
j2_template = env.get_template(template_file)

with open("README.md", "w") as readme_file:
readme_file.write(j2_template.render(version_parsed))