deb-s3 0.9.1 → 0.9.2

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
- SHA1:
3
- metadata.gz: 0fdcdc9b5f39dd0c26eaa1c9045dc5ce520697b4
4
- data.tar.gz: 743c9ae0a9368dac628bbfdee71da2c6606b411b
2
+ SHA256:
3
+ metadata.gz: ec462c0b2f303467f4894dd8aa080b8ba29132015af2c8d6b641a101ceb9d184
4
+ data.tar.gz: 497c2f2658e577d1357bfd48683aa6b03626efa32bd1686d4a28aa99fe64eec6
5
5
  SHA512:
6
- metadata.gz: a2eacf16e2fd89c4af49c9229b0cf185d0de6efeaa70bbe5543b93a83c11d651abc838734560a36dd54703b56a51ad15a53cf87f479d3c7645e366714fe0340e
7
- data.tar.gz: b3d97c88ef06bd7f908173e6e6ab466a98482231400f46f7e914d9a4f3a9564eab80e610c3df7939e1e15557828d1cf0f83deb11fd00312f2313406c6f7e9c5c
6
+ metadata.gz: 0da988ffe976866db0ee34ae7646ecbf7c7bb439e4ecbc6a77b03ae834b1f89c0ac417b8ff391845d2f9c24a1d94af898c1ff628c132ad1794b81adaf45e0751
7
+ data.tar.gz: 9ece8553037e9abe6d56110715e5a5d1249756fd353f9d7cbb5e0b270476f2ccfdadc7c6b4e3c62689a88d21dc56414313e5103f0e3f3ba4ec129cf398591be8
data/README.md CHANGED
@@ -61,33 +61,32 @@ Usage:
61
61
  deb-s3 upload FILES
62
62
 
63
63
  Options:
64
- -a, [--arch=ARCH] # The architecture of the package in the APT repository.
65
- -p, [--preserve-versions], [--no-preserve-versions] # Whether to preserve other versions of a package in the repository when uploading one.
66
- -l, [--lock], [--no-lock] # Whether to check for an existing lock on the repository to prevent simultaneous updates
67
- [--fail-if-exists], [--no-fail-if-exists] # Whether to overwrite any existing package that has the same filename in the pool or the same name and version in the manifest.
68
- -b, [--bucket=BUCKET] # The name of the S3 bucket to upload to.
69
- [--prefix=PREFIX] # The path prefix to use when storing on S3.
70
- -o, [--origin=ORIGIN] # The origin to use in the repository Release file.
71
- [--suite=SUITE] # The suite to use in the repository Release file.
72
- -c, [--codename=CODENAME] # The codename of the APT repository.
73
- # Default: stable
74
- -m, [--component=COMPONENT] # The component of the APT repository.
75
- # Default: main
76
- [--access-key-id=ACCESS_KEY_ID] # The access key for connecting to S3.
77
- [--secret-access-key=SECRET_ACCESS_KEY] # The secret key for connecting to S3.
78
- [--endpoint=ENDPOINT] # The region endpoint for connecting to S3.
79
- # Default: s3.amazonaws.com
80
- [--force-path-style], [--no-force-path-style] # Use S3 path style instead of subdomains.
81
- [--proxy-uri=PROXY_URI] # The URI of the proxy to send service requests through.
82
- [--use-ssl], [--no-use-ssl] # Whether to use HTTP or HTTPS for request transport.
83
- # Default: true
84
- -v, [--visibility=VISIBILITY] # The access policy for the uploaded files. Can be public, private, or authenticated.
85
- # Default: public
86
- [--sign=SIGN] # Sign the Release file when uploading a package, or when verifying it after removing a package. Use --sign with your key ID to use a specific key.
87
- [--gpg-options=GPG_OPTIONS] # Additional command line options to pass to GPG when signing.
88
- -e, [--encryption], [--no-encryption] # Use S3 server side encryption.
89
- -q, [--quiet], [--no-quiet] # Doesn't output information, just returns status appropriately.
90
- -C, [--cache-control=CACHE_CONTROL] # Add cache-control headers to S3 objects.
64
+ -a, [--arch=ARCH] # The architecture of the package in the APT repository.
65
+ -p, [--preserve-versions], [--no-preserve-versions] # Whether to preserve other versions of a package in the repository when uploading one.
66
+ -l, [--lock], [--no-lock] # Whether to check for an existing lock on the repository to prevent simultaneous updates
67
+ [--fail-if-exists], [--no-fail-if-exists] # Whether to overwrite any existing package that has the same filename in the pool or the same name and version in the manifest.
68
+ [--skip-package-upload], [--no-skip-package-upload] # Whether to skip all package uploads.This is useful when hosting .deb files outside of the bucket.
69
+ -b, [--bucket=BUCKET] # The name of the S3 bucket to upload to.
70
+ [--prefix=PREFIX] # The path prefix to use when storing on S3.
71
+ -o, [--origin=ORIGIN] # The origin to use in the repository Release file.
72
+ [--suite=SUITE] # The suite to use in the repository Release file.
73
+ -c, [--codename=CODENAME] # The codename of the APT repository.
74
+ # Default: stable
75
+ -m, [--component=COMPONENT] # The component of the APT repository.
76
+ # Default: main
77
+ [--access-key-id=ACCESS_KEY_ID] # The access key for connecting to S3.
78
+ [--secret-access-key=SECRET_ACCESS_KEY] # The secret key for connecting to S3.
79
+ [--s3-region=S3_REGION] # The region for connecting to S3.
80
+ # Default: us-east-1
81
+ [--force-path-style], [--no-force-path-style] # Use S3 path style instead of subdomains.
82
+ [--proxy-uri=PROXY_URI] # The URI of the proxy to send service requests through.
83
+ -v, [--visibility=VISIBILITY] # The access policy for the uploaded files. Can be public, private, or authenticated.
84
+ # Default: public
85
+ [--sign=SIGN] # GPG Sign the Release file when uploading a package, or when verifying it after removing a package. Use --sign with your GPG key ID to use a specific key (--sign=6643C242C18FE05B).
86
+ [--gpg-options=GPG_OPTIONS] # Additional command line options to pass to GPG when signing.
87
+ -e, [--encryption], [--no-encryption] # Use S3 server side encryption.
88
+ -q, [--quiet], [--no-quiet] # Doesn't output information, just returns status appropriately.
89
+ -C, [--cache-control=CACHE_CONTROL] # Add cache-control headers to S3 objects.
91
90
 
