Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module Files: Serve from the Library not the file system #1356

Closed
dasgarner opened this issue Dec 15, 2017 · 2 comments
Closed

Module Files: Serve from the Library not the file system #1356

dasgarner opened this issue Dec 15, 2017 · 2 comments
Assignees
Labels
enhancement An improvement to an existing feature
Milestone

Comments

@dasgarner
Copy link
Member

When creating a custom module, if it uses any resources these also have to be in /web/modules. This isn't optimal when using Docker as you have to mount those resources into the container using a volume.

This needs to be improved so that those resources are served from the Library directly - in the same way that they are for the Player.

We should change getResourceUrl so that - for preview - it looks up the resource provided and gives a download link that serves the file from the library instead.

@dasgarner dasgarner added the enhancement An improvement to an existing feature label Dec 15, 2017
@dasgarner dasgarner added this to the 1.8.4 milestone Dec 15, 2017
@dasgarner
Copy link
Member Author

Something like this might be suitable:

//to get the id automatically
if ($isPreview) {
    $media = $this->mediaFactory->getByName('name');
    $url = $this->getApp()->urlFor('library.download', ['id' => $media->mediaId]);
} else {
    $url = $this->getResourceUrl('your file name');
}
// use the $url here

@dasgarner
Copy link
Member Author

We'd have to ensure that the permission checking in library download didn't get in the way of serving these files.

I think this just needs to be that module system files are downloadable by all.

@dasgarner dasgarner self-assigned this Dec 20, 2017
dasgarner added a commit to dasgarner/xibo-cms that referenced this issue Dec 21, 2017
dasgarner added a commit to dasgarner/xibo-cms that referenced this issue Dec 21, 2017
dasgarner added a commit to dasgarner/xibo-cms that referenced this issue Dec 21, 2017
dasgarner added a commit to dasgarner/xibo-cms that referenced this issue Dec 21, 2017
dasgarner added a commit to dasgarner/xibo-cms that referenced this issue Dec 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant