From c0bcd57f8940291f76e59b478eeea7dcfbbb32cb Mon Sep 17 00:00:00 2001 From: thomas Date: Sun, 19 Apr 2026 15:14:13 +0800 Subject: [PATCH 1/7] 2.0.13 --- httpsok.sh | 987 ++--------------------------------------------------- 1 file changed, 35 insertions(+), 952 deletions(-) diff --git a/httpsok.sh b/httpsok.sh index e99f57b..0e578ff 100755 --- a/httpsok.sh +++ b/httpsok.sh @@ -6,998 +6,81 @@ # Try to run "bash -version" to check the version. # Try to visit WIKI to find a solution. -################################################ -NGINX_BIN=nginx -# NGINX_CONFIG=/etc/nginx/nginx.conf -# NGINX_CONFIG_HOME=/etc/nginx -################################################## - -VER=1.18.2 - PROJECT_NAME="httpsok" -PROJECT_ENTRY="httpsok.sh" - +PROJECT_ENTRY="httpsok" PROJECT_HOME="$HOME/.httpsok" -PROJECT_BACKUPS="$HOME/.httpsok/backups" PROJECT_ENTRY_BIN="$PROJECT_HOME/$PROJECT_ENTRY" +VERSION="v2" -PROJECT_TOKEN_FILE="$PROJECT_HOME/token" -HTTPSOK_UUID_FILE="$PROJECT_HOME/uuid" -PROJECT_LOG_FILE="$PROJECT_HOME/$PROJECT_NAME.log" -HTTPSOK_TOKEN="" -HTTPSOK_UUID="" - -HTTPSOK_HOME_URL="https://httpsok.com/" -BASE_API_URL="https://api.httpsok.com/v1/nginx" -SCRIPT_URL="https://get.httpsok.com/" - -latest_code="" -preparse="" -OS="" -NGINX_VERSION="" -MODE="normal" - - -_upper_case() { - tr '[a-z]' '[A-Z]' -} - -_lower_case() { - tr '[A-Z]' '[a-z]' -} - -_startswith() { - _str="$1" - _sub="$2" - echo "$_str" | grep -- "^$_sub" >/dev/null 2>&1 -} - -_endswith() { - _str="$1" - _sub="$2" - echo "$_str" | grep -- "$_sub\$" >/dev/null 2>&1 -} - -_contains() { - _str="$1" - _sub="$2" - echo "$_str" | grep -- "$_sub" >/dev/null 2>&1 -} - -_time() { - date -u "+%s" -} - -_math() { - _m_opts="$@" - printf "%s" "$(($_m_opts))" -} - -_err() { - echo -e "\033[31m$(date +"%F %T") $@\033[0m" 1>&2 -} - -_info() { - echo -e "$(date +"%F %T") $@" 1>&2 -} - -_suc() { - echo -e "\033[32m$(date +"%F %T") $@\033[0m" 1>&2 -} - -_random_md5() { - head -c 32 /dev/urandom | md5sum | awk '{print $1}' -} - -TRACE_ID=$(_random_md5) - -_exists() { - cmd="$1" - if [ -z "$cmd" ]; then - _usage "Usage: _exists cmd" - return 1 - fi - - if eval type type >/dev/null 2>&1; then - eval type "$cmd" >/dev/null 2>&1 - elif command >/dev/null 2>&1; then - command -v "$cmd" >/dev/null 2>&1 - else - which "$cmd" >/dev/null 2>&1 - fi - ret="$?" - return $ret -} - -showWelcome() { - echo - echo -e "\033[1;36mHttpsok make SSL easy. $HTTPSOK_HOME_URL \033[0m" - echo -e "\033[1;36mversion: $VER\033[0m" - echo -e "\033[1;36mTraceID: $TRACE_ID\033[0m" - echo -} _mkdirs() { _dir="$1" if [ ! "$_dir" = "" ]; then if [ ! -d "$_dir" ]; then - mkdir -p "$_dir" && _suc "Create directory $_dir success." + mkdir -p "$_dir" && echo "Create directory $_dir success." fi fi } _initpath() { _mkdirs "$PROJECT_HOME" - _mkdirs "$PROJECT_BACKUPS" -} - -_no_nginx_here(){ - echo - _err "Can’t detected nginx\n" - _err "Please confirm that nginx has been successfully installed on your system" - _detected_is_root_run - echo - echo - exit -} - -_detected_is_root_run(){ - YELLOW='\033[1;33m' - NC='\033[0m' # No Color - if [ "$(id -u)" -ne 0 ]; then - echo -e "${YELLOW}Detected non-root user running, it's recommended to run as root user.${NC}\n" - fi -} - -_init_params() { - - if [ "$OS" != "" ]; then - return 0 - fi - - if [ -f /etc/os-release ]; then - OS=$(grep 'PRETTY_NAME' /etc/os-release | awk -F '=' '{print $2}' | tr -d '"' | head -n 1) - elif [ -f /etc/redhat-release ]; then - OS=$(cat /etc/redhat-release) - elif [ -f /etc/alpine-release ]; then - OS="alpine" - else - _err "Unsupported operating system" - exit 1 - fi - -# NGINX_BIN=nginx - $NGINX_BIN -V > /dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "no nginx in PATH, find the nginx" - pid=$(ps -e | grep nginx | grep -v 'grep' | head -n 1 | awk '{print $1}') - if [ -n "$pid" ]; then - NGINX_BIN=$(readlink -f /proc/"$pid"/exe) - # echo "NGINX_BIN=$NGINX_BIN" - # again to verify - $NGINX_BIN -V > /dev/null 2>&1 - if [ $? -ne 0 ]; then - _no_nginx_here - else - echo "Nginx executable path: $NGINX_BIN" - fi - else - _no_nginx_here - fi - fi - - NGINX_VERSION=$($NGINX_BIN -v 2>&1 | awk -F ': ' '{print $2}' | head -n 1 | head -c 20) - - # user can setting - if [ -z "$NGINX_CONFIG" ]; then - # Use a running nginx first - NGINX_CONFIG=$(ps -eo pid,cmd | grep nginx | grep master | grep '\-c' | awk -F '-c' '{print $2}' | sed 's/ //g') - fi - - # fix the NGINX_CONFIG equals nginx.conf bug - if [ -z "$NGINX_CONFIG" ] || [ "$NGINX_CONFIG" = "nginx.conf" ]; then - NGINX_CONFIG=$($NGINX_BIN -t 2>&1 | grep 'configuration' | head -n 1 | awk -F 'file' '{print $2}' | awk '{print $1}' ) - fi - - if [ -z "$NGINX_CONFIG_HOME" ]; then - NGINX_CONFIG_HOME=$(dirname "$NGINX_CONFIG") - fi - - _init_httpsok_params - - _info "os-name: $OS" - _info "version: $NGINX_VERSION" - _info "nginx-config: $NGINX_CONFIG" - _info "nginx-config-home: $NGINX_CONFIG_HOME" - _info "nginx-bin: $NGINX_BIN" - _info "httpsok-uuid: $HTTPSOK_UUID" - - - if [ "$NGINX_CONFIG_HOME" = "." ]; then - echo "" - echo "" - echo -e "\033[31m获取nginx配置文件失败, 请您根据实际情况,手动设置\033[0m" - echo "" - echo -e "\033[1;36m修改文件 $PROJECT_ENTRY_BIN\033[0m" - echo "" - echo "################################################" - echo "# 配置示例 " - echo "NGINX_CONFIG=/etc/nginx/nginx.conf" - echo "NGINX_CONFIG_HOME=/etc/nginx" - echo "##################################################" - echo "" - exit 0 - fi - - showWelcome } -_init_httpsok_params() { - - if [ "$HTTPSOK_UUID" != "" ]; then - return 0 - fi - - if [ -f "$HTTPSOK_UUID_FILE" ]; then - HTTPSOK_UUID=$(cat "$HTTPSOK_UUID_FILE") - fi - - if [ "$HTTPSOK_UUID" != "" ]; then - # _info "load HTTPSOK_UUID from $HTTPSOK_UUID_FILE: $HTTPSOK_UUID" - return 0 - fi - +_install() { _initpath - if [ -f "/sys/class/dmi/id/product_uuid" ]; then - HTTPSOK_UUID=$(cat /sys/class/dmi/id/product_uuid) - if [ "$HTTPSOK_UUID" != "" ]; then - echo "$HTTPSOK_UUID" > "$HTTPSOK_UUID_FILE" - # _info "save HTTPSOK_UUID from product_uuid to $HTTPSOK_UUID_FILE: $HTTPSOK_UUID" - return 0 - fi - fi - - HTTPSOK_UUID=$(_random_md5) - echo "$HTTPSOK_UUID" > "$HTTPSOK_UUID_FILE" - # _info "save HTTPSOK_UUID to $HTTPSOK_UUID_FILE: $HTTPSOK_UUID" - -} - - -_inithttp() { - - _init_httpsok_params - - _H0="Content-Type: text/plain" - _H1="httpsok-token: $HTTPSOK_TOKEN" - _H2="httpsok-version: $VER" - _H3="os-name: $OS" - _H4="nginx-version: $NGINX_VERSION" - _H5="nginx-config-home: $NGINX_CONFIG_HOME" - _H6="nginx-config: $NGINX_CONFIG" - _H7="trace-id: $TRACE_ID" - _H8="mode: $MODE" - _H9="httpsok-uuid: $HTTPSOK_UUID" -} - -_post() { - _inithttp - url="${BASE_API_URL}$1" - body="$2" - curl -s -X POST -H "$_H0" -H "$_H1" -H "$_H2" -H "$_H3" -H "$_H4" -H "$_H5" -H "$_H6" -H "$_H7" -H "$_H8" -H "$_H9" --data-binary "$body" "$url" -} - -_post2() { - _inithttp - url="${BASE_API_URL}$1" - fiename="$2" - curl -s -X POST -H "$_H0" -H "$_H1" -H "$_H2" -H "$_H3" -H "$_H4" -H "$_H5" -H "$_H6" -H "$_H7" -H "$_H8" -H "$_H9" --data-binary "@$fiename" "$url" -} - -_get() { - _inithttp - url="${BASE_API_URL}$1" - curl -s -H "$_H0" -H "$_H1" -H "$_H2" -H "$_H3" -H "$_H4" -H "$_H5" -H "$_H6" -H "$_H7" -H "$_H8" -H "$_H9" "$url" -} - -_upload() { - _inithttp - url="${BASE_API_URL}/upload?code=$1" - _F1="cert=@\"$2\"" - _F2="certKey=@\"$3\"" - curl -s -X POST -H "Content-Type: multipart/form-data" -H "$_H1" -H "$_H2" -H "$_H3" -H "$_H4" -H "$_H5" -H "$_H6" -H "$_H7" -H "$_H8" -H "$_H9" -F $_F1 -F $_F2 "$url" 2>&1 -} - -_put() { - _inithttp - url="${BASE_API_URL}$1" - body="$2" - curl -s -X PUT -H "$_H0" -H "$_H1" -H "$_H2" -H "$_H3" -H "$_H4" -H "$_H5" -H "$_H6" -H "$_H7" -H "$_H8" -H "$_H9" --data-binary "$body" "$url" -} - -_remote_log() { - type="$1" - code="$2" - msg="$3" - _put "/log/$type?code=$code" "$msg" -} - -_done() { - _t=$(_time) - _get "/done?t=$_t" -} - -_remote_uninstall(){ - _load_token - _t=$(_time) - _get "/uninstall?t=$_t" -} - -_create_file() { - local _code="$1" - local file_path="$2" - if [ ! -e "$file_path" ]; then - dir_path=$(dirname "$file_path") - mkdir -p "$dir_path" - touch "$file_path" - _suc "$_code" "File created: $file_path" - else - # backup the files - if [ -f "$file_path" ]; then - _filename=${file_path##*/} - _date=$(date +"%Y%m%d%H%M%S") - backup_file_path="$PROJECT_BACKUPS/$_filename.$_date" - if [ -f "$backup_file_path" ]; then - _err "$_code" "Backup file already exists: $backup_file_path" - else - mv "$file_path" "$backup_file_path" - _suc "$_code" "Backup the file $file_path to $backup_file_path" - fi - fi - fi -} - -_check() { - depth=$1 - code=$2 - cert_file=$3 - cert_key_file=$4 - url="/check?code=$code" - - if [ $depth -le 0 ]; then - _err "The maximum number of attempts exceeded" + ARCH=$(uname -m) + if [ "$ARCH" == "x86_64" ]; then + ARCH="x86_64" + elif [ "$ARCH" == "aarch64" ]; then + ARCH="aarch64" + elif [ "$ARCH" == "i686" ]; then + ARCH="i686" + elif [ "$ARCH" == "arm64" ]; then + echo "Architecture arm64 is not supported yet, please use aarch64 or x86_64 architecture" + exit 1 else - resp=$(_get "$url") - status=$(echo "$resp" | head -n 1) - case $status in - "1") -# _info "$code $cert_file The new certificate has been updated" - md5_line=$(echo "$resp" | awk 'NR==2') - - cert_file_md5=$(echo $md5_line | awk -F ',' '{print $1}') - cert_key_file_md5=$(echo $md5_line | awk -F ',' '{print $2}') - - tmp_cert_file="/tmp/$code.cer" - tmp_cert_key_file="/tmp/$code.key" - - _get "/cert/$code.cer" > "$tmp_cert_file" && _get "/cert/$code.key" > "$tmp_cert_key_file" - - # md5 check - tmp_cert_md5=$(md5sum "$tmp_cert_file" | awk '{print $1}') - tmp_cert_key_md5=$(md5sum "$tmp_cert_key_file" | awk '{print $1}') - if [ "$cert_file_md5" = "$tmp_cert_md5" ] && [ "$cert_key_file_md5" = "$tmp_cert_key_md5" ]; then - # if local_cert_file not here. need to create the file - _create_file "$code" "$cert_file" && _create_file "$code" "$cert_key_file" - mv "$tmp_cert_file" "$cert_file" && mv "$tmp_cert_key_file" "$cert_key_file" - _suc "$code $cert_file New cert updated(证书更新成功)" - _remote_log "cert-updated-success" "$code" "New cert updated(证书更新成功)" - echo "latest_code $code" - else - _err "$code $cert_file New cert update failed (md5 not match)" - _remote_log "cert-updated-failed" "$code" "New cert update failed (md5 not match): cert_file_md5=$cert_file_md5,tmp_cert_md5=$tmp_cert_md5,cert_key_file_md5=$cert_key_file_md5,tmp_cert_key_md5=$tmp_cert_key_md5" - fi - ;; - "2") - _info "$code $cert_file Processing, please just wait(正在处理中,请稍等)..." - sleep 10 - _check $((depth - 1)) "$code" "$cert_file" "$cert_key_file" - ;; - "3") - _info "$code $cert_file Cert valid(证书有效)" - ;; - "12") - _err "$code $cert_file DNS CNAME invalid(DNS检测不通过)" - ;; - "13") - _err "$code $cert_file code invalid(非法请求)" - ;; - *) - _err "$code $cert_file $resp" - ;; - esac - fi -} - -_save_token() { - _token="$1" - _check_token "$_token" - _initpath - if [ ! "$_token" = "" ]; then - echo "$_token" > "$PROJECT_TOKEN_FILE" - _suc "save token $_token to $PROJECT_TOKEN_FILE" + echo "Unsupported architecture: $ARCH" + exit 1 fi -} - -_load_token() { - if [ "$HTTPSOK_TOKEN" = "" ]; then - HTTPSOK_TOKEN=$(cat "$PROJECT_TOKEN_FILE") - fi -} - -_show_token() { - _load_token - echo -e "Your token is: \033[1;36m$HTTPSOK_TOKEN\033[0m" -} - -_check_token() { - _token="$1" - if [ ! "$_token" = "" ]; then - HTTPSOK_TOKEN="$_token" - fi - if [ "$HTTPSOK_TOKEN" = "" ]; then - _err "httpsok's token can not empty" - exit 4 - fi - _init_params - status=$(_get "/status") - # _info "status >> $status" - if [ "$status" != "ok" ]; then - # echo -e "\033[1;36mTraceID: $TRACE_ID\033[0m" - _err "Invalid token: \033[1;36m$HTTPSOK_TOKEN\033[0m" - _info "Please copy your token from '$HTTPSOK_HOME_URL'" - echo - _err "$status" - exit 4 - fi - return 0 -} - -# Limit the maximum nesting level -_include_max_calls=20 -_include_global_count=0 - -__process_include() { - - # echo "-_include_global_count: $_include_global_count --------------------------------------------------" - # echo Recursive call, degree incremented by one - ((_include_global_count++)) - if [ $_include_global_count -gt $_include_max_calls ]; then - echo "#######################################################" - echo "##### warning: Maximum recursion limit reached." - echo "#######################################################" - cat /dev/stdin - return 0 + SCRIPT_URL="https://cdn.httpsok.com/archive/$VERSION/httpsok-$ARCH-unknown-linux-musl" + FILE_SIZE=$(curl -sI "$SCRIPT_URL" 2>&1 | grep -i "content-length" | awk '{print $2}' | tr -d '\r') + FILE_SIZE_BIN="" + if [ -f "$PROJECT_ENTRY_BIN" ]; then + FILE_SIZE_BIN=$(stat -c %s "$PROJECT_ENTRY_BIN" 2>/dev/null || true) fi - - tmp=$(cat /dev/stdin | awk -v NGINX_CONFIG=">$NGINX_CONFIG:" -v NGINX_CONFIG_HOME="$NGINX_CONFIG_HOME" '{ - - original = $0 - - # Remove leading and trailing whitespace characters from each line - gsub(/^[[:space:]]+|[[:space:]]+$/, "") - sub(/^[\t ]*|[\t ]*$/,"") - - # Ignore the lines at the beginning of the file - if ($0 ~ /^>/) { - print original - next - } - - # Determines if it starts with #, and if it does, ignores it - if ($0 ~ /^#/) { - - # Replace the include in the comment - # gsub("include", "import") - - print original - next - } - - # Determine whether include is included - if ($0 ~ /^include /) { - - # Ignore mime.types - if($0 ~ /mime\.types;/){ - print "#import " original - next - } - - # print "#import " $2 - print "#import " original - - # system("cat " $2) - # print ">> " - - # ls /etc/nginx/conf.d/*.conf | xargs -I {} sed "s|^|{}:|" {} - # system("ls " $2 " | xargs -I {} sed \"s|^|{}:|\" {}") - - # /etc/nginx/conf.d/*.conf; - # Replace ; - gsub(/;/, "") - - # /etc/nginx/conf.d/*.conf - # Resolved to an include file - # print $2 - - # Deal with relative path issues - if (substr($2, 1, 1) != "/") { - $2 = NGINX_CONFIG_HOME "/" $2 - } - - # print "# " original - - # The second way - # find . -maxdepth 1 -print0 | xargs -0 command - # system("find " $2 " -maxdepth 1 -print0 | xargs -0 -I {} sed \"s|^|>{}:|\" {}") - - # just backup - # system("ls -1 " $2 " | xargs -I {} sed \"s|^|>{}:|\" {}") - - # If the last line of the file is not newline, the file will not be parsed correctly - # system("ls -1 " $2 " 2>/dev/null | xargs -I {} cat {} ") - - # Using sh has security implications deprecated - # system("ls -1 " $2 " 2>/dev/null | xargs -I {} sh -c \"cat {} && echo\" ") - - # - # system("ls -1 " $2 " 2>/dev/null | xargs -I {} sed -n \"$p\" {} ") - - # xargs -I {} awk -v FP="{}" "BEGIN{ print \"# include \" FP } {print} END{print ""} " {} - #system("ls -1 " $2 " 2>/dev/null | xargs -I {} awk \" {print} END {print \"\" } \" {} ") - # - # cmd = "ls -1 " $2 " 2>/dev/null | xargs -I {} awk \" {print} END {print \"\\\"\"\n\"\\\"\" } \" {} " - - # cmd = "ls -1 " $2 " 2>/dev/null | xargs -I {} awk \"BEGIN {print \"\"{}\"\" } {print} END {print \n } \" {} " - - # OK Add a newline character to the end of the file - # cmd = "ls -1 " $2 " 2>/dev/null | xargs -I {} awk \" {print} END {print \"\\n\" } \" {} " - - # OK Add a newline character to the end of the file - # cmd = "ls -1 " $2 " 2>/dev/null | xargs -I {} awk '\'' {print} '\'' {} " - - # OK add config file path - #cmd = "ls -1 " $2 " 2>/dev/null | xargs -I GG awk '\'' BEGIN {print \"#included GG;\" } {print} '\'' GG " - #cmd = "ls -1 " $2 " 2>/dev/null | xargs -I {} awk '\'' BEGIN {print \"#included {};\" } {print} '\'' {} " - - cmd = "ls -1 " $2 " 2>/dev/null | xargs -I {} awk '\'' BEGIN {print \"#included-begin {};\" } {print} END{ print \"#included-end {};\" } '\'' {} " - - # print cmd - system(cmd) - print "" - - next - } - - print original - - }' - - ) - - - if echo "$tmp" | grep -v '#' | grep -q "include"; then - # Perform a recursive call - echo "$tmp" | __process_include - else - # End the recursive call - echo "$tmp" - fi -} - - -_preparse() { - _init_params - - - config_text=$($NGINX_BIN -T) - if [ "$?" != "0" ]; then - config_text=$(cat $NGINX_CONFIG | __process_include ) - fi - tmp_name="/tmp/2nLN3ZspTMGifYtO.tmp" - echo "$config_text" > $tmp_name - preparse=$(_post2 "/preparse" "$tmp_name") - rm -rf "$tmp_name" > /dev/null 2>&1 - if [ "$preparse" = "" ]; then - return 4 - fi - return 0 -} - -_upload_certs() { - while read row - do - if [ "$row" = "" ]; then - continue - fi - code=$(echo $row | awk -F ',' '{print $1}') - cert_file=$(echo $row | awk -F ',' '{print $2}') - cert_key_file=$(echo $row | awk -F ',' '{print $3}') - up_status=$(_upload "$code" "$cert_file" "$cert_key_file") - if [ "$up_status" != "ok" ]; then - continue - fi - done <&1) - if [ $? != 0 ]; then - _remote_log "nginx-test-failed" "$latest_code" "$msg" - echo - _err "Nginx test failed(测试失败). \n\n$msg" - else - msg=$($NGINX_BIN -s reload 2>&1) - if [ $? -eq 0 ]; then - _remote_log "nginx-reload-success" "$latest_code" "Nginx reload success(重载成功)." - echo - _suc "Nginx reload success(重载成功)." - else - - # Check if nginx is running - show_msg=$msg - pid=$(ps -e | grep nginx | grep -v 'grep' | head -n 1 | awk '{print $1}') - if [ -z "$pid" ]; then - msg="Nginx is not started(服务未启动). \n\n$msg" - show_msg="\033[33mNginx is not started. You can run \"service nginx start\" to start the Nginx(请重启服务). \033[31m\n\n$show_msg" - fi - - _remote_log "nginx-reload-failed" "$latest_code" "$msg" - echo - _err "Nginx reload failed(重载失败). \n\n$show_msg" - fi - fi - ) -} - -version() { - echo "$PROJECT_ENTRY v$VER" -} - -# Detect profile file if not specified as environment variable -_detect_profile() { - if [ -n "$PROFILE" -a -f "$PROFILE" ]; then - echo "$PROFILE" - return - fi - - DETECTED_PROFILE='' - SHELLTYPE="$(basename "/$SHELL")" - - if [ "$SHELLTYPE" = "bash" ]; then - if [ -f "$HOME/.bashrc" ]; then - DETECTED_PROFILE="$HOME/.bashrc" - elif [ -f "$HOME/.bash_profile" ]; then - DETECTED_PROFILE="$HOME/.bash_profile" - fi - elif [ "$SHELLTYPE" = "zsh" ]; then - DETECTED_PROFILE="$HOME/.zshrc" - fi - - if [ -z "$DETECTED_PROFILE" ]; then - if [ -f "$HOME/.profile" ]; then - DETECTED_PROFILE="$HOME/.profile" - elif [ -f "$HOME/.bashrc" ]; then - DETECTED_PROFILE="$HOME/.bashrc" - elif [ -f "$HOME/.bash_profile" ]; then - DETECTED_PROFILE="$HOME/.bash_profile" - elif [ -f "$HOME/.zshrc" ]; then - DETECTED_PROFILE="$HOME/.zshrc" - fi - fi - - if [ -z "$DETECTED_PROFILE" ]; then - if [ -f "/etc/profile" ]; then - DETECTED_PROFILE="/etc/profile" - fi - fi - echo "$DETECTED_PROFILE" -} - -_tail_c() { - tail -c "$1" 2>/dev/null || tail -"$1"c -} - -_setopt() { - __conf="$1" - __opt="$2" - __sep="$3" - __val="$4" - __end="$5" - if [ -z "$__opt" ]; then - _usage usage: _setopt '"file" "opt" "=" "value" [";"]' + if [ -n "$FILE_SIZE" ] && [ -n "$FILE_SIZE_BIN" ] && [ "$FILE_SIZE" == "$FILE_SIZE_BIN" ]; then + echo "File already exists, skip download." return fi - if [ ! -f "$__conf" ]; then - touch "$__conf" - fi - if [ -n "$(_tail_c 1 <"$__conf")" ]; then - echo >>"$__conf" - fi - - if grep -n "^$__opt$__sep" "$__conf" >/dev/null; then - if _contains "$__val" "&"; then - __val="$(echo "$__val" | sed 's/&/\\&/g')" - fi - if _contains "$__val" "|"; then - __val="$(echo "$__val" | sed 's/|/\\|/g')" - fi - text="$(cat "$__conf")" - printf -- "%s\n" "$text" | sed "s|^$__opt$__sep.*$|$__opt$__sep$__val$__end|" >"$__conf" - - elif grep -n "^#$__opt$__sep" "$__conf" >/dev/null; then - if _contains "$__val" "&"; then - __val="$(echo "$__val" | sed 's/&/\\&/g')" - fi - if _contains "$__val" "|"; then - __val="$(echo "$__val" | sed 's/|/\\|/g')" - fi - text="$(cat "$__conf")" - printf -- "%s\n" "$text" | sed "s|^#$__opt$__sep.*$|$__opt$__sep$__val$__end|" >"$__conf" - - else - echo "$__opt$__sep$__val$__end" >>"$__conf" - fi -} -_install() { - _info "Installing $PROJECT_NAME." - _initpath + echo "Downloading $PROJECT_NAME..." curl -s "$SCRIPT_URL" > "$PROJECT_ENTRY_BIN" && chmod +x "$PROJECT_ENTRY_BIN" if [ -x "$PROJECT_ENTRY_BIN" ] ; then - _suc "Install $PROJECT_NAME complete." + echo "Download $PROJECT_NAME complete." else - _err "Install $PROJECT_NAME failed." + echo "Download $PROJECT_NAME failed." exit 4 fi - installcronjob - installAlais } -installcronjob() { - _CRONTAB="crontab" - - _t=$(_time) - random_minute=$(_math $_t % 60) - random_hour=$(_math $_t % 9 + 9 ) # 9 ~ 17 - - if ! _exists "$_CRONTAB" ; then - _err "$_CRONTAB not exits\ncrontab定时任务不存在,请安装。参考文档:https://httpsok.com/doc/faq/crontab.html \n" - return 4 - fi - - if ! $_CRONTAB -l | grep "$PROJECT_ENTRY" > /dev/null; then - _info "Installing cron job." - if _exists uname && uname -a | grep SunOS >/dev/null; then - _CRONTAB_STDIN="$_CRONTAB --" - else - _CRONTAB_STDIN="$_CRONTAB -" - fi - $_CRONTAB -l | { - cat - echo "$random_minute $random_hour * * * '$PROJECT_ENTRY_BIN' -m -r >> '$PROJECT_LOG_FILE' 2>&1" - } | $_CRONTAB_STDIN - _suc "Install cron job complete." - fi - if [ "$?" != "0" ]; then - _err "Install cron job failed. You can add cronjob by yourself." - _err "Or you can add cronjob by yourself:" - _err "$random_minute $random_hour * * * '$PROJECT_ENTRY_BIN' -m -r >> '$PROJECT_LOG_FILE' 2>&1" - return 1 - fi -} - -installAlais() { - - _envfile="$PROJECT_ENTRY_BIN.env" - echo "alias $PROJECT_ENTRY=\"$PROJECT_ENTRY_BIN\"" > "$_envfile" - - _info "Installing alias" - _profile="$(_detect_profile)" - if [ "$_profile" ]; then - _info "Found profile: $_profile" - _info "Installing alias to '$_profile'" - _setopt "$_profile" ". \"$_envfile\"" - _suc "OK, Close and reopen your terminal to start using $PROJECT_NAME" - else - _err "No profile is found, you will need to go into $PROJECT_HOME to use $PROJECT_NAME" - fi -} - -_uninstall() { - _info "Uninstalling httpsok." - _remote_uninstall - uninstallcronjob - _uninstallalias - if [ -d "$PROJECT_HOME" ]; then - _info "Removing directory $PROJECT_HOME" - rm -rf "$PROJECT_HOME" - fi - _suc "Uninstall httpsok complete." - showWelcome - echo "If your need install httpsok agian. Please see $HTTPSOK_HOME_URL . - -curl -s $SCRIPT_URL | bash -s 'your token' - -" -} - -_uninstallalias() { - _envfile="$PROJECT_ENTRY_BIN.env" - _profile="$(_detect_profile)" - if [ "$_profile" ]; then - _info "Uninstalling alias from: '$_profile'" - text="$(cat "$_profile")" - echo "$text" | sed "s|^.*\"$_envfile\"$||" >"$_profile" - fi -} - -uninstallcronjob() { - _CRONTAB="crontab" - if ! _exists "$_CRONTAB" ; then - _err "$_CRONTAB not exits" - return 4 - fi - cr="$($_CRONTAB -l | grep "$PROJECT_ENTRY")" - if [ "$cr" ]; then - _info "Removing cron job" - if _exists uname && uname -a | grep SunOS >/dev/null; then - $_CRONTAB -l | sed "/$PROJECT_ENTRY/d" | $_CRONTAB -- - else - $_CRONTAB -l | sed "/$PROJECT_ENTRY/d" | $_CRONTAB - - fi - _suc "Remove cron job complete." - fi -} - -_run() { - _load_token - _check_token - if ! _preparse ; then - _err "No SSL certificate was detected(未检测到SSL证书).\n " - _info "Please refer to resolve the issue(查看文档,解决此问题). https://httpsok.com/doc/faq/nossl.html " - echo "" - return 4 - fi - _info "Checking SSL certificate, please wait a moment(证书检测中请稍等...)." - echo - _upload_certs - _check_dns - _check_certs - _reload_nginx - _done - echo "" -} - -_process() { - while [ ${#} -gt 0 ]; do - case "${1}" in - --help | -h) - show_help - return - ;; - --version | -v) - version - return - ;; - --run | -r) - _run - ;; - --setup | -s) - _save_token "$2" - _install - _run - return - ;; - --token | -t) - if [ "$2" ]; then - _save_token "$2" - else - _show_token - fi - return - ;; - --mode | -m) - MODE="crontab" - ;; - --install | -i) - _install - return - ;; - --uninstall | -u) - _uninstall - return - ;; - *) - echo "Unknown parameter : $1 $2" - return 1 - ;; - esac - shift 1 - done +_runing() { + echo "Running $PROJECT_NAME..." + $PROJECT_ENTRY_BIN -s $1 } - show_help() { - echo "Usage: $PROJECT_ENTRY ... [parameters ...] -Commands: - -h, --help Show this help message. - -v, --version Show version info. - -r, --run Run the $PROJECT_NAME - -s, --setup Install and run (Recommend first time use it). - -t, --token Set or show the token. - -m, --mode Mode of normal or crontab. - -i, --install Install $PROJECT_NAME to your system. - -u, --uninstall Uninstall $PROJECT_NAME in your system. -" - showWelcome + echo "Please provide a token to install $PROJECT_NAME." + echo "Usage: $PROJECT_NAME " + echo "Example: $PROJECT_NAME 1234567890" + echo "Please visit https://httpsok.com/ to get a token." + exit 1 } main() { [ -z "$1" ] && show_help && return - if _startswith "$1" '-'; then _process "$@"; else _process --setup "$@"; fi + _install "$@" && _runing "$@" } main "$@" \ No newline at end of file From 1c3a21c1958eba193431aa958d9e7e969036330a Mon Sep 17 00:00:00 2001 From: thomas Date: Sun, 19 Apr 2026 15:17:01 +0800 Subject: [PATCH 2/7] v2.0.13 --- README.en.md | 2 +- README.md | 2 +- README.zh.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.en.md b/README.en.md index 5f9c24c..a58e1c0 100644 --- a/README.en.md +++ b/README.en.md @@ -1,4 +1,4 @@ -

