owntracks / gw

Java MIDlet Project that includes Paho library to send MQTT position messages with Choral Greenwich hardware
Eclipse Public License 1.0
10 stars 4 forks source link

External trigger to upgrade #79

Closed jpmens closed 10 years ago

jpmens commented 10 years ago

New configuration parameter:

$set dnsTXT customer.example.com

Every startTime % 3 hours, device will query the DNS at the domain configured as dnsTXT. If the current Midlet version is different from that in the TXT record, an $upgrade will be performed.

jpmens commented 10 years ago

If the setting is not configured, this will not happen.

jpmens commented 10 years ago

The value of the DNS txt record (0.7.95) must be greater than the currently installed Midlet version

ghost commented 10 years ago

Pls note: very low cost plans (Vodafone Global is a notable example) sometimes do not allow connections outside specified hosts (IP lists) thus not allowing generic DNS queries. In this situation you will usually go with numeric IPs only (a private DHCP+DNS server could work but never tested/seen).

jpmens commented 10 years ago

In that case a private (public, on the Internet actually?!?) DHCP server would certainly not work. ;)

ghost commented 10 years ago

Just a trick suggested by Voda in case of legacy applications not easy to be re-configured

ghost commented 10 years ago

Ops sorry "DHCP" is misplaced here obviously

ckrey commented 10 years ago

An alternative would be an http(s)://customer.example.org/gw-version request

jpmens commented 10 years ago

DNS would have been ideal because it's so lightweight, but yes, HTTP sounds good enough. I don't think HTTPS is required, as we're not doing anything secret.

So,

$set versionURI=http://cust.example.com/version

Can you POST the current Midlet version to that? I would then return text/plain with a "1" if $upgrade should be initiated, "0" if not.

Also, please try to set the HTTP User-Agent to GW/<IMEI>.

curl -X POST --user-agent "XXX/12345678901234" -d 0.1.2 http://....
ckrey commented 10 years ago

Done

jpmens commented 10 years ago

Documented in OTAP.