Make HTTP server host configurable to support dedicated servers/VPS#2
Draft
Copilot wants to merge 1 commit into
Draft
Make HTTP server host configurable to support dedicated servers/VPS#2Copilot wants to merge 1 commit into
Copilot wants to merge 1 commit into
Conversation
Agent-Logs-Url: https://github.com/toby-gamez/SentryAPI/sessions/05e6ef7b-52d0-484b-9f27-ec20c1c37a36 Co-authored-by: toby-gamez <94223105+toby-gamez@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
toby-gamez
May 2, 2026 10:48
View session
toby-gamez
approved these changes
May 2, 2026
There was a problem hiding this comment.
Pull request overview
Makes the embedded Ktor HTTP server bind address configurable (instead of hardcoded localhost) so the API can be reachable when running on dedicated servers/VPS.
Changes:
- Added
hosttoconfig.yml(default0.0.0.0) with explanatory comments. - Updated
CommandApiPluginto readhostfrom config and use it when starting the Netty server. - Updated startup log to print the configured host.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/main/resources/config.yml | Adds host setting and guidance for binding to all interfaces vs localhost. |
| src/main/kotlin/com/sentrysmp/CommandApiPlugin.kt | Uses configured host for embeddedServer(...) and logs the chosen bind address. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+3
to
+4
| # Use "0.0.0.0" to listen on all interfaces (required for dedicated servers / VPS). | ||
| # Use "127.0.0.1" to restrict access to localhost only. |
| override fun onEnable() { | ||
| saveDefaultConfig() | ||
| val port = config.getInt("port", 8080) | ||
| val host = config.getString("host") ?: "0.0.0.0" |
| override fun onEnable() { | ||
| saveDefaultConfig() | ||
| val port = config.getInt("port", 8080) | ||
| val host = config.getString("host") ?: "0.0.0.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The HTTP server host was hardcoded to
127.0.0.1, making the API inaccessible from outside localhost — unusable on dedicated servers or VPS environments.Changes
config.yml— addshostfield (default0.0.0.0) with inline comments explaining0.0.0.0vs127.0.0.1CommandApiPlugin.kt— readshostfrom config instead of hardcoding; falls back to0.0.0.0if unset; reflects actual host in startup log