新增说明文件;新增kiwix-serve、papermc示例;更新README.md文件
This commit is contained in:
55
examples/papermc/velocity/alpine/dockerfile
Normal file
55
examples/papermc/velocity/alpine/dockerfile
Normal file
@@ -0,0 +1,55 @@
|
||||
# 配置参数(指定基础镜像版本)
|
||||
ARG BASE_TAG=11.0.20-alpine3.18
|
||||
|
||||
# 基于 Amazon Corretto 构建
|
||||
FROM amazoncorretto:$BASE_TAG
|
||||
|
||||
# 指定端口号
|
||||
EXPOSE 25577
|
||||
|
||||
# 配置参数
|
||||
ARG GROUP_ID=1024 \
|
||||
GROUP_NAME=papermc \
|
||||
USER_ID=1024 \
|
||||
USER_NAME=papermc \
|
||||
USER_HOME=/home/papermc \
|
||||
USER_SHELL=/bin/bash
|
||||
|
||||
# 更新应用并安装基础应用
|
||||
RUN set -ex && \
|
||||
apk add tzdata && \
|
||||
apk add --no-cache bash bash-doc bash-completion
|
||||
|
||||
# 设置时区、新建用户组及用户、配置目录权限
|
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
|
||||
addgroup $GROUP_NAME -g $GROUP_ID && \
|
||||
adduser $USER_NAME -G $GROUP_NAME -h $USER_HOME -s $USER_SHELL -u $USER_ID -D && \
|
||||
mkdir -pv $USER_HOME && \
|
||||
chown -R $GROUP_NAME.$USER_NAME $USER_HOME
|
||||
|
||||
# 配置环境变量
|
||||
ARG PAPERMC_VELOCITY_VERSION=3.2.0-SNAPSHOT-265
|
||||
ENV PAPERMC_VELOCITY_VERSION=$PAPERMC_VELOCITY_VERSION \
|
||||
PAPERMC_VELOCITY_HOME=/opt/papermc/velocity \
|
||||
PAPERMC_VELOCITY_DATA_DIR=/opt/papermc/velocity
|
||||
|
||||
# 安装 PaperMC Server
|
||||
COPY velocity-$PAPERMC_VELOCITY_VERSION.jar $PAPERMC_VELOCITY_HOME/velocity-$PAPERMC_VELOCITY_VERSION.jar
|
||||
COPY velocity.toml $PAPERMC_VELOCITY_HOME/velocity.toml
|
||||
COPY forwarding.secret $PAPERMC_VELOCITY_HOME/forwarding.secret
|
||||
COPY entrypoint.sh $PAPERMC_VELOCITY_HOME/entrypoint.sh
|
||||
RUN mkdir -pv $PAPERMC_VELOCITY_DATA_DIR && \
|
||||
chown -R $GROUP_NAME.$USER_NAME $PAPERMC_VELOCITY_HOME $PAPERMC_VELOCITY_DATA_DIR && \
|
||||
chmod -R 755 $PAPERMC_VELOCITY_HOME $PAPERMC_VELOCITY_DATA_DIR
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR $PAPERMC_VELOCITY_HOME
|
||||
|
||||
# 设置默认挂载目录
|
||||
VOLUME [$PAPERMC_VELOCITY_HOME/plugins, $PAPERMC_VELOCITY_HOME/logs]
|
||||
|
||||
# 设置启动用户
|
||||
USER $GROUP_NAME:$USER_NAME
|
||||
|
||||
# 设置执行启动脚本
|
||||
CMD ["/bin/bash","-c","./entrypoint.sh"]
|
||||
11
examples/papermc/velocity/alpine/entrypoint.sh
Executable file
11
examples/papermc/velocity/alpine/entrypoint.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo '===================================================================================================='
|
||||
echo `date +%Y-%m-%d` `date +%H:%M:%S`
|
||||
echo '============================== 开始启动 PaperMC Velocity...... =============================='
|
||||
echo 'PaperMC Velocity 版本号:' $PAPERMC_VELOCITY_VERSION
|
||||
echo 'PaperMC Velocity 工作目录:' $PAPERMC_VELOCITY_HOME
|
||||
echo 'PaperMC Velocity 监听端口:25577'
|
||||
echo '数据文件目录:' $PAPERMC_VELOCITY_DATA_DIR
|
||||
echo '----------------------------------------------------------------------------------------------------'
|
||||
java -Xms1G -Xmx1G -XX:+UseG1GC -XX:G1HeapRegionSize=4M -XX:+UnlockExperimentalVMOptions -XX:+ParallelRefProcEnabled -XX:+AlwaysPreTouch -XX:MaxInlineLevel=15 -jar $PAPERMC_VELOCITY_HOME/velocity-$PAPERMC_VELOCITY_VERSION.jar
|
||||
1
examples/papermc/velocity/alpine/forwarding.secret
Normal file
1
examples/papermc/velocity/alpine/forwarding.secret
Normal file
@@ -0,0 +1 @@
|
||||
OiXweorTzCig
|
||||
BIN
examples/papermc/velocity/alpine/velocity-3.2.0-SNAPSHOT-265.jar
Normal file
BIN
examples/papermc/velocity/alpine/velocity-3.2.0-SNAPSHOT-265.jar
Normal file
Binary file not shown.
155
examples/papermc/velocity/alpine/velocity.toml
Normal file
155
examples/papermc/velocity/alpine/velocity.toml
Normal file
@@ -0,0 +1,155 @@
|
||||
# Config version. Do not change this
|
||||
config-version = "2.6"
|
||||
|
||||
# What port should the proxy be bound to? By default, we'll bind to all addresses on port 25577.
|
||||
bind = "0.0.0.0:25577"
|
||||
|
||||
# What should be the MOTD? This gets displayed when the player adds your server to
|
||||
# their server list. Only MiniMessage format is accepted.
|
||||
motd = "<#09add3>A Velocity Server"
|
||||
|
||||
# What should we display for the maximum number of players? (Velocity does not support a cap
|
||||
# on the number of players online.)
|
||||
show-max-players = 500
|
||||
|
||||
# Should we authenticate players with Mojang? By default, this is on.
|
||||
online-mode = true
|
||||
|
||||
# Should the proxy enforce the new public key security standard? By default, this is on.
|
||||
force-key-authentication = true
|
||||
|
||||
# If client's ISP/AS sent from this proxy is different from the one from Mojang's
|
||||
# authentication server, the player is kicked. This disallows some VPN and proxy
|
||||
# connections but is a weak form of protection.
|
||||
prevent-client-proxy-connections = false
|
||||
|
||||
# Should we forward IP addresses and other data to backend servers?
|
||||
# Available options:
|
||||
# - "none": No forwarding will be done. All players will appear to be connecting
|
||||
# from the proxy and will have offline-mode UUIDs.
|
||||
# - "legacy": Forward player IPs and UUIDs in a BungeeCord-compatible format. Use this
|
||||
# if you run servers using Minecraft 1.12 or lower.
|
||||
# - "bungeeguard": Forward player IPs and UUIDs in a format supported by the BungeeGuard
|
||||
# plugin. Use this if you run servers using Minecraft 1.12 or lower, and are
|
||||
# unable to implement network level firewalling (on a shared host).
|
||||
# - "modern": Forward player IPs and UUIDs as part of the login process using
|
||||
# Velocity's native forwarding. Only applicable for Minecraft 1.13 or higher.
|
||||
player-info-forwarding-mode = "NONE"
|
||||
|
||||
# If you are using modern or BungeeGuard IP forwarding, configure a file that contains a unique secret here.
|
||||
# The file is expected to be UTF-8 encoded and not empty.
|
||||
forwarding-secret-file = "forwarding.secret"
|
||||
|
||||
# Announce whether or not your server supports Forge. If you run a modded server, we
|
||||
# suggest turning this on.
|
||||
#
|
||||
# If your network runs one modpack consistently, consider using ping-passthrough = "mods"
|
||||
# instead for a nicer display in the server list.
|
||||
announce-forge = false
|
||||
|
||||
# If enabled (default is false) and the proxy is in online mode, Velocity will kick
|
||||
# any existing player who is online if a duplicate connection attempt is made.
|
||||
kick-existing-players = false
|
||||
|
||||
# Should Velocity pass server list ping requests to a backend server?
|
||||
# Available options:
|
||||
# - "disabled": No pass-through will be done. The velocity.toml and server-icon.png
|
||||
# will determine the initial server list ping response.
|
||||
# - "mods": Passes only the mod list from your backend server into the response.
|
||||
# The first server in your try list (or forced host) with a mod list will be
|
||||
# used. If no backend servers can be contacted, Velocity won't display any
|
||||
# mod information.
|
||||
# - "description": Uses the description and mod list from the backend server. The first
|
||||
# server in the try (or forced host) list that responds is used for the
|
||||
# description and mod list.
|
||||
# - "all": Uses the backend server's response as the proxy response. The Velocity
|
||||
# configuration is used if no servers could be contacted.
|
||||
ping-passthrough = "DISABLED"
|
||||
|
||||
# If not enabled (default is true) player IP addresses will be replaced by <ip address withheld> in logs
|
||||
enable-player-address-logging = true
|
||||
|
||||
[servers]
|
||||
# Configure your servers here. Each key represents the server's name, and the value
|
||||
# represents the IP address of the server to connect to.
|
||||
lobby = "127.0.0.1:30066"
|
||||
factions = "127.0.0.1:30067"
|
||||
minigames = "127.0.0.1:30068"
|
||||
|
||||
# In what order we should try servers when a player logs in or is kicked from a server.
|
||||
try = [
|
||||
"lobby"
|
||||
]
|
||||
|
||||
[forced-hosts]
|
||||
# Configure your forced hosts here.
|
||||
"lobby.example.com" = [
|
||||
"lobby"
|
||||
]
|
||||
"factions.example.com" = [
|
||||
"factions"
|
||||
]
|
||||
"minigames.example.com" = [
|
||||
"minigames"
|
||||
]
|
||||
|
||||
[advanced]
|
||||
# How large a Minecraft packet has to be before we compress it. Setting this to zero will
|
||||
# compress all packets, and setting it to -1 will disable compression entirely.
|
||||
compression-threshold = 256
|
||||
|
||||
# How much compression should be done (from 0-9). The default is -1, which uses the
|
||||
# default level of 6.
|
||||
compression-level = -1
|
||||
|
||||
# How fast (in milliseconds) are clients allowed to connect after the last connection? By
|
||||
# default, this is three seconds. Disable this by setting this to 0.
|
||||
login-ratelimit = 3000
|
||||
|
||||
# Specify a custom timeout for connection timeouts here. The default is five seconds.
|
||||
connection-timeout = 5000
|
||||
|
||||
# Specify a read timeout for connections here. The default is 30 seconds.
|
||||
read-timeout = 30000
|
||||
|
||||
# Enables compatibility with HAProxy's PROXY protocol. If you don't know what this is for, then
|
||||
# don't enable it.
|
||||
haproxy-protocol = false
|
||||
|
||||
# Enables TCP fast open support on the proxy. Requires the proxy to run on Linux.
|
||||
tcp-fast-open = false
|
||||
|
||||
# Enables BungeeCord plugin messaging channel support on Velocity.
|
||||
bungee-plugin-message-channel = true
|
||||
|
||||
# Shows ping requests to the proxy from clients.
|
||||
show-ping-requests = false
|
||||
|
||||
# By default, Velocity will attempt to gracefully handle situations where the user unexpectedly
|
||||
# loses connection to the server without an explicit disconnect message by attempting to fall the
|
||||
# user back, except in the case of read timeouts. BungeeCord will disconnect the user instead. You
|
||||
# can disable this setting to use the BungeeCord behavior.
|
||||
failover-on-unexpected-server-disconnect = true
|
||||
|
||||
# Declares the proxy commands to 1.13+ clients.
|
||||
announce-proxy-commands = true
|
||||
|
||||
# Enables the logging of commands
|
||||
log-command-executions = false
|
||||
|
||||
# Enables logging of player connections when connecting to the proxy, switching servers
|
||||
# and disconnecting from the proxy.
|
||||
log-player-connections = true
|
||||
|
||||
[query]
|
||||
# Whether to enable responding to GameSpy 4 query responses or not.
|
||||
enabled = false
|
||||
|
||||
# If query is enabled, on what port should the query protocol listen on?
|
||||
port = 25577
|
||||
|
||||
# This is the map name that is reported to the query services.
|
||||
map = "Velocity"
|
||||
|
||||
# Whether plugins should be shown in query response by default or not
|
||||
show-plugins = false
|
||||
23
examples/papermc/velocity/example/compose.yaml
Normal file
23
examples/papermc/velocity/example/compose.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
papermc-velocity:
|
||||
# image: hty1024/papermc/velocity:3.2.0-SNAPSHOT-265
|
||||
image: hty1024/papermc/velocity:3.2.0-SNAPSHOT-265-alpine
|
||||
container_name: papermc-velocity
|
||||
restart: always
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- ./velocity.toml:/opt/papermc/velocity/velocity.toml
|
||||
- ./forwarding.secret:/opt/papermc/velocity/forwarding.secret
|
||||
- ./plugins:/opt/papermc/velocity/plugins
|
||||
- ./logs:/opt/papermc/velocity/logs
|
||||
ports:
|
||||
- "25577:25577"
|
||||
networks:
|
||||
- app_network
|
||||
|
||||
networks:
|
||||
app_network:
|
||||
external: true
|
||||
name: app_network
|
||||
1
examples/papermc/velocity/example/forwarding.secret
Normal file
1
examples/papermc/velocity/example/forwarding.secret
Normal file
@@ -0,0 +1 @@
|
||||
CEqNAMuCv85AGSjn
|
||||
13
examples/papermc/velocity/example/logs/latest.log
Normal file
13
examples/papermc/velocity/example/logs/latest.log
Normal file
@@ -0,0 +1,13 @@
|
||||
[09:29:40] [main/INFO] [com.velocitypowered.proxy.VelocityServer]: Booting up Velocity 3.2.0-SNAPSHOT (git-19abb909-b265)...
|
||||
[09:29:40] [main/INFO] [com.velocitypowered.proxy.VelocityServer]: Loading localizations...
|
||||
[09:29:40] [main/INFO] [com.velocitypowered.proxy.network.ConnectionManager]: Connections will use epoll channels, libdeflate (Linux x86_64) compression, OpenSSL 3.0.x (Linux x86_64) ciphers
|
||||
[09:29:40] [main/WARN] [com.velocitypowered.proxy.config.VelocityConfiguration]: Player info forwarding is disabled! All players will appear to be connecting from the proxy and will have offline-mode UUIDs.
|
||||
[09:29:40] [main/INFO] [com.velocitypowered.proxy.VelocityServer]: Loading plugins...
|
||||
[09:29:40] [main/INFO] [com.velocitypowered.proxy.VelocityServer]: Loaded 0 plugins
|
||||
[09:29:41] [main/INFO] [com.velocitypowered.proxy.Metrics]: Velocity and some of its plugins collect metrics and send them to bStats (https://bStats.org).
|
||||
[09:29:41] [main/INFO] [com.velocitypowered.proxy.Metrics]: bStats collects some basic information for plugin authors, like how many people use
|
||||
[09:29:41] [main/INFO] [com.velocitypowered.proxy.Metrics]: their plugin and their total player count. It's recommended to keep bStats enabled, but
|
||||
[09:29:41] [main/INFO] [com.velocitypowered.proxy.Metrics]: if you're not comfortable with this, you can opt-out by editing the config.txt file in
|
||||
[09:29:41] [main/INFO] [com.velocitypowered.proxy.Metrics]: the '/plugins/bStats/' folder and setting enabled to false.
|
||||
[09:29:41] [main/INFO] [com.velocitypowered.proxy.Velocity]: Done (1.57s)!
|
||||
[09:29:41] [Netty epoll Boss #0/INFO] [com.velocitypowered.proxy.network.ConnectionManager]: Listening on /0.0.0.0:25577
|
||||
10
examples/papermc/velocity/example/plugins/bStats/config.txt
Normal file
10
examples/papermc/velocity/example/plugins/bStats/config.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
# bStats (https://bStats.org) collects some basic information for plugin authors, like
|
||||
# how many people use their plugin and their total player count. It's recommended to keep
|
||||
# bStats enabled, but if you're not comfortable with this, you can turn this setting off.
|
||||
# There is no performance penalty associated with having metrics enabled, and data sent to
|
||||
# bStats is fully anonymous.
|
||||
enabled=true
|
||||
server-uuid=3a00e61a-2c29-4da7-a066-755532f7d936
|
||||
log-errors=false
|
||||
log-sent-data=false
|
||||
log-response-status-text=false
|
||||
155
examples/papermc/velocity/example/velocity.toml
Normal file
155
examples/papermc/velocity/example/velocity.toml
Normal file
@@ -0,0 +1,155 @@
|
||||
# Config version. Do not change this
|
||||
config-version = "2.6"
|
||||
|
||||
# What port should the proxy be bound to? By default, we'll bind to all addresses on port 25577.
|
||||
bind = "0.0.0.0:25577"
|
||||
|
||||
# What should be the MOTD? This gets displayed when the player adds your server to
|
||||
# their server list. Only MiniMessage format is accepted.
|
||||
motd = "<#09add3>A Velocity Server"
|
||||
|
||||
# What should we display for the maximum number of players? (Velocity does not support a cap
|
||||
# on the number of players online.)
|
||||
show-max-players = 500
|
||||
|
||||
# Should we authenticate players with Mojang? By default, this is on.
|
||||
online-mode = true
|
||||
|
||||
# Should the proxy enforce the new public key security standard? By default, this is on.
|
||||
force-key-authentication = true
|
||||
|
||||
# If client's ISP/AS sent from this proxy is different from the one from Mojang's
|
||||
# authentication server, the player is kicked. This disallows some VPN and proxy
|
||||
# connections but is a weak form of protection.
|
||||
prevent-client-proxy-connections = false
|
||||
|
||||
# Should we forward IP addresses and other data to backend servers?
|
||||
# Available options:
|
||||
# - "none": No forwarding will be done. All players will appear to be connecting
|
||||
# from the proxy and will have offline-mode UUIDs.
|
||||
# - "legacy": Forward player IPs and UUIDs in a BungeeCord-compatible format. Use this
|
||||
# if you run servers using Minecraft 1.12 or lower.
|
||||
# - "bungeeguard": Forward player IPs and UUIDs in a format supported by the BungeeGuard
|
||||
# plugin. Use this if you run servers using Minecraft 1.12 or lower, and are
|
||||
# unable to implement network level firewalling (on a shared host).
|
||||
# - "modern": Forward player IPs and UUIDs as part of the login process using
|
||||
# Velocity's native forwarding. Only applicable for Minecraft 1.13 or higher.
|
||||
player-info-forwarding-mode = "NONE"
|
||||
|
||||
# If you are using modern or BungeeGuard IP forwarding, configure a file that contains a unique secret here.
|
||||
# The file is expected to be UTF-8 encoded and not empty.
|
||||
forwarding-secret-file = "forwarding.secret"
|
||||
|
||||
# Announce whether or not your server supports Forge. If you run a modded server, we
|
||||
# suggest turning this on.
|
||||
#
|
||||
# If your network runs one modpack consistently, consider using ping-passthrough = "mods"
|
||||
# instead for a nicer display in the server list.
|
||||
announce-forge = false
|
||||
|
||||
# If enabled (default is false) and the proxy is in online mode, Velocity will kick
|
||||
# any existing player who is online if a duplicate connection attempt is made.
|
||||
kick-existing-players = false
|
||||
|
||||
# Should Velocity pass server list ping requests to a backend server?
|
||||
# Available options:
|
||||
# - "disabled": No pass-through will be done. The velocity.toml and server-icon.png
|
||||
# will determine the initial server list ping response.
|
||||
# - "mods": Passes only the mod list from your backend server into the response.
|
||||
# The first server in your try list (or forced host) with a mod list will be
|
||||
# used. If no backend servers can be contacted, Velocity won't display any
|
||||
# mod information.
|
||||
# - "description": Uses the description and mod list from the backend server. The first
|
||||
# server in the try (or forced host) list that responds is used for the
|
||||
# description and mod list.
|
||||
# - "all": Uses the backend server's response as the proxy response. The Velocity
|
||||
# configuration is used if no servers could be contacted.
|
||||
ping-passthrough = "DISABLED"
|
||||
|
||||
# If not enabled (default is true) player IP addresses will be replaced by <ip address withheld> in logs
|
||||
enable-player-address-logging = true
|
||||
|
||||
[servers]
|
||||
# Configure your servers here. Each key represents the server's name, and the value
|
||||
# represents the IP address of the server to connect to.
|
||||
lobby = "127.0.0.1:30066"
|
||||
factions = "127.0.0.1:30067"
|
||||
minigames = "127.0.0.1:30068"
|
||||
|
||||
# In what order we should try servers when a player logs in or is kicked from a server.
|
||||
try = [
|
||||
"lobby"
|
||||
]
|
||||
|
||||
[forced-hosts]
|
||||
# Configure your forced hosts here.
|
||||
"lobby.example.com" = [
|
||||
"lobby"
|
||||
]
|
||||
"factions.example.com" = [
|
||||
"factions"
|
||||
]
|
||||
"minigames.example.com" = [
|
||||
"minigames"
|
||||
]
|
||||
|
||||
[advanced]
|
||||
# How large a Minecraft packet has to be before we compress it. Setting this to zero will
|
||||
# compress all packets, and setting it to -1 will disable compression entirely.
|
||||
compression-threshold = 256
|
||||
|
||||
# How much compression should be done (from 0-9). The default is -1, which uses the
|
||||
# default level of 6.
|
||||
compression-level = -1
|
||||
|
||||
# How fast (in milliseconds) are clients allowed to connect after the last connection? By
|
||||
# default, this is three seconds. Disable this by setting this to 0.
|
||||
login-ratelimit = 3000
|
||||
|
||||
# Specify a custom timeout for connection timeouts here. The default is five seconds.
|
||||
connection-timeout = 5000
|
||||
|
||||
# Specify a read timeout for connections here. The default is 30 seconds.
|
||||
read-timeout = 30000
|
||||
|
||||
# Enables compatibility with HAProxy's PROXY protocol. If you don't know what this is for, then
|
||||
# don't enable it.
|
||||
haproxy-protocol = false
|
||||
|
||||
# Enables TCP fast open support on the proxy. Requires the proxy to run on Linux.
|
||||
tcp-fast-open = false
|
||||
|
||||
# Enables BungeeCord plugin messaging channel support on Velocity.
|
||||
bungee-plugin-message-channel = true
|
||||
|
||||
# Shows ping requests to the proxy from clients.
|
||||
show-ping-requests = false
|
||||
|
||||
# By default, Velocity will attempt to gracefully handle situations where the user unexpectedly
|
||||
# loses connection to the server without an explicit disconnect message by attempting to fall the
|
||||
# user back, except in the case of read timeouts. BungeeCord will disconnect the user instead. You
|
||||
# can disable this setting to use the BungeeCord behavior.
|
||||
failover-on-unexpected-server-disconnect = true
|
||||
|
||||
# Declares the proxy commands to 1.13+ clients.
|
||||
announce-proxy-commands = true
|
||||
|
||||
# Enables the logging of commands
|
||||
log-command-executions = false
|
||||
|
||||
# Enables logging of player connections when connecting to the proxy, switching servers
|
||||
# and disconnecting from the proxy.
|
||||
log-player-connections = true
|
||||
|
||||
[query]
|
||||
# Whether to enable responding to GameSpy 4 query responses or not.
|
||||
enabled = false
|
||||
|
||||
# If query is enabled, on what port should the query protocol listen on?
|
||||
port = 25577
|
||||
|
||||
# This is the map name that is reported to the query services.
|
||||
map = "Velocity"
|
||||
|
||||
# Whether plugins should be shown in query response by default or not
|
||||
show-plugins = false
|
||||
Reference in New Issue
Block a user