Problem/Motivation

Trying to figure out how to exclude files from the private file system.

Tried a few things regarding the system path in the other tab but didn't get very far.

Tried the following in the file url and path blacklists:

private://*
../private/*
private*
system/*
section-group-file*

Proposed resolution

Remaining tasks

User interface changes

API changes

Comments

joelpittet’s picture

Issue summary: View changes
wim leers’s picture

Category: Support request » Task

Sorry for the late reply. Been too busy with D8 :)

This is kind of a duplicate of #1793652: hook_requirements() should check if the private file system being used… but since that went in the wrong direction, let's do it here — I marked the other issue as a duplicate of this one with this comment:

I don't know why I didn't simply state in the past that cdn_file_url_alter() should be updated to exclude private://… that'd solve the problem transparently for everybody.

The sad thing is that we cannot programmatically (i.e. by stream wrapper type, see the constants at https://api.drupal.org/api/drupal/includes%21stream_wrappers.inc/7) exclude the private file system, we have to check for it explicitly. But oh well, that seems acceptable.

Let's do that over at #2352391: Exclude private:// stream wrapper.

wim leers’s picture

Title: Exclude Private file system » Exclude private:// file system
wim leers’s picture

Title: Exclude private:// file system » Exclude private:// stream wrapper
wim leers’s picture

Status: Active » Needs review
StatusFileSize
new1.16 KB
new1.76 KB

I think explicitly disallowing private:// is fine in the Drupal 7 version of the CDN module. In the Drupal 8 port I will probably just whitelist the stream wrappers that the CDN module should alter the file URLs for — that'll be more elegant, but isn't worth the configuration upgrade pain in Drupal 7.

wim leers’s picture

StatusFileSize
new1.16 KB
new1.76 KB

Re-enabled automated testing for D7 CDN. Re-uploading patches in #5.

The last submitted patch, 6: 2352391-5-test-only-FAIL.patch, failed testing.

  • Wim Leers committed 4a7f616 on
    Issue #2352391 by Wim Leers: Exclude private:// stream wrapper
    
wim leers’s picture

Status: Needs review » Fixed

Test prove this is working, yay :)

joelpittet’s picture

At first glance this looked better, I'll see in staging:) Thanks @Wim Leers

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.