Shirakumo / radiance

A Common Lisp web application environment
https://shirakumo.github.io/radiance/
zlib License
311 stars 19 forks source link

Data Storage Directory #28

Closed Shinmera closed 5 years ago

Shinmera commented 5 years ago

Currently Radiance does not provide a proper data storage directory where files and other upload data can be put that does not fit into the database.

Some existing modules like Filebox and Purplish abuse the mconfig-pathname to store files within the configuration directory, as storing them in the source root is not a good choice. However, this is clearly also not an acceptable way to handle things.

Shinmera commented 5 years ago

So far I think this is going to need a breaking change. Namely we need to get rid of *environment-root* and instead handle the environment file resolution mechanism via a function that the user can override:

(defgeneric environment-directory (env type)) 

By default this function will consult XDG_CONFIG_HOME and XDG_DATA_HOME and fall back to ~/.config/ and ~/.local/share/ on unix, and consult %APPDATA% on Windows. Allowing different environment storage types will also help with #26, to provide an environment-based directory for template overrides.