DreamFactory Wiki Files

Here we look at how we can provide proper RESTful access to Fedwiki Files from multiple domains using DreamFactory.

The files managed by DreamFactory are found in the following directory:

/opt/dreamfactory/storage/app

# Aims

We are looking to add a Decentralised Media Commons functionality to wiki, using the Permanent Web.

We seek to achieve this by adding asset management to wiki, and linking this to a DreamFactory IPFS Service, which will automatically add media files to IPFS, while at the same time making them available to wiki in a convenient way.

# Scenarios

The advantage of using a decentralised copy of the file (ie on IPFS). is that we have a decentralised backup, and we can use the wiki page files

# File naming

More important than the actual location of the media files, is the file naming. We are proposing naming the files with an IPFS prefix, and a mime type (media) suffix.

This way all the media files can be in a single folder without name clashes.

# Asset folder

We should probably discuss creating a new asset folder structure for wiki. Currently we use the Fedwiki Theme Folder for each domain (which is a bit ugly).

I am proposing using a new toplevel assets folder, with subfolders corresponding to wiki page slugs:

However it may be better to keep a toplevel only structure, and use this IPFS short filename hack (see above) - as this would enable a script to work out the file location based on the short file both in IPFS and as a conventional file within the assets folder.

assets/ david-bovill welcome-visiters/ pages/ status/

# Current Issues

A standard DreamFactory HTTP GET call to access a file looks like:

http://culturecollective.cc/api/v2/wiki/pages/hello? api_key=API Key

This is not quite working.

curl -X GET --header 'Accept: application/octet-stream' --header 'X-DreamFactory-Api-Key: api key' --header 'X-DreamFactory-Session-Token: session token' 'http://culturecollective.cc/api/v2/wiki/%2Fpages%2Fhello?download=false'

# Examples Here are some examples of interacting with Dreamfactory:

curl -i -k -3 -X POST "http://culturecollective.cc/api/v2/user/session" -d '{ "email" : "david@feast.fm", "password" : "pass123" }' -H "Content-Type: application/json"

or equivalently: