PerlDancer / PerlDancer/Dancer2
Dancer2 Apps installed using CPAN can't be used in a site
Nobody has claimed this yet.
- Dominant language
- Perl
- Stars
- 604
- Forks
- 288
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 5
Description
Dancer2 Apps installed using CPAN can't be used in a site because they can't reach configuration files.
Scenario
You have an App on CPAN that you want to use in your site. You installed it using
cpan -i MyAPP
and you have in your bin/app.pl
use MyApp
MyApp uses plugins and you configured them in the config.yml under your siteroot.
When the plugin is invoked it starts looking for informations about configuration, but it calculates the config_location starting from the location of the MyApp module so it gets lost under your local perl repository, never reaching the config.yml under the siteroot.
Solutions (in my opinion)
A workaround is setting the DANCER_CONFDIR as siteroot. In my opinionis this is not a clean solution and at the moment I don't know how to use it when running the test-suite.
A solution could be to store the site root in the Dancer->Runner->Config as it the previous versions and use it as a default when calculated config_location has no config file inside it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with bin/app.pl and the config.yml under the siteroot, then trace how Dancer->Runner->Config determines config_location for a CPAN-installed MyApp. Compare that behavior with the DANCER_CONFDIR workaround and the proposed site-root fallback. Done means the installed app can reach the site's configuration, including when the test-suite is run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- perl
- Domain
- backend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100