forked from GNUsocial/gnu-social
Diogo Peralta Cordeiro
6028175bfc
Fixed file quota as well. There can be more than one file for the same filehash IF the url are different. Possible states: - A file with no url and with filename is a local file. - A file with an url but no filename is a remote file that wasn't fetched, not even the thumbnail. - A file with an url and filename is a fetched remote file (maybe just a thumbnail of it). - A file with no filename nor url is a redirect. Routes: Given these states, updated routes so that an attachment can only be retrieved by id and a file by filehash. Major API changes: File::getByHash now returns a yield of files Major UI changes: - Now remote non stored files are presented. - /view became preferred - Redirects to remote originals are preferred. Many other minor bug fixes... |
||
---|---|---|
.. | ||
locale | ||
scripts | ||
README | ||
StoreRemoteMediaPlugin.php |
The StoreRemoteMedia plugin downloads remotely attached files to local server. Installation ============ add "addPlugin('StoreRemoteMedia');" to the bottom of your config.php Settings ======== domain_blacklist: Array of regular expressions. Always escape your dots and end your strings. check_blacklist: Whether to check the domain_blacklist. domain_whitelist: Array of regular expressions. Always escape your dots and end your strings. check_whitelist: Whether to check the domain_whitelist. max_image_bytes: Max image size. Anything bigger than this is rejected. 10MiB by default When check_whitelist is set, only images from URLs matching a regex in the domain_whitelist array are accepted for local storage. When check_blacklist is set, images from URLs matching any regex in the domain_blacklist are denied local storage. When both lists are checked, only images from URLs that match a regex in the domain_whitelist and that match no regexen in the domain_blacklist are accepted for local storage. Example ======= addPlugin('StoreRemoteMedia', array( 'domain_whitelist' => array( '^i\d*\.ytimg\.com$' => 'YouTube', '^i\d*\.vimeocdn\.com$' => 'Vimeo' ), 'check_whitelist' => true, ));