awssh 0.3.1 → 0.3.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
2
  SHA1:
3
- metadata.gz: 41ff945d54ed3800f4453bcde333df76f1ddf186
4
- data.tar.gz: c05e3208e7953cdebf07f47e812f78f7e9357fe3
3
+ metadata.gz: 34f90f8db1821a009c13349a1a086a96e5200c2b
4
+ data.tar.gz: 49a74acf53fe5c80bfaa7baebe961887a6cf32a6
5
5
  SHA512:
6
- metadata.gz: 2219334008fdc31fe8e702818d28b2e09ac12f9eab7a63b0d438bc24d3a4361cfaeefb7d3284de0b6d32138920f13ecf1217b86410cd21854c49cbc4e7c7a8c9
7
- data.tar.gz: a77c02a299a80abf29952e22f1d6906a025075a9e5fbe9b33307806d4f5dc3a48795c3a1a9275e09a6bfaea0ee153d359905be344d4bebbbad8f34332713aa8b
6
+ metadata.gz: 366decc391cad6e35c85976ab31cabf97d6c15f4470e6d6f4ee72d3c43ed00380c26c471dde71a3a7727e9b17a7a5af505f40b0c6de87c7183efbcd1063c814b
7
+ data.tar.gz: fba8f18db93c5e602a6960f436ec466fe0c0645238e23132be683dec7049408065494e2a67d2d19149f07d17489c845876cf73389dd8a53238cf198bb2b7c656
data/README.md CHANGED
@@ -17,9 +17,10 @@ Initialize the config file:
17
17
 
18
18
  $ awssh -i
19
19
 
20
- Edit the config file and add the AWS key and secret.
20
+ Edit the config file and add the AWS region, key, and secret.
21
21
  ```
22
22
  ...
23
+ region: us-east-1 # AWS region
23
24
  key: AWS ACCESS KEY ID # AWS key
24
25
  secret: AWS SECRET ACCESS KEY # AWS secret
25
26
  ...
@@ -27,12 +28,21 @@ secret: AWS SECRET ACCESS KEY # AWS secret
27
28
 
28
29
  ## Requirement
29
30
 
30
- The only requirement of the tool is that the Name tag on the instance maps to the DNS record.
31
+ ### Use Names = False
32
+
33
+ With `use_names: false` in the config, the tool will use the private address of the
34
+ server, expecting that the servers are in a vpc and that you are able to connect
35
+ to them directly (with VPN).
36
+
37
+ ### Use Names = True
38
+
39
+ If `use_names: true`, then the only requirement of the tool is that the Name tag
40
+ on the instance maps to the DNS record.
31
41
  Generally, `awssh` expects that if the name of the instance is `foo.bar`, then it can
32
42
  connect to the server by appending the domain name as `foo.bar.example.com`.
33
43
 
34
44
  If you unset the domain name in the config, it will not append it. As such, if your Name
35
- tag maps directly to the DNS name, it will work as well.
45
+ tag maps directly to the FQDN, it will work as well.
36
46
 
37
47
  In the future, I might add a templated way for handling hostnames, to allow for
38
48
  more customization in DNS lookup.
@@ -50,8 +60,10 @@ Search Terms:
50
60
  name !~ /term/
51
61
 
52
62
  Options:
63
+ -c, --config override config file (default: ~/.awssh)
53
64
  -V, --version print version
54
- -i, --init initialize config
65
+ -i, --identity=IDENTITY set ssh key
66
+ --init initialize config
55
67
 
56
68
  -l, --list just list servers
57
69
  -n, --test just output ssh command
@@ -61,9 +73,7 @@ Options:
61
73
  --no-cache disable cache for this run
62
74
 
63
75
  -m, --[no-]multi connect to multiple servers
64
- -c, --config override config file (default: ~/.awssh)
65
- -u, --user override user setting
66
-
76
+ -u, --user USER override user setting
67
77
  ```
68
78
  ## Examples
69
79
  Given a list of servers:
@@ -96,15 +106,20 @@ awssh -m production ^app3 #=> web1.production, web2.production, app1.production,
96
106
  ## Config
97
107
  ```
98
108
  ---
99
- multi: csshX # multi ssh program: csshX or cssh
100
- single: ssh # ssh program, allows for common configs
101
- region: us-east-1 # ec2 region
102
- user: # username to ssh as
103
- key: AWS ACCESS KEY ID # AWS key
104
- secret: AWS SECRET ACCESS KEY # AWS secret
105
- domain: example.com # append domain to server names
106
- cache: "~/.awssh.cache" # cache file location
107
- expires: 86400 # cache expiration time (in seconds)
109
+ region: us-east-1 # AWS Region
110
+ key: AWS_ACCESS_KEY_ID # AWS access key id
111
+ secret: AWS_SECRET_ACCESS_KEY # AWS secret access key
112
+ multi: csshX # command to use when connecting to multiple servers
113
+ single: ssh # command to use when connecting to single server
114
+ #user: username # set user for connection to all servers
115
+ # this can be overridden on the command line
116
+ domain: example.com # if 'use_names' is set, this will be appended
117
+ # to names, leave blank if name is fully-qualified
118
+ use_names: false # if true, rather than connecting to IP's,
119
+ # connection strings will be created using Name
120
+ # tag and domain
121
+ cache: ~/.awssh.cache # the cache file, set to false to disable caching
122
+ expires: 86400 # cache expiration time in seconds
108
123
  ```
109
124
 
110
125
  ## Multi SSH
@@ -121,7 +136,6 @@ for more advanced usage.
121
136
  ## Caching
122
137
 
123
138
  Maintains a simple cache with expiration (default: 1 day).
124
- The cache just contains the list of servers' names.
125
139
  You can disable the cache by setting the cache value to false in the config file.
126
140
 
127
141
  ## Shell Alias
@@ -17,9 +17,9 @@ module Awssh
17
17
  attr_reader :data
18
18
 
19
19
  def initialize(file)
20
- @file = file
21
- raise "config file does not exist: #{file}" unless File.exist?(file)
22
- @data = OpenStruct.new(YAML.load_file(file))
20
+ @file = File.expand_path(file)
21
+ yaml = File.exist?(@file) ? YAML.load_file(file) : {}
22
+ @data = OpenStruct.new(yaml)
23
23
  end
24
24
 
25
25
  DEFAULT = <<-EOF
@@ -2,7 +2,7 @@ module Awssh
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 3
5
- TINY = 1
5
+ TINY = 2
6
6
  TAG = nil
7
7
  LIST = [MAJOR, MINOR, TINY, TAG].compact
8
8
  STRING = LIST.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shawn Catanzarite
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-23 00:00:00.000000000 Z
11
+ date: 2015-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk