Skip to content

fnt-eve/zobserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZObserver

zobserver is a Go-based application designed to monitor EVE Online killmail feeds, filter them based on specified criteria (characters, corporations, alliances), and relay relevant killmails to Discord webhooks. It polls ZKillboard's R2Z2 killmail feed for incoming killmails and uses the EVE Online ESI API for additional data.

Features

  • EVE Online Killmail Monitoring: Polls ZKillboard's R2Z2 killmail feed, an ordered sequence of static killmail files.
  • Configurable Filtering: Filters killmails based on:
    • Character IDs
    • Corporation IDs
    • Alliance IDs
    • Option to capture all killmails.
  • Discord Notifications: Sends formatted killmail notifications to configured Discord webhooks.
  • Containerized & Kubernetes Ready: Designed to run as a Docker container and deployable via a Helm chart.

Configuration

zobserver is configured via environment variables.

Core Configuration

  • ESI_USER_AGENT: User-Agent string sent on ESI and R2Z2 requests. R2Z2 returns HTTP 403 for a blank User-Agent. Default: "zobserver".
  • DESTINATIONS: A string containing the YAML configuration for destinations directly (see format below).
  • DESTINATIONS_FILE: Path to a YAML file containing destination configurations. Alternative to DESTINATIONS.
  • ACTIVE_POLL_INTERVAL: Delay between consecutive killmail fetches while catching up to the live edge. Default: 100ms.
  • IDLE_POLL_INTERVAL: Delay after reaching the live edge (HTTP 404) before polling again. Default: 6s.
  • LOG_FORMAT: Log output format (e.g., "prod", "devel").
  • LOG_LEVEL: Logging level (e.g., "info", "debug").

If neither DESTINATIONS_FILE nor DESTINATIONS is provided, the application will error as it requires at least one destination.

Destinations Configuration (YAML Format)

This configuration can be provided via the DESTINATIONS environment variable directly or in a file specified by DESTINATIONS_FILE.

- name: "Example Destination 1 (All Killmails)"
  all: true
  discord_webhooks:
    - id: "YOUR_DISCORD_WEBHOOK_ID_1"
      token: "YOUR_DISCORD_WEBHOOK_TOKEN_1"
- name: "Example Destination 2 (Specific Entities)"
  character_ids:
    - 90000001
    - 90000002
  corporation_ids:
    - 1000001
  alliance_ids:
    - 300001
  discord_webhooks:
    - id: "YOUR_DISCORD_WEBHOOK_ID_2"
      token: "YOUR_DISCORD_WEBHOOK_TOKEN_2"
    - id: "YOUR_DISCORD_WEBHOOK_ID_3"
      token: "YOUR_DISCORD_WEBHOOK_TOKEN_3"

Refer to internal/observer/config.go for the structure definitions.

Getting Started

Prerequisites

  • Go (for building from source)
  • Docker
  • Kubernetes and Helm (for Kubernetes deployment)

Run with Docker

A Dockerfile is present in the root of the project. The application image is also available on ghcr.io/fnt-eve/zobserver.

  1. Build the Docker image (if building locally):
    docker build -t zobserver:latest .
  2. Run the Docker container: You'll need to pass the necessary environment variables for configuration.
    docker run -d \
      -e ESI_USER_AGENT="your-esi-agent/1.0 your@email.com" \
      -e DESTINATIONS_FILE="/app/destinations.yaml" \
      -v /path/to/your/destinations.yaml:/app/destinations.yaml \
      --name zobserver \
      ghcr.io/fnt-eve/zobserver:latest # Or your locally built tag

Deploy to Kubernetes

The project includes a Helm chart located in the k8s/zobserver/ directory.

  1. Navigate to the chart directory:
    cd k8s/zobserver
  2. Customize values.yaml as needed, especially the env section for configuration. The existing k8s/zobserver/README.md provides details on configurable values.
  3. Deploy using Helm:
    helm install zobserver . -n <your-namespace>
    # Or
    helm upgrade --install zobserver . -n <your-namespace> -f my-values.yaml

Project Structure

  • cmd/observer/: Main application entry point.
  • internal/: Contains the core logic of the observer.
    • internal/logger/: Logging setup.
    • internal/observer/: Core observer, R2Z2 poller, routing, and ESI/Discord sending logic.
  • k8s/zobserver/: Helm chart for Kubernetes deployment.
  • Dockerfile: For building the Docker image.
  • go.mod, go.sum: Go module files.

Contributing

Contributions are welcome! Please feel free to open an issue or submit a pull request. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

About

EVE Online killmail observer that filters and relays killmails to Discord webhooks via Redis and ESI.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors