kerry350 / ember-deploy-s3-index Goto Github PK
View Code? Open in Web Editor NEWS3 index adapter for ember-deploy
S3 index adapter for ember-deploy
I'm trying to use ember-deploy-s3 and ember-deploy-s3-index together and I'm having trouble.
I want to host a number of files at the root of my domain: robots.txt, humans.txt, favicon.ico, opensearch.xml, etc. Instead of placing them in an assets.mydomain.com
bucket I want to put them in my mydomain.com
bucket along with my index files. These two plugins seem to trample on each other when the same bucket is used though.
I assume I am probably approaching this all wrong. What is the recommended way to host all assets out of the same bucket?
Thanks! ๐
Right now, I have a CI server (Jenkins) doing deployments. That server has an IAM Role giving it READ/WRITE access to S3.
aws-sdk knows about role and will use them, but I believe the metadata_service is too strict.
Would it be possible to remove that validation and let aws-sdk fail later on if no credentials at all are given?
CredentialsError: Missing credentials in config
at Object.parse (native)
at /workspace/node_modules/ember-deploy-s3-index/node_modules/aws-sdk/lib/metadata_service.js:115:38
Since the silent-error package is now included, could we please get a new release in order to silence the deprecation warning. Thanks
Hi Kerry,
Aaron from the ember-cli-deploy team here.
We're in the process of getting things ready for our 0.5.0 release of ember-cli-deploy which is quite a shift away from how the addon currently works. With this change comes the need to make sure existing ember-cli-deploy plugins (this is the new name for them, as opposed to adapters) are compatible with the new version.
Are you in a position to make a 0.5.0 compatible version of this plugin? Or to update this one?
I'm am more than happy to help out or guide you along the way if needed.
Please get in touch and let me know if this is something you're able to help, or if you need any help in doing so.
Cheers,
Aaron
@Kerry350 great plugin!
One thing, in your redirect XML in the Readme you redirect from a 404
error, for me I found I have to use 403
. Any thoughts on this?
<RoutingRules>
<RoutingRule>
<Condition>
<HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals>
</Condition>
<Redirect>
<HostName><your-bucket-endpoint-from-static-website-hosting-options></HostName>
<ReplaceKeyPrefixWith>#/</ReplaceKeyPrefixWith>
</Redirect>
</RoutingRule>
</RoutingRules>
It would be great if this project tagged releases that were published to npm so it is possible to easily see what version corresponds to what point in the git commit history.
First off I must thank you for the project and this great blog post about how to get up/running :)
http://kerrygallagher.co.uk/deploying-an-ember-cli-application-to-amazon-s3/
I got a ton of value from your post and wanted to say "thank you" for the time you took to write it!
Now my question => I realize this isn't the ideal use case but for simplicity ... is it possible to deploy the index.html without a revision prefix? I'm looking for the simplest deploy step at the moment and having a revision seems to introduce a manual step for us (we are not (yet) using the full redis/ember deploy setup Luke often talks about).
Thanks again for such a great open source project!
Here's an exerpt from the logs when running ember deploy --environment production
C:\Users\Quantik\git\whatsyourimpact\impact-frontend>ember deploy --environment production
DEPRECATION: ember-cli/lib/errors/silent.js
is deprecated, use silent-error
instead.
DEPRECATION: ember-cli/lib/errors/silent.js
is deprecated, use silent-error
instead.
DEPRECATION: ember-cli/lib/errors/silent.js
is deprecated, use silent-error
instead.
DEPRECATION: ember-cli/lib/errors/silent.js
is deprecated, use silent-error
instead.
DEPRECATION: ember-cli/lib/errors/silent.js
is deprecated, use silent-error
instead.
DEPRECATION: ember-cli/lib/errors/silent.js
is deprecated, use silent-error
instead.
DEPRECATION: ember-cli/lib/errors/silent.js
is deprecated, use silent-error
instead.
Future versions of Ember CLI will not support v0.10.32. Please update to Node 0.12 or io.js
version: 1.13.1
Built project successfully. Stored in "dist/".
Uploading assets...
Assets upload successful. Done uploading.
Uploading dist/index.html
...
You tried to use an unknown adapter: undefined
. Please pass a supported adapter-type.
Here's an exerpt from my deploy.js file:
...
production: {
store: {
type: "S3",
accessKeyId: "KEY",
secretAccessKey: "SECRET",
bucket: "BUCKET",
acl: 'public-read', //optional, e.g. 'public-read', if ACL is not configured, it is not sent
hostName: "BUCKET.s3-website-us-west-2.amazonaws.com", // To be set with 'direct' indexMode
indexMode: 'direct',
prefix: ""
},
assets: {
type: "s3",
accessKeyId: 'KEY',
secretAccessKey: 'SECRET',
bucket: 'BUCKET'
}
}
Am I doing something wrong? It's my first time using it, so I can't say if it's related to a specific version of ember-cli
here are my versions:
version: 1.13.1
node: 0.10.32
npm: 2.12.1
i am trying to ember deploy:list --environment production
and getting PermanentRedirect: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.
i managed to console.log
the complete error which shows:
{ Code: 'PermanentRedirect',
Message: 'The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.',
Bucket: 'my.bucket',
Endpoint: 'my.bucket.s3.amazonaws.com',
RequestId: 'xxx',
HostId: 'xxx' }
i believe this error is due to the fact that my bucket name contains a .
but i'm not sure.
# config/deploy.js
module.exports = {
production: {
store: {
type: "S3",
accessKeyId: process.env.S3_ACCESS_KEY_ID,
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,
bucket: 'my.bucket',
acl: 'public-read',
hostName: 'my.bucket.s3-website-us-west-1.amazonaws.com',
indexMode: 'direct',
prefix: ''
},
assets: {
type: "s3",
accessKeyId: process.env.S3_ACCESS_KEY_ID,
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,
bucket: 'my.bucket'
}
}
}
thanks!
Currently, anything in the store gets the following headers when uploaded using ember deploy --environment production
:
Cache-Control: max-age=63072000, public
Expires: Tue, 01 Jan 2030 00:00:00 GMT
This is problematic particularly for the index.html
file, since it will get cached forever by anything downstream.
This happens when indexMode
is set to either "direct"
or "indirect"
.
This behavior is not present if the assets and index are uploaded, then activated with ember deploy:activate --revision project:rev --environment production
.
Expected Result
Cache headers should be set to
Cache-Control: max-age=0, no-cache
when deploying via ember deploy
.
I've been considering putting together a PR that improves the behavior of deploy:activate.
My thoughts:
ember deploy:activate
with no arguments should activate the most recent version, simplifying the process.deploy:list
as arguments to deploy:activate
$ ember deploy:list
version: 0.1.15
Found the following revisions:
1) my-app:5a77e50
2) my-app:b8256de
3) my-app:c239613
Use activate() to activate one of these revisions
$ ember deploy:activate
# would activate my-app:5a77e50
$ ember deploy: activate 2
# would activate my-app:b8256de
Do you think these would be useful features?
If the bucket is, say, prototype.foo-bar
, deploying shows the message "Trying to upload dist/index.html
..." then it fails silently.
I get the following error after following the guide
Unable to sync: InvalidRequest: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.
Don't know if this is a bug in ember-deploy-s3 or index or not a bug at all.
I followed your (excellent) article: http://kerrygallagher.co.uk/deploying-an-ember-cli-application-to-amazon-s3/ and after deploying i'm always getting the above error for my .css and .js files.
Can you help?
Hi @Kerry350, I'm opening this issue as a place holder to track this being updated for ember-cli-deploy
.
Is it possible to use this adapter with cloudfront (and s3) ?
It seems that cloudfront doesn't use the Index Document specified by ember-deploy-s3-index on revision activation. Can anyone confirm please ?
As a non satisfying workaround, I wanted to set manually the "Default Root Object" of my Cloudfront distribution to the latest index.html revision (something like myapp:6512e6a.html), but cloudfront does not accept the colon character.
Hi, I'm looking into deploying my app to amazon, and it seems that a lot of people recommend putting it in S3.
My question is, being that this is an Ember App, how will URL's work? Is the use of hashtags mandatory in this case, or is there a way to redirect all requests to index.html ?
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.