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

Clearing Control Panel resources deletes gitignore #2823

Closed
Wiejeben opened this issue Apr 28, 2018 · 11 comments
Closed

Clearing Control Panel resources deletes gitignore #2823

Wiejeben opened this issue Apr 28, 2018 · 11 comments

Comments

@Wiejeben
Copy link
Contributor

Wiejeben commented Apr 28, 2018

Description

When clearing control panel resource cache, it deletes the (by default provided by craftcms/craft) /web/cpresources/.gitignore file. As a result someone could accidentally commit the contents of their cpresources directory.

Steps to reproduce

  1. Having a .gitignore file inside the cpresources directory
  2. CP -> Utilities -> Clear Cache -> Make sure Control Panel resources is selected -> Press Clear Caches

Additional info

  • Craft version: 3.0.4
  • PHP version: 7.0.30
  • Database driver & version: MySQL 5.7.21
  • Plugins & versions: -
@brandonkelly
Copy link
Member

Thanks for pointing that out! Fixed for the next release.

@benface
Copy link
Contributor

benface commented Feb 24, 2019

I'm still experiencing this @brandonkelly, on Craft CMS 3.1.14. Same repro steps as the first post ^

@brandonkelly
Copy link
Member

@benface Strange, still working correctly on my end. Is your gitignore file named exactly .gitignore ?

@benface
Copy link
Contributor

benface commented Feb 25, 2019

@brandonkelly This is weird. It's happening on the production server but not locally. And yes, the file is named exactly .gitignore and it has the following contents:

*
!.gitignore

The server is a cPanel VPS. All the requirements are met for running Craft (except the Max Execution Time which is set to 60 seconds instead of 120). Anything else would be useful?

@brandonkelly
Copy link
Member

Have you set a custom resourceBasePath config setting value?

@benface
Copy link
Contributor

benface commented Feb 26, 2019

@brandonkelly No, I haven’t.

@brandonkelly
Copy link
Member

Huh… I’m a bit stumped then. You’re positive that the .gitignore file is deleted exactly when you are running the Clear Caches utility? Maybe worth sending in some admin & SSH credentials to [email protected] so we can try looking into it from there.

@epcliff
Copy link

epcliff commented Aug 19, 2019

I'm having the same issue.

@Wiejeben
Copy link
Contributor Author

@epcliff which version of Craft are you running?

@brandonkelly
Copy link
Member

Sorry, I guess this fell through the cracks. I was able to reproduce the issue after looking into it again per #7361, and it’s now fixed for the next release.

@brandonkelly
Copy link
Member

Craft 3.5.18 is out now with that fix ✨

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

No branches or pull requests

4 participants