mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 12:42:34 +02:00
refactor: cleanup setup script
This commit is contained in:
parent
9006049d33
commit
e9a8194cf8
1 changed files with 4 additions and 21 deletions
|
@ -21,25 +21,8 @@ fi
|
||||||
|
|
||||||
echo "Using ${DOWNLOAD_TOOL} for downloads"
|
echo "Using ${DOWNLOAD_TOOL} for downloads"
|
||||||
|
|
||||||
# get_default_branch() {
|
|
||||||
# local repo="$1" # Format: owner/repo
|
|
||||||
# local branch
|
|
||||||
|
|
||||||
# if [ "$DOWNLOAD_TOOL" = "curl" ]; then
|
|
||||||
# branch=$(curl -sL "https://api.github.com/repos/${repo}" | grep -o '"default_branch": *"[^"]*"' | cut -d'"' -f4)
|
|
||||||
# elif [ "$DOWNLOAD_TOOL" = "wget" ]; then
|
|
||||||
# branch=$(wget -qO- "https://api.github.com/repos/${repo}" | grep -o '"default_branch": *"[^"]*"' | cut -d'"' -f4)
|
|
||||||
# fi
|
|
||||||
|
|
||||||
# if [ -z "$branch" ]; then
|
|
||||||
# echo "main" # Fallback to 'main' if detection fails
|
|
||||||
# else
|
|
||||||
# echo "$branch"
|
|
||||||
# fi
|
|
||||||
# }
|
|
||||||
|
|
||||||
# Environment variables with defaults
|
# Environment variables with defaults
|
||||||
REPO="yusing/go-proxy"
|
REPO="yusing/godoxy"
|
||||||
BRANCH=${BRANCH:-"main"}
|
BRANCH=${BRANCH:-"main"}
|
||||||
REPO_URL="https://github.com/$REPO"
|
REPO_URL="https://github.com/$REPO"
|
||||||
WIKI_URL="${REPO_URL}/wiki"
|
WIKI_URL="${REPO_URL}/wiki"
|
||||||
|
@ -162,7 +145,7 @@ get_timezone() {
|
||||||
echo "$TIMEZONE"
|
echo "$TIMEZONE"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Warning: could not detect timezone, please set it manually"
|
echo "Warning: could not detect timezone, you may set it manually in ${DOT_ENV_PATH} to have correct time in logs"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,11 +201,11 @@ if [ "$ENABLE_AUTOCERT" == "y" ]; then
|
||||||
ask_while_empty "Enter email for Let's Encrypt: " EMAIL
|
ask_while_empty "Enter email for Let's Encrypt: " EMAIL
|
||||||
|
|
||||||
# ask if using cloudflare
|
# ask if using cloudflare
|
||||||
ask_while_empty "Are you using cloudflare? (y/n): " USE_CLOUDFLARE
|
ask_while_empty "Is cloudflare the current DNS nameserver? (y/n): " USE_CLOUDFLARE
|
||||||
|
|
||||||
# ask for cloudflare api key
|
# ask for cloudflare api key
|
||||||
if [ "$USE_CLOUDFLARE" = "y" ]; then
|
if [ "$USE_CLOUDFLARE" = "y" ]; then
|
||||||
ask_while_empty "Enter cloudflare api key: " CLOUDFLARE_API_KEY
|
ask_while_empty "Enter cloudflare zone api key: " CLOUDFLARE_API_KEY
|
||||||
cat <<EOF >>"$CONFIG_BASE_PATH/$CONFIG_FILE_NAME"
|
cat <<EOF >>"$CONFIG_BASE_PATH/$CONFIG_FILE_NAME"
|
||||||
autocert:
|
autocert:
|
||||||
provider: cloudflare
|
provider: cloudflare
|
||||||
|
|
Loading…
Add table
Reference in a new issue