92
91
  Uploads the given files to a S3 bucket as an APT repository.
93
92
  ```
@@ -125,15 +124,13 @@ Options:
125
124
  # Default: main
126
125
  [--access-key-id=ACCESS_KEY_ID] # The access key for connecting to S3.
127
126
  [--secret-access-key=SECRET_ACCESS_KEY] # The secret key for connecting to S3.
128
- [--endpoint=ENDPOINT] # The region endpoint for connecting to S3.
129
- # Default: s3.amazonaws.com
127
+ [--s3-region=S3_REGION] # The region for connecting to S3.
128
+ # Default: us-east-1
130
129
  [--force-path-style], [--no-force-path-style] # Use S3 path style instead of subdomains.
131
130
  [--proxy-uri=PROXY_URI] # The URI of the proxy to send service requests through.
132
- [--use-ssl], [--no-use-ssl] # Whether to use HTTP or HTTPS for request transport.
133
- # Default: true
134
131
  -v, [--visibility=VISIBILITY] # The access policy for the uploaded files. Can be public, private, or authenticated.
135
132
  # Default: public
136
- [--sign=SIGN] # Sign the Release file when uploading a package, or when verifying it after removing a package. Use --sign with your key ID to use a specific key.
133
+ [--sign=SIGN] # GPG Sign the Release file when uploading a package, or when verifying it after removing a package. Use --sign with your GPG key ID to use a specific key (--sign=6643C242C18FE05B).
137
134
  [--gpg-options=GPG_OPTIONS] # Additional command line options to pass to GPG when signing.
138
135
  -e, [--encryption], [--no-encryption] # Use S3 server side encryption.
139
136
  -q, [--quiet], [--no-quiet] # Doesn't output information, just returns status appropriately.
@@ -168,15 +165,13 @@ Options:
168
165
  # Default: main
169
166
  [--access-key-id=ACCESS_KEY_ID] # The access key for connecting to S3.
170
167
  [--secret-access-key=SECRET_ACCESS_KEY] # The secret key for connecting to S3.
171
- [--endpoint=ENDPOINT] # The region endpoint for connecting to S3.
172
- # Default: s3.amazonaws.com
168
+ [--s3-region=S3_REGION] # The region for connecting to S3.
169
+ # Default: us-east-1
173
170
  [--force-path-style], [--no-force-path-style] # Use S3 path style instead of subdomains.
174
171
  [--proxy-uri=PROXY_URI] # The URI of the proxy to send service requests through.
175
- [--use-ssl], [--no-use-ssl] # Whether to use HTTP or HTTPS for request transport.
176
- # Default: true
177
172
  -v, [--visibility=VISIBILITY] # The access policy for the uploaded files. Can be public, private, or authenticated.
178
173
  # Default: public
179
- [--sign=SIGN] # Sign the Release file when uploading a package, or when verifying it after removing a package. Use --sign with your key ID to use a specific key.
174
+ [--sign=SIGN] # GPG Sign the Release file when uploading a package, or when verifying it after removing a package. Use --sign with your GPG key ID to use a specific key (--sign=6643C242C18FE05B).
180
175
  [--gpg-options=GPG_OPTIONS] # Additional command line options to pass to GPG when signing.
181
176
  -e, [--encryption], [--no-encryption] # Use S3 server side encryption.
182
177
  -q, [--quiet], [--no-quiet] # Doesn't output information, just returns status appropriately.
data/bin/deb-s3 CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- $:.unshift File.expand_path('../../lib', __FILE__)
3
+ require 'pathname'
4
+ $:.unshift File.join(Pathname.new(__FILE__).realpath,'../../lib')
4
5
 
5
6
  require 'rubygems'
6
7
  require 'deb/s3/cli'
@@ -1,6 +1,6 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Deb
3
3
  module S3
4
- VERSION = "0.9.1"
4
+ VERSION = "0.9.2"
5
5
  end
6
6
  end
@@ -56,6 +56,10 @@ class Deb::S3::CLI < Thor
56
56
  :type => :string,
57
57
  :desc => "The secret key for connecting to S3."
58
58
 
59
+ class_option :session_token,
60
+ :type => :string,
61
+ :desc => "The (optional) session token for connecting to S3."
62
+
59
63
  class_option :s3_region,
60
64
  :type => :string,
61
65
  :desc => "The region for connecting to S3.",
@@ -84,9 +88,9 @@ class Deb::S3::CLI < Thor
84
88
 
85
89
  class_option :sign,
86
90
  :type => :string,
87
- :desc => "Sign the Release file when uploading a package, " +
91
+ :desc => "GPG Sign the Release file when uploading a package, " +
88
92
  "or when verifying it after removing a package. " +
89
- "Use --sign with your key ID to use a specific key."
93
+ "Use --sign with your GPG key ID to use a specific key (--sign=6643C242C18FE05B)."
90
94
 
91
95
  class_option :gpg_options,
92
96
  :default => "",
@@ -190,7 +194,7 @@ class Deb::S3::CLI < Thor
190
194
 
191
195
  # If they've specified an arch type that doesn't match the package let them know
192
196
  if options.key?("arch") && options[:arch] != pkg.architecture
193
- warn("You specified architecture #{options[:arch]} but package #{pkg.name} has architecture type of #{pkg.architecture}")
197
+ warn("You specified architecture #{options[:arch]} but package #{pkg.name} has architecture type of #{pkg.architecture}")
194
198
  end
195
199
 
196
200
  # validate we have them
@@ -565,6 +569,7 @@ class Deb::S3::CLI < Thor
565
569
  def provider
566
570
  access_key_id = options[:access_key_id]
567
571
  secret_access_key = options[:secret_access_key]
572
+ session_token = options[:session_token]
568
573
 
569
574
  if access_key_id.nil? ^ secret_access_key.nil?
570
575
  error("If you specify one of --access-key-id or --secret-access-key, you must specify the other.")
@@ -572,6 +577,7 @@ class Deb::S3::CLI < Thor
572
577
  static_credentials = {}
573
578
  static_credentials[:access_key_id] = access_key_id if access_key_id
574
579
  static_credentials[:secret_access_key] = secret_access_key if secret_access_key
580
+ static_credentials[:session_token] = session_token if session_token
575
581
 
576
582
  static_credentials
577
583
  end
@@ -103,7 +103,7 @@ class Deb::S3::Release
103
103
  # sign the file, if necessary
104
104
  if Deb::S3::Utils.signing_key
105
105
  key_param = Deb::S3::Utils.signing_key != "" ? "--default-key=#{Deb::S3::Utils.signing_key}" : ""
106
- if self.codename == "xenial"
106
+ if self.codename == "xenial" || self.codename == "jessie" || self.codename == "stretch"
107
107
  if system("gpg -a #{key_param} #{Deb::S3::Utils.gpg_options} -s --clearsign #{release_tmp.path}")
108
108
  local_file = release_tmp.path+".asc"
109
109
  remote_file = "dists/#{@codename}/InRelease"
@@ -75,7 +75,7 @@ module Deb::S3::Utils
75
75
 
76
76
  def s3_store(path, filename=nil, content_type='application/octet-stream; charset=binary', cache_control=nil, fail_if_exists=false)
77
77
  filename = File.basename(path) unless filename
78
- obj = s3_exists?(path)
78
+ obj = s3_exists?(filename)
79
79
 
80
80
  file_md5 = Digest::MD5.file(path)
81
81
 
@@ -97,7 +97,7 @@ module Deb::S3::Utils
97
97
  end
98
98
 
99
99
  # specify if encryption is required
100
- options[:server_side_encryption] = :aes256 if Deb::S3::Utils.encryption
100
+ options[:server_side_encryption] = "AES256" if Deb::S3::Utils.encryption
101
101
 
102
102
  # upload the file
103
103
  File.open(path) do |f|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deb-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Robertson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-08 00:00:00.000000000 Z
11
+ date: 2018-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  version: '0'
105
105
  requirements: []
106
106
  rubyforge_project:
107
- rubygems_version: 2.5.2
107
+ rubygems_version: 2.7.6
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: Easily create and manage an APT repository on S3.