Page MenuHomePhabricator

Install luasocket for all sister projects to use with Scribunto
Closed, DeclinedPublic

Description

Author: gryllida

Description:
Lua code:

  • loads the HTTP module and any libraries it requires local http = require("socket.http")

    local p = {}

    function p.main(frame) r, e = http.request("http://wrong.host/") return e end

    return p

Invoke code:

{{#invoke:Foo|main}}

Expected result:

Returned 'host not found' or some like.

Actual result:

Returned "script error".

Rationale:

Retrieve API URLs contents using Lua, like it is now possible in JS. Note that there wouldn't be a high additional load, since the module would only be loaded when a Lua module is invoked, and only if it has a relevant require() statement.

Version: wmf-deployment
Severity: enhancement

Details

Reference
bz60386

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:59 AM
bzimport set Reference to bz60386.
bzimport added a subscriber: Unknown Object (MLST).

Possibly related:

  • bug 49726
  • bug 48176

(In reply to comment #1)

Please also install a Lua module to parse JSON or XML, either would do.

"Please also" indicates to me the need for additional bug reports.

No, we're not going to allow arbitrary socket connections outgoing from WMF servers during the page parse.

gryllida wrote:

In my understanding the socket connections can be limited to Wikimedia projects only (wikimedia.org/*, wikipedia.org/*, etc). Brad Jorsch, is that considered unsafe?

We don't want to be allowing network fetches during the page parse. Not even bug 49726 is likely to happen.