ALTUI : Alternate App Store

Hi,

I’m trying to update one of my published apps, but it stops with “Contacting Server…”. I tried with Edge, Firefox and Chrome. In the console I see the following error:
J_ALTUI_utils.js:1865 Uncaught ReferenceError: options is not defined
at Object. (J_ALTUI_utils.js:1865,40)

This is ALTUI version v1.91.2099.

Update: Just installed ALTUI v1.93.2151 and now it is working.

Cheers Rene

There is currently a problem with AltAppStore being unable to download code from GitHub.

As pointed out in this thread New Install Debian No Handler (thanks @d55m14) GitHub has now switched off access from clients using deprecated weak cryptographic standards. Unfortunately, this hits many systems using OpenSSL and the TLSv1.1 protocol. See Redirecting…

This may be a small issue for AltAppStore on Vera, but it is a major one for openLuup since ALL it’s upgrades (including AltUI and openLuup itself) use GitHub access for updates.

I’m working on a solution, which may require updates to both OpenSSL and LuaSocket/LuaSec libraries, plus a small change to AltAppStore itself. But if anyone has further insight into this, I’d be pleased to hear from them.

Problem identified, and fix being tested.

This will require a one-time manual file install to fix the problem…
…also, perhaps, an update to your openssl installation (should just be a one-liner.)

Vera UI7 Fix only for AltAppStore / GitHub SSL error

AltAppStore has now been updated to fix this problem.

For UI7, the fix is:

[ul][li]Remove the existing plugin device.[/li]
[li]Delete all AltAppStore files: [tt]rm /etc/cmh-ludl/AltAppStore[/tt][/li]
[li]Run the code below (the altappstore_install.lua file) in the Lua Test window[/li]
[li]Reload[/li][/ul]

Here’s the code:

-- first-time download and install ofAltAppStore files from GitHub
-- this code should be run on a Vera in the Lua Test Code window
-- 2016.11.16 @akbooer
-- 2018.02.24 upgrade SSL encryption to tls v1.2 after GitHub deprecation of v1 protocol


local x = os.execute
local p = print

p "AltAppStore_install   2018.02.24   @akbooer"

local https = require "ssl.https"
local ltn12 = require "ltn12"

p "getting latest AltAppStore version tar file from GitHub..."

local _, code = https.request{
  url = "https://codeload.github.com/akbooer/AltAppStore/tar.gz/master",
  sink = ltn12.sink.file(io.open("/tmp/altappstore.tar.gz", "wb")),
  protocol = "tlsv1_2",
}

assert (code == 200, "GitHub download failed with code " .. code)
  
p "un-zipping download files..."

x "tar -xz -f /tmp/altappstore.tar.gz -C /etc/cmh-ludl/" 
x "mv /etc/cmh-ludl/AltAppStore-master/*_* /etc/cmh-ludl/"

p "creating AltAppStore plugin device"

local s,c = luup.inet.wget (table.concat {
    "http://127.0.0.1:3480/data_request?id=action",
    "&output_format=json",
    "&DeviceNum=0",
    "&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1",
    "&action=CreateDevice",
    "&Description=AltAppStore",
    "&UpnpDevFilename=D_AltAppStore.xml",
    "&UpnpImplFilename=I_AltAppStore.xml",
    "&RoomNum=0",
    "&Reload=1",
  })

p ("status = " .. (s or '?'))
p ("response = " .. (c or '?'))
p "done!"

-----

And here’s the response that you should get (if you ran this under AltUI, otherwise you won’t see the print output.)

AltAppStore_install   2018.02.24   @akbooer
getting latest AltAppStore version tar file from GitHub...
un-zipping download files...
creating AltAppStore plugin device
status = 0
response = { "u:CreateDeviceResponse": { "DeviceNum": "145" } }
done!

I’ve tested this on a Vera Edge and used AltAppStore to install a new plugin successfully.

Unfortunately, UI5 does not have a recent enough default openssl library (I think, or possibly LuaSocket / LuaSec) to allow the required tls v1.2 protocol to work. There may be a fix, but I haven’t found it yet.

[tt]openLuup Fix only for AltAppStore / GitHub SSL error[/tt]

AltAppStore has now been updated to fix this problem.

For openLuup (on a RPi), the fix requires both an update to openssl and openLuup itself.

1) Log in to RPi and update openssl (if necessary):

pi@raspberrypi:~ $ openssl version
OpenSSL 1.0.1k 8 Jan 2015

pi@raspberrypi:~ $ sudo apt-get update

pi@raspberrypi:~ $ sudo apt-get install openssl
Reading package lists... Done
[...]
Setting up openssl (1.0.1t-1+deb8u7) ...

pi@raspberrypi:~ $ openssl version
OpenSSL 1.0.1t  3 May 2016 (Library: OpenSSL 1.0.1k 8 Jan 2015)

2) update openLuup’s AltAppStore:

Replace the openLuup/L_AltAppStore.lua file with the attached file.
Then reload openLuup from the AltUI menu.

