s3_website 3.1.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +60 -22
- data/additional-docs/example-configurations.md +11 -17
- data/additional-docs/running-from-ec2-with-dropbox.md +6 -0
- data/changelog.md +4 -0
- data/lib/s3_website/version.rb +1 -1
- data/resources/configuration_file_template.yml +5 -2
- data/s3_website.gemspec +1 -1
- data/src/main/scala/s3/website/model/Config.scala +8 -11
- data/src/test/scala/s3/website/ConfigSpec.scala +87 -0
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9dd48d8a609cc024fe3ecd567bcd390077b07f1d
|
4
|
+
data.tar.gz: 1fd28bdff75aaed3f3a6d3590ae8258a05d9af97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cf5a79c29bab7b6c2820e80c6068f4aa7cbf2fde9936310eb3a16dabdbcfc0da294d5e38125d1929dd17b485a3dd51cfc18dad802fec520a4f710e090198c07
|
7
|
+
data.tar.gz: 62ac09a5a98f025a894a9fbfe83b66d7ad6a2519e78ab5c2df77b832ec449c98db52b777bfc832f31f7d22699d9638601941abdfc8acb92a91ecd6f3538f2a38
|
data/README.md
CHANGED
@@ -52,6 +52,10 @@ If you want to store the `s3_website.yml` file in a directory other than
|
|
52
52
|
the project's root you can specify the directory like so:
|
53
53
|
`s3_website push --config-dir config`.
|
54
54
|
|
55
|
+
### Using standard AWS credentials
|
56
|
+
|
57
|
+
If you omit `s3_id` from your `s3_website.yml`, S3_website will fall back to reading from the [default AWS SDK locations](http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html). For instance, if you've used `aws configure` to set up credentials in `~/.aws/credentials`, S3_website can use these.
|
58
|
+
|
55
59
|
### Using environment variables
|
56
60
|
|
57
61
|
You can use ERB in your `s3_website.yml` file which incorporates environment variables:
|
@@ -77,6 +81,8 @@ Your `.env` file should containing the following variables:
|
|
77
81
|
S3_ID=FOO
|
78
82
|
S3_SECRET=BAR
|
79
83
|
|
84
|
+
S3_website will also honor environment variables named `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_SESSION_TOKEN` (if using STS) automatically if `s3_id` is ommitted from `s3_website.yml`.
|
85
|
+
|
80
86
|
## Project goals
|
81
87
|
|
82
88
|
* Provide a command-line interface tool for deploying and managing S3 websites
|
@@ -280,7 +286,7 @@ thus force the CDN system to reload the changes from your website S3 bucket.
|
|
280
286
|
|
281
287
|
`s3_website` lets you define custom settings for your CloudFront distribution.
|
282
288
|
|
283
|
-
For example, like this you can define
|
289
|
+
For example, like this you can define your own TTL and CNAME:
|
284
290
|
|
285
291
|
```yaml
|
286
292
|
cloudfront_distribution_config:
|
@@ -289,7 +295,7 @@ cloudfront_distribution_config:
|
|
289
295
|
aliases:
|
290
296
|
quantity: 1
|
291
297
|
items:
|
292
|
-
|
298
|
+
CNAME: your.website.com
|
293
299
|
```
|
294
300
|
|
295
301
|
Once you've saved the configuration into `s3_website.yml`, you can apply them by
|
@@ -333,27 +339,30 @@ index file, your source bucket in Cloudfront likely is pointing to the S3 Origin
|
|
333
339
|
|
334
340
|
### Configuring redirects on your S3 website
|
335
341
|
|
336
|
-
You can set HTTP redirects on your S3 website in
|
337
|
-
simple "301 Moved Premanently" redirects for certain keys, use the Simple
|
338
|
-
Redirects method. Otherwise, use the Routing Rules method.
|
342
|
+
You can set HTTP redirects on your S3 website in three ways.
|
339
343
|
|
340
|
-
####
|
344
|
+
#### Exact page match for moving a single page
|
345
|
+
If a request is received matching a string e.g. /heated-towel-rail/ redirect to a page e.g. /
|
341
346
|
|
342
|
-
|
343
|
-
[`x-amz-website-redirect-location`](http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html)
|
344
|
-
metadata. It will create zero-byte objects for each path you want
|
345
|
-
redirected with the appropriate `x-amz-website-redirect-location` value.
|
346
|
-
|
347
|
-
For setting up simple redirect rules, simply list each path and target
|
348
|
-
as key-value pairs under the `redirects` configuration option:
|
347
|
+
This kind of redirect is created in the s3_website.yml file under the ```redirects:``` section as follows:
|
349
348
|
|
350
349
|
```yaml
|
351
350
|
redirects:
|
352
351
|
index.php: /
|
353
352
|
about.php: /about.html
|
354
353
|
music-files/promo.mp4: http://www.youtube.com/watch?v=dQw4w9WgXcQ
|
354
|
+
heated-towel-rail/index.html: /
|
355
|
+
|
355
356
|
```
|
356
357
|
|
358
|
+
Note that the root forward slash is omitted in the requested page path and included in the redirect-to path. Note also that in the heated-towel-rail example this also matches heated-towel-rail/ since S3 appends index.html to request URLs terminated with a slash.
|
359
|
+
|
360
|
+
This redirect will be created as a 301 redirect from the first URL to the destination URL on the same server with the same http protocol.
|
361
|
+
|
362
|
+
Under the hood `s3_website` creates a zero-byte index.html page for each path you want redirected with the appropriate `x-amz-website-redirect-location` value in the metadata for the object. See Amazon S3's
|
363
|
+
[`x-amz-website-redirect-location`](http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html)
|
364
|
+
documentation for more details.
|
365
|
+
|
357
366
|
On terminology: the left value is the redirect source and the right value is the redirect
|
358
367
|
target. For example above, *about.php* is the redirect source and */about.html* the target.
|
359
368
|
|
@@ -362,21 +371,31 @@ target if and only if the redirect target points to a site-local resource and
|
|
362
371
|
does not start with a slash. E.g., `about.php: about.html` will be translated
|
363
372
|
into `about.php: VALUE-OF-S3_KEY_PREFIX/about.html`.
|
364
373
|
|
365
|
-
####
|
374
|
+
#### Prefix replacement for moving a folder of pages
|
375
|
+
Common to content migrations, content pages often move from one subdirectory to another. For example if you're moving all the case studies on your site under /portfolio/work/ to /work/. In this case we use a prefix replacement such that /portfolio/work/walkjogrun/ gets 301 redirected to /work/walkjogrun/.
|
366
376
|
|
367
|
-
|
368
|
-
configuration into the `s3_website.yml` file:
|
377
|
+
To do this we add a new rule to the routing_rules: section as follows:
|
369
378
|
|
370
|
-
```
|
371
|
-
routing_rules:
|
379
|
+
```
|
372
380
|
- condition:
|
373
|
-
|
381
|
+
key_prefix_equals: portfolio/work/
|
374
382
|
redirect:
|
375
|
-
|
376
|
-
|
377
|
-
|
383
|
+
protocol: https
|
384
|
+
host_name: <%= ENV['REDIRECT_DOMAIN_NAME'] %>
|
385
|
+
replace_key_prefix_with: work/
|
386
|
+
http_redirect_code: 301
|
378
387
|
```
|
379
388
|
|
389
|
+
Here:
|
390
|
+
|
391
|
+
* ```-condition:``` indicates the start of a new rule.
|
392
|
+
* ```key_prefix_equals:``` introduces the path prefix (also without the leading / per the exact page match). Note that this prefix matches anything underneath it so every case study under that path will be handled by the subsequent redirect
|
393
|
+
* ```redirect:``` indicates the start of the redirect definition
|
394
|
+
* ```protocol:``` is optional and defaults to http.
|
395
|
+
* ```host_name:``` is optional but the default is the amazonaws.com bucket name not the actual domain name so this also effectively required for our site. In this example we use an environment variable to store the server hostname to support building to different environments. ```REDIRECT_DOMAIN_NAME``` can be configured on a CI server as well any CodePipelines responsible for building the site to different environments. If you're running locally you'll need to set ```REDIRECT_DOMAIN_NAME=local.myhostname.com```
|
396
|
+
* ```replace_key_prefix_with:``` indicates the substitution to use in place of the matched prefix. This is the only field required by `s3_website`, so effectively this rule works like a replace rule e.g. replace portfolio/work with /work in the string portfolio/work/walkjogrun
|
397
|
+
* ```http_redirect_code:``` is optional and defaults to 302 Temporary redirect **which is terrible for SEO** since your content temporarily vanishes from the Google index until the response changes for the URL. This is almost never what you want. You *can* use this to temporarily redirect any content you haven't migrated to the new site yet as long as you remove or replace the 302 with a link to a permanent home. This tells Google to forget the old location of the page and use the new content at the new URL. For pages that move you'll see little if any discrepancy in Google traffic.
|
398
|
+
|
380
399
|
After adding the configuration, run the command `s3_website cfg apply` on your
|
381
400
|
command-line interface. This will apply the routing rules on your S3 bucket.
|
382
401
|
|
@@ -385,6 +404,25 @@ For more information on configuring redirects, see the documentation of the
|
|
385
404
|
gem, which comes as a transitive dependency of the `s3_website` gem. (The
|
386
405
|
command `s3_website cfg apply` internally calls the `configure-s3-website` gem.)
|
387
406
|
|
407
|
+
#### Prefix coallescing for deleting pages (or consolidating)
|
408
|
+
If you 301 redirect lots of content into one new path you're telling Google that the old pages are gone so only the destination page is important moving forward. E.g. if you had 10 services pages and consolidate them into 1 services listing page you'll lose the 10 pages uniquely optimized for different sets of keywords and retain just 1 page with no real keyword focus and hence less SEO value.
|
409
|
+
|
410
|
+
For example, we're not porting the entire set of pages under the folder /experience to the new website. Some of these pages still get traffic from either Google or inbound links so we don't want to just show a 404 content not found error. We will 301 redirect them to the most useful replacement page. In the case of /experience we don't have anything better to show than just the home page so that is how the redirect is configured.
|
411
|
+
|
412
|
+
Here's how to redirect to indicate a deleted page:
|
413
|
+
|
414
|
+
```
|
415
|
+
- condition:
|
416
|
+
key_prefix_equals: experience/
|
417
|
+
redirect:
|
418
|
+
protocol: https
|
419
|
+
host_name: <%= ENV['REDIRECT_DOMAIN_NAME'] %>
|
420
|
+
**replace_key_with**: /
|
421
|
+
http_redirect_code: 301
|
422
|
+
```
|
423
|
+
|
424
|
+
Note the only difference is that instead of using ```replace_key_prefix_with``` we use ```replace_key_with``` to effectively say "replace the entire path matching the prefix specfied in the condition with the new path".
|
425
|
+
|
388
426
|
#### On skipping application of redirects
|
389
427
|
|
390
428
|
If your website has a lot of redirects, you may find the following setting
|
@@ -5,19 +5,22 @@ This document shows examples of complete `s3_website.yml` configurations.
|
|
5
5
|
## Minimal
|
6
6
|
|
7
7
|
````yaml
|
8
|
-
s3_id: abcd
|
9
|
-
s3_secret: 2s+x92
|
10
8
|
s3_bucket: your.domain.net
|
11
9
|
````
|
12
10
|
|
13
|
-
|
11
|
+
This configuration will use AWS access credentials from the environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`. If those are not set, it will fall back to the credentials saved by `aws configure`.
|
12
|
+
|
13
|
+
If you run `s3_website` on an EC2 instance with IAM roles, this configuration will use the instance's role instead.
|
14
|
+
|
15
|
+
## Minimal with explicit credentials
|
14
16
|
|
15
17
|
````yaml
|
18
|
+
s3_id: abcd
|
19
|
+
s3_secret: 2s+x92
|
16
20
|
s3_bucket: your.domain.net
|
17
21
|
````
|
18
22
|
|
19
|
-
|
20
|
-
the `s3_id` and `s3_secret`.
|
23
|
+
Use caution when embedding AWS credentials directly in `s3_website.yml`. Do not commit the file to a public Git repository or share it publicly.
|
21
24
|
|
22
25
|
## Minimal for temporary security credentials
|
23
26
|
|
@@ -33,8 +36,6 @@ s3_bucket: your.domain.net
|
|
33
36
|
Use CloudFront, gzip, cache headers and greater concurrency:
|
34
37
|
|
35
38
|
````yaml
|
36
|
-
s3_id: <%= ENV['your_domain_net_aws_key'] %>
|
37
|
-
s3_secret: <%= ENV['your_domain_net_aws_secret'] %>
|
38
39
|
s3_bucket: your.domain.net
|
39
40
|
cloudfront_distribution_id: <%= ENV['your_domain_net_cloudfront_distribution_id'] %>
|
40
41
|
cloudfront_distribution_config:
|
@@ -48,10 +49,9 @@ max_age: 120
|
|
48
49
|
gzip: true
|
49
50
|
````
|
50
51
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
version-controlled.
|
52
|
+
In this example, we keep the CloudFront distribution ID in an environment variable.
|
53
|
+
This is convenient, since you can keep the `s3_website.yml` in a public Git repo, and
|
54
|
+
thus have your deployment configurations version-controlled.
|
55
55
|
|
56
56
|
## Setup for HTTP2 and Custom SNI SSL Certificate
|
57
57
|
|
@@ -65,8 +65,6 @@ This isn't yet automated by s3_website, [but is a few manual steps](https://medi
|
|
65
65
|
which is now free thanks to Let's Encrypt.
|
66
66
|
|
67
67
|
````yaml
|
68
|
-
s3_id: <%= ENV['your_domain_net_aws_key'] %>
|
69
|
-
s3_secret: <%= ENV['your_domain_net_aws_secret'] %>
|
70
68
|
s3_bucket: your.domain.net
|
71
69
|
cloudfront_distribution_id: <%= ENV['your_domain_net_cloudfront_distribution_id'] %>
|
72
70
|
cloudfront_distribution_config:
|
@@ -82,8 +80,6 @@ gzip: true
|
|
82
80
|
Sometimes you want to use multiple CNAMEs aliases in your CloudFront distribution:
|
83
81
|
|
84
82
|
````yaml
|
85
|
-
s3_id: <%= ENV['your_domain_net_aws_key'] %>
|
86
|
-
s3_secret: <%= ENV['your_domain_net_aws_secret'] %>
|
87
83
|
s3_bucket: your.domain.net
|
88
84
|
cloudfront_distribution_id: <%= ENV['your_domain_net_cloudfront_distribution_id'] %>
|
89
85
|
cloudfront_distribution_config:
|
@@ -104,8 +100,6 @@ Always remember to set the 'quantity' property to match the number of items you
|
|
104
100
|
## Using redirects
|
105
101
|
|
106
102
|
````yaml
|
107
|
-
s3_id: hello
|
108
|
-
s3_secret: galaxy
|
109
103
|
redirects:
|
110
104
|
index.php: /
|
111
105
|
about.php: about.html
|
@@ -0,0 +1,6 @@
|
|
1
|
+
# Running from an EC2 instance with jekyll files on Dropbox
|
2
|
+
|
3
|
+
Based on [this](http://namelesshorror.com/2015/02/26/jekyll-dropbox-aws-and-ifttt-easy-blogging/) article about automating the deployment of jekyll via an EC2 instance, I wrote the following shell script for use with such a setup. It assumes that you have a Linux Amazon EC2 instance, with the Dropbox client running as a daemon, and s3_website installed and configured. The script could be run from the default user's cron every so often, and allow anyone to effectively serve their jekyll source files to AWS from Dropbox.
|
4
|
+
|
5
|
+
|
6
|
+
[jekyll-s3-dropbox.sh](https://gist.github.com/RNCTX/359489a5432937578bf5736850917d70)
|
data/changelog.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
This project uses [Semantic Versioning](http://semver.org).
|
4
4
|
|
5
|
+
## 3.2.0
|
6
|
+
|
7
|
+
* Fall back to [the default credentials sources](http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html) if `s3_id` is not provided in `s3_website.yml`
|
8
|
+
|
5
9
|
## 3.1.0
|
6
10
|
|
7
11
|
Support for [session tokens](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html)
|
data/lib/s3_website/version.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
|
+
# You can remove these two lines to have credentials read from
|
2
|
+
# the environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY or
|
3
|
+
# ~/.aws/credentials.
|
1
4
|
s3_id: YOUR_AWS_S3_ACCESS_KEY_ID
|
2
5
|
s3_secret: YOUR_AWS_S3_SECRET_ACCESS_KEY
|
3
6
|
s3_bucket: your.blog.bucket.com
|
4
7
|
|
5
|
-
# set
|
6
|
-
#
|
8
|
+
# set session_token if using temporary credentials with a session token (eg: when assuming a role)
|
9
|
+
# session_token: YOUR_AWS_S3_SESSION_TOKEN
|
7
10
|
|
8
11
|
# Below are examples of all the available configurations.
|
9
12
|
# See README for more detailed info on each of them.
|
data/s3_website.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.default_executable = %q{s3_website}
|
19
19
|
|
20
20
|
s.add_dependency 'thor', '~> 0.18'
|
21
|
-
s.add_dependency 'configure-s3-website', '= 2.
|
21
|
+
s.add_dependency 'configure-s3-website', '= 2.1.0'
|
22
22
|
s.add_dependency 'colored', '1.2'
|
23
23
|
s.add_dependency 'dotenv', '~> 1.0'
|
24
24
|
|
@@ -8,7 +8,7 @@ import scala.util.{Failure, Try}
|
|
8
8
|
import scala.collection.JavaConversions._
|
9
9
|
import s3.website.Ruby.rubyRuntime
|
10
10
|
import s3.website._
|
11
|
-
import com.amazonaws.auth.{AWSCredentialsProvider, BasicAWSCredentials, BasicSessionCredentials, DefaultAWSCredentialsProviderChain}
|
11
|
+
import com.amazonaws.auth.{AWSCredentialsProvider, BasicAWSCredentials, BasicSessionCredentials, AWSStaticCredentialsProvider, DefaultAWSCredentialsProviderChain}
|
12
12
|
|
13
13
|
case class Config(
|
14
14
|
s3_id: Option[String], // If undefined, use IAM Roles (http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/java-dg-roles.html)
|
@@ -37,25 +37,22 @@ case class Config(
|
|
37
37
|
object Config {
|
38
38
|
|
39
39
|
def awsCredentials(config: Config): AWSCredentialsProvider = {
|
40
|
-
val credentialsFromConfigFile =
|
41
|
-
if (config.
|
40
|
+
val credentialsFromConfigFile: Option[AWSStaticCredentialsProvider] =
|
41
|
+
if (config.s3_id.isEmpty) {
|
42
|
+
None
|
43
|
+
} else if (config.session_token.isEmpty) {
|
42
44
|
for {
|
43
45
|
s3_id <- config.s3_id
|
44
46
|
s3_secret <- config.s3_secret
|
45
|
-
} yield new BasicAWSCredentials(s3_id, s3_secret)
|
47
|
+
} yield new AWSStaticCredentialsProvider(new BasicAWSCredentials(s3_id, s3_secret))
|
46
48
|
} else {
|
47
49
|
for {
|
48
50
|
s3_id <- config.s3_id
|
49
51
|
s3_secret <- config.s3_secret
|
50
52
|
session_token <- config.session_token
|
51
|
-
} yield new BasicSessionCredentials(s3_id, s3_secret, session_token)
|
53
|
+
} yield new AWSStaticCredentialsProvider(new BasicSessionCredentials(s3_id, s3_secret, session_token))
|
52
54
|
}
|
53
|
-
credentialsFromConfigFile
|
54
|
-
new AWSCredentialsProvider {
|
55
|
-
def getCredentials = credentials
|
56
|
-
def refresh() = {}
|
57
|
-
}
|
58
|
-
)
|
55
|
+
credentialsFromConfigFile getOrElse new DefaultAWSCredentialsProviderChain
|
59
56
|
}
|
60
57
|
|
61
58
|
def loadOptionalBooleanOrStringSeq(key: String)(implicit unsafeYaml: UnsafeYaml): Either[ErrorReport, Option[Either[Boolean, Seq[String]]]] = {
|
@@ -0,0 +1,87 @@
|
|
1
|
+
package s3.website
|
2
|
+
import com.amazonaws.auth.{BasicAWSCredentials, BasicSessionCredentials, DefaultAWSCredentialsProviderChain}
|
3
|
+
import org.specs2.mutable.Specification
|
4
|
+
import s3.website.model.{Config, S3Endpoint}
|
5
|
+
|
6
|
+
class ConfigSpec extends Specification {
|
7
|
+
|
8
|
+
"Config#awsCredentials" should {
|
9
|
+
s"return ${classOf[BasicAWSCredentials]} when s3_id and s3_secret are defined in the config" in {
|
10
|
+
Config.awsCredentials(Config(
|
11
|
+
s3_id = Some("test"),
|
12
|
+
s3_secret = Some("secret"),
|
13
|
+
session_token = None,
|
14
|
+
s3_bucket = "foo",
|
15
|
+
s3_endpoint = S3Endpoint.defaultEndpoint,
|
16
|
+
site = None,
|
17
|
+
max_age = None,
|
18
|
+
cache_control = None,
|
19
|
+
gzip = None,
|
20
|
+
gzip_zopfli = None,
|
21
|
+
s3_key_prefix = None,
|
22
|
+
ignore_on_server = None,
|
23
|
+
exclude_from_upload = None,
|
24
|
+
s3_reduced_redundancy = None,
|
25
|
+
cloudfront_distribution_id = None,
|
26
|
+
cloudfront_invalidate_root = None,
|
27
|
+
content_type = None,
|
28
|
+
redirects = None,
|
29
|
+
concurrency_level = 1,
|
30
|
+
cloudfront_wildcard_invalidation = None,
|
31
|
+
treat_zero_length_objects_as_redirects = None
|
32
|
+
)).getCredentials must beAnInstanceOf[BasicAWSCredentials]
|
33
|
+
}
|
34
|
+
|
35
|
+
s"return ${classOf[BasicSessionCredentials]} when s3_id, s3_secret and session_token are defined in the config" in {
|
36
|
+
Config.awsCredentials(Config(
|
37
|
+
s3_id = Some("test"),
|
38
|
+
s3_secret = Some("secret"),
|
39
|
+
session_token = Some("Token"),
|
40
|
+
s3_bucket = "foo",
|
41
|
+
s3_endpoint = S3Endpoint.defaultEndpoint,
|
42
|
+
site = None,
|
43
|
+
max_age = None,
|
44
|
+
cache_control = None,
|
45
|
+
gzip = None,
|
46
|
+
gzip_zopfli = None,
|
47
|
+
s3_key_prefix = None,
|
48
|
+
ignore_on_server = None,
|
49
|
+
exclude_from_upload = None,
|
50
|
+
s3_reduced_redundancy = None,
|
51
|
+
cloudfront_distribution_id = None,
|
52
|
+
cloudfront_invalidate_root = None,
|
53
|
+
content_type = None,
|
54
|
+
redirects = None,
|
55
|
+
concurrency_level = 1,
|
56
|
+
cloudfront_wildcard_invalidation = None,
|
57
|
+
treat_zero_length_objects_as_redirects = None
|
58
|
+
)).getCredentials must beAnInstanceOf[BasicSessionCredentials]
|
59
|
+
}
|
60
|
+
|
61
|
+
s"return ${classOf[DefaultAWSCredentialsProviderChain]} when s3_id and s3_secret are not defined in the config" in {
|
62
|
+
Config.awsCredentials(Config(
|
63
|
+
s3_id = None,
|
64
|
+
s3_secret = None,
|
65
|
+
session_token = None,
|
66
|
+
s3_bucket = "foo",
|
67
|
+
s3_endpoint = S3Endpoint.defaultEndpoint,
|
68
|
+
site = None,
|
69
|
+
max_age = None,
|
70
|
+
cache_control = None,
|
71
|
+
gzip = None,
|
72
|
+
gzip_zopfli = None,
|
73
|
+
s3_key_prefix = None,
|
74
|
+
ignore_on_server = None,
|
75
|
+
exclude_from_upload = None,
|
76
|
+
s3_reduced_redundancy = None,
|
77
|
+
cloudfront_distribution_id = None,
|
78
|
+
cloudfront_invalidate_root = None,
|
79
|
+
content_type = None,
|
80
|
+
redirects = None,
|
81
|
+
concurrency_level = 1,
|
82
|
+
cloudfront_wildcard_invalidation = None,
|
83
|
+
treat_zero_length_objects_as_redirects = None
|
84
|
+
)) must beAnInstanceOf[DefaultAWSCredentialsProviderChain]
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: s3_website
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lauri Lehmijoki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.
|
33
|
+
version: 2.1.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.
|
40
|
+
version: 2.1.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: colored
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -126,6 +126,7 @@ files:
|
|
126
126
|
- additional-docs/debugging.md
|
127
127
|
- additional-docs/development.md
|
128
128
|
- additional-docs/example-configurations.md
|
129
|
+
- additional-docs/running-from-ec2-with-dropbox.md
|
129
130
|
- additional-docs/setting-up-aws-credentials.md
|
130
131
|
- assembly.sbt
|
131
132
|
- bin/s3_website
|
@@ -156,6 +157,7 @@ files:
|
|
156
157
|
- src/main/scala/s3/website/model/ssg.scala
|
157
158
|
- src/main/scala/s3/website/package.scala
|
158
159
|
- src/test/scala/s3/website/AwsSdkSpec.scala
|
160
|
+
- src/test/scala/s3/website/ConfigSpec.scala
|
159
161
|
- src/test/scala/s3/website/S3EndpointSpec.scala
|
160
162
|
- src/test/scala/s3/website/S3WebsiteSpec.scala
|
161
163
|
- src/test/scala/s3/website/UnitTest.scala
|
@@ -186,6 +188,7 @@ specification_version: 4
|
|
186
188
|
summary: Manage your S3 website
|
187
189
|
test_files:
|
188
190
|
- src/test/scala/s3/website/AwsSdkSpec.scala
|
191
|
+
- src/test/scala/s3/website/ConfigSpec.scala
|
189
192
|
- src/test/scala/s3/website/S3EndpointSpec.scala
|
190
193
|
- src/test/scala/s3/website/S3WebsiteSpec.scala
|
191
194
|
- src/test/scala/s3/website/UnitTest.scala
|