Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
113 changes: 113 additions & 0 deletions .examples/bedrock/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Gate + Geyser Bedrock Support Example

This example demonstrates how to set up Gate with Geyser for Bedrock Edition support, allowing both Java and Bedrock players to join the same server.

## Quick Start

1. **Generate Floodgate Key** (first time only):

```bash
# Generate a new Floodgate key
docker run --rm -v $(pwd)/geyser:/data itzg/minecraft-server \
sh -c "mkdir -p /data && openssl genpkey -algorithm RSA -out /data/key.pem -pkcs8"
```

2. **Start the services**:

```bash
docker compose up -d
```

3. **Check logs**:

```bash
docker compose logs -f
```

4. **Connect**:
- **Java players**: Connect to `localhost:25565`
- **Bedrock players**: Connect to `localhost:19132`

## Architecture

```
Bedrock Players (19132/udp) → Geyser → Gate (25567) → Backend Servers
Java Players (25565/tcp) → Gate → Backend Servers
```

## Services

- **Gate**: Main proxy server handling both Java and translated Bedrock connections
- **Geyser**: Protocol translator converting Bedrock to Java Edition protocol
- **Server1**: Backend Minecraft server (no plugins required)
- **Volumes**: Persistent world data

## Configuration Files

- `gate.yml` - Gate proxy configuration with Bedrock support enabled
- `geyser/config.yml` - Geyser standalone configuration

- `server.properties` - Backend server properties
- `docker-compose.yml` - Docker services orchestration

## Security Notes

- The Gate Bedrock listener (port 25567) should only accept connections from Geyser
- In production, use firewall rules to restrict access to this port
- The `key.pem` file enables secure authentication between Geyser and Gate (no backend plugins required)

## Troubleshooting

### Bedrock players can't connect

- Check that UDP port 19132 is accessible
- Verify Geyser logs for connection errors
- Ensure the Floodgate key is properly shared

### Authentication errors

- Verify the `key.pem` is accessible by both Geyser and Gate
- Check file permissions on the key file
- Ensure backend servers have `online-mode=false` (since Gate handles authentication)

### Performance issues

- Adjust Geyser's `compression-level` and `mtu` settings
- Monitor resource usage of the Geyser container
- Consider using `use-direct-connection: true` in Geyser config

## Customization

### Username Format

Change the Bedrock username prefix in `gate.yml`:

```yaml
bedrock:
usernameFormat: 'BE_%s' # Prefix with "BE_"
```

### Resource Packs

Add Bedrock-compatible resource packs to the Geyser configuration.

### Plugins

Install additional plugins on the backend server. Most Java plugins work with Bedrock players since Gate handles the protocol translation and presents them as regular Java players.

## Production Deployment

For production use:

1. Use proper secrets management for the Floodgate key
2. Configure firewall rules to protect the Bedrock listener port
3. Set up monitoring and logging
4. Use persistent volumes for world data
5. Configure backup strategies
6. Consider using Gate's Connect integration for DDoS protection

## Support

