Skip to content

garden/tree

Repository files navigation

tree

A multiplayer file system. All files synced realtime, offline-ready. Use apps for each file types. Make your own apps on the platform. Access control per-file.

thefiletree.com

Install

git clone https://github.com/garden/tree
cd tree
mkdir -p admin/private; cp env.json admin/private/  # See admin/README.md
# For development:
make start
open http://[::1]:1234
# For production:
make install
tail -f admin/log/tree.log # to see errors.
sudo systemctl restart tree # when you need to restart the server.

Interface

  • Create
    • file: PUT / (content is body)
    • folder: MKCOL /
  • Read
    • GET / (show in default browser app)
    • GET /?app=data (raw, optional header Depth:3 for folder; TODO slice)
    • GET /?app=metadata Content-Type:multipart/form-data (JSON)
  • Update
    • single file:
      • data:
        • overwrite: PUT /
        • TODO append: POST /?op=append
        • TODO partial: PATCH /
        • sync: websocket /?op=edit&app=text (TODO json, dir)
      • metadata: PUT /?app=metadata Content-Type:application/json (TODO: PATCH /)
    • multiple files: POST /?op=append&content Content-Type:multipart/form-data
    • folder:
      • TODO copy: COPY /from Destination:/to Overwrite:T
      • TODO move: MOVE /from Destination:/to Overwrite:F
      • TODO shell: POST /?op=shell&cmd=make&keep=a.out (stdin is body, stdout is result, unless websocket)
  • Delete: DELETE /

Contribute

Plans

  • Allow user-made apps
    • Send APP_AUTH
    • Use a safe templating system
  • JSON sync
  • File search
  • Snapshots (may require to migrate the file content to CockroachDB)
  • Remote desktop

Dependencies

This project is covered by the GNU General Public License (version 2) and contains code from:

  • ScoutCamp, a powerful web server (LGPL license)
  • CodeMirror, a nifty in-browser code editor (MIT license)
  • Canop, a real time sync system (MIT license)
  • CockroachDB, a distributed SQL database