I suggest for DocumentStore.setOutDir checking if the out directory exists
and throwing an error if not.
In (the very likely) case that someone doesn't follow the INSTALL file
suggestion to use '/srv/onionoo' as working directory, the missing folder
is reported immediatly.
And, maybe add some hint about changing 'etc/web.xml.template' to the top
of INSTALL? Like "If you choose a different working directory make sure
its path is reflected in the following files: ..."
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items
0
Link issues together to show that they're related.
Learn more.
I suggest for DocumentStore.setOutDir checking if the out directory exists
and throwing an error if not.
In (the very likely) case that someone doesn't follow the INSTALL file
suggestion to use '/srv/onionoo' as working directory, the missing folder
is reported immediatly.
Yes, good idea. Want to submit a patch for this?
And, maybe add some hint about changing 'etc/web.xml.template' to the top
of INSTALL? Like "If you choose a different working directory make sure
its path is reflected in the following files: ..."
Or should we take this parameter out of etc/web.xml.template? We could default to out/ in the current working directory, and accept a command-line parameter to override that default similar to the logging directory. Does that make sense?
I think it is most useful that the setOutdir method just verifies the path and
throws FileNotFoundEx. if there is no directory.
The callers have to deal with that. Currently, only NodeIndexer is affected and
an informative message should be logged and the web application should exit.
A patch is attached, which exits the web application and logs an error message and
a hint about where to fix the path, i.e.
Out-dir not found! Expected directory: /srv/onionoo.torproject.org/onionoo/out Verify the configuration in ./etc/web.xml.template
I think it might be better to keep real application configuration in files rather than
on the command line. That way it'll be easier to determine runtime parameters during trouble-shooting.
Command lines can be ephemeral sometimes.
If the location of the outdir configuration is changed in future, the error handling
is close to the affected code and can be easily adapted.
I'm yet undecided if we should find a better solution than defining the directory in etc/web.xml which is then included in the .war file. If we ever want to give out binaries, which include the .war file, people wouldn't be able to change the path to their out/ directory. If command-line parameters are not the way to go, how about we use something else for config files? (I vaguely remember that you suggested something on a different ticket, but I don't remember the details.)
Without an additional lib reference, why not use a plain old java properties file?
Have useful defaults for everything and write the properties file, if the app could not
find one initially?
Either commons-configuration or properties file works for me. And yes, new ticket makes sense. Want to create one and ideally submit a patch? Resolving this issue as implemented. Thanks!
Trac: Resolution: N/Ato fixed Status: new to closed