Coder Social home page Coder Social logo

Comments (3)

eyedeekay avatar eyedeekay commented on April 30, 2024 1

Thanks for the report and thanks for pinging me about the i2pgit.org registration. The amount of spam registration is unbelievable, people need to get in touch with me to get the accounts enabled. I approved your account a moment ago.

I think, based on what you said, there's no way we get out of it without looking at all those references to hosts.txt in the code and figuring out why it might sometimes be defined via the install dir and sometimes via the address book. So I'll add auditing those to my list. Will get back to you with more soon.

from i2p.i2p.

eyedeekay avatar eyedeekay commented on April 30, 2024

These are all the non-comment, non-translation occurences to the string hosts.txt in java files in i2p.i2p, flagging them here to keep track:

./apps/routerconsole/jsp/WEB-INF/classes/net/i2p/router/web/jsp/help_jsp.java:686:      out.print(intl._t("Note that subscribing to a hosts.txt service is an act of trust, as a malicious subscription could give you incorrect addresses, so be careful subscribing to lists from unknown sources."));
./apps/susidns/src/java/src/i2p/susi/dns/BaseBean.java:27:    private static final String DEFAULT_PRIVATE_BOOK = "../privatehosts.txt";
./apps/susidns/src/tmp/i2p/susi/dns/jsp/addressbook_jsp.java:318:            out.print(intl._t("Export in hosts.txt format"));
./apps/susidns/src/tmp/i2p/susi/dns/jsp/addressbook_jsp.java:765:      out.print(intl._t("Import from hosts.txt file"));
./apps/susidns/src/tmp/i2p/susi/dns/jsp/subscriptions_jsp.java:234:      out.print(intl._t("Those URLs refer to published hosts.txt files."));
./apps/susidns/src/tmp/i2p/susi/dns/jsp/subscriptions_jsp.java:236:      out.print(intl._t("The default subscription is the hosts.txt from {0}, which is updated infrequently.", "i2p-projekt.i2p"));
./apps/susidns/src/tmp/i2p/susi/dns/jsp/config_jsp.java:257:      out.print(intl._t("Your public hosts.txt file (choose a path within your webserver document root)"));
./apps/susidns/src/tmp/i2p/susi/dns/jsp/config_jsp.java:259:      out.print(intl._t("Your hosts.txt (don't change)"));
./apps/susidns/src/tmp/i2p/susi/dns/jsp/index_jsp.java:210:      out.print(intl._t("It regularly updates your hosts.txt file from distributed sources or \"subscriptions\"."));
./apps/ministreaming/java/test/junit/net/i2p/client/streaming/I2PSocketAddressTest.java:25:		FileOutputStream out = new FileOutputStream("hosts.txt");
./apps/ministreaming/java/test/junit/net/i2p/client/streaming/I2PSocketAddressTest.java:35:		File f = new File("hosts.txt");
./apps/ministreaming/java/test/junit/net/i2p/client/streaming/I2PSocketEepGetTest.java:53:        FileOutputStream out = new FileOutputStream("hosts.txt");
./apps/ministreaming/java/test/junit/net/i2p/client/streaming/I2PSocketEepGetTest.java:63:        File f = new File("hosts.txt");
./apps/addressbook/java/src/net/i2p/router/naming/BlockfileNamingService.java:127:    private static final String FALLBACK_LIST = "hosts.txt";
./apps/addressbook/java/src/net/i2p/router/naming/BlockfileNamingService.java:189:                                       "If you are using clients outside the router JVM, consider using the hosts.txt " +
./apps/addressbook/java/src/net/i2p/router/naming/BlockfileNamingService.java:298:                _log.logAlways(Log.WARN, "No hosts.txt files found, Initialized hosts database with zero entries");
./apps/addressbook/java/src/net/i2p/router/naming/BlockfileNamingService.java:2197:        String lname = "privatehosts.txt";
./apps/addressbook/java/src/net/i2p/router/naming/BlockfileNamingService.java:2200:        lname = "userhosts.txt";
./apps/addressbook/java/src/net/i2p/router/naming/BlockfileNamingService.java:2203:        lname = "hosts.txt";
./apps/addressbook/java/src/net/i2p/router/naming/BlockfileNamingService.java:2211:            DataHelper.loadProps(props, new File("hosts.txt"), true);
./apps/addressbook/java/src/net/i2p/router/naming/BlockfileNamingService.java:2215:            System.out.println("No hosts.txt to test with");
./apps/addressbook/java/src/net/i2p/addressbook/Daemon.java:137:            opts.setProperty("file", "hosts.txt");
./apps/addressbook/java/src/net/i2p/addressbook/Daemon.java:818:        NamingService ns = getNamingService("hosts.txt");
./apps/addressbook/java/src/net/i2p/addressbook/Daemon.java:844:        defaultSettings.put("local_addressbook", "../userhosts.txt");
./apps/addressbook/java/src/net/i2p/addressbook/Daemon.java:845:        defaultSettings.put("router_addressbook", "../hosts.txt");
./apps/addressbook/java/src/net/i2p/addressbook/Daemon.java:846:        defaultSettings.put("published_addressbook", "../eepsite/docroot/hosts.txt");
./apps/addressbook/java/src/net/i2p/addressbook/Daemon.java:855:        defaultSettings.put("naming_service", "hosts.txt");
./apps/addressbook/java/src/net/i2p/addressbook/HostTxtParser.java:314:        File f = new File("tmp-hosts.txt");
./apps/addressbook/java/test/junit/net/i2p/router/naming/BlockfileNamingServiceTest.java:32:        InputStream is = getClass().getResourceAsStream("/hosts.txt");
./apps/addressbook/java/test/junit/net/i2p/router/naming/BlockfileNamingServiceTest.java:41:        hostsTxt = new File(routerDir, "hosts.txt");
./apps/addressbook/java/test/junit/net/i2p/router/naming/BlockfileNamingServiceTest.java:43:        is = getClass().getResourceAsStream("/hosts.txt");
./apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2Ping.java:126:                hostListFile = "hosts.txt";
./apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2Ping.java:205:            "ping <opts> -h (pings all hosts in hosts.txt)\n" +
./apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java:179:            String book = "privatehosts.txt";
./apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java:181:                book = "userhosts.txt";
./apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java:183:                book = "hosts.txt";
./apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java:352:        if ("hosts.txt".equals(book))
./apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java:354:        else if ("userhosts.txt".equals(book))
./apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java:356:        else if ("privatehosts.txt".equals(book))
./router/java/src/net/i2p/router/startup/PortableWorkingDir.java:86:        File test = new File(oldDirf, "hosts.txt");
./router/java/src/net/i2p/router/startup/WorkingDir.java:178:        File test = new File(oldDirf, "hosts.txt");
./router/java/src/net/i2p/router/startup/WorkingDir.java:349:        "hosts.txt,i2psnark.config,i2ptunnel.config,jetty-i2psnark.xml," +
./core/java/src/net/i2p/client/naming/SingleFileNamingService.java:611:        NamingService ns = new SingleFileNamingService(I2PAppContext.getGlobalContext(), "hosts.txt");
./core/java/src/net/i2p/client/naming/EepGetAndAddNamingService.java:42:    private final static String DEFAULT_HOSTS_FILE = "hosts.txt";
./core/java/src/net/i2p/client/naming/HostsTxtNamingService.java:50:        "privatehosts.txt,userhosts.txt,hosts.txt";
./core/java/src/net/i2p/data/PrivateKeyFile.java:1092:        String[] filenames = new String[] {"privatehosts.txt", "userhosts.txt", "hosts.txt"};

