Files that contain ! (exclamation mark) in the file name are not added to content.json.
Note: This seems to apply to a few other characters too, including but not limited to ' (apostrophe) and & (ampersand)
When setting the site name and description, the directory is scanned for files, and they are added to the content.json index. Files containing an exclamation mark are not added to the file and thus are not shared with others.
The debug log contains lines like these (some information has been redacted by me):
[2019-08-11 โโโ] ERROR Site:โโโ - [ERROR] Invalid filename: Test !.txt
[2019-08-11 โโโ] INFO Site:โโโ - [SKIPPED] Test !.txt
No seemingly arbitrarily chosen file name rules in place. Any file name made up of a valid file name character sequence should be added to the content.json file.
Files/directories that start with . or end in -old or -new are hardcoded to be excluded too.
This puts a huge dampener on sharing git repositories or creating the .well-known folder. (See RFC 5785)
The offending location for the character selection seems to be https://github.com/HelloZeroNet/ZeroNet/blob/5a746769d01db58d54ff121e784fbf87374a89f3/src/Content/ContentManager.py#L603
I want to add here that it took me hours to find this problem because the local client that hosts the files is totally happy delivering them to the browser regardless if the names are considered valid.
If you need a regex for all valid file names: ^[^\x00-\x1F\x22\x2A\x2F\x3A\x3C\x3E\x3F\x5C\x7C]+$
Without hex where avoidable: ^[^\x00-\x1F"*/:<>?\\|]+$
Most helpful comment
I want to add here that it took me hours to find this problem because the local client that hosts the files is totally happy delivering them to the browser regardless if the names are considered valid.
If you need a regex for all valid file names:
^[^\x00-\x1F\x22\x2A\x2F\x3A\x3C\x3E\x3F\x5C\x7C]+$Without hex where avoidable:
^[^\x00-\x1F"*/:<>?\\|]+$