fix cache and log dirs to be writable, add gitignore