X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Fceph-post-file.in;fp=src%2Fceph%2Fsrc%2Fceph-post-file.in;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=8a88a03bd4c828e9ba0948bec9667f50e497fbbd;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/ceph-post-file.in b/src/ceph/src/ceph-post-file.in deleted file mode 100755 index 8a88a03..0000000 --- a/src/ceph/src/ceph-post-file.in +++ /dev/null @@ -1,176 +0,0 @@ -#!/bin/bash -e - -# If these files exist, assume we are a source install. -if [[ -f ../share/known_hosts_drop.ceph.com && -f ../share/id_rsa_drop.ceph.com ]] - then # running from source install - known_hosts=../share/known_hosts_drop.ceph.com - ssh_key=../share/id_rsa_drop.ceph.com - else # running from a pkg install - known_hosts=@datadir@/known_hosts_drop.ceph.com - ssh_key=@datadir@/id_rsa_drop.ceph.com -fi - -function usage() { - echo "Usage: $0 [options] file1 [dir2 ...] - -Easily upload files or directories to ceph.com for analysis by Ceph -developers. - -Each invocation uploads files or directories to a separate directory -with a unique tag. That tag can be passed to a developer or -referenced in a bug report (http://tracker.ceph.com/). Once the -upload completes, the directory is marked non-readable and -non-writeable to prevent access or modification by other users. - -WARNING: - Basic measures are taken to make posted data be visible only to - developers with access to ceph.com infrastructure. However, users - should think twice and/or take appropriate precautions before - posting potentially sensitive data (for example, logs or data - directories that contain Ceph secrets). - -Options: - -d|--description Description for this post - [Default: none] - -u|--user User identifier - [Default: \`whoami\`@\`hostname -f\`] - -r|--remote Remote to upload to - [Default: postfile@drop.ceph.com] - -k|--known_hosts known_hosts file - [Default: /usr/share/ceph/known_hosts_drop.ceph.com] - -i Ssh identity file - [Default: /usr/share/ceph/id_rsa_drop.ceph.com] - -h|--help Show this usage information -" -} - -if [ -z "$*" ]; then - usage - exit 1 -fi - -description="" -user="`whoami`@`hostname -f`" -remote="postfile@drop.ceph.com" - -if [ `uname` = FreeBSD ]; then - GETOPT=/usr/local/bin/getopt -else - GETOPT=getopt -fi - -ARGS=$(${GETOPT} -n "ceph-post-file" -o 'd:u:hk:i:r:' -l "description:,user:,help,known-hosts:,remote:" -- "$@") -eval set -- $ARGS - -while true; do - echo "args: $@" - case $1 in - -d | --description) - description="$2" - shift - shift - ;; - -u | --user) - user="$2" - shift - shift - ;; - -h | --help) - usage - exit 0 - ;; - -k | --known-hosts) - known_hosts="$2" - shift - shift - ;; - -i) - ssh_key="$2" - shift - shift - ;; - -r | --remote) - remote="$2" - shift - shift - ;; - --) - shift - break - ;; - esac -done - -# this id should be shared -id=`uuidgen` -echo "$0: upload tag $id" - -# this is secret goop we add to the directory so that $id is not -# enough to find the data using the shared user; only ceph developers -# who have access to the server and can read the post directory can -# find the uploaded data. -nonce=`uuidgen` - -# stick the user info in the dir too -dir="${id}_${user}_${nonce}" - -t1=$(mktemp) || exit -t2=$(mktemp) || exit -t3=$(mktemp) || exit -t4=$(mktemp) || exit -trap "rm -f -- '$t1' '$t2' '$t3' '$t4'" EXIT -cat > $t1 < $t3 <> $t1 - -if [ -n "$description" ]; then - echo "$0: description: $description" - cat > $t2 <> $t1 -fi - -while [ -n "$*" ]; do - if [ -d "$1" ]; then - echo $0: will upload directory $1 - bn=`basename "$1"` - cat >> $t1 <> $t1 <