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

Redirects don't currently work for files #10

Closed
bgantick opened this issue May 10, 2018 · 5 comments
Closed

Redirects don't currently work for files #10

bgantick opened this issue May 10, 2018 · 5 comments

Comments

@bgantick
Copy link
Contributor

Cause: Files served directly by nginx before redirects happen

Possible Solution: This probably won't be solved in this module. I think we need to do one/both of these things:

@boutell
Copy link
Member

boutell commented May 10, 2018 via email

@boutell
Copy link
Member

boutell commented May 11, 2018

There is now a practical path to fix this:

  1. npm update

'apostrophe-attachments': {
  uploadfs: {
    disabledFileKey: 'very-random-string-please-not-this'
  }
}
  1. Deploy as usual. (Please note: I put these steps in this order for reasons)

  2. On the server, run this task to complete the transition:

node app apostrophe-attachments:migrate-to-disabled-file-key

Now files in the trash have their names changed rather than their permissions changed. Recommend verifying an example.

BENEFITS

  1. You can now sync down without permissions nonsense! Woo

  2. You can now create a redirect for the old URL of the file, because the file ain't there no more.

@boutell boutell closed this as completed May 11, 2018
@boutell
Copy link
Member

boutell commented May 14, 2018

Brand-new punkave projects (created today from our client-boilerplate) should be good to go out of the box. You need to npm install -g apostrophe-cli though.

@abea
Copy link

abea commented May 29, 2018

Should disabledFileKey be documented in the apostrophe-attachments docs page? I could do that if so.

@boutell
Copy link
Member

boutell commented May 29, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants