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 +5 -5
- data/README.md +32 -37
- data/bin/deb-s3 +2 -1
- data/lib/deb/s3.rb +1 -1
- data/lib/deb/s3/cli.rb +9 -3
- data/lib/deb/s3/release.rb +1 -1
- data/lib/deb/s3/utils.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ec462c0b2f303467f4894dd8aa080b8ba29132015af2c8d6b641a101ceb9d184
|
4
|
+
data.tar.gz: 497c2f2658e577d1357bfd48683aa6b03626efa32bd1686d4a28aa99fe64eec6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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]
|
65
|
-
-p, [--preserve-versions], [--no-preserve-versions]
|
66
|
-
-l, [--lock], [--no-lock]
|
67
|
-
[--fail-if-exists], [--no-fail-if-exists]
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
[--
|
78
|
-
[--
|
79
|
-
|
80
|
-
|
81
|
-
[--
|
82
|
-
[--
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
[--
|
87
|
-
|
88
|
-
-
|
89
|
-
-
|
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
|
-
[--
|
129
|
-
# Default:
|
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
|
-
[--
|
172
|
-
# Default:
|
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
data/lib/deb/s3.rb
CHANGED
data/lib/deb/s3/cli.rb
CHANGED
@@ -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
|
data/lib/deb/s3/release.rb
CHANGED
@@ -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"
|
data/lib/deb/s3/utils.rb
CHANGED
@@ -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?(
|
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] =
|
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.
|
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:
|
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.
|
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.
|