summaryrefslogtreecommitdiff
path: root/bin/leap_ca
blob: f999238cb6348e719c92330b94a992e831364629 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/ruby
LEAP_CA_ROOT = File.expand_path('../..', __FILE__)
$:.unshift File.expand_path('lib', LEAP_CA_ROOT)

require 'rubygems'
require 'daemons'
require 'yajl/http_stream'

require 'leap_ca'

puts "Tracking #{Cert.database.root}"
couch = CouchStream.new(Cert.database.root)
changes = CouchChanges.new(couch)
pool = LeapCA::Pool.new(File.expand_path("config/pool.yml", LEAP_CA_ROOT))
pool.fill
Daemons.run_proc('leap_ca.rb') do
  changes.follow do |hash|
    p hash
    if hash[:deleted]
      pool.fill
    end
  end
end