I’m still struggling with doing the same for BeagleBone Black and Mac, but the RPi approach above should cover the majority of cases. Windows 10 seems OK.

Hi akbooer,

I followed your instructions for a Debian system (v 8) and all is ok !! tnks tnks

In my case having already installed openluup I executed :

http://openLuupIP:3480/data_request?id=altui

But can you remember me how can I define the DY parameters (daemons, local_dir, destinations, config_dir, etc.) if I haven’t ALTUI installed ?

tnks again

donato

Thanks for that. BTW, you might want to update openLuup just once more to the latest development branch, I found a bug in VeraBridge! :frowning:

Karma to you, for spotting this AltAppStore error and reporting it, so that it could be fixed in a timely way.

For your DataYours question, could you start a new thread in the Datamine/DataYours board for this, as it’s really nothing at all to do with this thread.

Thanks

ok akbooer,

I’ll update openluup with the development branch.

ok for the DY question too.

tnks

interesting. My OpenSSL version on ubuntu was already 1.02g

@akbooer

On a Vera 3:

[string "ALTUI - LuaRunHandler"]:23: GitHub download failed with code invalid protocol

AltAppStore_install 2018.02.24 @akbooer getting latest AltAppStore version tar file from GitHub...

@akbooer

On openLuup:

Ran this ‘openssl version’ and got this ‘OpenSSL 1.0.1t 3 May 2016’ - so presumably no need to continue with the openSSL update.

[s]Then copied L_AltAppStore.lua to /etc/cmh-ludl/openLuup/ there was no existing file there already - does it delete its self. Did the openLuup restart. After a browser refresh AppStore version shows: v16.11.23

This doesn’t sound right? Console shows this:[/s] FIXED - my mistake.

2018-02-25 17:01:53.987 openLuup.userdata:: ...scene loading completed 2018-02-25 17:01:53.987 openLuup.userdata:: loading installed plugin info... 2018-02-25 17:01:53.988 openLuup.userdata:: [openLuup] openLuup (17.7.17) 2018-02-25 17:01:53.989 openLuup.userdata:: [8246] Alternate UI (GitHub.2305) 2018-02-25 17:01:53.989 openLuup.userdata:: [AltAppStore] Alternate App Store (16.11.23) 2018-02-25 17:01:53.989 openLuup.userdata:: [VeraBridge] VeraBridge (17.5.10)

Depends a bit of the history of your openLuup installation. It’s possible that there’s another (old) version of the file somewhere, perhaps in cmh-ludl, or cmh-lu? Find it. Delete it.

Yes, your OpenSSL version looks fine. This obviously depends on the vintage of your operating system.

When it works, I’d suggest you update to the latest development version of openLuup.

@akbooer - any update on this one:

http://forum.micasaverde.com/index.php/topic,38102.msg352506.html#msg352506

This looks like the same as my VeraLites. What is your OpenSSL version?

openssl version

I get 1.0.0d :frowning:

I have tried to update this on one machine, where it’s now 1.0.1l, but I don’t know if this is good enough. I’ll check later today.

Bit of confusion here: one post relates to openLuup; that’s fixed. Other post relate to a Vera 3; that’s not working.

No confusion at this end, I hope. Your message…

[quote=“a-lurker, post:50, topic:192721”]@akbooer

On a Vera 3:

[string "ALTUI - LuaRunHandler"]:23: GitHub download failed with code invalid protocol

AltAppStore_install 2018.02.24 @akbooer getting latest AltAppStore version tar file from GitHub...[/quote]

…was what I was responding to in my previous post:

This looks like the same as my VeraLites. What is your OpenSSL version?

The reason that AltAppStore doesn’t work on your Vera 3 is because OpenSSL / LuaSocket libraries are not up to date. That same issue breaks luup.inet.wget doing https on a Vera 3.

How does the icon image in the AltUI plugin page on openLuup get updated? I initially published a plugin with an incorrect image location. This has since been corrected, but the image on that page still has the old link. I can use the update button to get new plugin code - so the plugin itself is getting updated correctly. The only issue is with the icon on the plugin page in AltUI.

thanks

[quote=“jswim788, post:57, topic:192721”]How does the icon image in the AltUI plugin page on openLuup get updated? I initially published a plugin with an incorrect image location. This has since been corrected, but the image on that page still has the old link. I can use the update button to get new plugin code - so the plugin itself is getting updated correctly. The only issue is with the icon on the plugin page in AltUI.

thanks[/quote]
Did you clear the browser cache ?
Otherwise give the plugin reference and proper icon path that you expect and we can take a look at the dB.

If it’s not too much inconvenience, can you delete the plugin with the X on the Plugins page and reload it (presumably from the AltAppStore, where you got it in the first place?)

Let me know how that goes.

I wasn’t happy about deleting the plugin since I have some setup with it including several data pushes. But I realized that it is the “Icon” field in the user_data.json that is not updated. So I just stopped openLuup, edited the file, and now it is fine. I think if I deleted and reinstalled the plugin I would have achieved the same result. When a plugin is updated, probably the plugin files get updated, but maybe not this “Icon” field?