httpsok logo

+

httpsok logo

Gitcode Repo stars diff --git a/README.md b/README.md index 1bdcb27..a6079cb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -

httpsok logo

+

httpsok logo

Gitcode Repo stars diff --git a/README.zh.md b/README.zh.md index 1bdcb27..a6079cb 100644 --- a/README.zh.md +++ b/README.zh.md @@ -1,4 +1,4 @@ -

httpsok logo

+

httpsok logo

Gitcode Repo stars From 847e2e802c6957d089dfa5b8a4bddbf74462f228 Mon Sep 17 00:00:00 2001 From: thomas Date: Wed, 22 Apr 2026 22:13:41 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20nginx=20=E7=89=88?= =?UTF-8?q?=E6=9C=AC=20v1.29.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/demo/compose.yml | 2 +- docker/nginx/Dockerfile | 4 ++-- docker/nginx/Dockerfile-alpine | 4 ++-- docker/nginx/buildx.sh | 4 ++-- docker/nginx/compose.yml | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docker/demo/compose.yml b/docker/demo/compose.yml index 3fd86a6..696bd02 100644 --- a/docker/demo/compose.yml +++ b/docker/demo/compose.yml @@ -2,7 +2,7 @@ services: httpsok-nginx: container_name: httpsok-nginx - image: httpsok/nginx:1.28.0-alpine +# image: httpsok/nginx:1.29.8-alpine # image: httpsok/nginx:1.28.0 ports: - "80:80" diff --git a/docker/nginx/Dockerfile b/docker/nginx/Dockerfile index ea64cbd..cd6fe41 100644 --- a/docker/nginx/Dockerfile +++ b/docker/nginx/Dockerfile @@ -1,8 +1,8 @@ -FROM nginx:1.27.5 +FROM nginx:1.29.8 LABEL maintainer="httpsok.com" \ description="Nginx with HTTPSOK integration" \ - version="1.27.5" + version="1.29.8" ENV HTTPSOK_TOKEN="" diff --git a/docker/nginx/Dockerfile-alpine b/docker/nginx/Dockerfile-alpine index 1f272f0..5242f1a 100644 --- a/docker/nginx/Dockerfile-alpine +++ b/docker/nginx/Dockerfile-alpine @@ -1,8 +1,8 @@ -FROM nginx:1.27.5-alpine +FROM nginx:1.29.8-alpine LABEL maintainer="httpsok.com" \ description="Nginx with HTTPSOK integration" \ - version="1.27.5" + version="1.29.8" ENV HTTPSOK_TOKEN="" diff --git a/docker/nginx/buildx.sh b/docker/nginx/buildx.sh index 5285784..471c281 100644 --- a/docker/nginx/buildx.sh +++ b/docker/nginx/buildx.sh @@ -4,8 +4,8 @@ cd `dirname $0` && pwd echo '开始构建镜像' -docker buildx build --platform linux/amd64,linux/arm64 -t httpsok/nginx:1.27.5-alpine --push -f Dockerfile-alpine . -docker buildx build --platform linux/amd64,linux/arm64 -t httpsok/nginx:1.27.5 --push -f Dockerfile . +docker buildx build --platform linux/amd64,linux/arm64 -t httpsok/nginx:1.29.8 --push -f Dockerfile . +#docker buildx build --platform linux/amd64,linux/arm64 -t httpsok/nginx:1.29.8-alpine -t httpsok/nginx:latest --push -f Dockerfile-alpine . # 本地构建镜像并且测试 # COMPOSE_BAKE=true docker-compose build httpsok-nginx-alpine diff --git a/docker/nginx/compose.yml b/docker/nginx/compose.yml index 7fa2c35..0be771e 100644 --- a/docker/nginx/compose.yml +++ b/docker/nginx/compose.yml @@ -8,7 +8,7 @@ services: # 设置容器名称 container_name: httpsok-nginx-alpine # 镜像 - image: httpsok/nginx:1.27.5-alpine + image: httpsok/nginx:1.29.8-alpine # 端口 ports: - "80:80" @@ -24,7 +24,7 @@ services: - TZ=Asia/Shanghai # 设置TOKEN,从httpsok.com 控制台获取 - HTTPSOK_TOKEN=2JMRIohknAn4pEuzOZCV - - HTTPSOK_DEV=dev.sh +# - HTTPSOK_DEV=dev.sh httpsok-nginx: # 构建 @@ -34,7 +34,7 @@ services: # 设置容器名称 container_name: httpsok-nginx # 镜像 - image: httpsok/nginx:1.27.5 + image: httpsok/nginx:1.29.8 # 端口 ports: - "80:80" @@ -50,4 +50,4 @@ services: - TZ=Asia/Shanghai # 设置TOKEN,从httpsok.com 控制台获取 - HTTPSOK_TOKEN=2JMRIohknAn4pEuzOZCV - - HTTPSOK_DEV=dev.sh \ No newline at end of file +# - HTTPSOK_DEV=dev.sh \ No newline at end of file From 7f47b3e49793603dfdefbcb3edda67bd8b91b2be Mon Sep 17 00:00:00 2001 From: thomas Date: Wed, 22 Apr 2026 22:46:41 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20nginx=20=E7=89=88?= =?UTF-8?q?=E6=9C=AC=20v1.29.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/nginx/buildx.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/nginx/buildx.sh b/docker/nginx/buildx.sh index 471c281..086c518 100644 --- a/docker/nginx/buildx.sh +++ b/docker/nginx/buildx.sh @@ -4,8 +4,8 @@ cd `dirname $0` && pwd echo '开始构建镜像' -docker buildx build --platform linux/amd64,linux/arm64 -t httpsok/nginx:1.29.8 --push -f Dockerfile . -#docker buildx build --platform linux/amd64,linux/arm64 -t httpsok/nginx:1.29.8-alpine -t httpsok/nginx:latest --push -f Dockerfile-alpine . +docker buildx build --platform linux/amd64,linux/arm64 -t httpsok/nginx:1.29.8 -t httpsok/nginx:latest --push -f Dockerfile . +#docker buildx build --platform linux/amd64,linux/arm64 -t httpsok/nginx:1.29.8-alpine --push -f Dockerfile-alpine . # 本地构建镜像并且测试 # COMPOSE_BAKE=true docker-compose build httpsok-nginx-alpine From 675247287cb6d0551c099c7dc6c8021f32c6ca19 Mon Sep 17 00:00:00 2001 From: thomas Date: Thu, 23 Apr 2026 01:16:57 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20nginx=20=E7=89=88?= =?UTF-8?q?=E6=9C=AC=20v1.30.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/demo/compose.yml | 2 +- docker/nginx/Dockerfile | 4 ++-- docker/nginx/Dockerfile-alpine | 4 ++-- docker/nginx/buildx.sh | 4 ++-- docker/nginx/compose.yml | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docker/demo/compose.yml b/docker/demo/compose.yml index 696bd02..d6a4c88 100644 --- a/docker/demo/compose.yml +++ b/docker/demo/compose.yml @@ -2,7 +2,7 @@ services: httpsok-nginx: container_name: httpsok-nginx -# image: httpsok/nginx:1.29.8-alpine +# image: httpsok/nginx:1.30.0-alpine # image: httpsok/nginx:1.28.0 ports: - "80:80" diff --git a/docker/nginx/Dockerfile b/docker/nginx/Dockerfile index cd6fe41..4f63df3 100644 --- a/docker/nginx/Dockerfile +++ b/docker/nginx/Dockerfile @@ -1,8 +1,8 @@ -FROM nginx:1.29.8 +FROM nginx:1.30.0 LABEL maintainer="httpsok.com" \ description="Nginx with HTTPSOK integration" \ - version="1.29.8" + version="1.30.0" ENV HTTPSOK_TOKEN="" diff --git a/docker/nginx/Dockerfile-alpine b/docker/nginx/Dockerfile-alpine index 5242f1a..8b406d9 100644 --- a/docker/nginx/Dockerfile-alpine +++ b/docker/nginx/Dockerfile-alpine @@ -1,8 +1,8 @@ -FROM nginx:1.29.8-alpine +FROM nginx:1.30.0-alpine LABEL maintainer="httpsok.com" \ description="Nginx with HTTPSOK integration" \ - version="1.29.8" + version="1.30.0" ENV HTTPSOK_TOKEN="" diff --git a/docker/nginx/buildx.sh b/docker/nginx/buildx.sh index 086c518..639a5f1 100644 --- a/docker/nginx/buildx.sh +++ b/docker/nginx/buildx.sh @@ -4,8 +4,8 @@ cd `dirname $0` && pwd echo '开始构建镜像' -docker buildx build --platform linux/amd64,linux/arm64 -t httpsok/nginx:1.29.8 -t httpsok/nginx:latest --push -f Dockerfile . -#docker buildx build --platform linux/amd64,linux/arm64 -t httpsok/nginx:1.29.8-alpine --push -f Dockerfile-alpine . +#docker buildx build --platform linux/amd64,linux/arm64 -t httpsok/nginx:1.30.0 -t httpsok/nginx:latest --push -f Dockerfile . +#docker buildx build --platform linux/amd64,linux/arm64 -t httpsok/nginx:1.30.0-alpine --push -f Dockerfile-alpine . # 本地构建镜像并且测试 # COMPOSE_BAKE=true docker-compose build httpsok-nginx-alpine diff --git a/docker/nginx/compose.yml b/docker/nginx/compose.yml index 0be771e..c32b755 100644 --- a/docker/nginx/compose.yml +++ b/docker/nginx/compose.yml @@ -8,7 +8,7 @@ services: # 设置容器名称 container_name: httpsok-nginx-alpine # 镜像 - image: httpsok/nginx:1.29.8-alpine + image: httpsok/nginx:1.30.0-alpine # 端口 ports: - "80:80" @@ -34,7 +34,7 @@ services: # 设置容器名称 container_name: httpsok-nginx # 镜像 - image: httpsok/nginx:1.29.8 + image: httpsok/nginx:1.30.0 # 端口 ports: - "80:80" From 4e09c2c1a3c551377b7c1650bdaba384d57645b8 Mon Sep 17 00:00:00 2001 From: thomas Date: Wed, 20 May 2026 11:18:38 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20nginx=20=E7=89=88?= =?UTF-8?q?=E6=9C=AC=20v1.30.1=20=EF=BC=8C=E8=A7=A3=E5=86=B3=E8=87=B4?= =?UTF-8?q?=E5=91=BD=20BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/demo/compose.yml | 2 +- docker/nginx/Dockerfile | 4 ++-- docker/nginx/Dockerfile-alpine | 4 ++-- docker/nginx/buildx.sh | 4 ++-- docker/nginx/compose.yml | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docker/demo/compose.yml b/docker/demo/compose.yml index d6a4c88..cf299e7 100644 --- a/docker/demo/compose.yml +++ b/docker/demo/compose.yml @@ -2,7 +2,7 @@ services: httpsok-nginx: container_name: httpsok-nginx -# image: httpsok/nginx:1.30.0-alpine + image: httpsok/nginx:1.30.1-alpine # image: httpsok/nginx:1.28.0 ports: - "80:80" diff --git a/docker/nginx/Dockerfile b/docker/nginx/Dockerfile index 4f63df3..731d65d 100644 --- a/docker/nginx/Dockerfile +++ b/docker/nginx/Dockerfile @@ -1,8 +1,8 @@ -FROM nginx:1.30.0 +FROM nginx:1.30.1 LABEL maintainer="httpsok.com" \ description="Nginx with HTTPSOK integration" \ - version="1.30.0" + version="1.30.1" ENV HTTPSOK_TOKEN="" diff --git a/docker/nginx/Dockerfile-alpine b/docker/nginx/Dockerfile-alpine index 8b406d9..3dab203 100644 --- a/docker/nginx/Dockerfile-alpine +++ b/docker/nginx/Dockerfile-alpine @@ -1,8 +1,8 @@ -FROM nginx:1.30.0-alpine +FROM nginx:1.30.1-alpine LABEL maintainer="httpsok.com" \ description="Nginx with HTTPSOK integration" \ - version="1.30.0" + version="1.30.1" ENV HTTPSOK_TOKEN="" diff --git a/docker/nginx/buildx.sh b/docker/nginx/buildx.sh index 639a5f1..d011e93 100644 --- a/docker/nginx/buildx.sh +++ b/docker/nginx/buildx.sh @@ -4,8 +4,8 @@ cd `dirname $0` && pwd echo '开始构建镜像' -#docker buildx build --platform linux/amd64,linux/arm64 -t httpsok/nginx:1.30.0 -t httpsok/nginx:latest --push -f Dockerfile . -#docker buildx build --platform linux/amd64,linux/arm64 -t httpsok/nginx:1.30.0-alpine --push -f Dockerfile-alpine . +#docker buildx build --platform linux/amd64,linux/arm64 -t httpsok/nginx:1.30.1 -t httpsok/nginx:latest --push -f Dockerfile . +#docker buildx build --platform linux/amd64,linux/arm64 -t httpsok/nginx:1.30.1-alpine --push -f Dockerfile-alpine . # 本地构建镜像并且测试 # COMPOSE_BAKE=true docker-compose build httpsok-nginx-alpine diff --git a/docker/nginx/compose.yml b/docker/nginx/compose.yml index c32b755..dccdca1 100644 --- a/docker/nginx/compose.yml +++ b/docker/nginx/compose.yml @@ -8,7 +8,7 @@ services: # 设置容器名称 container_name: httpsok-nginx-alpine # 镜像 - image: httpsok/nginx:1.30.0-alpine + image: httpsok/nginx:1.30.1-alpine # 端口 ports: - "80:80" @@ -34,7 +34,7 @@ services: # 设置容器名称 container_name: httpsok-nginx # 镜像 - image: httpsok/nginx:1.30.0 + image: httpsok/nginx:1.30.1 # 端口 ports: - "80:80" From b0fa6eee50f2a52dac92a26281e402688bdb5202 Mon Sep 17 00:00:00 2001 From: thomas Date: Mon, 25 May 2026 18:57:39 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20nginx=20=E7=89=88?= =?UTF-8?q?=E6=9C=AC=20v1.31.1=20=EF=BC=8C=E8=A7=A3=E5=86=B3=E8=87=B4?= =?UTF-8?q?=E5=91=BD=20BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/demo/compose.yml | 2 +- docker/nginx/Dockerfile | 4 ++-- docker/nginx/Dockerfile-alpine | 4 ++-- docker/nginx/buildx.sh | 4 ++-- docker/nginx/compose.yml | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docker/demo/compose.yml b/docker/demo/compose.yml index cf299e7..5eb22b4 100644 --- a/docker/demo/compose.yml +++ b/docker/demo/compose.yml @@ -2,7 +2,7 @@ services: httpsok-nginx: container_name: httpsok-nginx - image: httpsok/nginx:1.30.1-alpine + image: httpsok/nginx:1.31.1-alpine # image: httpsok/nginx:1.28.0 ports: - "80:80" diff --git a/docker/nginx/Dockerfile b/docker/nginx/Dockerfile index 731d65d..70c0b73 100644 --- a/docker/nginx/Dockerfile +++ b/docker/nginx/Dockerfile @@ -1,8 +1,8 @@ -FROM nginx:1.30.1 +FROM nginx:1.31.1 LABEL maintainer="httpsok.com" \ description="Nginx with HTTPSOK integration" \ - version="1.30.1" + version="1.31.1" ENV HTTPSOK_TOKEN="" diff --git a/docker/nginx/Dockerfile-alpine b/docker/nginx/Dockerfile-alpine index 3dab203..6220486 100644 --- a/docker/nginx/Dockerfile-alpine +++ b/docker/nginx/Dockerfile-alpine @@ -1,8 +1,8 @@ -FROM nginx:1.30.1-alpine +FROM nginx:1.31.1-alpine LABEL maintainer="httpsok.com" \ description="Nginx with HTTPSOK integration" \ - version="1.30.1" + version="1.31.1" ENV HTTPSOK_TOKEN="" diff --git a/docker/nginx/buildx.sh b/docker/nginx/buildx.sh index d011e93..fa7526c 100644 --- a/docker/nginx/buildx.sh +++ b/docker/nginx/buildx.sh @@ -4,8 +4,8 @@ cd `dirname $0` && pwd echo '开始构建镜像' -#docker buildx build --platform linux/amd64,linux/arm64 -t httpsok/nginx:1.30.1 -t httpsok/nginx:latest --push -f Dockerfile . -#docker buildx build --platform linux/amd64,linux/arm64 -t httpsok/nginx:1.30.1-alpine --push -f Dockerfile-alpine . +#docker buildx build --platform linux/amd64,linux/arm64 -t httpsok/nginx:1.31.1 -t httpsok/nginx:latest --push -f Dockerfile . +#docker buildx build --platform linux/amd64,linux/arm64 -t httpsok/nginx:1.31.1-alpine --push -f Dockerfile-alpine . # 本地构建镜像并且测试 # COMPOSE_BAKE=true docker-compose build httpsok-nginx-alpine diff --git a/docker/nginx/compose.yml b/docker/nginx/compose.yml index dccdca1..37b19ad 100644 --- a/docker/nginx/compose.yml +++ b/docker/nginx/compose.yml @@ -8,7 +8,7 @@ services: # 设置容器名称 container_name: httpsok-nginx-alpine # 镜像 - image: httpsok/nginx:1.30.1-alpine + image: httpsok/nginx:1.31.1-alpine # 端口 ports: - "80:80" @@ -34,7 +34,7 @@ services: # 设置容器名称 container_name: httpsok-nginx # 镜像 - image: httpsok/nginx:1.30.1 + image: httpsok/nginx:1.31.1 # 端口 ports: - "80:80"