Last modified: 2014-01-24 01:53:54 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T62386, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 60386 - Install luasocket for all sister projects to use with Scribunto
Install luasocket for all sister projects to use with Scribunto
Status: RESOLVED WONTFIX
Product: Wikimedia
Classification: Unclassified
General/Unknown (Other open bugs)
wmf-deployment
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-24 00:34 UTC by Gryllida
Modified: 2014-01-24 01:53 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Gryllida 2014-01-24 00:34:52 UTC
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.
Comment 1 Gryllida 2014-01-24 00:37:11 UTC
Please also install a Lua module to parse JSON or XML, either would do.

Of possible relevance:
- https://www.mediawiki.org/wiki/Extension_talk:Scribunto/Lua_reference_manual#Access_to_MediaWiki_API.3B_access_to_page_text
Comment 2 MZMcBride 2014-01-24 00:42:57 UTC
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.
Comment 4 Brad Jorsch 2014-01-24 01:35:44 UTC
No, we're not going to allow arbitrary socket connections outgoing from WMF servers during the page parse.
Comment 5 Gryllida 2014-01-24 01:48:58 UTC
In my understanding the socket connections can be limited to Wikimedia projects only (wikimedia.org/*, wikipedia.org/*, etc). Brad Jorsch, is that considered unsafe?
Comment 6 Brad Jorsch 2014-01-24 01:53:54 UTC
We don't want to be allowing network fetches during the page parse. Not even bug 49726 is likely to happen.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links