3 # If these files exist, assume we are a source install.
4 if [[ -f ..
/share
/known_hosts_drop.ceph.com
&& -f ..
/share
/id_rsa_drop.ceph.com
]]
5 then # running from source install
6 known_hosts
=..
/share
/known_hosts_drop.ceph.com
7 ssh_key
=..
/share
/id_rsa_drop.ceph.com
8 else # running from a pkg install
9 known_hosts
=@datadir@
/known_hosts_drop.ceph.com
10 ssh_key
=@datadir@
/id_rsa_drop.ceph.com
14 echo "Usage: $0 [options] file1 [dir2 ...]
16 Easily upload files or directories to ceph.com for analysis by Ceph
19 Each invocation uploads files or directories to a separate directory
20 with a unique tag. That tag can be passed to a developer or
21 referenced in a bug report (http://tracker.ceph.com/). Once the
22 upload completes, the directory is marked non-readable and
23 non-writeable to prevent access or modification by other users.
26 Basic measures are taken to make posted data be visible only to
27 developers with access to ceph.com infrastructure. However, users
28 should think twice and/or take appropriate precautions before
29 posting potentially sensitive data (for example, logs or data
30 directories that contain Ceph secrets).
33 -d|--description <desc> Description for this post
35 -u|--user <user> User identifier
36 [Default: \`whoami\`@\`hostname -f\`]
37 -r|--remote <user@host> Remote to upload to
38 [Default: postfile@drop.ceph.com]
39 -k|--known_hosts <path> known_hosts file
40 [Default: /usr/share/ceph/known_hosts_drop.ceph.com]
41 -i <path> Ssh identity file
42 [Default: /usr/share/ceph/id_rsa_drop.ceph.com]
43 -h|--help Show this usage information
53 user
="`whoami`@`hostname -f`"
54 remote
="postfile@drop.ceph.com"
56 if [ `uname` = FreeBSD
]; then
57 GETOPT
=/usr
/local
/bin
/getopt
62 ARGS
=$
(${GETOPT} -n "ceph-post-file" -o 'd:u:hk:i:r:' -l "description:,user:,help,known-hosts:,remote:" -- "$@")
104 # this id should be shared
106 echo "$0: upload tag $id"
108 # this is secret goop we add to the directory so that $id is not
109 # enough to find the data using the shared user; only ceph developers
110 # who have access to the server and can read the post directory can
111 # find the uploaded data.
114 # stick the user info in the dir too
115 dir
="${id}_${user}_${nonce}"
121 trap "rm -f -- '$t1' '$t2' '$t3' '$t4'" EXIT
127 echo "$0: user: $user"
131 echo put
$t3 user
>> $t1
133 if [ -n "$description" ]; then
134 echo "$0: description: $description"
138 echo put
$t2 description
>> $t1
141 while [ -n "$*" ]; do
143 echo $0: will upload directory
$1
150 echo $0: will upload
file $1
158 # no UserKnownHostsFile so that we don't try to record the IP hash key
159 # GlobalKnownHostsFile so that we are verifying that this is the real drop.ceph.com
160 # IdentitiesOnly=yes forces sftp to ignore any keys offered by ssh-agent
163 cp "${ssh_key}.pub" "$t4.pub"
165 sftp
-o "IdentityFile=$t4" \
168 -oGlobalKnownHostsFile=$known_hosts \
170 -oIdentitiesOnly=yes \
173 echo "$0: copy the upload id below to share with a dev: