{"action":"created","issue":{"url":"https://api.github.com/repos/spf13/hugo/issues/130","labels_url":"https://api.github.com/repos/spf13/hugo/issues/130/labels{/name}","comments_url":"https://api.github.com/repos/spf13/hugo/issues/130/comments","events_url":"https://api.github.com/repos/spf13/hugo/issues/130/events","html_url":"https://github.com/spf13/hugo/issues/130","id":23083633,"number":130,"title":"File permissions in /public","user":{"login":"rmorriso","id":110104,"avatar_url":"https://avatars.githubusercontent.com/u/110104?v=3","gravatar_id":"","url":"https://api.github.com/users/rmorriso","html_url":"https://github.com/rmorriso","followers_url":"https://api.github.com/users/rmorriso/followers","following_url":"https://api.github.com/users/rmorriso/following{/other_user}","gists_url":"https://api.github.com/users/rmorriso/gists{/gist_id}","starred_url":"https://api.github.com/users/rmorriso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmorriso/subscriptions","organizations_url":"https://api.github.com/users/rmorriso/orgs","repos_url":"https://api.github.com/users/rmorriso/repos","events_url":"https://api.github.com/users/rmorriso/events{/privacy}","received_events_url":"https://api.github.com/users/rmorriso/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spf13/hugo/labels/bug","name":"bug","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2013-11-21T17:41:02Z","updated_at":"2015-01-25T11:55:36Z","closed_at":null,"body":"When content is generated to /public, directories are created with permission 0764. This works fine when running in server mode (same user that generates the file is running the server). But if hugo is being used by one user to generate content that will be served by another user (e.g. Apache), the permissions aren't correct. \r\n\r\nUse permissions 0755 instead in target/file.go:\r\n...\r\nfunc writeToDisk(translated string, r io.Reader) (err error) {\r\n        path, _ := filepath.Split(translated)\r\n        ospath := filepath.FromSlash(path)\r\n\r\n        if ospath != \"\" {\r\n                err = os.MkdirAll(ospath, 0755) // rwx, rx rx\r\n                if err != nil {\r\n                        panic(err)\r\n                }\r\n        }\r\n..."},"comment":{"url":"https://api.github.com/repos/spf13/hugo/issues/comments/71368848","html_url":"https://github.com/spf13/hugo/issues/130#issuecomment-71368848","issue_url":"https://api.github.com/repos/spf13/hugo/issues/130","id":71368848,"user":{"login":"anthonyfok","id":1274764,"avatar_url":"https://avatars.githubusercontent.com/u/1274764?v=3","gravatar_id":"","url":"https://api.github.com/users/anthonyfok","html_url":"https://github.com/anthonyfok","followers_url":"https://api.github.com/users/anthonyfok/followers","following_url":"https://api.github.com/users/anthonyfok/following{/other_user}","gists_url":"https://api.github.com/users/anthonyfok/gists{/gist_id}","starred_url":"https://api.github.com/users/anthonyfok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anthonyfok/subscriptions","organizations_url":"https://api.github.com/users/anthonyfok/orgs","repos_url":"https://api.github.com/users/anthonyfok/repos","events_url":"https://api.github.com/users/anthonyfok/events{/privacy}","received_events_url":"https://api.github.com/users/anthonyfok/received_events","type":"User","site_admin":false},"created_at":"2015-01-25T11:55:36Z","updated_at":"2015-01-25T11:55:36Z","body":"@synful, thank you for your report!  I can reproduce the panic you saw, when `hugo -d /nonexistant/directory` is run in a directory containing a `content/` subdirectory, no matter it is empty or not.\r\n\r\nIn order to better track this bug that you have found, and to give proper credit to your discovery, could you please create a new issue on this panic bug?  Many thanks!"}}