From 6c61ac5106729e9f78037a6b090e2c75b95c58c7 Mon Sep 17 00:00:00 2001 From: whyour Date: Mon, 26 Aug 2024 00:56:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/Dockerfile | 2 +- shell/api.sh | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 3d719e37..733919a5 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -15,7 +15,7 @@ ARG QL_URL=https://github.com/${QL_MAINTAINER}/qinglong.git ARG QL_BRANCH=develop ENV PNPM_HOME=/root/.local/share/pnpm \ - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.local/share/pnpm:/root/.local/share/pnpm/global/5/node_modules:$PNPM_HOME \ + PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.local/share/pnpm:/root/.local/share/pnpm/global/5/node_modules \ NODE_PATH=/usr/local/bin:/usr/local/pnpm-global/5/node_modules:/usr/local/lib/node_modules:/root/.local/share/pnpm/global/5/node_modules \ LANG=C.UTF-8 \ SHELL=/bin/bash \ diff --git a/shell/api.sh b/shell/api.sh index 22497f8a..c2ff9783 100755 --- a/shell/api.sh +++ b/shell/api.sh @@ -6,12 +6,12 @@ create_token() { if [[ -f $token_file ]]; then token_command="node ${token_file}" fi - token=$(eval "$token_command") + __ql_token__=$(eval "$token_command") } get_token() { if [[ -f $file_auth_token ]]; then - token=$(cat $file_auth_token | jq -r .value) + __ql_token__=$(cat $file_auth_token | jq -r .value) local expiration=$(cat $file_auth_token | jq -r .expiration) local currentTimeStamp=$(date +%s) if [[ $currentTimeStamp -ge $expiration ]]; then @@ -43,7 +43,7 @@ add_cron_api() { local api=$( curl -s --noproxy "*" "http://0.0.0.0:5600/open/crons?t=$currentTimeStamp" \ -H "Accept: application/json" \ - -H "Authorization: Bearer $token" \ + -H "Authorization: Bearer ${__ql_token__}" \ -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" \ -H "Content-Type: application/json;charset=UTF-8" \ -H "Origin: http://0.0.0.0:5700" \ @@ -79,7 +79,7 @@ update_cron_api() { curl -s --noproxy "*" "http://0.0.0.0:5600/open/crons?t=$currentTimeStamp" \ -X 'PUT' \ -H "Accept: application/json" \ - -H "Authorization: Bearer $token" \ + -H "Authorization: Bearer ${__ql_token__}" \ -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" \ -H "Content-Type: application/json;charset=UTF-8" \ -H "Origin: http://0.0.0.0:5700" \ @@ -111,7 +111,7 @@ update_cron_command_api() { curl -s --noproxy "*" "http://0.0.0.0:5600/open/crons?t=$currentTimeStamp" \ -X 'PUT' \ -H "Accept: application/json" \ - -H "Authorization: Bearer $token" \ + -H "Authorization: Bearer ${__ql_token__}" \ -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" \ -H "Content-Type: application/json;charset=UTF-8" \ -H "Origin: http://0.0.0.0:5700" \ @@ -136,7 +136,7 @@ del_cron_api() { curl -s --noproxy "*" "http://0.0.0.0:5600/open/crons?t=$currentTimeStamp" \ -X 'DELETE' \ -H "Accept: application/json" \ - -H "Authorization: Bearer $token" \ + -H "Authorization: Bearer ${__ql_token__}" \ -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" \ -H "Content-Type: application/json;charset=UTF-8" \ -H "Origin: http://0.0.0.0:5700" \ @@ -166,7 +166,7 @@ update_cron() { curl -s --noproxy "*" "http://0.0.0.0:5600/open/crons/status?t=$currentTimeStamp" \ -X 'PUT' \ -H "Accept: application/json" \ - -H "Authorization: Bearer $token" \ + -H "Authorization: Bearer ${__ql_token__}" \ -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" \ -H "Content-Type: application/json;charset=UTF-8" \ -H "Origin: http://0.0.0.0:5700" \ @@ -190,7 +190,7 @@ notify_api() { curl -s --noproxy "*" "http://0.0.0.0:5600/open/system/notify?t=$currentTimeStamp" \ -X 'PUT' \ -H "Accept: application/json" \ - -H "Authorization: Bearer $token" \ + -H "Authorization: Bearer ${__ql_token__}" \ -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" \ -H "Content-Type: application/json;charset=UTF-8" \ -H "Origin: http://0.0.0.0:5700" \ @@ -214,7 +214,7 @@ find_cron_api() { local api=$( curl -s --noproxy "*" "http://0.0.0.0:5600/open/crons/detail?$params&t=$currentTimeStamp" \ -H "Accept: application/json" \ - -H "Authorization: Bearer $token" \ + -H "Authorization: Bearer ${__ql_token__}" \ -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" \ -H "Content-Type: application/json;charset=UTF-8" \ -H "Origin: http://0.0.0.0:5700" \