conoha 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +15 -0
- data/Rakefile +9 -0
- data/exe/conoha +4 -3
- data/lib/conoha/util.rb +13 -0
- data/lib/conoha/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31ec5261016745ae27ce4804e4935aa00c00e299
|
4
|
+
data.tar.gz: d255da18a9a141611113e9e83753e15682da58a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb9540ec00d4c6e0936949c6e228b3876255aff6539a9512d2e0451f7aeb7beaf41f3d8956e5501477441f93408c662f88c081f35edcf1948bd812127b16b5dc
|
7
|
+
data.tar.gz: 9a3e44b50304c391b69eae9d99ed3f33d7e997ab818888dab00844c04cb1816514013f5ea8472dd9503c30d0d87c501109c2a7c37cbc812c0d5a2147f2dbd9e0
|
data/README.md
CHANGED
@@ -84,6 +84,18 @@ conoha imagedelete fedcba98-7654-3210-fedc-ba9876543210
|
|
84
84
|
|
85
85
|
# Create a VPS from a saved image
|
86
86
|
conoha createfromimage fedcba98-7654-3210-fedc-ba9876543210 g-1gb
|
87
|
+
|
88
|
+
# SSH
|
89
|
+
conoha ssh 01234567-89ab-cdef-0123-456789abcdef root # ssh root@ipaddress
|
90
|
+
conoha ssh 01234567-89ab-cdef-0123-456789abcdef yourname # ssh yourname@ipaddress
|
91
|
+
conoha ssh 01234567-89ab-cdef-0123-456789abcdef # ssh ipaddress
|
92
|
+
|
93
|
+
# Mosh
|
94
|
+
conoha mosh 01234567-89ab-cdef-0123-456789abcdef root # mosh root@ipaddress
|
95
|
+
|
96
|
+
# Launch Web browser
|
97
|
+
conoha browse 01234567-89ab-cdef-0123-456789abcdef # xdg-open http://ipaddress
|
98
|
+
conoha browse 01234567-89ab-cdef-0123-456789abcdef 3000 # xdg-open http://ipaddress:3000
|
87
99
|
```
|
88
100
|
|
89
101
|
## Development
|
@@ -115,6 +127,9 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/kaosf/
|
|
115
127
|
- [x] delete image
|
116
128
|
- [ ] public keys
|
117
129
|
- [x] make as a gem
|
130
|
+
- [ ] remove `curl` command from authenticate
|
131
|
+
- [ ] help message
|
132
|
+
- [ ] subcommand help messages
|
118
133
|
|
119
134
|
### Code
|
120
135
|
|
data/Rakefile
CHANGED
data/exe/conoha
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
# vim: filetype=ruby
|
3
3
|
|
4
4
|
require 'conoha'
|
5
|
+
require 'conoha/util'
|
5
6
|
require 'pp'
|
6
7
|
|
7
8
|
subcommand = ARGV.shift
|
@@ -53,20 +54,20 @@ when 'createfromimage'
|
|
53
54
|
puts Conoha.create_from_image image_ref, ram
|
54
55
|
when 'ssh'
|
55
56
|
exit 1 if ARGV.size < 1 || 2 < ARGV.size
|
56
|
-
ipaddress = Conoha.ip_address_of(server_id(ARGV.first))
|
57
|
+
ipaddress = ipv4(Conoha.ip_address_of(server_id(ARGV.first)))
|
57
58
|
user = ARGV[1].nil? ? '' : "#{ARGV[1]}@"
|
58
59
|
command = "ssh -oStrictHostKeyChecking=no #{user}#{ipaddress}"
|
59
60
|
puts command
|
60
61
|
system command
|
61
62
|
when 'mosh'
|
62
63
|
exit 1 if ARGV.size != 1
|
63
|
-
ipaddress = Conoha.ip_address_of(server_id(ARGV.first))
|
64
|
+
ipaddress = ipv4(Conoha.ip_address_of(server_id(ARGV.first)))
|
64
65
|
command = "mosh #{ipaddress}"
|
65
66
|
puts command
|
66
67
|
system command
|
67
68
|
when 'browse'
|
68
69
|
exit 1 if ARGV.size < 1 || 2 < ARGV.size
|
69
|
-
ipaddress = Conoha.ip_address_of(server_id(ARGV.first))
|
70
|
+
ipaddress = ipv4(Conoha.ip_address_of(server_id(ARGV.first)))
|
70
71
|
port = ARGV[1].nil? ? '' : ":#{ARGV[1]}"
|
71
72
|
command = "xdg-open http://#{ipaddress}#{port}"
|
72
73
|
puts command
|
data/lib/conoha/util.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# @params [Array<String>]
|
2
|
+
# The return value of `ip_address_of` method. It is either
|
3
|
+
#
|
4
|
+
# ["111.111.111.111", "1111:1111:1111:1111:1111:1111:1111:1111"]
|
5
|
+
#
|
6
|
+
# or
|
7
|
+
#
|
8
|
+
# ["1111:1111:1111:1111:1111:1111:1111:1111", "111.111.111.111"]
|
9
|
+
#
|
10
|
+
# @return [String] IPv4 address (e.g. "111.111.111.111")
|
11
|
+
def ipv4(ip_address)
|
12
|
+
ip_address.select { |e| e =~ /\d+\.\d+\.\d+\.\d+/ }.first
|
13
|
+
end
|
data/lib/conoha/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conoha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ka
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -57,6 +57,7 @@ files:
|
|
57
57
|
- conoha.gemspec
|
58
58
|
- exe/conoha
|
59
59
|
- lib/conoha.rb
|
60
|
+
- lib/conoha/util.rb
|
60
61
|
- lib/conoha/version.rb
|
61
62
|
homepage: https://github.com/kaosf/conoha
|
62
63
|
licenses:
|