haydenwoodhead / burner.kiwi

No bullshit temporary mail service written in Go
https://burner.kiwi
MIT License
216 stars 26 forks source link

Wrong static files served when using STATIC_URL=/static #12

Closed cdubz closed 5 years ago

cdubz commented 5 years ago

This was definitely working in the past and I couldn't find any recent commit that seemed like it would affect it. The following steps end up serving the static folder from the repo root instead or what gets compiled for the build.

git clone https://github.com/haydenwoodhead/burner.kiwi.git
cd burner.kiwi
go mod init
make build-sqlite
[set up BK env with STATIC_URL=/static]
./build/burnerkiwi

Accessing WEBSITE_URL works and core functionality is fine, but none of the CSS loads. However, WEBSITE_URL/static/custom.css does load.

haydenwoodhead commented 5 years ago

Looking into it.

haydenwoodhead commented 5 years ago

So I'm encountering a different issue when using the same steps. ~Chrome refuses to apply the styles due to a MIME type issue~. What version of packr are you running?

Edit: it's actually failing to find the files at all. So this is related because packr will fall back to the filesystem when it can't find them in the binary.

haydenwoodhead commented 5 years ago

So this was caused by the switch from build.sh to the Makefile. I'm going to push a commit soon that will hopefully fix this.

haydenwoodhead commented 5 years ago

I've pushed the commit to master. Let me know if this fixes your issue.

cdubz commented 5 years ago

Nice, that fixed it!