Laravel-apidoc-generator: Move public/docs/source outside of public web root

Created on 15 Oct 2018  路  8Comments  路  Source: mpociot/laravel-apidoc-generator

The $outputDir/source directory should not exist in a publicly accessible location. As it seems to be used for generating the public assets, it should probably go into storage. I'm not sure of the best way to handle any customizations. Views need to be overridable from resources/views/vendor, at least. It seems like perhaps the whole structure of the package needs to be reexamined to work in a more Laravel-standard way.

next

All 8 comments

The $outputDir/source directory should not exist in a publicly accessible location.

Why? The docs already go into a publicly accessible path, and the docs are essentially just the built source.

Also, a user can configure their output path to some other directory if they wish.

No code should ever go into /public (other than index.php), only compiled resources. There is no need for the general public to access any files in /source that I'm aware of. Maintaining the same organizational structure as Laravel and most other web frameworks is definitely beneficial. I think this is particularly important if people are going to customize any of those files.

@hackel

I agree. I cant move the docs behind auth if it's in the public directory. index.html file straight in the public directory doesn't even load the framework.

The benefit is you can drop the docs folder anywhere on a web server and it will work. The bad news is it doesn't work with the web framework at all once it's generated.

I think it's a very good idea, because in my case I would like to use the prepend and append markdown file to customize api doc page, but I don't want to push the public/docs directory into my git repository, I generate the documentation on deploy.
Like the logo path, all of the customisable resources' path could be configurable.

This isn't a major concern for me right now TBH. Interested folks can make a PR (with adequate description and tests, please).

+1 Might not be a major concern. But for private project, i would like to move it to secure place.

As of #608 (coming in v4), thee's now support for this. See https://github.com/mpociot/laravel-apidoc-generator/pull/608#issue-328470114.

Feel free to provide any feedback on the implementation. Also you can install the 4.0.0-alpha or 4.x-dev releases from Composer and take it for a spin.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nikosv picture nikosv  路  3Comments

Jaspur picture Jaspur  路  8Comments

Humni picture Humni  路  6Comments

shankesgk2 picture shankesgk2  路  6Comments

arikardnoir picture arikardnoir  路  8Comments