Dancer2 icon indicating copy to clipboard operation
Dancer2 copied to clipboard

Remove heuristics finding "lib", "bin", etc.

Open xsawyerx opened this issue 12 years ago • 5 comments

This causes unneeded hidden behavior ("action at a distance") and makes it difficult to separate application code form application directory.

We really don't need it.

xsawyerx avatar Aug 23 '13 21:08 xsawyerx

The following is (I think) an example of this problem. Given an app structured like this:

./bin/app.pl
./public/images/secret.jpg

Visiting the page http://<hostname>:3000/images/secret.jpg returns a 404, but moving ./bin/app.pl to just ./app.pl it works as expected.

andrewsolomon avatar Aug 30 '13 21:08 andrewsolomon

Are the heuristics still present? Does #919 cover this issue, so it can be closed? When you get a moment, thanks.

@andrewsolomon the example works correctly for me with a current Dancer2 version.

rleir avatar Oct 19 '15 14:10 rleir

These heuristics are currently in ::Role::ConfigLoader. #919 doesn't cover it.

veryrusty avatar Oct 19 '15 17:10 veryrusty

Thanks for leading me to this. I had a look at Core/Role/ConfigReader.pm Is the problem in sub _build_config_files line 106 where it makes a list of possible config files in various locations then sorts them? I think this is more complicated than it needs to be, and sure to trip me up. But any changes to this could break existing apps.

Suggest: in sub load_config_file we need a debug option to dump the list of files. Perhaps at line 203 or thereabouts. And at line 121, dump $path.

And maybe deprecate this module in favour of a simpler one?

rleir avatar Oct 20 '15 14:10 rleir

Ideally, #1032 was supposed to help address this, but we never made it further than creating the .dancer file.

#1593 was created to address dumping the list of config files, and #1580 exists to help us remember why we created the .dancer file at all.

Config, in general, needs some love, and I am hoping to get there soon. Stay tuned.

cromedome avatar Mar 01 '21 21:03 cromedome