Skip to content

Commit 3f83c44

Browse files
committed
Fix
1 parent 9c6716c commit 3f83c44

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

nginx_proxy_manager_cli.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ TOKEN_FILE="$TOKEN_DIR/token_${NGINX_IP}.txt"
139139

140140
# Set Token duration validity.
141141
TOKEN_EXPIRY="365d"
142+
#TOKEN_EXPIRY="31536000s"
143+
#TOKEN_EXPIRY="1y"
142144

143145
# Default variables (you can adapt)
144146
CACHING_ENABLED=false
@@ -423,9 +425,8 @@ colorize_booleanh() {
423425
# Generate a new API token
424426
generate_token() {
425427

426-
# response=$(curl -s -X POST "$BASE_URL$API_ENDPOINT?expiry=$TOKEN_EXPIRY" \
427-
428-
response=$(curl -s -X POST "$BASE_URL$API_ENDPOINT?expiresIn=$TOKEN_EXPIRY" \
428+
# response=$(curl -s -X POST "$BASE_URL$API_ENDPOINT?expiresIn=$TOKEN_EXPIRY" \
429+
response=$(curl -s -X POST "$BASE_URL$API_ENDPOINT?expiry=$TOKEN_EXPIRY" \
429430
-H "Content-Type: application/json; charset=UTF-8" \
430431
--data-raw "{\"identity\":\"$API_USER\",\"secret\":\"$API_PASS\"}")
431432

@@ -437,8 +438,11 @@ generate_token() {
437438
token=$(echo "$response" | jq -r '.token')
438439
expires=$(echo "$response" | jq -r '.expires')
439440

440-
# Debug
441-
# echo -e "\n $BASE_URL$API_ENDPOINT?expiry=$TOKEN_EXPIRY \n"
441+
## Debug
442+
echo "Request URL: $BASE_URL$API_ENDPOINT?expiry=$TOKEN_EXPIRY"
443+
echo "Request Body: {\"identity\":\"$API_USER\",\"secret\":\"$API_PASS\"}"
444+
echo "Response: $response"
445+
##
442446

443447
if [ "$token" != "null" ]; then
444448
echo "$token" > $TOKEN_FILE

0 commit comments

Comments
 (0)