Changeset 1413


Ignore:
Timestamp:
Oct 29, 2008, 12:00:15 AM (15 years ago)
Author:
broder
Message:

In invirt-vnc-client, get certificates from remctl, instead of from
the filesystems

Location:
trunk/packages/invirt-vnc-client/debian
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-vnc-client/debian/changelog

    r1345 r1413  
     1invirt-vnc-client (0.0.4) unstable; urgency=low
     2
     3  * Get certificates from remctl, instead of from the filesystems
     4
     5 -- Evan Broder <broder@mit.edu>  Tue, 28 Oct 2008 23:55:43 -0400
     6
    17invirt-vnc-client (0.0.3) unstable; urgency=low
    28
  • trunk/packages/invirt-vnc-client/debian/invirt-update-vnc-cert

    r1345 r1413  
    1 #!/bin/bash
     1#!/usr/bin/python
    22
    3 if [ "$(ls /etc/invirt/vnc-cert.d)" == "" ]; then
    4     echo "E: No certs in /etc/invirt/vnc-cert.d/" >&2
    5     echo "   Put certificates for all Invirt VNC proxy servers in" >&2
    6     echo "   /etc/invirt/vnc-cert.d, then run this script again" >&2
    7     exit 1
    8 fi
     3from invirt.config import structs as config
     4from subprocess import Popen, call, PIPE
     5import tempfile
     6import os
     7import sys
     8import shutil
    99
    10 TMP_DIR="$(mktemp -d)"
    11 for i in /etc/invirt/vnc-cert.d/*.crt; do
    12     keytool -import -noprompt -alias "$(basename "${i%.crt}")" -file \
    13         "$i" -keystore "$TMP_DIR/trust.store" -storepass "foobar"
    14 done
     10def main():
     11    subprocess.call(['kinit', '-k', 'daemon/%s' % config.web.hostname])
     12   
     13    temp_dir = tempfile.mkdtemp()
     14    keystore = os.path.join(temp_dir, 'trust.store')
     15    for host in config.hosts:
     16        cert = subprocess.Popen(['remctl', config.remote.hostname, 'web',
     17                                 'vnccert', host.hostname],
     18                                stdout=PIPE)
     19        cert.wait()
     20        subprocess.call(['keytool', '-import', '-noprompt', '-alias',
     21                         host.hostname, '-keystore', keystore, '-storepass',
     22                         'foobar'], stdin=cert.stdout)
     23   
     24    subprocess.call(['jar', 'uf', '/usr/share/invirt-vnc-client/VncViewer.jar',
     25                     '-C', temp_dir, 'trust.store'])
     26   
     27    shutil.rmtree(temp_dir)
    1528
    16 jar uf /usr/share/invirt-vnc-client/VncViewer.jar -C "$TMP_DIR" trust.store
    17 
    18 rm -rf "$TMP_DIR"
     29if __name__ == '__main__':
     30    sys.exit(main())
  • trunk/packages/invirt-vnc-client/debian/invirt-vnc-client.dirs

    r1336 r1413  
    1 etc/invirt/vnc-cert.d
    21usr/share/invirt-vnc-client
Note: See TracChangeset for help on using the changeset viewer.