view · edit · sidebar · attach · print · history

20130624-setup-ydim-debug-ydim-injection

<< | Index | >>


Summary

  • Debug Ydim in local machine and fastpower.

Commits

Index / Status


Debug Ydim injection

ydim-html

  • sbsm
  • rclconf
  • etc/config.rb (not in repo, it is specified with relative path, in doc/index.rbx)
  • etc/ydim-htmld.yml
commit

Check injection in Local

vetoquinol.bbmb.ch (BBMB v2)

etc/config.yml
ydim_config: /path/to/vetoquinol/etc/ydim.yml
ydim_id: 68
etc/ydim.yml
---
user: ydim-inject
private_key: '/home/bbmb/.ssh/id_dsa' (without pass-phrase)
server_url: 'druby://xxx.xxx.x.xxx' => # thinpower
client_url: 'druby://xxx.xxx.x.xxx' => # fastpower

sandoz.bbmb.ch (BBMB v2)

etc/config.yml
ydim_config: /var/www/sandoz.bbmb.ch/etc/ydim.yml
ydim_id: 51
etc/ydim.yml
---
user: ydim-inject
private_key: '/home/bbmb/.ssh/id_dsa' (without pass-phrase)
server_url: 'druby://xxx.xxx.x.xxx' => # thinpower
client_url: 'druby://xxx.xxx.x.xxx' => # fastpower

alloga.bbmb.ch (BBMB v1)

No Configuration.
bbmb.ch (old interface) uses directly SSH command with /var/www/bbmb.ch/etc/id_dsa key as ydim-inject user.
See note below.

globopharm.xmlconv.bbmb.ch (XMLCONV)

sandoz.xmlconv.bbmb.ch (XMLCONV)

xmlconv.yml must have ydim_id and ydim_config in xmlconv.yml.
But, they don't have ydim_id in xmlconv.yml.

xmlconv services connect via BBMB.

Note

xmlcovd and bbmbd are client.

    def ydim_connect(&block)
      config = YDIM::Client::CONFIG
      if(path = XmlConv::CONFIG.ydim_config)
        config.load(path)
      end 
      server = DRbObject.new(nil, config.server_url)
      client = YDIM::Client.new(config)                     # => create client instance (drb)
      key = OpenSSL::PKey::DSA.new(File.read(config.private_key))
      client.login(server, key)
      block.call(client)
    ensure
      client.logout if(client)
    end

Note

BBMB v1 (alloga.bbmb.ch) uses ssh command directly, like this:

src/custom/behavior.rb
    def mail_pdf_bill(billn, time_range, total)
      config = {
        'currency'    =>  'CHF',
        'debitor'     =>  12,
        'description' =>  billn,
        'items'       =>  [
          {
            'time'    =>  Time.now, 
            'text'    =>  time_range.first.strftime('Umsatzbeteiligung %m/%Y'), 
            'unit'    =>  'Auftrag', 
            'quantity'=>  1, 
            'price'   =>  total/1000.0,
          },
        ],
      }

      keypath = File.expand_path('../../etc/id_dsa', File.dirname(__FILE__))
      target = "ydim-inject@192.168.0.36"
      command = '/usr/bin/ruby /usr/bin/ydim-inject'
      IO.popen("ssh -i #{keypath} #{target} #{command}", 'w') { |ch|
        ch.puts(config.to_yaml)
        ch.close
      }
    end

TODO about ydim

  • Write small scrpit for YDIM injection Test.
view · edit · sidebar · attach · print · history
Page last modified on June 24, 2013, at 09:43 AM