stelas / GCLog

GCLOG is a lightweight daemon running in the background and constantly reporting your Geiger counter readings to various radiation monitoring websites. With a small footprint and minimal dependencies it is aimed to run on Linux embedded computers.
https://www.gclog.de/
GNU General Public License v3.0
9 stars 1 forks source link

Upload to GCMMap only in https now #2

Open snarkbe opened 5 years ago

snarkbe commented 5 years ago

The upload to gmcmap.com does not work anymore. journalctl shows

Apr 21 09:34:35 pihole gclog[30652]: CPM: 28 (= 1662/60), Timestamp: Sun Apr 21 07:33:35 2019
Apr 21 09:34:36 pihole gclog[30652]: [WARNING] Upload to gmcmap.com failed.

When I try to simulate an upload from command-line, I get:

$ curl -v "www.gmcmap.com/log2.asp?AID=01234&GID=1234567890&CPM=33"
*   Trying 184.168.224.226...
* TCP_NODELAY set
* Connected to www.gmcmap.com (184.168.224.226) port 80 (#0)
> GET /log2.asp?AID=01234&GID=1234567890&CPM=33 HTTP/1.1
> Host: www.gmcmap.com
> User-Agent: curl/7.52.1
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Content-Type: text/html; charset=UTF-8
< Location: https://www.gmcmap.com/log2.asp?AID=01234&GID=1234567890&CPM=33
< Server: Microsoft-IIS/8.0
< X-Powered-By: ASP.NET
< X-Powered-By-Plesk: PleskWin
< Date: Sun, 21 Apr 2019 07:36:56 GMT
< Content-Length: 194
<                                                                                                                                                              <head><title>Document Moved</title></head>
* Curl_http_done: called premature == 0
* Connection #0 to host www.gmcmap.com left intact
<body><h1>Object Moved</h1>This document may be found <a HREF="https://www.gmcmap.com/log2.asp?AID=01234&amp;GID=1234567890&amp;CPM=33">here</a></body>

So it looks like they're now redirecting all requests to https, which is not supported by the code in gclog.c .

snarkbe commented 5 years ago

Other people are discussing vaguely similar issues at the GQ forum

Either the forced upgrade to https was not planned, or they have not measured the consequences.

stelas commented 5 years ago

HTTPS support has been on the todo list for a year now. :(

The easiest way would be to use libcurl instead of the simple TCP client tcpcli.h. But that would break the compatibility with 4MB flash OpenWrt routers.

snarkbe commented 5 years ago

I understand. But if they keep the redirect to https, it won't work anymore for all supported plaftorms, not only for OpenWrt.

stelas commented 5 years ago

I'll see how complex it is to write a wrapper for mbed TLS and integrate it. But that will take a while...

snarkbe commented 5 years ago

While it'll be nice to have https included later, it's not urgent. GQ has reckoned there was an issue at their side:

Sorry guys we are trying to fix the issues. Looks like https problem.