added comments on how to set things up, and work around the "overwriting" prompt y/n
[infrastructure.git] / omf / export-omf.sh
1 #!/bin/bash
2 # to be run on {www,boot}.planet-lab.eu where the CERTH key was imported
3 #
4 # (*) initialized gpg with the gpg rings found in /etc/planetlab
5 # ple-www.pl.sophia.inria.fr ~ # ls -ld .gnupg .gnupg/*ring.gpg
6 # drwx------ 2 root root  4096 Jun 17 16:11 .gnupg
7 # -rw------- 1 root root 28357 Jun 17 16:11 .gnupg/pubring.gpg
8 # -rw------- 1 root root 47028 Jun 16 16:43 .gnupg/secring.gpg# 
9 #
10 # (*) used NITOS indications to locate armored key
11 # http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x4646985724FAFE07
12 #
13 # (*) stored that in /etc/planetlab/Nitlab.key
14 #
15 # (*) gpg --import /etc/planetlab/Nitlab.key
16 #
17 # (*) signed the snipped version and published it to NITOS
18 #
19 ####################
20 # (*) upon reception of their acknowledgement, which establishes trust
21 # sign and trust the key:
22 # [boot-planet-lab-eu] ~/.gnupg # gpg --edit-key CERTH
23 # gpg (GnuPG) 1.4.7; Copyright (C) 2006 Free Software Foundation, Inc.
24
25 # <snip>
26
27 # Command> sign
28
29 # <snip>
30
31 # Really sign? (y/N) y
32
33 # Command> trust
34
35 # <snip>
36
37 #   1 = I don't know or won't say
38 #   2 = I do NOT trust
39 #   3 = I trust marginally
40 #   4 = I trust fully
41 #   5 = I trust ultimately
42 #   m = back to the main menu
43
44 # Your decision? 5
45 # Do you really want to set this key to ultimate trust? (y/N) y
46
47 # <snip>
48
49 # Command> q
50 # Save changes? (y/N) y
51 # [boot-planet-lab-eu] ~/.gnupg # 
52
53
54 DIRNAME=$(dirname $0)
55
56 cd $DIRNAME
57
58 # refresh the gpg encrypted version of the export file 
59 mv -f EXPORT.nitlab.gpg EXPORT.nitlab.gpg.bak
60 plcsh ./export-omf.py | gpg -r CERTH -e --output EXPORT.nitlab.gpg
61
62 # publish under /var/www/html/download/EXPORT.nitlab
63 cp EXPORT.nitlab.gpg /var/www/html/download/EXPORT.nitlab.gpg