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

Don't write load_mod_ = false entries to world.mt #11423

Open
Montandalar opened this issue Jul 6, 2021 · 9 comments · May be fixed by #15758
Open

Don't write load_mod_ = false entries to world.mt #11423

Montandalar opened this issue Jul 6, 2021 · 9 comments · May be fixed by #15758
Labels
Concept approved Approved by a core dev: PRs welcomed! @ Content / PkgMgr Request / Suggestion The issue makes a suggestion for something that should be done but isn't a new feature

Comments

@Montandalar
Copy link
Contributor

Problem

Whenever you configure the mods on a world, the serialiser for world.mt goes and writes load_mod_* = true/false for all mods in your entire mod directory. This adds a lot of noise to the world.mt as all of the false entries are not really useful at all. In fact, for anyone with a decent mod collection, if their mods didn't change often, then the list of mods could probably be used to fingerprint who made a particular world.mt - as silly of a privacy concern as that may sound..

Solution

When serialising world.mt, ignore any mods that are disabled and don't write any entry to world.mt at all for them.

@Montandalar Montandalar added the Feature request Issues that request the addition or enhancement of a feature label Jul 6, 2021
@celeron55
Copy link
Member

There's actually a related problem also: If you delete a mod that was disabled, the world won't start anymore until you remove the "= false" line from world.mt.

@hlqkj
Copy link

hlqkj commented Jul 6, 2021

One more potential nuisance: I know some people who rely on the engine pre-filling world.mt with load_mod_* = false entries to actually create, or initialize their world.mt file.

EDIT: could a possible solution be to only write the entries when the world.mt is created for the first time (world creation) then never update it anymore?

Personally, I'd love to see this implemented though!

@sfan5
Copy link
Collaborator

sfan5 commented Jul 6, 2021

the world won't start anymore until you remove the "= false" line from world.mt.

Huh? I can't get MT to care about disabled entries, if you meant enabled ones the world will still start up but throw an error:
2021-07-06 19:24:38: ERROR[Main]: The following mods could not be found: "asasasasas"

@Emojigit
Copy link
Contributor

Emojigit commented Jul 10, 2021

Related codes: https://github.com/minetest/minetest/blob/cec0dfcbbda1e11e5ff2f45e58ea393d0437d7c6/src/content/mods.cpp#L307-L310
Suggested solution (not tested yet):

diff --git a/src/content/mods.cpp b/src/content/mods.cpp
index 434004b29..22127d242 100644
--- a/src/content/mods.cpp
+++ b/src/content/mods.cpp
@@ -306,8 +306,6 @@ void ModConfiguration::addModsFromConfig(
                        const ModSpec &mod = *it;
                        if (load_mod_names.count(mod.name) != 0)
                                addon_mods.push_back(mod);
-                       else
-                               conf.setBool("load_mod_" + mod.name, false);
                }
        }
        conf.updateConfigFile(settings_path.c_str());

@Emojigit
Copy link
Contributor

Huh? I can't get MT to care about disabled entries, if you meant enabled ones the world will still start up but throw an error:
2021-07-06 19:24:38: ERROR[Main]: The following mods could not be found: "asasasasas"

He means:

  1. Create a mod called foobar
  2. Let Minetest to auto-generate the world.mt with load_mod_foobar = false
  3. Delete the load_mod_foobar = false line
  4. Minetest won't load the world again (but it is false afaik and it will re-generate load_mod_foobar = false again)

@rubenwardy
Copy link
Contributor

One more potential nuisance: I know some people who rely on the engine pre-filling world.mt with load_mod_* = false entries to actually create, or initialize their world.mt file.

If we had a good MT cli for server management, this wouldn't really be needed

@rubenwardy rubenwardy added Request / Suggestion The issue makes a suggestion for something that should be done but isn't a new feature and removed Feature request Issues that request the addition or enhancement of a feature labels Nov 20, 2021
@rubenwardy rubenwardy marked this as a duplicate of #15757 Feb 4, 2025
@mruncreative
Copy link

mruncreative commented Feb 5, 2025

I will add that not just valid mods end up in this list. Every folder name that isn't a mod ends up in the list. Even empty folders.

And it clutters the file badly: #12691 didn't even notice he had player_backend twice in his world.mt file which caused him issues.

It took me almost all day to find this duplicate line. The server was down all the while.

@sfan5
Copy link
Collaborator

sfan5 commented Feb 5, 2025

I will add that not just valid mods end up in this list. Every folder name that isn't a mod ends up in the list. Even empty folders.

Are you implying it's a privacy issue? I doubt most would agree.

@mruncreative
Copy link

mruncreative commented Feb 5, 2025

Montandalar who made this issue said so and he only thought of mod name fingerprints. Just scroll to the top of the page and read it again.

I share his opinion. I often move stuff there during development that aren't real mods. I wouldn't have guessed all those folder names get shoved into every world.mt of every world I load up.

If I shared those, they'd see my entire .minetest/mods folder.

@appgurueu appgurueu added the Concept approved Approved by a core dev: PRs welcomed! label Feb 5, 2025
@appgurueu appgurueu linked a pull request Feb 5, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Concept approved Approved by a core dev: PRs welcomed! @ Content / PkgMgr Request / Suggestion The issue makes a suggestion for something that should be done but isn't a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants