| index e397699..60cbdb8 100644 | ||
| --- a/plugin.json | ||
| +++ b/plugin.json | ||
| @@ -6,7 +6,7 @@ | ||
| 6 | 6 | "title": "ntfy Push & Pub/Sub Channel Connector", |
| 7 | 7 | "summary": "Zero-dependency ntfy connector with two faces: an MCP tool (ntfy_send) so the agent can push alerts and report summaries to your phone, and a supervised channel daemon that subscribes to a topic's NDJSON stream, holds every unknown sender in a default-deny pairing queue, forwards only approved senders' messages to a SCORPIOX BOT session through POST /inbox, and publishes the agent's newest reply back to the publish topic. Setup, pairing approval and a live daemon log live behind node authentication; TLS verification is fail-closed against a bundled root store with an SPKI pin option for self-hosted relays.", |
| 8 | 8 | "category": "network", |
| 9 | - "version": "1.0.2", | |
| 9 | + "version": "1.0.3", | |
| 10 | 10 | "license": "MIT", |
| 11 | 11 | "kind": "hybrid", |
| 12 | 12 | "mcp": true, |
| index e312a11..16e6bfc 100644 | ||
| --- a/src/plugin_ntfy.c | ||
| +++ b/src/plugin_ntfy.c | ||
| @@ -100,7 +100,7 @@ | ||
| 100 | 100 | |
| 101 | 101 | #define PLUGIN_SLUG "ntfy" |
| 102 | 102 | #define PLUGIN_ID "plugin_ntfy" |
| 103 | -#define PLUGIN_VER "1.0.2" | |
| 103 | +#define PLUGIN_VER "1.0.3" | |
| 104 | 104 | #define SELF_SOURCE_ID "scorpiox-bot-plugin-ntfy" |
| 105 | 105 | |
| 106 | 106 | /* The tag every notification THIS plugin publishes carries. A second, |
| @@ -1942,6 +1942,16 @@ int main(int argc, char **argv) | ||
| 1942 | 1942 | int embed; |
| 1943 | 1943 | int i; |
| 1944 | 1944 | |
| 1945 | +#if defined(_WIN32) | |
| 1946 | + /* Winsock has to be up before ANY mode touches the resolver. It used to | |
| 1947 | + * be started only on the CGI path (and separately for --daemon), so | |
| 1948 | + * `plugin_ntfy.exe --mcp` ran with a cold winsock: getaddrinfo() failed | |
| 1949 | + * straight away and every ntfy_send came back "cannot resolve | |
| 1950 | + * ntfy.sh:443". Verified on a real Windows box -- the MCP face is the | |
| 1951 | + * face an agent actually uses. */ | |
| 1952 | + { WSADATA wsa; WSAStartup(MAKEWORD(2, 2), &wsa); } | |
| 1953 | +#endif | |
| 1954 | + | |
| 1945 | 1955 | for (i = 1; i < argc; i++) { |
| 1946 | 1956 | if (!strcmp(argv[i], "--meta") || !strcmp(argv[i], "-m")) |
| 1947 | 1957 | return mode_meta(); |
| index c7e47a7..adc8813 100755 | ||
| --- a/tests/run.sh | ||
| +++ b/tests/run.sh | ||
| @@ -592,9 +592,28 @@ fi | ||
| 592 | 592 | if [ -f plugin_ntfy.exe ]; then |
| 593 | 593 | MAGIC=$(head -c 2 plugin_ntfy.exe) |
| 594 | 594 | if [ "$MAGIC" = "MZ" ]; then pass "the windows artifact has a PE header"; else fail "plugin_ntfy.exe is not a PE"; fi |
| 595 | +fi | |
| 596 | + | |
| 597 | +# ---------------------------------------------------------------- win32 guards | |
| 598 | +section "windows guards (static)" | |
| 599 | +# Neither of these can be RUN offline, and both have already shipped broken | |
| 600 | +# once, so the source itself carries the assertion. | |
| 601 | +SRC=$(cat src/plugin_ntfy.c) | |
| 602 | +# WSAStartup must sit in main(), before the mode dispatch -- not inside the | |
| 603 | +# CGI branch. It used to live only there, so plugin_ntfy.exe --mcp ran with a | |
| 604 | +# cold winsock and every ntfy_send died at "cannot resolve ntfy.sh:443" on a | |
| 605 | +# real Windows box while --meta looked fine. | |
| 606 | +WSA_MAIN=$(awk '/^int main\(/{f=1} f && /WSAStartup/{print NR; exit}' src/plugin_ntfy.c) | |
| 607 | +DISPATCH=$(awk '/^int main\(/{f=1} f && /mode_mcp\(\)/{print NR; exit}' src/plugin_ntfy.c) | |
| 608 | +if [ -n "$WSA_MAIN" ] && [ -n "$DISPATCH" ] && [ "$WSA_MAIN" -lt "$DISPATCH" ]; then | |
| 609 | + pass "winsock starts in main() before any mode dispatch" | |
| 595 | 610 | else |
| 596 | - printf ' (plugin_ntfy.exe not built here - covered by the dist publish)\n' | |
| 611 | + fail "winsock must be started in main() before the mode dispatch" | |
| 597 | 612 | fi |
| 613 | +check "the --mcp face is dispatched from main, not only the env" 'if (!strcmp(argv[i], "--mcp"))' "$SRC" | |
| 614 | +# stdout must be binary on Windows: text mode turns our \n into \r\n and | |
| 615 | +# double-terminates the CGI headers. | |
| 616 | +check "_setmode(_fileno(stdout), _O_BINARY) on the windows path" '_O_BINARY' "$SRC" | |
| 598 | 617 | |
| 599 | 618 | # ---------------------------------------------------------------- secrets |
| 600 | 619 | section "git history secret audit" |
| 601 | 620 |
| index e397699..60cbdb8 100644 | index e397699..60cbdb8 100644 | ||
| --- a/plugin.json | --- a/plugin.json | ||
| +++ b/plugin.json | +++ b/plugin.json | ||
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | "title": "ntfy Push & Pub/Sub Channel Connector", | 6 | "title": "ntfy Push & Pub/Sub Channel Connector", |
| 7 | "summary": "Zero-dependency ntfy connector with two faces: an MCP tool (ntfy_send) so the agent can push alerts and report summaries to your phone, and a supervised channel daemon that subscribes to a topic's NDJSON stream, holds every unknown sender in a default-deny pairing queue, forwards only approved senders' messages to a SCORPIOX BOT session through POST /inbox, and publishes the agent's newest reply back to the publish topic. Setup, pairing approval and a live daemon log live behind node authentication; TLS verification is fail-closed against a bundled root store with an SPKI pin option for self-hosted relays.", | 7 | "summary": "Zero-dependency ntfy connector with two faces: an MCP tool (ntfy_send) so the agent can push alerts and report summaries to your phone, and a supervised channel daemon that subscribes to a topic's NDJSON stream, holds every unknown sender in a default-deny pairing queue, forwards only approved senders' messages to a SCORPIOX BOT session through POST /inbox, and publishes the agent's newest reply back to the publish topic. Setup, pairing approval and a live daemon log live behind node authentication; TLS verification is fail-closed against a bundled root store with an SPKI pin option for self-hosted relays.", |
| 8 | "category": "network", | 8 | "category": "network", |
| 9 | - "version": "1.0.2", | 9 | + "version": "1.0.3", |
| 10 | "license": "MIT", | 10 | "license": "MIT", |
| 11 | "kind": "hybrid", | 11 | "kind": "hybrid", |
| 12 | "mcp": true, | 12 | "mcp": true, |
| index e312a11..16e6bfc 100644 | index e312a11..16e6bfc 100644 | ||
| --- a/src/plugin_ntfy.c | --- a/src/plugin_ntfy.c | ||
| +++ b/src/plugin_ntfy.c | +++ b/src/plugin_ntfy.c | ||
| @@ -100,7 +100,7 @@ | @@ -100,7 +100,7 @@ | ||
| 100 | 100 | ||
| 101 | #define PLUGIN_SLUG "ntfy" | 101 | #define PLUGIN_SLUG "ntfy" |
| 102 | #define PLUGIN_ID "plugin_ntfy" | 102 | #define PLUGIN_ID "plugin_ntfy" |
| 103 | -#define PLUGIN_VER "1.0.2" | 103 | +#define PLUGIN_VER "1.0.3" |
| 104 | #define SELF_SOURCE_ID "scorpiox-bot-plugin-ntfy" | 104 | #define SELF_SOURCE_ID "scorpiox-bot-plugin-ntfy" |
| 105 | 105 | ||
| 106 | /* The tag every notification THIS plugin publishes carries. A second, | 106 | /* The tag every notification THIS plugin publishes carries. A second, |
| @@ -1942,6 +1942,16 @@ int main(int argc, char **argv) | @@ -1942,6 +1942,16 @@ int main(int argc, char **argv) | ||
| 1942 | int embed; | 1942 | int embed; |
| 1943 | int i; | 1943 | int i; |
| 1944 | 1944 | ||
| 1945 | +#if defined(_WIN32) | ||
| 1946 | + /* Winsock has to be up before ANY mode touches the resolver. It used to | ||
| 1947 | + * be started only on the CGI path (and separately for --daemon), so | ||
| 1948 | + * `plugin_ntfy.exe --mcp` ran with a cold winsock: getaddrinfo() failed | ||
| 1949 | + * straight away and every ntfy_send came back "cannot resolve | ||
| 1950 | + * ntfy.sh:443". Verified on a real Windows box -- the MCP face is the | ||
| 1951 | + * face an agent actually uses. */ | ||
| 1952 | + { WSADATA wsa; WSAStartup(MAKEWORD(2, 2), &wsa); } | ||
| 1953 | +#endif | ||
| 1954 | + | ||
| 1945 | for (i = 1; i < argc; i++) { | 1955 | for (i = 1; i < argc; i++) { |
| 1946 | if (!strcmp(argv[i], "--meta") || !strcmp(argv[i], "-m")) | 1956 | if (!strcmp(argv[i], "--meta") || !strcmp(argv[i], "-m")) |
| 1947 | return mode_meta(); | 1957 | return mode_meta(); |
| index c7e47a7..adc8813 100755 | index c7e47a7..adc8813 100755 | ||
| --- a/tests/run.sh | --- a/tests/run.sh | ||
| +++ b/tests/run.sh | +++ b/tests/run.sh | ||
| @@ -592,9 +592,28 @@ fi | @@ -592,9 +592,28 @@ fi | ||
| 592 | if [ -f plugin_ntfy.exe ]; then | 592 | if [ -f plugin_ntfy.exe ]; then |
| 593 | MAGIC=$(head -c 2 plugin_ntfy.exe) | 593 | MAGIC=$(head -c 2 plugin_ntfy.exe) |
| 594 | if [ "$MAGIC" = "MZ" ]; then pass "the windows artifact has a PE header"; else fail "plugin_ntfy.exe is not a PE"; fi | 594 | if [ "$MAGIC" = "MZ" ]; then pass "the windows artifact has a PE header"; else fail "plugin_ntfy.exe is not a PE"; fi |
| 595 | +fi | ||
| 596 | + | ||
| 597 | +# ---------------------------------------------------------------- win32 guards | ||
| 598 | +section "windows guards (static)" | ||
| 599 | +# Neither of these can be RUN offline, and both have already shipped broken | ||
| 600 | +# once, so the source itself carries the assertion. | ||
| 601 | +SRC=$(cat src/plugin_ntfy.c) | ||
| 602 | +# WSAStartup must sit in main(), before the mode dispatch -- not inside the | ||
| 603 | +# CGI branch. It used to live only there, so plugin_ntfy.exe --mcp ran with a | ||
| 604 | +# cold winsock and every ntfy_send died at "cannot resolve ntfy.sh:443" on a | ||
| 605 | +# real Windows box while --meta looked fine. | ||
| 606 | +WSA_MAIN=$(awk '/^int main\(/{f=1} f && /WSAStartup/{print NR; exit}' src/plugin_ntfy.c) | ||
| 607 | +DISPATCH=$(awk '/^int main\(/{f=1} f && /mode_mcp\(\)/{print NR; exit}' src/plugin_ntfy.c) | ||
| 608 | +if [ -n "$WSA_MAIN" ] && [ -n "$DISPATCH" ] && [ "$WSA_MAIN" -lt "$DISPATCH" ]; then | ||
| 609 | + pass "winsock starts in main() before any mode dispatch" | ||
| 595 | else | 610 | else |
| 596 | - printf ' (plugin_ntfy.exe not built here - covered by the dist publish)\n' | 611 | + fail "winsock must be started in main() before the mode dispatch" |
| 597 | fi | 612 | fi |
| 613 | +check "the --mcp face is dispatched from main, not only the env" 'if (!strcmp(argv[i], "--mcp"))' "$SRC" | ||
| 614 | +# stdout must be binary on Windows: text mode turns our \n into \r\n and | ||
| 615 | +# double-terminates the CGI headers. | ||
| 616 | +check "_setmode(_fileno(stdout), _O_BINARY) on the windows path" '_O_BINARY' "$SRC" | ||
| 598 | 617 | ||
| 599 | # ---------------------------------------------------------------- secrets | 618 | # ---------------------------------------------------------------- secrets |
| 600 | section "git history secret audit" | 619 | section "git history secret audit" |
| 601 | 620 |