Updated to less cluttered and removed features that dont work
This commit is contained in:
27
.env
27
.env
@@ -1,27 +0,0 @@
|
|||||||
# Copy this file to .env and fill in your values
|
|
||||||
# Discord bot token and channel
|
|
||||||
DISCORD_TOKEN=MTA3MTEwMzcwMDAyMzY0ODMyMA.GIlFkn.o10LKcpjlaLDvVsgF_WKZhz5ykPYf1KEds_g3I
|
|
||||||
DISCORD_CHANNEL_ID=1247178901004877916
|
|
||||||
# Optional if using webhooks
|
|
||||||
WEBHOOK_URL=
|
|
||||||
|
|
||||||
# Display name and avatar for server-origin messages when using webhooks
|
|
||||||
SERVER_NAME=TFMC
|
|
||||||
# Optional image URL to use as the avatar for server messages
|
|
||||||
# SERVER_IMAGE=https://example.com/server-icon.png
|
|
||||||
|
|
||||||
# If logs are mounted, keep true; set to false to use remote webhook mode
|
|
||||||
IS_LOCAL_FILE=true
|
|
||||||
|
|
||||||
# Path on host to the Minecraft server logs directory containing latest.log
|
|
||||||
MC_LOGS_DIR=./data/logs
|
|
||||||
|
|
||||||
# Optionally override the log path inside the container
|
|
||||||
# LOCAL_FILE_PATH_OVERRIDE=/minecraft/logs/latest.log
|
|
||||||
|
|
||||||
# RCON connection to send Discord -> Minecraft messages
|
|
||||||
# Ensure server.properties has enable-rcon=true and set password/port
|
|
||||||
# Set IP to the Minecraft server host or container name on the Docker network
|
|
||||||
MINECRAFT_SERVER_RCON_IP=mc
|
|
||||||
MINECRAFT_SERVER_RCON_PORT=25575
|
|
||||||
MINECRAFT_SERVER_RCON_PASSWORD=509dbd71b996df2bd575d43b
|
|
||||||
27
.env.example
27
.env.example
@@ -1,27 +0,0 @@
|
|||||||
# Copy this file to .env and fill in your values
|
|
||||||
# Discord bot token and channel
|
|
||||||
DISCORD_TOKEN=
|
|
||||||
DISCORD_CHANNEL_ID=
|
|
||||||
# Optional if using webhooks
|
|
||||||
WEBHOOK_URL=
|
|
||||||
|
|
||||||
# Display name and avatar for server-origin messages when using webhooks
|
|
||||||
SERVER_NAME=Shulker
|
|
||||||
# Optional image URL to use as the avatar for server messages
|
|
||||||
# SERVER_IMAGE=https://example.com/server-icon.png
|
|
||||||
|
|
||||||
# If logs are mounted, keep true; set to false to use remote webhook mode
|
|
||||||
IS_LOCAL_FILE=true
|
|
||||||
|
|
||||||
# Path on host to the Minecraft server logs directory containing latest.log
|
|
||||||
MC_LOGS_DIR=./data/logs
|
|
||||||
|
|
||||||
# Optionally override the log path inside the container
|
|
||||||
# LOCAL_FILE_PATH_OVERRIDE=/minecraft/logs/latest.log
|
|
||||||
|
|
||||||
# RCON connection to send Discord -> Minecraft messages
|
|
||||||
# Ensure server.properties has enable-rcon=true and set password/port
|
|
||||||
# Set IP to the Minecraft server host or container name on the Docker network
|
|
||||||
MINECRAFT_SERVER_RCON_IP=127.0.0.1
|
|
||||||
MINECRAFT_SERVER_RCON_PORT=25575
|
|
||||||
MINECRAFT_SERVER_RCON_PASSWORD=
|
|
||||||
@@ -2,39 +2,35 @@ version: "3.8"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
shulker:
|
shulker:
|
||||||
build:
|
image: gitea.taginu.com/marc/tfmc-website:latest
|
||||||
context: .
|
|
||||||
dockerfile: docker/shulker/Dockerfile
|
|
||||||
container_name: shulker
|
container_name: shulker
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
# Configure everything inline here; no .env file required
|
||||||
environment:
|
environment:
|
||||||
# Provide these via environment or .env file
|
# Discord configuration (fill these)
|
||||||
- DISCORD_TOKEN=${DISCORD_TOKEN}
|
DISCORD_TOKEN: "REPLACE_ME"
|
||||||
- DISCORD_CHANNEL_ID=${DISCORD_CHANNEL_ID}
|
DISCORD_CHANNEL_ID: ""
|
||||||
- WEBHOOK_URL=${WEBHOOK_URL}
|
# If set, webhook mode is used; leave empty to use the bot account
|
||||||
- SERVER_NAME=${SERVER_NAME:-Shulker}
|
WEBHOOK_URL: ""
|
||||||
- SERVER_IMAGE=${SERVER_IMAGE}
|
|
||||||
- DISCORD_MESSAGE_TEMPLATE=${DISCORD_MESSAGE_TEMPLATE}
|
# Display name/avatar for server-origin messages (webhook mode)
|
||||||
- DEBUG=${DEBUG}
|
SERVER_NAME: "Shulker"
|
||||||
- ALLOW_USER_MENTIONS=${ALLOW_USER_MENTIONS}
|
SERVER_IMAGE: ""
|
||||||
- ALLOW_HERE_EVERYONE_MENTIONS=${ALLOW_HERE_EVERYONE_MENTIONS}
|
|
||||||
- MINECRAFT_SERVER_RCON_IP=${MINECRAFT_SERVER_RCON_IP}
|
# Message formatting and logging
|
||||||
- MINECRAFT_SERVER_RCON_PORT=${MINECRAFT_SERVER_RCON_PORT}
|
DISCORD_MESSAGE_TEMPLATE: "<%username%> %message%"
|
||||||
- MINECRAFT_SERVER_RCON_PASSWORD=${MINECRAFT_SERVER_RCON_PASSWORD}
|
DEBUG: "false"
|
||||||
- MINECRAFT_TELLRAW_DOESNT_EXIST=${MINECRAFT_TELLRAW_DOESNT_EXIST}
|
|
||||||
- MINECRAFT_TELLRAW_TEMPLATE=${MINECRAFT_TELLRAW_TEMPLATE}
|
# Tail local logs inside the container (recommended)
|
||||||
- MINECRAFT_TELLRAW_DOESNT_EXIST_SAY_TEMPLATE=${MINECRAFT_TELLRAW_DOESNT_EXIST_SAY_TEMPLATE}
|
IS_LOCAL_FILE: "true"
|
||||||
# Set to false if using remote hook mode
|
# Optionally override the log path inside the container (default shown)
|
||||||
- IS_LOCAL_FILE=${IS_LOCAL_FILE:-true}
|
# LOCAL_FILE_PATH_OVERRIDE: "/minecraft/logs/latest.log"
|
||||||
# Optionally override the log path inside the container
|
|
||||||
- LOCAL_FILE_PATH_OVERRIDE=${LOCAL_FILE_PATH_OVERRIDE}
|
|
||||||
volumes:
|
volumes:
|
||||||
# Persist config.json in a named volume
|
# Persist config.json in a named volume
|
||||||
- shulker_data:/data
|
- shulker_data:/data
|
||||||
# Map your host/server Minecraft logs into the container
|
# Map your host/server Minecraft logs into the container
|
||||||
- ${MC_LOGS_DIR:-./data/logs}:/minecraft/logs:ro
|
- ./data/logs:/minecraft/logs:ro
|
||||||
ports:
|
# No port exposure needed in local log tail mode
|
||||||
- "8000:8000"
|
|
||||||
|
|
||||||
mc:
|
mc:
|
||||||
image: itzg/minecraft-server
|
image: itzg/minecraft-server
|
||||||
@@ -44,11 +40,6 @@ services:
|
|||||||
- "25565:25565"
|
- "25565:25565"
|
||||||
environment:
|
environment:
|
||||||
EULA: "TRUE"
|
EULA: "TRUE"
|
||||||
ENABLE_RCON: "true"
|
|
||||||
RCON_PASSWORD: ${MINECRAFT_SERVER_RCON_PASSWORD}
|
|
||||||
RCON_PORT: ${MINECRAFT_SERVER_RCON_PORT}
|
|
||||||
# Ensure env values are written into server.properties on each start
|
|
||||||
OVERRIDE_SERVER_PROPERTIES: "true"
|
|
||||||
volumes:
|
volumes:
|
||||||
# attach the relative directory 'data' to the container's /data path
|
# attach the relative directory 'data' to the container's /data path
|
||||||
- ./data:/data
|
- ./data:/data
|
||||||
|
|||||||
@@ -60,26 +60,6 @@ fi
|
|||||||
[ -n "${SERVER_NAME}" ] && jq ".SERVER_NAME=\"${SERVER_NAME}\"" /data/config.json > /data/config.json.tmp && mv /data/config.json.tmp /data/config.json || true
|
[ -n "${SERVER_NAME}" ] && jq ".SERVER_NAME=\"${SERVER_NAME}\"" /data/config.json > /data/config.json.tmp && mv /data/config.json.tmp /data/config.json || true
|
||||||
[ -n "${SERVER_IMAGE}" ] && jq ".SERVER_IMAGE=\"${SERVER_IMAGE}\"" /data/config.json > /data/config.json.tmp && mv /data/config.json.tmp /data/config.json || true
|
[ -n "${SERVER_IMAGE}" ] && jq ".SERVER_IMAGE=\"${SERVER_IMAGE}\"" /data/config.json > /data/config.json.tmp && mv /data/config.json.tmp /data/config.json || true
|
||||||
|
|
||||||
# RCON configuration overrides
|
|
||||||
[ -n "${MINECRAFT_SERVER_RCON_IP}" ] && jq ".MINECRAFT_SERVER_RCON_IP=\"${MINECRAFT_SERVER_RCON_IP}\"" /data/config.json > /data/config.json.tmp && mv /data/config.json.tmp /data/config.json || true
|
|
||||||
if [ -n "${MINECRAFT_SERVER_RCON_PORT}" ]; then
|
|
||||||
case "${MINECRAFT_SERVER_RCON_PORT}" in
|
|
||||||
''|*[!0-9]*) jq ".MINECRAFT_SERVER_RCON_PORT=\"${MINECRAFT_SERVER_RCON_PORT}\"" /data/config.json > /data/config.json.tmp && mv /data/config.json.tmp /data/config.json ;;
|
|
||||||
*) jq ".MINECRAFT_SERVER_RCON_PORT=${MINECRAFT_SERVER_RCON_PORT}" /data/config.json > /data/config.json.tmp && mv /data/config.json.tmp /data/config.json ;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
[ -n "${MINECRAFT_SERVER_RCON_PASSWORD}" ] && jq ".MINECRAFT_SERVER_RCON_PASSWORD=\"${MINECRAFT_SERVER_RCON_PASSWORD}\"" /data/config.json > /data/config.json.tmp && mv /data/config.json.tmp /data/config.json || true
|
|
||||||
|
|
||||||
# Minecraft output formatting overrides
|
|
||||||
if [ -n "${MINECRAFT_TELLRAW_DOESNT_EXIST}" ]; then
|
|
||||||
case "${MINECRAFT_TELLRAW_DOESNT_EXIST}" in
|
|
||||||
[Tt][Rr][Uu][Ee]|1|yes|on) jq ".MINECRAFT_TELLRAW_DOESNT_EXIST=true" /data/config.json > /data/config.json.tmp && mv /data/config.json.tmp /data/config.json ;;
|
|
||||||
[Ff][Aa][Ll][Ss][Ee]|0|no|off) jq ".MINECRAFT_TELLRAW_DOESNT_EXIST=false" /data/config.json > /data/config.json.tmp && mv /data/config.json.tmp /data/config.json ;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
[ -n "${MINECRAFT_TELLRAW_TEMPLATE}" ] && jq ".MINECRAFT_TELLRAW_TEMPLATE=\"${MINECRAFT_TELLRAW_TEMPLATE}\"" /data/config.json > /data/config.json.tmp && mv /data/config.json.tmp /data/config.json || true
|
|
||||||
[ -n "${MINECRAFT_TELLRAW_DOESNT_EXIST_SAY_TEMPLATE}" ] && jq ".MINECRAFT_TELLRAW_DOESNT_EXIST_SAY_TEMPLATE=\"${MINECRAFT_TELLRAW_DOESNT_EXIST_SAY_TEMPLATE}\"" /data/config.json > /data/config.json.tmp && mv /data/config.json.tmp /data/config.json || true
|
|
||||||
|
|
||||||
# Always set IS_LOCAL_FILE true and path to mounted logs unless overridden explicitly via env IS_LOCAL_FILE
|
# Always set IS_LOCAL_FILE true and path to mounted logs unless overridden explicitly via env IS_LOCAL_FILE
|
||||||
if [ -z "${IS_LOCAL_FILE}" ]; then IS_LOCAL_FILE=true; fi
|
if [ -z "${IS_LOCAL_FILE}" ]; then IS_LOCAL_FILE=true; fi
|
||||||
jq ".IS_LOCAL_FILE=${IS_LOCAL_FILE} | .LOCAL_FILE_PATH=\"${LOCAL_FILE_PATH}\"" /data/config.json > /data/config.json.tmp && mv /data/config.json.tmp /data/config.json
|
jq ".IS_LOCAL_FILE=${IS_LOCAL_FILE} | .LOCAL_FILE_PATH=\"${LOCAL_FILE_PATH}\"" /data/config.json > /data/config.json.tmp && mv /data/config.json.tmp /data/config.json
|
||||||
|
|||||||
Reference in New Issue
Block a user