Skip to content

Option to restrict webserver to localhost#456

Merged
BuckarooBanzay merged 1 commit intominetest-mapserver:masterfrom
passw0rd123:listen
Jan 30, 2026
Merged

Option to restrict webserver to localhost#456
BuckarooBanzay merged 1 commit intominetest-mapserver:masterfrom
passw0rd123:listen

Conversation

@passw0rd123
Copy link
Contributor

@passw0rd123 passw0rd123 commented Jan 1, 2026

This should fix #418

  • Adds a localhostonly option to the config
  • Ability to choose between listening on all interfaces or 127.0.0.1 (v4 only for now)
  • Default is preserved for backward compatibility (listen on all interfaces)

Code is untested for now. So please have a look at the changes.

I chose this boolean option (all/localhost) to avoid the need of validating the config input as a correct ipv4/v6 address or empty string(->all interfaces). This might lead to more complexity and maybe dependencies which I like to avoid.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 20635506127

Details

  • 0 of 7 (0.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.04%) to 25.671%

Changes Missing Coverage Covered Lines Changed/Added Lines %
app/config.go 0 1 0.0%
web/serve.go 0 6 0.0%
Totals Coverage Status
Change from base Build 17698624320: -0.04%
Covered Lines: 909
Relevant Lines: 3541

💛 - Coveralls

@BuckarooBanzay
Copy link
Member

lgtm, thanks 👍

@BuckarooBanzay BuckarooBanzay merged commit 6c1b26c into minetest-mapserver:master Jan 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option to limit mapserver to localhost

3 participants