From 7c843710a5769c132f4d29b427a1b42dbb24bc29 Mon Sep 17 00:00:00 2001 From: Michael Stahnke Date: Tue, 17 Sep 2024 18:22:41 -0500 Subject: [PATCH] chore(cspp): Clean up shell-helpers Remove redundant scripts and clean up the ones left to allow for a development or production URI easily. --- cspp/shell-helpers/api_key_revoke.sh | 9 +++++++++ cspp/shell-helpers/{upload.sh => post.sh} | 12 ++++++++---- cspp/shell-helpers/revoke.sh | 8 -------- 3 files changed, 17 insertions(+), 12 deletions(-) create mode 100755 cspp/shell-helpers/api_key_revoke.sh rename cspp/shell-helpers/{upload.sh => post.sh} (57%) mode change 100644 => 100755 delete mode 100644 cspp/shell-helpers/revoke.sh diff --git a/cspp/shell-helpers/api_key_revoke.sh b/cspp/shell-helpers/api_key_revoke.sh new file mode 100755 index 0000000..0e3936b --- /dev/null +++ b/cspp/shell-helpers/api_key_revoke.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# Development +URI=http://localhost:7171 +# Produciton +# URI=https://cspp.mandatoryfun.dev/upload + +curl -X DELETE -H "X-API-KEY: $API_KEY" $URI + diff --git a/cspp/shell-helpers/upload.sh b/cspp/shell-helpers/post.sh old mode 100644 new mode 100755 similarity index 57% rename from cspp/shell-helpers/upload.sh rename to cspp/shell-helpers/post.sh index 476be65..7cb84ce --- a/cspp/shell-helpers/upload.sh +++ b/cspp/shell-helpers/post.sh @@ -1,6 +1,11 @@ -#curl -X POST -F "image=@/path/to/your/image.jpg" -F "caption=OptionalCaption" http://localhost:8080/upload +#!/usr/bin/env bash + +# Development +URI=http://localhost:7171 +# Produciton +# URI=https://cspp.mandatoryfun.dev/upload + -#file=`ls ~/Desktop/*.png ~/Desktop/*.jpeg |sort -R |tail -1` if [ -z "$1" ]; then echo "Usage: $0 " exit 1 @@ -16,6 +21,5 @@ curl -X POST \ -F "image=@$file" \ -F "caption=$caption" \ -H "X-API-KEY: $API_KEY" \ -http://localhost:7171/upload - +$URI diff --git a/cspp/shell-helpers/revoke.sh b/cspp/shell-helpers/revoke.sh deleted file mode 100644 index cd1bd29..0000000 --- a/cspp/shell-helpers/revoke.sh +++ /dev/null @@ -1,8 +0,0 @@ -#curl -X POST -F "image=@/path/to/your/image.jpg" -F "caption=OptionalCaption" http://localhost:8080/upload - -#file=`ls ~/Desktop/*.png ~/Desktop/*.jpeg |sort -R |tail -1` -#echo $file - -curl -X DELETE -H "X-API-KEY: $API_KEY" http://localhost:7171/api - -