s3_website 2.15.0 → 2.15.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3817c71cb9e62df94035abdb0c2a82518086f31f
4
- data.tar.gz: f865711262a86542bbbbe79889fed47695f00ced
3
+ metadata.gz: 74e389d709a1b22628c825ed08d0b10ed70a3203
4
+ data.tar.gz: 36fe9d03a05edd81fe46d640a658adab56190d82
5
5
  SHA512:
6
- metadata.gz: b8fdf4cc12c1e05ed5189e1ad0e447e83794c510f7347786eca40cc08d22336fafb6f5d88a439451f7fd7d1002529b8aab9407c064f065993c991b8d43cae4ee
7
- data.tar.gz: 462f392810758a973b71aece6a052651d95978b98740ae421cb6b35373c5167bcccf31e4d1d19ee4643ba3a83335714dafd3fe551c1cf4b55e621e8d41e809c8
6
+ metadata.gz: f7e14464bf2b8a3b3ea49f475dce49fc8642f5710a6c9e2b6bd07c4d7b2522854fd6e603c0c913fd2ad899804d11d638949fc2e56eb16556e88c80828bd69df7
7
+ data.tar.gz: 7b30125db36d4bbbca1443c2455e2f71a1d38205a7e1622963a334ca634d314212c41f9e072dd5a6e51677844385f5a3e6f0cd7714bc286c406d1b735d78c712
data/README.md CHANGED
@@ -205,11 +205,6 @@ s3_endpoint: ap-northeast-1
205
205
  The valid `s3_endpoint` values consist of the [S3 location constraint
206
206
  values](http://docs.amazonwebservices.com/general/latest/gr/rande.html#s3_region).
207
207
 
208
- Note that at the moment s3_website does not support any region that
209
- supports only a V4 Signature and does not support V2
210
- (i.e. *eu-central-1*, *ap-south-1*, *ap-northeast-2*).
211
- This support can be tracked in [issue #126](https://github.com/laurilehmijoki/s3_website/issues/126).
212
-
213
208
  ### Ignoring files you want to keep on AWS
214
209
 
215
210
  Sometimes there are files or directories you want to keep on S3, but not on
data/build.sbt CHANGED
@@ -18,7 +18,7 @@ libraryDependencies += "org.yaml" % "snakeyaml" % "1.13"
18
18
 
19
19
  libraryDependencies += "org.jruby" % "jruby" % "1.7.11"
20
20
 
21
- libraryDependencies += "com.amazonaws" % "aws-java-sdk" % "1.7.7"
21
+ libraryDependencies += "com.amazonaws" % "aws-java-sdk" % "1.11.32"
22
22
 
23
23
  libraryDependencies += "log4j" % "log4j" % "1.2.17"
24
24
 
data/changelog.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  This project uses [Semantic Versioning](http://semver.org).
4
4
 
5
+ ## 2.15.1
6
+
7
+ * Support all AWS regions
8
+
5
9
  ## 2.15.0
6
10
 
7
11
  * Add new setting `content_type`
@@ -1,3 +1,3 @@
1
1
  module S3Website
2
- VERSION = '2.15.0'
2
+ VERSION = '2.15.1'
3
3
  end
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', '= 1.7.1'
21
+ s.add_dependency 'configure-s3-website', '= 1.7.5'
22
22
  s.add_dependency 'colored', '1.2'
23
23
  s.add_dependency 'dotenv', '~> 1.0'
24
24
 
@@ -131,12 +131,8 @@ object Config {
131
131
 
132
132
 
133
133
  def loadEndpoint(implicit unsafeYaml: UnsafeYaml): Either[ErrorReport, Option[S3Endpoint]] =
134
- loadOptionalString("s3_endpoint").right flatMap { endpointString =>
135
- endpointString.map(S3Endpoint.forString) match {
136
- case Some(Right(endpoint)) => Right(Some(endpoint))
137
- case Some(Left(endpointError)) => Left(endpointError)
138
- case None => Right(None)
139
- }
134
+ loadOptionalString("s3_endpoint").right map { endpointString =>
135
+ endpointString.map(S3Endpoint(_))
140
136
  }
141
137
 
142
138
  def loadRedirects(s3_key_prefix: Option[String])(implicit unsafeYaml: UnsafeYaml): Either[ErrorReport, Option[Map[S3Key, String]]] = {
@@ -1,24 +1,43 @@
1
1
  package s3.website.model
2
2
 
3
- import s3.website.ErrorReport
4
-
5
3
  case class S3Endpoint(
6
4
  s3WebsiteHostname: String,
7
5
  s3Hostname: String
8
6
  )
9
7
 
10
8
  object S3Endpoint {
11
- val defaultEndpoint = S3Endpoint("s3-website-us-east-1.amazonaws.com", "s3.amazonaws.com")
9
+ def defaultEndpoint = S3Endpoint("us-east-1")
10
+
11
+ val oldRegions = Seq(
12
+ "us-east-1",
13
+ "us-west-1",
14
+ "us-west-2",
15
+ "ap-southeast-1",
16
+ "ap-southeast-2",
17
+ "ap-northeast-1",
18
+ "eu-west-1",
19
+ "sa-east-1"
20
+ )
21
+
22
+ def apply(region: String): S3Endpoint = {
23
+ if (region == "EU") {
24
+ return S3Endpoint("eu-west-1")
25
+ }
26
+
27
+ val isOldRegion = oldRegions.contains(region)
28
+ val s3WebsiteHostname =
29
+ if (isOldRegion)
30
+ s"s3-website-$region.amazonaws.com"
31
+ else
32
+ s"s3-website.$region.amazonaws.com"
33
+ val s3Hostname =
34
+ if (region == "us-east-1")
35
+ "s3.amazonaws.com"
36
+ else if (isOldRegion)
37
+ s"s3-$region.amazonaws.com"
38
+ else
39
+ s"s3.$region.amazonaws.com"
12
40
 
13
- def forString(locationConstraint: String): Either[ErrorReport, S3Endpoint] = locationConstraint match {
14
- case "EU" | "eu-west-1" => Right(S3Endpoint("s3-website-eu-west-1.amazonaws.com", "s3-eu-west-1.amazonaws.com"))
15
- case "us-east-1" => Right(defaultEndpoint)
16
- case "us-west-1" => Right(S3Endpoint("s3-website-us-west-1.amazonaws.com", "s3-us-west-1.amazonaws.com"))
17
- case "us-west-2" => Right(S3Endpoint("s3-website-us-west-2.amazonaws.com", "s3-us-west-2.amazonaws.com"))
18
- case "ap-southeast-1" => Right(S3Endpoint("s3-website-ap-southeast-1.amazonaws.com", "s3-ap-southeast-1.amazonaws.com"))
19
- case "ap-southeast-2" => Right(S3Endpoint("s3-website-ap-southeast-2.amazonaws.com", "s3-ap-southeast-2.amazonaws.com"))
20
- case "ap-northeast-1" => Right(S3Endpoint("s3-website-ap-northeast-1.amazonaws.com", "s3-ap-northeast-1.amazonaws.com"))
21
- case "sa-east-1" => Right(S3Endpoint("s3-website-sa-east-1.amazonaws.com", "s3-sa-east-1.amazonaws.com"))
22
- case _ => Left(ErrorReport(s"Unrecognised endpoint: $locationConstraint"))
41
+ S3Endpoint(s3WebsiteHostname = s3WebsiteHostname, s3Hostname = s3Hostname)
23
42
  }
24
43
  }
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: 2.15.0
4
+ version: 2.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lauri Lehmijoki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-29 00:00:00.000000000 Z
11
+ date: 2016-09-07 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: 1.7.1
33
+ version: 1.7.5
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: 1.7.1
40
+ version: 1.7.5
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: colored
43
43
  requirement: !ruby/object:Gem::Requirement