From d6926dea5e4229f515b8162b366f1f06a990f418 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Fri, 17 Mar 2023 20:41:14 +0100 Subject: [PATCH] Support custom instance Signed-off-by: Knut Ahlers --- cli_create.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cli_create.sh b/cli_create.sh index 31f1cdc..ce25bbf 100644 --- a/cli_create.sh +++ b/cli_create.sh @@ -1,6 +1,8 @@ #!/bin/bash set -euo pipefail +: ${INSTANCE:=https://ots.fyi} # Where to reach the API of the instance (omit trailing slash) + deps=(curl jq) for cmd in "${deps[@]}"; do which ${cmd} >/dev/null || { @@ -28,9 +30,9 @@ id=$( -X POST \ -H 'content-type: application/json' \ -d "$(jq --arg secret "${ciphertext}" -cn '{"secret": $secret}')" \ - https://ots.fyi/api/create | + "${INSTANCE}/api/create" | jq -r '.secret_id' ) # Display URL to user -echo -e "Secret is now available at:\nhttps://ots.fyi/#${id}%7C${pass}" +echo -e "Secret is now available at:\n${INSTANCE}/#${id}%7C${pass}"