haproxy-api 0.1.1 → 0.1.2
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 +5 -13
- data/bin/haproxy-api_initd +54 -0
- data/bin/install_haproxy-api_initd +17 -0
- data/haproxy-api.gemspec +2 -4
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
MzdiMmU4MTNhNTU0NmFlMjYyMGIyYThkMTk2ZDc1N2Y2NDVkYTM5ZA==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c50776286df12d8f2a7a7418c4a86c08863fdcdb
|
4
|
+
data.tar.gz: 4cb2f9c9e305b53ac0d5fd90a0dbbaae1279a810
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
YzlhOWIyY2I4OGYxZTFmNzU3MmJlYjk1YzFmZTYzNjUwMWNiN2E5MDA2MTBi
|
11
|
-
ZjVmOWMyZGFlNzFjNDk0MTRmOThlOGM4OTQwMmY0MjE5MWYzMTM=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MzczNTNkYmJhODc5NTlmNGE1MGZjNjNjOTIzZGQ3Njc4YmI4MzFlMDMyNTE1
|
14
|
-
MjI3ZTgzMWJiZTFjZTc0NmRmNTkyNmJkYzFmNDNiODdiYTMzMWI5NWZhMzAx
|
15
|
-
YmMyMDFlNjgwZWMzMWVkZDM1YzRiZjI3MDEwMzA4ZTk5OTI1MGI=
|
6
|
+
metadata.gz: e11c41eaeacad31d91ee1b5b648e65b49edd9ba656dbbfd0a73c7f6930cc345c56bd47f4c6bf97528b778f1048383cb2061519233bc73cc02334eb3319371068
|
7
|
+
data.tar.gz: 09674ffad2bae4a48799694576d1e9bfe8cf8d9d47c79696044c73f9cc79e9c8fef8b94d44cdbafac859a0f6ff69255942b02a1dd1a3df5965c46e8e8bdb2cc3
|
@@ -0,0 +1,54 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
# init script for hapi
|
3
|
+
# chkconfig: 2345 90 10
|
4
|
+
# description: haproxy-api
|
5
|
+
|
6
|
+
CERT_PATH=/etc/haproxy
|
7
|
+
|
8
|
+
PS=$(ps -A | grep hapi | head -1)
|
9
|
+
RETVAL=0
|
10
|
+
|
11
|
+
start() {
|
12
|
+
if [ -z "$PS" ]; then
|
13
|
+
exec nohup /usr/local/bin/hapi >/var/log/hapi.api 2>&1 &
|
14
|
+
RETVAL=1
|
15
|
+
else
|
16
|
+
echo "hapi was already running."
|
17
|
+
fi
|
18
|
+
}
|
19
|
+
|
20
|
+
stop() {
|
21
|
+
pkill -9 hapi
|
22
|
+
}
|
23
|
+
|
24
|
+
status() {
|
25
|
+
if [ -z "$PS" ]; then
|
26
|
+
echo "hapi not running."
|
27
|
+
RETVAL=1
|
28
|
+
else
|
29
|
+
echo "hapi running."
|
30
|
+
fi
|
31
|
+
}
|
32
|
+
|
33
|
+
case "$1" in
|
34
|
+
start)
|
35
|
+
start
|
36
|
+
;;
|
37
|
+
stop)
|
38
|
+
stop
|
39
|
+
;;
|
40
|
+
status)
|
41
|
+
status
|
42
|
+
;;
|
43
|
+
restart)
|
44
|
+
stop
|
45
|
+
sleep 1
|
46
|
+
start
|
47
|
+
;;
|
48
|
+
*)
|
49
|
+
echo $"Usage: hapi {start|stop|restart|status}"
|
50
|
+
RETVAL=3
|
51
|
+
esac
|
52
|
+
|
53
|
+
exit $RETVAL
|
54
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
if !File.exists('/etc/haproxy/hapi.crt')
|
4
|
+
puts "generating hapi.crt and hapi.key in /etc/haproxy"
|
5
|
+
Dir.chdir '/etc/haproxy'
|
6
|
+
system("openssl req -x509 -newkey rsa:4096 -keyout hapi.key -out hapi.crt -days 365 -nodes -subj \"/C=UT/ST=Sandy /L=Sandy/O=Global Security/OU=IT Department/CN=tooese.com\"")
|
7
|
+
end
|
8
|
+
|
9
|
+
path = File.expand_path(File.dirname(__FILE__))
|
10
|
+
Dir.chdir path
|
11
|
+
|
12
|
+
system("sudo cp haproxy-api_initd /etc/init.d/haproxy-api")
|
13
|
+
system("sudo chkconfig haproxy-api on")
|
14
|
+
system("sudo service haproxy-api start")
|
15
|
+
sleep 1
|
16
|
+
system("sudo service haproxy-api status")
|
17
|
+
|
data/haproxy-api.gemspec
CHANGED
@@ -2,21 +2,19 @@ $:.unshift File.expand_path("../lib", __FILE__)
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'haproxy-api'
|
5
|
-
s.version = '0.1.
|
5
|
+
s.version = '0.1.2'
|
6
6
|
s.license = 'Apache-2.0'
|
7
7
|
s.author = 'Mike Schwankl'
|
8
8
|
s.email = 'schwankl@gmail.com'
|
9
9
|
s.homepage = 'https://github.com/schwankl/haproxy-api'
|
10
10
|
s.description = 'Haproxy API using sinatra'
|
11
11
|
s.summary = 'rest API using to haproxy'
|
12
|
-
s.executables = %(hapi)
|
13
|
-
|
12
|
+
s.executables = %w(hapi install_haproxy-api_initd)
|
14
13
|
s.platform = Gem::Platform::RUBY
|
15
14
|
s.extra_rdoc_files = %w()
|
16
15
|
s.add_dependency('sinatra', '1.4.7')
|
17
16
|
s.add_dependency('webrick', '1.3.1')
|
18
17
|
|
19
|
-
s.bindir = 'bin'
|
20
18
|
s.require_path = 'lib'
|
21
19
|
s.files = %w() + ["haproxy-api.gemspec"] + Dir.glob("lib/**/*") + Dir.glob('bin/**/*')
|
22
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haproxy-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Schwankl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|
@@ -42,10 +42,13 @@ description: Haproxy API using sinatra
|
|
42
42
|
email: schwankl@gmail.com
|
43
43
|
executables:
|
44
44
|
- hapi
|
45
|
+
- install_haproxy-api_initd
|
45
46
|
extensions: []
|
46
47
|
extra_rdoc_files: []
|
47
48
|
files:
|
48
49
|
- bin/hapi
|
50
|
+
- bin/haproxy-api_initd
|
51
|
+
- bin/install_haproxy-api_initd
|
49
52
|
- haproxy-api.gemspec
|
50
53
|
- lib/hapi/application/app.rb
|
51
54
|
homepage: https://github.com/schwankl/haproxy-api
|
@@ -58,12 +61,12 @@ require_paths:
|
|
58
61
|
- lib
|
59
62
|
required_ruby_version: !ruby/object:Gem::Requirement
|
60
63
|
requirements:
|
61
|
-
- -
|
64
|
+
- - ">="
|
62
65
|
- !ruby/object:Gem::Version
|
63
66
|
version: '0'
|
64
67
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
68
|
requirements:
|
66
|
-
- -
|
69
|
+
- - ">="
|
67
70
|
- !ruby/object:Gem::Version
|
68
71
|
version: '0'
|
69
72
|
requirements: []
|