neocities / neocities

Neocities.org - the web site. Yep, the backend is open source!
https://neocities.org
Other
1.45k stars 139 forks source link

Bug: New Filename Character Limit needs to be removed or fixed + increased. #498

Closed FrogCast closed 4 months ago

FrogCast commented 8 months ago

[ Line 9 ] https://github.com/neocities/neocities/commit/a1cb3c6a118f04bc9c3aacb215bc6e877d19b92a#diff-c9c870ed47e82d937affc705cc1b735d9a895bd5d71aaf0e0ac3cbd776526620R8 Introduction of this line broke my backend, and caused several hours of rework, mainly because the limit imposed of 100 characters is very small.

Also, the limit is broken:

{
  "result": "error",
  "error_type": "file_name_too_long",
  "message": "Graphics/Vancouver | Protection of The Blessed Virgin Mary 2024.01.29 Class, Club, Family, Formation.webp filename is too long"
}

Vancouver | Protection of The Blessed Virgin Mary 2024.01.29 Class, Club, Family, Formation.webp is 96 characters long, meaning that it is also counting "Graphics/"

I'd like to suggest the limit to be removed, or greatly increased so that it is on par with common filesystem naming limits like ext4 ( 255 characters ).

The error message should also tell what the character limit is.

js044 commented 6 months ago

Having a similar problem, and it took me quite awhile to rename and reorganize my images to satisfy the bugged requirements. My SSG handles image processing and appends the file names with an MD5 hash and some filter data. This pushes the file names to be over 100 characters if I'm not careful. That would be annoying, but acceptable, if it wasn't for the fact that the file paths are also counted towards the 100 character limit. I verified this with a few files that just would not upload, even though their file names were all 80 characters or below. Finally realized the problem was that their sub-directories were pushing the total character count over 100, so I had to restructure my file hierarchy to make it all work. Seems like a clear bug, but I also do think the intended 100 character limit is a little unreasonable. 255 seems better.

buffalotony commented 5 months ago

Having the same issue. I built a site with hugo and used a theme component to generate a simple and small image gallery and the filenames it creates for thumbnails are around 85 characters, which neocities is rejecting. Having this be on par like others have requested would be extremely beneficial to everyone.

kyledrake commented 4 months ago

We'll try this and see if it has any issues. Original issue was that there were huge filenames causing errors in the postgres btree indexer. I think setting it to exactly 255 could potentially cause edge issues but we'll see what happens and I can adjust accordingly. Thanks and sorry for the delay.

kyledrake commented 4 months ago

Indeed, the moment I merged this a test failed - the Tmpfile functionality adds to the filename and causes the file to be too long. I've set it to 200, which seems to work fine with it and doubles the previous limit. If anything is generating larger files than that, please update this issue, but also, that's kind of a design smell to me honestly, filenames really shouldn't be bigger than 200 characters for static web sites.

buffalotony commented 3 months ago

Thanks for this update! I re-engaged the plugin I was using and it is currently generating file-names under the 200 character limit, which is great. hugo-shortcode-gallery is working again!