{"action":"created","issue":{"url":"https://api.github.com/repos/PhileCMS/Phile/issues/183","labels_url":"https://api.github.com/repos/PhileCMS/Phile/issues/183/labels{/name}","comments_url":"https://api.github.com/repos/PhileCMS/Phile/issues/183/comments","events_url":"https://api.github.com/repos/PhileCMS/Phile/issues/183/events","html_url":"https://github.com/PhileCMS/Phile/pull/183","id":55743403,"number":183,"title":"Delete 'cache' and 'datastorage' directories from repository and only create them when required","user":{"login":"infostreams","id":1132744,"avatar_url":"https://avatars.githubusercontent.com/u/1132744?v=3","gravatar_id":"","url":"https://api.github.com/users/infostreams","html_url":"https://github.com/infostreams","followers_url":"https://api.github.com/users/infostreams/followers","following_url":"https://api.github.com/users/infostreams/following{/other_user}","gists_url":"https://api.github.com/users/infostreams/gists{/gist_id}","starred_url":"https://api.github.com/users/infostreams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infostreams/subscriptions","organizations_url":"https://api.github.com/users/infostreams/orgs","repos_url":"https://api.github.com/users/infostreams/repos","events_url":"https://api.github.com/users/infostreams/events{/privacy}","received_events_url":"https://api.github.com/users/infostreams/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-01-28T11:16:23Z","updated_at":"2015-02-07T11:53:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/PhileCMS/Phile/pulls/183","html_url":"https://github.com/PhileCMS/Phile/pull/183","diff_url":"https://github.com/PhileCMS/Phile/pull/183.diff","patch_url":"https://github.com/PhileCMS/Phile/pull/183.patch"},"body":"This addresses the issue mentioned in https://github.com/PhileCMS/Phile/pull/182: that creating a 'datastorage' directory on the fly does not recreate everything that was in there in the original repository – notably, a .htaccess file.\r\n\r\nThe way I've set it up now is to remove the 'cache' and 'datastorage' directories from the repository altogether, and to only create them when we need them.\r\n\r\nI've addressed the security issue by preventing access to the whole 'lib/' directory, and to the whole 'plugins/' directory while we're at it. I don't think that there's anything in there that needs to be accessible from the outside (right?)."},"comment":{"url":"https://api.github.com/repos/PhileCMS/Phile/issues/comments/73361226","html_url":"https://github.com/PhileCMS/Phile/pull/183#issuecomment-73361226","issue_url":"https://api.github.com/repos/PhileCMS/Phile/issues/183","id":73361226,"user":{"login":"infostreams","id":1132744,"avatar_url":"https://avatars.githubusercontent.com/u/1132744?v=3","gravatar_id":"","url":"https://api.github.com/users/infostreams","html_url":"https://github.com/infostreams","followers_url":"https://api.github.com/users/infostreams/followers","following_url":"https://api.github.com/users/infostreams/following{/other_user}","gists_url":"https://api.github.com/users/infostreams/gists{/gist_id}","starred_url":"https://api.github.com/users/infostreams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infostreams/subscriptions","organizations_url":"https://api.github.com/users/infostreams/orgs","repos_url":"https://api.github.com/users/infostreams/repos","events_url":"https://api.github.com/users/infostreams/events{/privacy}","received_events_url":"https://api.github.com/users/infostreams/received_events","type":"User","site_admin":false},"created_at":"2015-02-07T11:53:03Z","updated_at":"2015-02-07T11:53:03Z","body":"Yeah, that works! I have no objections to this except for an academic one: this introduces \"two points of truth\" – there is a set of directories and a set of files in the repository (/lib/cache/, /lib/datastorage, and the .htaccess files in both), and then there's this code that (re)creates them if these files and directories are missing. The location of these directories is hardcoded (CACHE_DIR and STORAGE_DIR), and the contents of the .htaccess file is hardcoded as well. In general I don't like duplication, and although a bit contrived, this is a duplication of functionality. The best case scenario is that they are both (manually) kept in sync, but the worst case scenario is that they diverge due to carelessness or forgetfulness. In our scenario, I don't think there are any significant/real upsides to having this duplicate functionality."}}