-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Cloudshark's new API. #8
Conversation
LGTM :) |
@@ -95,7 +101,7 @@ start) | |||
for i in 1 2 3 | |||
do | |||
push_event $EVENT_ID UPLOAD "Uploading capture for ${PATHS[2]} to CloudShark ($i try)..." | |||
JSON_STATUS=`curl --cacert /usr/lib/cdns/cacert.pem -H "Origin: https://appliance.cloudshark.org" -F "capture[upload]=@${DUMP_FILE}.0" https://www.cloudshark.org/captures.json` | |||
JSON_STATUS=`curl --cacert /usr/lib/cdns/cacert.pem --upload-file ${DUMP_FILE}.0 https://www.cloudshark.org/api/v1/${CLOUDSHARK_API_TOKEN}/upload` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need "" around ${DUMP_FILE}.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took a look, and nowhere else in that file is $DUMP_FILE surrounded by double quotes. While I agree it would be safer to do that, this change matches existing usage. Quoting it should probably be a separate commit outside the scope of this pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was in "capture[upload]=@${DUMP_FILE}.0"
@kgoodier can fix this quotes? |
Cloudshark now requires you to create an account and use an API token to upload files. See https://support.cloudshark.org/api/upload.html for more info. The /etc/config/cdns file must now be edited after installation in order to provide an API token.
Updated and added quotes to DUMP_FILE in the curl line. |
Thanks! |
Cloudshark now requires you to create an account and use an API token
to upload files. See https://support.cloudshark.org/api/upload.html
for more info.
The /etc/config/cdns file must now be edited after installation in
order to provide an API token.
Resolves issue #7