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