NeoForge 和 MinecraftForge 会将所有“服务器配置”的完整内容同步到客户端。由于命名并不清晰,一些模组最终将这些配置中包含了敏感值,例如 Discord 机器人令牌。如果你运行一个存在此问题的模组的服务器,这将允许任何能够加入你服务器的用户访问这些值。本模组通过在配置发送到客户端之前移除敏感值来避免这种情况。
版本说明
由于本模组支持广泛的 Minecraft 版本以及两种加载器,其版本方案 somewhat 复杂。请参阅下表以获取适用于你的加载器和 Minecraft 版本的正确版本。
| 加载器 | Minecraft 版本 | 模组版本后缀 |
|---|---|---|
| MinecraftForge | 1.13.2 - 1.16.5 | -1.13.2 |
| MinecraftForge | 1.17.x - 1.20.1 | -1.17.1 |
| NeoForge | 1.20.1 | -1.17.1 |
| MinecraftForge | 1.20.2+ | -1.20.2-mcf |
| NeoForge | 1.20.2 - 1.20.5 | -1.20.2-neo |
| NeoForge | 21.0+ | -1.21.0-neo |
工作原理
本模组分两个阶段工作:首先,它在启动期间检测可能包含敏感信息的配置选项。由于这是使用非常粗略的启发式方法完成的,因此找到的选项必须在 config/serverconfigcleaner-common.toml 配置文件中手动分类:
- 其中大多数将是误报,即恰好匹配启发式规则的无害选项。例如,Create 中的选项
logistics.seatHostileMobs会因为包含字符串Host而被标记为潜在敏感选项。这些配置值必须添加到falsePositives列表中。 - 其中一些可能是包含实际敏感值的选项。这些选项必须以相同格式添加到同一文件的
doNotSync列表中,例如doNotSync = ["mymod:discord.token"]。
要继续启动,必须在 ServerConfigCleaner 配置中对所有找到的值进行分类。该模组附带了一个已知误报列表和已知的“有问题的”选项列表(后者不以明文形式存储)。因此,通常你不需要在此阶段进行任何操作。如果需要手动添加值,请参阅下面关于将它们添加到默认列表的方法。
在第二阶段,模组拦截服务器上的配置同步。如果在第一阶段之后某个值被标记为敏感,则该值将在同步到客户端之前被替换为默认值。由于敏感选项的默认值通常是由开发者提供的无意义常数值(例如 INSERT BOT TOKEN HERE),因此可以将其发送给客户端而不会泄露任何秘密信息。
报告遗漏的值
如果你在配置的默认列表中遇到了误报,请创建一个列出它们的问题。
如果你发现任何包含敏感信息的服务器配置选项且不属于默认的敏感选项集合,请不要就此创建问题。相反,请联系 malte0811(Discord: malte0811;电子邮件可在 GitHub 个人资料中找到)或 ThatGravyBoat(Discord: thatgravyboat)。
NeoForge and MinecraftForge sync the entire content of all "server configs" to the client. Since this is not clear from the naming, some mods ended up putting secret values in these configs, e.g. Discord bot tokens. If you run a server using a mod with this issue, this allows any user that can join your server to access these values. This mod avoids this by removing sensitive values before the config is sent to the client.
Versions
Since this mod covers a wide range of Minecraft versions and two modloaders, the versioning scheme is somewhat complicated. See the table below for the correct version for your loader and Minecraft version.
| Loader | Minecraft version | Mod version suffix |
|---|---|---|
| MinecraftForge | 1.13.2 - 1.16.5 | -1.13.2 |
| MinecraftForge | 1.17.x - 1.20.1 | -1.17.1 |
| NeoForge | 1.20.1 | -1.17.1 |
| MinecraftForge | 1.20.2+ | -1.20.2-mcf |
| NeoForge | 1.20.2 - 1.20.5 | -1.20.2-neo |
| NeoForge | 1.21.0+ | -1.21.0-neo |
How it works
This mod works in two stages: First, it detects config options that potentially contain sensitive information during
launch. Since this is done using a very rough heuristic, the options that are found have to be manually classified in
the config/serverconfigcleaner-common.toml config file:
- Most of them will be false positives, harmless options that happen to match the heuristic. For example, the option
logistics.seatHostileMobsin Create would be marked as a potentially sensitive option since it contains the stringHost. These config values have to be added to thefalsePositiveslist. - Some of them may be options that contain actual sensitive values. These options have to be added to the
doNotSynclist in the same format, e.g.doNotSync = ["mymod:discord.token"].
To continue the launch, all found values have to be classified in the ServerConfigCleaner config. The mod ships with a list of known false positives and known "problematic" options (the latter not in plaintext). Therefore, you should usually not have to do anything at this stage. If you have to add values manually, see below on getting them added to the default lists.
In the second stage, the mod intercepts the config sync on the server. If a value was marked as sensitive in the config
after the first stage, the value will be replaced by the default value before being synced to the client. Since the
default value for sensitive options is generally a meaningless constant value provided by the developer (e.g. INSERT BOT TOKEN HERE), this can be sent to the client without revealing any secret information.
Reporting missed values
If you run into false positives that are not in the default list in the config, please create an issue listing them.
If you find any server config options that contain sensitive information and are not part of the default set of
sensitive options, please do not create an issue with these options. Instead, please get in touch with either
malte0811 (Discord: malte0811; e-mail available on GitHub profile) or ThatGravyBoat (Discord: thatgravyboat).
下载 ServerConfigCleaner
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ServerConfigCleaner
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ServerConfigCleaner
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ServerConfigCleaner
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ServerConfigCleaner
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ServerConfigCleaner
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ServerConfigCleaner
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ServerConfigCleaner
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ServerConfigCleaner
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ServerConfigCleaner
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
将“魔杖不足”添加到默认误报中
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
AE2:一款流行的自动化与存储模组
模组
添加区块认领和玩家组队功能,并与 Xaero's Minimap 和 World Map 集成
评论 0
登录后参与评分
还没有评论,来抢沙发吧