pem 1.1.1 → 1.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 +15 -3
- data/bin/pem +3 -1
- data/lib/pem/manager.rb +15 -14
- data/lib/pem/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd76824795300fb6be355a1bc879e8419f2f28d7
|
4
|
+
data.tar.gz: 2574f6607266f8bc4bdd939eb447d8385f517ed7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 213fe72ac935a7aab97497d5f73dd0028f1255af8634b6e9ede2e0d1d7f782ce8027b6a9e2a1db018ac287452c29c651a5e186a9a9aa68a0d9de676befb3955a
|
7
|
+
data.tar.gz: 57d0437137d3eec33eedc2fdaba0ecd70820e09048bc3de4b0cf46b3bf53c98465ff7354ab7e485b415889bd8960cd2c8c2bdfe47d89a9e8955787171ea403df
|
data/README.md
CHANGED
@@ -29,8 +29,8 @@
|
|
29
29
|
pem
|
30
30
|
============
|
31
31
|
|
32
|
-
[![Twitter: @
|
33
|
-
[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/
|
32
|
+
[![Twitter: @FastlaneTools](https://img.shields.io/badge/contact-@FastlaneTools-blue.svg?style=flat)](https://twitter.com/FastlaneTools)
|
33
|
+
[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/fastlane/pem/blob/master/LICENSE)
|
34
34
|
[![Gem](https://img.shields.io/gem/v/pem.svg?style=flat)](http://rubygems.org/gems/pem)
|
35
35
|
|
36
36
|
###### Automatically generate and renew your push notification profiles
|
@@ -41,7 +41,7 @@ Tired of manually creating and maintaining your push notification profiles for y
|
|
41
41
|
|
42
42
|
To automate iOS Provisioning profiles you can use [sigh](https://github.com/fastlane/sigh).
|
43
43
|
|
44
|
-
Get in contact with the developer on Twitter: [@
|
44
|
+
Get in contact with the developer on Twitter: [@FastlaneTools](https://twitter.com/FastlaneTools)
|
45
45
|
|
46
46
|
-------
|
47
47
|
<p align="center">
|
@@ -112,6 +112,15 @@ To get a list of available options run:
|
|
112
112
|
pem --help
|
113
113
|
|
114
114
|
|
115
|
+
### Note about empty `p12` passwords and Keychain Access.app
|
116
|
+
|
117
|
+
`pem` will produce a valid `p12` without specifying a password, or using the empty-string as the password.
|
118
|
+
While the file is valid, Mac OSX's Keychain Access will not allow you to open the file without specifing a passphrase.
|
119
|
+
|
120
|
+
Instead, you may verify the file is valid using OpenSSL:
|
121
|
+
|
122
|
+
openssl pkcs12 -info -in my.p12
|
123
|
+
|
115
124
|
##### [Like this tool? Be the first to know about updates and new fastlane tools](https://tinyletter.com/krausefx)
|
116
125
|
|
117
126
|
## Environment Variables
|
@@ -155,6 +164,9 @@ It will show you the ```pem``` files like this:
|
|
155
164
|
# Need help?
|
156
165
|
Please submit an issue on GitHub and provide information about your setup
|
157
166
|
|
167
|
+
# Code of Conduct
|
168
|
+
Help us keep `pem` open and inclusive. Please read and follow our [Code of Conduct](https://github.com/fastlane/code-of-conduct).
|
169
|
+
|
158
170
|
# License
|
159
171
|
This project is licensed under the terms of the MIT license. See the LICENSE file.
|
160
172
|
|
data/bin/pem
CHANGED
@@ -17,9 +17,11 @@ class PemApplication
|
|
17
17
|
program :description, 'CLI for \'PEM\' - Automatically generate and renew your push notification profiles'
|
18
18
|
program :help, 'Author', 'Felix Krause <pem@krausefx.com>'
|
19
19
|
program :help, 'Website', 'https://fastlane.tools'
|
20
|
-
program :help, 'GitHub', 'https://github.com/
|
20
|
+
program :help, 'GitHub', 'https://github.com/fastlane/PEM'
|
21
21
|
program :help_formatter, :compact
|
22
22
|
|
23
|
+
global_option('--verbose') { $verbose = true }
|
24
|
+
|
23
25
|
FastlaneCore::CommanderGenerator.new.generate(PEM::Options.available_options)
|
24
26
|
|
25
27
|
command :renew do |c|
|
data/lib/pem/manager.rb
CHANGED
@@ -15,13 +15,13 @@ module PEM
|
|
15
15
|
|
16
16
|
if existing_certificate
|
17
17
|
remaining_days = (existing_certificate.expires - Time.now) / 60 / 60 / 24
|
18
|
-
|
18
|
+
UI.message "Existing push notification profile '#{existing_certificate.owner_name}' is valid for #{remaining_days.round} more days."
|
19
19
|
if remaining_days > 30
|
20
20
|
if PEM.config[:force]
|
21
|
-
|
21
|
+
UI.success "You already have an existing push certificate, but a new one will be created since the --force option has been set."
|
22
22
|
else
|
23
|
-
|
24
|
-
|
23
|
+
UI.success "You already have a push certificate, which is active for more than 30 more days. No need to create a new one"
|
24
|
+
UI.success "If you still want to create a new one, use the --force option when running PEM."
|
25
25
|
return false
|
26
26
|
end
|
27
27
|
end
|
@@ -31,15 +31,15 @@ module PEM
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def login
|
34
|
-
|
34
|
+
UI.message "Starting login with user '#{PEM.config[:username]}'"
|
35
35
|
Spaceship.login(PEM.config[:username], nil)
|
36
36
|
Spaceship.client.select_team
|
37
|
-
|
37
|
+
UI.message "Successfully logged in"
|
38
38
|
end
|
39
39
|
|
40
40
|
# rubocop:disable Metrics/AbcSize
|
41
41
|
def create_certificate
|
42
|
-
|
42
|
+
UI.important "Creating a new push certificate for app '#{PEM.config[:app_identifier]}'."
|
43
43
|
|
44
44
|
csr, pkey = Spaceship.certificate.create_certificate_signing_request
|
45
45
|
|
@@ -48,9 +48,8 @@ module PEM
|
|
48
48
|
rescue => ex
|
49
49
|
if ex.to_s.include? "You already have a current"
|
50
50
|
# That's the most common failure probably
|
51
|
-
|
52
|
-
|
53
|
-
Helper.log.error "You'll need to revoke an old certificate to make room for a new one".red
|
51
|
+
UI.message ex.to_s
|
52
|
+
UI.user_error!("You already have 2 active push profiles for this application/environment. You'll need to revoke an old certificate to make room for a new one")
|
54
53
|
else
|
55
54
|
raise ex
|
56
55
|
end
|
@@ -64,19 +63,21 @@ module PEM
|
|
64
63
|
if PEM.config[:save_private_key]
|
65
64
|
private_key_path = File.join(PEM.config[:output_path], "#{filename_base}.pkey")
|
66
65
|
File.write(private_key_path, pkey.to_pem)
|
67
|
-
|
66
|
+
UI.message("Private key: ".green + Pathname.new(private_key_path).realpath.to_s)
|
68
67
|
end
|
69
68
|
|
70
69
|
if PEM.config[:generate_p12]
|
71
|
-
|
70
|
+
output_path = PEM.config[:output_path]
|
71
|
+
FileUtils.mkdir_p(File.expand_path(output_path))
|
72
|
+
p12_cert_path = File.join(output_path, "#{filename_base}.p12")
|
72
73
|
p12 = OpenSSL::PKCS12.create(PEM.config[:p12_password], certificate_type, pkey, x509_certificate)
|
73
74
|
File.write(p12_cert_path, p12.to_der)
|
74
|
-
|
75
|
+
UI.message("p12 certificate: ".green + Pathname.new(p12_cert_path).realpath.to_s)
|
75
76
|
end
|
76
77
|
|
77
78
|
x509_cert_path = File.join(PEM.config[:output_path], "#{filename_base}.pem")
|
78
79
|
File.write(x509_cert_path, x509_certificate.to_pem + pkey.to_pem)
|
79
|
-
|
80
|
+
UI.message("PEM: ".green + Pathname.new(x509_cert_path).realpath.to_s)
|
80
81
|
return x509_cert_path
|
81
82
|
end
|
82
83
|
# rubocop:enable Metrics/AbcSize
|
data/lib/pem/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felix Krause
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastlane_core
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.36.1
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 1.0.0
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
29
|
+
version: 0.36.1
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 1.0.0
|
@@ -36,7 +36,7 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 0.
|
39
|
+
version: 0.19.3
|
40
40
|
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: 1.0.0
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
requirements:
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.
|
49
|
+
version: 0.19.3
|
50
50
|
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: 1.0.0
|
@@ -168,14 +168,14 @@ dependencies:
|
|
168
168
|
requirements:
|
169
169
|
- - "~>"
|
170
170
|
- !ruby/object:Gem::Version
|
171
|
-
version:
|
171
|
+
version: 0.35.1
|
172
172
|
type: :development
|
173
173
|
prerelease: false
|
174
174
|
version_requirements: !ruby/object:Gem::Requirement
|
175
175
|
requirements:
|
176
176
|
- - "~>"
|
177
177
|
- !ruby/object:Gem::Version
|
178
|
-
version:
|
178
|
+
version: 0.35.1
|
179
179
|
description: Automatically generate and renew your push notification profiles
|
180
180
|
email:
|
181
181
|
- pem@krausefx.com
|