Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent Windows Defender warnings in singleplayer (Bind singleplayer server to 127.0.0.1) #13930

Merged
merged 1 commit into from Oct 27, 2023

Conversation

rollerozxa
Copy link
Member

@rollerozxa rollerozxa commented Oct 26, 2023

This PR stops Minetest from throwing Windows Defender firewall warnings on Windows when playing singleplayer, by always binding the simple singleplayer server to 127.0.0.1.

Previously, it would listen on 0.0.0.0. But even if it would refuse connections from anyone other than "singleplayer", Windows treats this as wanting to break through the firewall, showing the user a warning and asking if it should be allowed.

image

In addition to this looking a little bit sketchy for someone who's just starting up Minetest for the first time, if a player refuses this then hosting a server sometime later won't work unless you go into Windows Defender and edit the firewall rule.

To do

This PR is Ready for Review.

How to test

  1. Obtain Windows, and have Windows Defender enabled (obviously)

  2. Go into the Windows Defender firewall settings and make sure that there are no entries for minetest.exe, delete any that may already exist:

image

  1. Run Minetest with this PR, and start a singleplayer world

  2. There should be no Windows Defender warning that shows up.

In addition, test hosting a server from the main menu will bind to 0.0.0.0 by default (which should cause a warning in Windows Defender) and that connecting to a singleplayer server hasn't somehow broken on a platform because of this.

@rubenwardy rubenwardy requested a review from sfan5 October 26, 2023 20:23
Copy link
Member

@rubenwardy rubenwardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this approach works on Windows from past projects. Tested, still works on Linux

@rubenwardy rubenwardy added this to the 5.8.0 milestone Oct 27, 2023
@sfan5 sfan5 merged commit 1a562ca into minetest:master Oct 27, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants