{"action":"created","issue":{"url":"https://api.github.com/repos/grow/pygrow/issues/65","labels_url":"https://api.github.com/repos/grow/pygrow/issues/65/labels{/name}","comments_url":"https://api.github.com/repos/grow/pygrow/issues/65/comments","events_url":"https://api.github.com/repos/grow/pygrow/issues/65/events","html_url":"https://github.com/grow/pygrow/pull/65","id":64929118,"number":65,"title":"Object store-specific temporary deployment extensions","user":{"login":"vitorio","id":336712,"avatar_url":"https://avatars.githubusercontent.com/u/336712?v=3","gravatar_id":"","url":"https://api.github.com/users/vitorio","html_url":"https://github.com/vitorio","followers_url":"https://api.github.com/users/vitorio/followers","following_url":"https://api.github.com/users/vitorio/following{/other_user}","gists_url":"https://api.github.com/users/vitorio/gists{/gist_id}","starred_url":"https://api.github.com/users/vitorio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vitorio/subscriptions","organizations_url":"https://api.github.com/users/vitorio/orgs","repos_url":"https://api.github.com/users/vitorio/repos","events_url":"https://api.github.com/users/vitorio/events{/privacy}","received_events_url":"https://api.github.com/users/vitorio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-28T10:51:30Z","updated_at":"2015-04-01T21:11:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/grow/pygrow/pulls/65","html_url":"https://github.com/grow/pygrow/pull/65","diff_url":"https://github.com/grow/pygrow/pull/65.diff","patch_url":"https://github.com/grow/pygrow/pull/65.patch"},"body":"Hi, okay, after #64, it occurred to me that, if these temporary extensions are object store deployment-specific, and temporary, then they should probably have their scope limited to deployment, both in code and configuration, and the user shouldn't really have to deal with them otherwise.\r\n\r\nAs with #64, this pull request supports deploying resources to an object store (like S3) without extensions, by building on the filesystem with a temporary extension and then removing it on `write_file`, while also still supporting subresources, as seen here:\r\n\r\n - http://vitorio-test-grow.s3-website-us-east-1.amazonaws.com/about-us\r\n - http://vitorio-test-grow.s3-website-us-east-1.amazonaws.com/about-us/bench.gif\r\n\r\n(That deployment is new, using this code, not using #64's code.)\r\n\r\nThis is already supported using the built in `grow run` development server with a `_blueprint.yaml` of:\r\n\r\n    path: /{slug}               # The URL path format\r\n\r\nAnd a `podspec.yaml` including:\r\n\r\n    static_dirs:\r\n      - static_dir: /static/\r\n        serve_at: /static/\r\n      - static_dir: /assets/about-us/\r\n        serve_at: /about-us/\r\n\r\nThis new pull request enables a new configuration option only in the S3 deployment code:\r\n\r\n    deployments:\r\n      default:\r\n        destination: local\r\n        out_dir: my-codelab-launch/\r\n      s3:\r\n        destination: s3\r\n        bucket: vitorio-test-grow\r\n        extensionless_paths: yes\r\n\r\n(By default, `extensionless_paths` is \"no\", and not needed to be specified at all.  There is also an option to specify the temporary extension used, but a reasonable default is also provided.)\r\n\r\nNo other deployment destinations are affected.  `extensionless_paths` is trapped appropriately in `deploy.py` for destinations which do not support it.  The `dump` function in `pods.py` is made more explicit to support both `index.html` and temporary extensions, and `suffix` is renamed to `main_page_suffix` to match `google_cloud_storage.py`.\r\n\r\nI hope you'll consider accepting this pull request.  I'm also idling in IRC if you'd like to discuss it further there."},"comment":{"url":"https://api.github.com/repos/grow/pygrow/issues/comments/88632881","html_url":"https://github.com/grow/pygrow/pull/65#issuecomment-88632881","issue_url":"https://api.github.com/repos/grow/pygrow/issues/65","id":88632881,"user":{"login":"vitorio","id":336712,"avatar_url":"https://avatars.githubusercontent.com/u/336712?v=3","gravatar_id":"","url":"https://api.github.com/users/vitorio","html_url":"https://github.com/vitorio","followers_url":"https://api.github.com/users/vitorio/followers","following_url":"https://api.github.com/users/vitorio/following{/other_user}","gists_url":"https://api.github.com/users/vitorio/gists{/gist_id}","starred_url":"https://api.github.com/users/vitorio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vitorio/subscriptions","organizations_url":"https://api.github.com/users/vitorio/orgs","repos_url":"https://api.github.com/users/vitorio/repos","events_url":"https://api.github.com/users/vitorio/events{/privacy}","received_events_url":"https://api.github.com/users/vitorio/received_events","type":"User","site_admin":false},"created_at":"2015-04-01T21:11:44Z","updated_at":"2015-04-01T21:11:44Z","body":"You always need to specify an \"index document,\" because you need one for the site root `/`, and having that be named `index.html` is fine with me, it's as standard or expected as anything.  The current patch continues to use `index.html` if you have a trailing slash on your slug or path.  I just don't want to have to have a trailing slash, when trailing slashes and index documents are really a kludge for filesystem-based stores.  If this were a REST API, for example, you'd expect `http://example.com/api/endpoint` to be a single resource, and `http://example.com/api/endpoint/` to be a collection of other things.\r\n\r\nHere's a proper example where \"website configuration\" is enabled:\r\n\r\n- http://vitor.io/genuine-outbreaks-of-the-future is an extensionless resource.\r\n- http://vitor.io/genuine-outbreaks-of-the-future/ is a \"folder\" which 403s, because there's no index.html.  I think this is appropriate: if you think of this as a collection of sub-resources, I don't want you poking around.\r\n- http://vitor.io/genuine-outbreaks-of-the-future/27-7.jpg is a sub-resource under that first extensionless resource.\r\n- http://vitor.io.s3-website-us-east-1.amazonaws.com/genuine-outbreaks-of-the-future is the equivalent S3-named endpoint.\r\n\r\nIf I put an `index.html` file in the folder, then it serves that up when the trailing slash is present, and serves up the original extensionless resource when it's not.\r\n\r\nDoes that help?\r\n\r\nThis temporary-extension-and-then-rename is how I manage the process manually now.  I haven't looked into how Google Cloud Storage serves up files, but I can, if it would help."}}