直接在 Minecraft 服务器上托管网站
Portel 是一款 Minecraft 插件,允许你直接从服务器托管一个简单的网站。它会启动一个轻量级的 Web 服务器,从插件配置目录内的文件夹中提供文件服务。
为什么使用 Portel?
- 简单性: Portel 设计为易于使用。只需将插件放入服务器的
plugins文件夹即可就绪。无需复杂的设置或配置。 - 性能: Portel 构建为轻量且高效。它使用 Java 内置的 HTTP 服务器以最小化资源占用,确保不影响服务器的性能。
- 自定义: Portel 赋予你对网站的完全控制权。你可以创建自己的 HTML、CSS 和 JavaScript 文件来构建反映服务器特色的独特网站。你还可以为 403、404 和 429 错误创建自定义错误页面。
- 安全性: Portel 包含白名单/黑名单系统以控制对网站的访问。它还具备路径遍历保护和速率限制功能以防止滥用。
- 实时更新: 网站文件的更改会通过自动**热重载(Hot-Reloading)**实时反映出来。
- 无需外部托管: 直接在 Minecraft 服务器上托管你的网站,无需单独的网络托管服务。
配置
配置文件位于 plugins/Portel/config.yml。
port: 8080
websocket-port: 8081
index-file: index.html
# 当 web/ 目录中的文件被修改时自动清除缓存。
hot-reloading: true
ssl:
enabled: false
keystore-path: "keystore.jks"
keystore-password: "password"
websocket:
# 启用 Web 用户向 Minecraft 服务器发送消息
allow-web-to-game-chat: true
# Web 到游戏消息的格式
chat-prefix: "[Web] "
prefix-color: "DARK_PURPLE"
message-color: "LIGHT_PURPLE"
logging:
# 启用控制台日志记录
console: true
# 启用 IP 日志记录到文件
ip: true
# IP 日志的文件名
ip-log-file: "ips.log"
命令
/portel help- 显示交互式帮助信息。/portel restart- 重启 Web 服务器。- 权限:
portel.restart
- 权限:
/portel reload- 重新加载配置。- 权限:
portel.reload
- 权限:
/portel version- 显示当前版本。/portel whitelist <add/remove/list/on/off> [ip]- 管理 IP 访问权限。- 权限:
portel.admin
- 权限:
指南
- WebSocket 支持 - 了解如何使用实时聊天功能。
- PlaceholderAPI 支持 - 将动态服务器信息集成到你的网页中。
- HTTPS/SSL 支持 - 使用 SSL 证书保护你的 Web 服务器。
从源码构建
要从源码构建插件,你需要安装 Java 21 和 Gradle。
- 克隆仓库:
git clone https://github.com/Skullmc1/Portel.git - 进入项目目录:
cd Portel - 构建插件:
./gradlew shadowJar
编译后的 .jar 文件将位于 build/libs 目录中。
贡献
欢迎贡献!如果你有任何想法、建议或 Bug 报告,请提交 Issue 或创建 Pull Request。
许可证
本项目采用 MIT 许可证授权 - 详情请参阅 LICENSE 文件。
Websites hosted directly on Minecraft servers
Portel is a Minecraft plugin that allows you to host a simple website directly from your server. It starts a lightweight web server that serves files from a folder within the plugin's configuration directory.
Why use Portel?
- Simplicity: Portel is designed to be easy to use. Simply drop the plugin into your server's
pluginsfolder and you're ready to go. No complex setup or configuration required. - Performance: Portel is built to be lightweight and efficient. It uses Java's built-in HTTP server to minimize resource usage, ensuring that your server's performance is not affected.
- Customization: Portel gives you full control over your website. You can create your own HTML, CSS, and JavaScript files to build a unique website that reflects your server's identity. You can also create custom error pages for 403, 404, and 429 errors.
- Security: Portel includes a whitelist/blacklist system to control access to your website. It also has a path-traversal protection and a rate-limiting feature to prevent abuse.
- Real-time updates: Changes to your website files are reflected in real-time with automatic Hot-Reloading.
- No external hosting required: Host your website directly on your Minecraft server, eliminating the need for a separate web hosting service.
Configuration
The configuration file is located at plugins/Portel/config.yml.
port: 8080
websocket-port: 8081
index-file: index.html
# Automatically clear cache when files in web/ directory are modified.
hot-reloading: true
ssl:
enabled: false
keystore-path: "keystore.jks"
keystore-password: "password"
websocket:
# Enable web users to send messages to the Minecraft server
allow-web-to-game-chat: true
# Formatting for web-to-game messages
chat-prefix: "[Web] "
prefix-color: "DARK_PURPLE"
message-color: "LIGHT_PURPLE"
logging:
# Enable console logging
console: true
# Enable IP logging to a file
ip: true
# File name for IP logging
ip-log-file: "ips.log"
Commands
/portel help- Shows the interactive help message./portel restart- Restarts the web server.- Permission:
portel.restart
- Permission:
/portel reload- Reloads the configuration.- Permission:
portel.reload
- Permission:
/portel version- Displays the current version./portel whitelist <add/remove/list/on/off> [ip]- Manage IP access.- Permission:
portel.admin
- Permission:
Guides
- WebSocket Support - Learn how to use the real-time chat feature.
- PlaceholderAPI Support - Integrate dynamic server information into your web pages.
- HTTPS/SSL Support - Secure your web server with SSL certificates.
Building from source
To build the plugin from source, you will need to have Java 21 and Gradle installed.
- Clone the repository:
git clone https://github.com/Skullmc1/Portel.git - Navigate to the project directory:
cd Portel - Build the plugin:
./gradlew shadowJar
The compiled .jar file will be located in the build/libs directory.
Contributing
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or create a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
下载 Portel
下载 Portel
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Portel
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Portel
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Portel
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Portel
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Portel
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
已更新至 Minecraft 版本 26.3
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
PacketEvents 是一款专为 Minecraft Java 版打造的协议库,旨在简化数据包的处理与传输。
插件
ExyliaPlugins 的库。
插件
通过对话框或铁砧界面帮助你的 Anthme
插件
自定义你的Minecraft头像!
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
为基于 Spigot/Paper/Folia 的服务器添加对 Vivecraft 的支持
评论 0
登录后参与评分
还没有评论,来抢沙发吧