Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ HaRP is configured via several environment variables. Here are the key variables
- **`HP_SHARED_KEY`** (or **`HP_SHARED_KEY_FILE`**)
- **Description:** A secret token used for authentication between services.
- **Requirement:** Must be set at runtime. Use only one of these methods.
- **Important:** Must contain only ASCII characters (a-z, A-Z, 0-9, and common symbols).

- **`NC_INSTANCE_URL`**
- **Description:** The base URL of your Nextcloud instance.
Expand Down
9 changes: 9 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ if [ -z "$HP_SHARED_KEY" ]; then
echo "ERROR: Either HP_SHARED_KEY or HP_SHARED_KEY_FILE must be set."
exit 1
fi

# Validate HP_SHARED_KEY contains only ASCII characters (required by SPOE library)
NON_ASCII_COUNT=$(printf '%s' "$HP_SHARED_KEY" | LC_ALL=C tr -d '\040-\176' | wc -c)
if [ "$NON_ASCII_COUNT" -gt 0 ]; then
echo "ERROR: HP_SHARED_KEY contains non-ASCII characters."
echo "Please use only printable ASCII characters (a-z, A-Z, 0-9, and symbols like !@#\$%^&*...)."
exit 1
fi

export HP_SHARED_KEY

# Check if the required environment variables are set
Expand Down