AIOCOAP-FILESERVER(1)

πŸ“¦
version 0.4.17 Β· 3 versions
, in ubuntu stonking

🌸 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) stat output β€” 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 GET requests on files are served block by block (reading only what is being requested), PUT operations 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-bind for 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

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