- [Gate Documentation](https://gate.minekube.com/)
- [Geyser Wiki](https://wiki.geysermc.org/)
- [Gate Discord](https://minekube.com/discord)
47 changes: 47 additions & 0 deletions .examples/bedrock/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
services:
gate:
image: ghcr.io/minekube/gate:latest
restart: unless-stopped
environment:
- GATE_CONFIG_PATH=/gate/gate.yml
volumes:
- ./gate.yml:/gate/gate.yml
- ./geyser/key.pem:/gate/floodgate.pem
ports:
- '25565:25565' # Java Edition
- '25567:25567' # Geyser listener
depends_on:
- server1

geyser:
image: itzg/minecraft-server
restart: unless-stopped
environment:
EULA: 'TRUE'
TYPE: 'CUSTOM'
CUSTOM_SERVER: 'https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/standalone'
ports:
- '19132:19132/udp' # Bedrock Edition
volumes:
- ./geyser/config.yml:/data/config.yml
- ./geyser/key.pem:/data/key.pem
depends_on:
- gate

server1:
image: itzg/minecraft-server
restart: unless-stopped
environment:
EULA: 'TRUE'
TYPE: PAPER
VERSION: 1.21.4
PAPER_BUILD: latest
EXTRA_ARGS: '--world-dir ./worlds/'
volumes:
- worlds:/worlds
- ./server.properties:/data/server.properties
expose:
- '25565'

volumes:
worlds:
25 changes: 25 additions & 0 deletions .examples/bedrock/gate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
config:
bind: 0.0.0.0:25565
onlineMode: true
servers:
server1: server1:25566
try:
- server1
# forwarding:
# mode: legacy
# velocitySecret: 'bedrock-crossplay-secret'
status:
motd: |
§bGate + Geyser Cross-Play
§eJava & Bedrock Players Welcome!

# Enable Bedrock edition support (Manual mode - Geyser runs as separate container)
bedrock:
enabled: true
# Gate ↔ Geyser connection (Geyser container connects to Gate container)
geyserListenAddr: 'gate:25567'
# Bedrock player settings
usernameFormat: '.%s'
# Floodgate authentication key (shared between containers)
floodgateKeyPath: '/gate/floodgate.pem'
# managed: false (default - Docker manages Geyser container, not Gate)
59 changes: 59 additions & 0 deletions .examples/bedrock/geyser/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
bedrock:
port: 19132
motd1: "Gate + Geyser"
motd2: "Cross-Play Server"
server-name: "Gate Bedrock"
compression-level: 6

remote:
# Connect to Gate's Bedrock listener
address: gate
port: 25567
auth-type: floodgate
use-proxy-protocol: true
forward-hostname: false

# Point to the shared Floodgate key
floodgate-key-file: key.pem

# Enable passthrough for better integration
passthrough-motd: true
passthrough-player-counts: true
legacy-ping-passthrough: false
ping-passthrough-interval: 3

# Performance settings
forward-player-ping: true
max-players: 100
debug-mode: false

# Bedrock-specific settings
show-cooldown: title
show-coordinates: true
disable-bedrock-scaffolding: false
emote-offhand-workaround: "disabled"

# Custom skulls and items
allow-custom-skulls: true
max-visible-custom-skulls: 128
custom-skull-render-distance: 32
add-non-bedrock-items: true

# Resource packs
force-resource-packs: true

# Xbox features
xbox-achievements-enabled: false

# Logging
log-player-ip-addresses: true
notify-on-new-bedrock-update: true

# Advanced settings
scoreboard-packet-threshold: 20
enable-proxy-connections: false
mtu: 1400
use-direct-connection: true
disable-compression: true

config-version: 4
1 change: 1 addition & 0 deletions .examples/bedrock/geyser/key.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
äf“9„V??®
62 changes: 62 additions & 0 deletions .examples/bedrock/server.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Minecraft server properties for Gate + Bedrock setup

# Server settings
server-name=Gate Bedrock Server
server-port=25565
server-ip=

# Game settings
gamemode=survival
difficulty=easy
hardcore=false
max-players=20
pvp=true
allow-flight=false

# World settings
level-name=world
level-seed=
level-type=minecraft\:normal
generate-structures=true
spawn-protection=16

# Authentication - MUST be false when using Gate proxy
online-mode=false
# Required for Bedrock players and chat compatibility
enforce-secure-profile=false

# Whitelist and ops
white-list=false
enforce-whitelist=false
op-permission-level=4

# Resource pack settings
resource-pack=
resource-pack-sha1=
require-resource-pack=false

# Network settings
network-compression-threshold=256
max-tick-time=60000

# Logging
enable-rcon=false
enable-query=false
enable-status=true

# Performance
view-distance=10
simulation-distance=10
max-world-size=29999984

# Chat settings
broadcast-console-to-ops=true
broadcast-rcon-to-ops=true
enable-command-block=false

# Other settings
allow-nether=true
spawn-npcs=true
spawn-animals=true
spawn-monsters=true
function-permission-level=2
51 changes: 51 additions & 0 deletions .examples/bedrock/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

# Gate + Geyser Bedrock Support Example
# This script helps you get started with Bedrock support in Gate

set -e

echo "🚀 Starting Gate + Geyser Bedrock Support Example"
echo "================================================="

# Check if Docker is running
if ! docker info > /dev/null 2>&1; then
echo "❌ Docker is not running. Please start Docker and try again."
exit 1
fi

# Check if key.pem exists
if [ ! -f "geyser/key.pem" ]; then
echo "🔑 Generating Floodgate key..."
openssl genpkey -algorithm RSA -out geyser/key.pem
echo "✅ Floodgate key generated at geyser/key.pem"
else
echo "✅ Floodgate key already exists"
fi

# Start services
echo "📦 Starting Docker services..."
docker compose up -d

echo ""
echo "🎉 Services started successfully!"
echo ""
echo "📊 Service Status:"
docker compose ps

echo ""
echo "🎮 Connection Information:"
echo " Java Players: localhost:25565"
echo " Bedrock Players: localhost:19132"
echo ""
echo "📋 Useful Commands:"
echo " View logs: docker compose logs -f"
echo " Stop services: docker compose down"
echo " Restart: docker compose restart"
echo ""
echo "🔍 Troubleshooting:"
echo " - Check logs if players can't connect"
echo " - Ensure ports 25565 (Java) and 19132/udp (Bedrock) are open"
echo " - Verify the Floodgate key is shared between all services"
echo ""
echo "📖 Documentation: https://gate.minekube.com/guide/bedrock"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea
.yarn
/.web/docs/.vitepress/cache
tmp
tmp
.geyser
Loading
Loading