Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion haproxy_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ async def get_info(request: web.Request):
k8s_status["reachable"] = False

return web.json_response({
"version": 0.3,
"version": 0.4,
Comment thread
oleksandr-nc marked this conversation as resolved.
"docker": True,
"kubernetes": k8s_status,
})
Expand Down
13 changes: 13 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,19 @@ if [ "$NON_ASCII_COUNT" -gt 0 ]; then
exit 1
fi

# Reject characters that break the generated FRP TOML config or get mangled by
# strip_quotes:
# " - terminates the TOML basic string used for metadatas.token
# \ - starts a TOML escape sequence inside that string
# ' - silently stripped from the end of the value by strip_quotes() below
FORBIDDEN_COUNT=$(printf '%s' "$HP_SHARED_KEY" | LC_ALL=C tr -cd "\"\\\\'" | wc -c)
if [ "$FORBIDDEN_COUNT" -gt 0 ]; then
Comment thread
oleksandr-nc marked this conversation as resolved.
echo "ERROR: HP_SHARED_KEY contains a forbidden character."
echo "The following characters are not allowed: double quote (\"), single quote ('), backslash (\\)."
echo "Please choose a password without these characters."
exit 1
fi
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
Comment on lines +135 to +141

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated PR description 👍


# Strip surrounding quotes if user accidentally included them in env vars
HP_SHARED_KEY="$(strip_quotes "$HP_SHARED_KEY")"
export HP_SHARED_KEY
Expand Down
Loading