Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Workers Sites uploads do not include files that are in .gitignore #958

Closed
lighterpl opened this issue Dec 14, 2019 · 3 comments · Fixed by #981
Closed

Workers Sites uploads do not include files that are in .gitignore #958

lighterpl opened this issue Dec 14, 2019 · 3 comments · Fixed by #981
Labels
bug Something isn't working investigate

Comments

@lighterpl
Copy link

🐛 Bug Report

Environment

  • operating system: windows 10 pro v1909 (18363.535)

Steps to reproduce

Generate workers site project, set account id, api access granted using workers site template permissions.

Static file export of Wordpress site, placed in ./public folder

Run wrangler publish

Some css and js and font files are not uploaded (as seen by http 500 error in chrome dev tools for those resources)

I suspect this is because the files are in a deep folder structure, because when these files are moved to root public folder or 1 folder deep, wrangler does not skip them and they are successfully deployed.

What did you expect to see?

I expect ALL files in ./public folder to be deployed

What did you see instead?

Some files are skipped during wrangler publish process

@EverlastingBugstopper
Copy link
Contributor

Hey @lighterpl - my guess is that these assets are actually being uploaded and they're just linked incorrectly from within the application.

That being said this is just a hunch, and it's very possible that they are not being uploaded! The best way for us to help here is if you could point us to a repository that reproduces the problem and then we can investigate :)

@lighterpl
Copy link
Author

Seems that it happens when there is a subfolder anywhere inside the ./public directory named “dist” all files inside are ignored.

@EverlastingBugstopper
Copy link
Contributor

Aha! It seems that Wrangler is not uploading files in the .gitignore for some reason. I'm pretty sure this is a bug! While we work on a fix for this, you should be able edit your .gitignore file - it should have dist in it, you can change this to /dist so it only ignores the top level dist directory, and not the directory in your public folder. Hope this helps!

@EverlastingBugstopper EverlastingBugstopper added bug Something isn't working and removed user report labels Dec 17, 2019
@EverlastingBugstopper EverlastingBugstopper changed the title Wrangler publish misses some files Workers Sites uploads do not include files that are in .gitignore Dec 17, 2019
gabbifish added a commit that referenced this issue Jan 3, 2020
…tory traversal (#981)

* Fix #958: Do not factor in .gitignore into workers sites upload directory traversal

* make sure to delete interior public/ directory in test directory before deleting test directory; this looks like a weird windows quirk with fs::remove_dir_all

* try writeln?

* drop/close gitignore file before deleting directory

* comment on why our test calls drop()

* Update src/commands/kv/bucket/mod.rs
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working investigate
Projects
None yet
2 participants