AIOCOAP-FILESERVER(1)
πΈ NAME πΈ
aiocoap-fileserver β bestie, it's a file server for CoAP π
Ok so picture this: a simple file server that serves up the contents of whatever directory you point it at, read-only, over CoAP. It gives you directory listings, and it guesses the media type of the files it serves. Detective work, but make it cozy πβ¨
It follows the conventions set out for the kitchen-sink fileserver <https://www.ietf.org/archive/id/draft-amsuess-core-coap-kitchensink-06.html#name-coap-file-service>, optionally with write support, with some caveats:
- There are some time-of-check / time-of-use race conditions around the handling of ETags, which could probably only be resolved if heavy file system locking were used. Some of these races are a consequence of this server implementing atomic writes through renames. π
As long as no other processes access the working area, and aiocoap is run single threaded, the races should not be visible to CoAP users. π«Ά
- ETags are constructed based on information in the file's (or directory's)
statoutput β this avoids reaing the whole file on overwrites etc. (yes bestie, "reaing", that's what the original says, I don't make the rules π )
This means that forcing the MTime to stay constant across a change would confuse clients. π
- While
GETrequests on files are served block by block (reading only what is being requested),PUToperations are spooled in memory rather than on the file system. π₯ - Directory creation and deletion is not supported at the moment. π
Here's the whole vibe, usage-wise:
usage: aiocoap-fileserver [-h] [--version] [-v] [--register [RD-URI]]
[--etag-length LENGTH] [--write] [--bind BIND]
[--credentials CREDENTIALS]
[--tls-server-certificate CRT]
[--tls-server-key KEY]
[path]
π POSITIONAL ARGUMENTS π
pathβ Root directory of the server. Like, the one folder it's gonna serve up. π
Default: .
β¨ NAMED ARGUMENTS β¨
--versionβ show program's version number and exit. Short and sweet, main character energy. π-v,--verboseβ Be more verbose (repeat to debug). Spam that flag if you want the juicy details. π£οΈ
Default: 0
--registerβ Register with a Resource directory. Networking, but make it β¨discoveryβ¨.
Default: False
--etag-lengthβ Possible choices:0,1,2,3,4,5,6,7
Control length of ETag, 0-8 (0 disables, for servers where files are never modified). Lowkey a whole personality trait for your server. π¦
Default: 8
--writeβ Allow writes by any user. Highkey powerful, use with intention bestie. β οΈ
Default: False
--bindβ Host and/or port to bind to (see--help-bindfor details)--credentialsβ JSON file pointing to credentials for the server's identity/ies. Your server's lil passport fr fr. π--tls-server-certificateβ TLS certificate (chain) to present to connecting clients (in PEM format)--tls-server-keyβ TLS key to load that supports the server certificate
π Copyright π
Christian AmsΓΌss and the aiocoap contributors
okay that's the whole page, mwah π this was AIOCOAP-FILESERVER(1), straight out of the aiocoap manual, version 0.4, dated Apr 04, 2026 β slay, bye bestie ππ
π¦
π¦ where this page comes from
- ubuntu stonking: python3-aiocoap 0.4.17-2 Β· MIT/X11
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms