Serving files?

I’m incredibly impressed with Hugo so far. For someone with basically no web programming experience, I’ve been able to get a pretty decent site up and running with not much effort. I’m using Hugo within a Docker container (based on this)

The next step in my migration is to serve a large .exe file as a download from one of my pages.
My first idea is to just move the .exe into my site/ directory and link to it. However, this seems to always crash Hugo (which takes down my container).

I’ve tried adding

ignoreFiles = [ "\\.exe$" ]

However, this does not change anything for me. I’ve tried putting the .exe in various folders (static, data, etc). Every time I move it into the site’s tree, the next rebuild crashes Hugo.

Is there an agreed-upon way to do this?

  1. I assume you get an error message or some kind? Without one it is impossible to tell.
  2. I would try with another file format (ZIP it?) and see if that makes any difference; exe sounds like malware to me. Not sure what the preferred distribution format on Windows is, ZIP, MSI?
  3. The built-in Hugo server is meant for development; it works fine in production, but we have deliberately labeled it as a dev server to prevent having to support it in production and adding production like features. Nginx or similar should run fine on Docker.

Do you think this could be related? It seems similar at least…

I’ll dig in today and collect an error message to look at for sure.
I don’t get what you mean by ‘exe sounds like malware to me.’ Does mp3 sound like piracy?

What would be the general approach to make a new Hugo site and post a blog entry linking to a short audio clip?
Host it elsewhere even though you just made a blog and web server? Or replace the Hugo server with nginx just to be able to post a file?

mp3 files isn’t executable files that may do harmful stuff to my computer. Please supply an error message.

That’s funny, because I just uploaded an mp3 to my site and it worked fine.
Then I renamed it to .exe and that worked fine too.

So this must not be the reason for the crash, right?

Also I’m not trying to spread malware. Just trying to link to my own installer on my own blog. I’ll get back soon with more details.

I’m just trying to help you, but you have given very little information, hence my wild guesses …

Alright, I finally got time to look at this again.
When it tries to sync the file (131MB), it runs out of memory and crashes with this log.

From what I remember, I was able to serve a smaller exe/mp3/whatever without this happening.
Can I configure a memory limit somewhere to help this?
Is ignoreFiles doing its job in this case? Not sure if I’m misunderstanding it…

Actually, this might even just be user error. I don’t really have as much memory free on the box as I would need for this to rebuild and malloc my big file. Let me try some stuff and get back to you!

Yep, adding more memory to the machine solved this. Thanks for the help regardless!