Asset hosting on S3: Difference between revisions
Sournetwork (talk | contribs) (Manually copying assets to Amazon S3) |
Sournetwork (talk | contribs) m (Minor fixes.) |
||
Line 1: | Line 1: | ||
=== Diaspora Comes With Support For Amazon S3 Built In. === | === Diaspora Comes With Support For Amazon S3 Built In. === | ||
Line 15: | Line 13: | ||
=== Manually copying assets to Amazon S3. === | === Manually copying assets to Amazon S3. === | ||
First you need to copy your Assets folder to your S3 bucket. This can be done by copying the Assets folder from the source code to your Amazon S3 bucket. Then | First you need to copy your Assets folder to your S3 bucket. This can be done by copying the Assets folder from the source code to your Amazon S3 bucket. Then cd into your Diaspora folder and edit the config/diaspora.yml file to the preferences below: | ||
<pre> assets: ## Section | <pre> assets: ## Section | ||
Line 28: | Line 26: | ||
## Specify an asset host. Ensure it does not have a trailing slash (/). | ## Specify an asset host. Ensure it does not have a trailing slash (/). | ||
host: https://[bucket].s3.amazonaws.com/</pre> (Replace '[bucket]' with your Amazon S3 bucket | host: https://[bucket].s3.amazonaws.com/</pre> (Replace '[bucket]' with your Amazon S3 bucket) | ||
Revision as of 23:07, 30 August 2014
Diaspora Comes With Support For Amazon S3 Built In.
You can use Amazon S3 (Simple Storage Service) To Host Many Parts Of Your Pod. This includes the static assets that are created using the assets:precompile rake task built into Diaspora, to do this Diaspora uses the asset-sync gem. You can also store user profile pictures on Amazon S3.
Storing Static Assets On Amazon S3.
Firstly, cd Into Your Diaspora Code Folder Using The Command Line. Then Run The Following Commands (For A NON Heroku Setup) Replacing 'xxxx' For The Piece Of Info From Your S3 Account:
export AWS_ACCESS_KEY_ID=xxxx export AWS_SECRET_ACCESS_KEY=xxxx export FOG_DIRECTORY=xxxx
Manually copying assets to Amazon S3.
First you need to copy your Assets folder to your S3 bucket. This can be done by copying the Assets folder from the source code to your Amazon S3 bucket. Then cd into your Diaspora folder and edit the config/diaspora.yml file to the preferences below:
assets: ## Section ## Serve static assets via the appserver. ## This is highly discouraged for production use, ## let your reverse proxy/webserver do it by serving the files ## under public/ directly. serve: true ## Upload your assets to S3 upload: false ## Specify an asset host. Ensure it does not have a trailing slash (/). host: https://[bucket].s3.amazonaws.com/
(Replace '[bucket]' with your Amazon S3 bucket)