from i2p.i2p.

zzzi2p avatar zzzi2p commented on April 30, 2024

I think where you went astray here is having separate router, config, and app dirs. Nobody does that and probably not tested. In trunk they're the same by default and we kinda use them interchangeably. In our startup we just set config and everything else defaults to that. In particular the migration of files to those three (one) dirs at first startup (as implemented in WorkingDir.java) may not have the right files go to the right places, or maybe we're not consistent elsewhere in the code.

Yes we can work on cleanup/fixes but it won't be in time for our next release in December. As a workaround you may wish to set them all the same or do symlinks, I don't know how you want to deal with new vs. existing installs but that's your field of expertise. But I think you may hit more weird problems if they're not all effectively pointing to the same place. That's on us that we haven't really said that anywhere before.

As far as the ../ in addressbook/config.txt, it really doesn't matter, it should work split or non-split install as long as the dir settings are all the same. And it really doesn't matter, because hosts.txt is copied from install dir to config dir, and then imported into hostsdb.blockfile (BlockfileNamingService) on first run. The files to be imported are hardcoded to be in the router dir, we're not looking in the config.txt file to see what to import. Neither hosts.txt is never modified. I guess hosts.txt isn't where we think it should be so it doesn't get imported.

Hopefully that explains what's going on, sorry for the trouble.
Thanks for supporting I2P.

from i2p.i2p.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.