GitHub PullRequestEvent at 2014-06-08 21:25:11
Repository: minetest
Actor: celeron55
Payload: {"action":"closed","number":490,"pull_request":{"url":"https://api.github.com/repos/minetest/minetest/pulls/490","id":4151061,"html_url":"https://github.com/minetest/minetest/pull/490","diff_url":"https://github.com/minetest/minetest/pull/490.diff","patch_url":"https://github.com/minetest/minetest/pull/490.patch","issue_url":"https://api.github.com/repos/minetest/minetest/issues/490","number":490,"state":"closed","title":"Allow downloading files/requesting urls from Lua","user":{"login":"Jeija","id":1311964,"avatar_url":"https://avatars.githubusercontent.com/u/1311964?","gravatar_id":"d91e17ec3744fdbc10dad3f3649bc17b","url":"https://api.github.com/users/Jeija","html_url":"https://github.com/Jeija","followers_url":"https://api.github.com/users/Jeija/followers","following_url":"https://api.github.com/users/Jeija/following{/other_user}","gists_url":"https://api.github.com/users/Jeija/gists{/gist_id}","starred_url":"https://api.github.com/users/Jeija/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jeija/subscriptions","organizations_url":"https://api.github.com/users/Jeija/orgs","repos_url":"https://api.github.com/users/Jeija/repos","events_url":"https://api.github.com/users/Jeija/events{/privacy}","received_events_url":"https://api.github.com/users/Jeija/received_events","type":"User","site_admin":false},"body":"<h4>Example</h4>\r\n```Lua\r\n\ton_punch = function (pos, node)\r\n\t\tminetest.download_http(\"mesecons.net\", 10, function (result, code)\r\n\t\t\tprint(result)\r\n\t\t\tprint(code)\r\n\t\tend)\r\n\tend\r\n```\r\n\r\n<h4>Use cases</h4>\r\n* Tell user when update for a mod is available\r\n* Share creations with others (Buildings, mesecons microcontroller code snippets)\r\n* Interaction with other servers (Inter-Server Chat, Inter-Server Trade)\r\n* Interface to Real-Life devices (e.g. Mod that notifys server owners e.g. by email or sms)\r\n* There are propably more cases you can think of\r\n\r\n<h4>How it works</h4>\r\nDownloads/Calls are all in seperate threads (CurlFetchThread : SimpleThread)\r\nThe lua function minetest.curl_fetch(url, timeout) starts a thread and returns a handle.\r\nThe handle can be used in data, curlcode = minetest.get_curl_fetch_result(handle)\r\nReturns nil if not finished or data from website and curlcode if succesful.\r\nThe function minetest.download_http(url, timeout, callbackfunction) defined in builtin/misc.lua defines a callback-like interface to be used by mods, by polling the status of the current downloads.\r\nFor some reason the timeout doesn't seem to work on all setups, but as downloads are in a seperate thread anyway, that doesn't really matter anyway.\r\n\r\n<h4>Security</h4>\r\nBeing able to send stuff across the internet likely sounds like a vulnerability. I propose to merge sapier's pull request concerning the safe file opening API, so that mods cannot remotely modify the server's computer. Additionaly, when accessing curl, the server will output something like\r\n```\r\n20:01:32: ACTION[ServerThread]: WARNING: A mod accesses URL 'example.org'. Remove it if you don't trust that site.\r\n```","created_at":"2013-02-14T19:30:57Z","updated_at":"2014-06-08T21:25:10Z","closed_at":"2014-06-08T21:25:10Z","merged_at":null,"merge_commit_sha":null,"assignee":{"login":"kahrl","id":630411,"avatar_url":"https://avatars.githubusercontent.com/u/630411?","gravatar_id":"4bb130c48975dfcbbe358e5033ef7e93","url":"https://api.github.com/users/kahrl","html_url":"https://github.com/kahrl","followers_url":"https://api.github.com/users/kahrl/followers","following_url":"https://api.github.com/users/kahrl/following{/other_user}","gists_url":"https://api.github.com/users/kahrl/gists{/gist_id}","starred_url":"https://api.github.com/users/kahrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kahrl/subscriptions","organizations_url":"https://api.github.com/users/kahrl/orgs","repos_url":"https://api.github.com/users/kahrl/repos","events_url":"https://api.github.com/users/kahrl/events{/privacy}","received_events_url":"https://api.github.com/users/kahrl/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/minetest/minetest/pulls/490/commits","review_comments_url":"https://api.github.com/repos/minetest/minetest/pulls/490/comments","review_comment_url":"https://api.github.com/repos/minetest/minetest/pulls/comments/{number}","comments_url":"https://api.github.com/repos/minetest/minetest/issues/490/comments","statuses_url":"https://api.github.com/repos/minetest/minetest/statuses/983b2be7b68bfa7d9141bd0a5445c99d4bd96716","head":{"label":"Jeija:curl_lua","ref":"curl_lua","sha":"983b2be7b68bfa7d9141bd0a5445c99d4bd96716","user":{"login":"Jeija","id":1311964,"avatar_url":"https://avatars.githubusercontent.com/u/1311964?","gravatar_id":"d91e17ec3744fdbc10dad3f3649bc17b","url":"https://api.github.com/users/Jeija","html_url":"https://github.com/Jeija","followers_url":"https://api.github.com/users/Jeija/followers","following_url":"https://api.github.com/users/Jeija/following{/other_user}","gists_url":"https://api.github.com/users/Jeija/gists{/gist_id}","starred_url":"https://api.github.com/users/Jeija/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jeija/subscriptions","organizations_url":"https://api.github.com/users/Jeija/orgs","repos_url":"https://api.github.com/users/Jeija/repos","events_url":"https://api.github.com/users/Jeija/events{/privacy}","received_events_url":"https://api.github.com/users/Jeija/received_events","type":"User","site_admin":false},"repo":{"id":6373690,"name":"minetest","full_name":"Jeija/minetest","owner":{"login":"Jeija","id":1311964,"avatar_url":"https://avatars.githubusercontent.com/u/1311964?","gravatar_id":"d91e17ec3744fdbc10dad3f3649bc17b","url":"https://api.github.com/users/Jeija","html_url":"https://github.com/Jeija","followers_url":"https://api.github.com/users/Jeija/followers","following_url":"https://api.github.com/users/Jeija/following{/other_user}","gists_url":"https://api.github.com/users/Jeija/gists{/gist_id}","starred_url":"https://api.github.com/users/Jeija/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jeija/subscriptions","organizations_url":"https://api.github.com/users/Jeija/orgs","repos_url":"https://api.github.com/users/Jeija/repos","events_url":"https://api.github.com/users/Jeija/events{/privacy}","received_events_url":"https://api.github.com/users/Jeija/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Jeija/minetest","description":"Minetest-c55, an open source infinite-world block sandbox game with survival and crafting. [also https://github.com/celeron55/minetest_game]","fork":true,"url":"https://api.github.com/repos/Jeija/minetest","forks_url":"https://api.github.com/repos/Jeija/minetest/forks","keys_url":"https://api.github.com/repos/Jeija/minetest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Jeija/minetest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Jeija/minetest/teams","hooks_url":"https://api.github.com/repos/Jeija/minetest/hooks","issue_events_url":"https://api.github.com/repos/Jeija/minetest/issues/events{/number}","events_url":"https://api.github.com/repos/Jeija/minetest/events","assignees_url":"https://api.github.com/repos/Jeija/minetest/assignees{/user}","branches_url":"https://api.github.com/repos/Jeija/minetest/branches{/branch}","tags_url":"https://api.github.com/repos/Jeija/minetest/tags","blobs_url":"https://api.github.com/repos/Jeija/minetest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Jeija/minetest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Jeija/minetest/git/refs{/sha}","trees_url":"https://api.github.com/repos/Jeija/minetest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Jeija/minetest/statuses/{sha}","languages_url":"https://api.github.com/repos/Jeija/minetest/languages","stargazers_url":"https://api.github.com/repos/Jeija/minetest/stargazers","contributors_url":"https://api.github.com/repos/Jeija/minetest/contributors","subscribers_url":"https://api.github.com/repos/Jeija/minetest/subscribers","subscription_url":"https://api.github.com/repos/Jeija/minetest/subscription","commits_url":"https://api.github.com/repos/Jeija/minetest/commits{/sha}","git_commits_url":"https://api.github.com/repos/Jeija/minetest/git/commits{/sha}","comments_url":"https://api.github.com/repos/Jeija/minetest/comments{/number}","issue_comment_url":"https://api.github.com/repos/Jeija/minetest/issues/comments/{number}","contents_url":"https://api.github.com/repos/Jeija/minetest/contents/{+path}","compare_url":"https://api.github.com/repos/Jeija/minetest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Jeija/minetest/merges","archive_url":"https://api.github.com/repos/Jeija/minetest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Jeija/minetest/downloads","issues_url":"https://api.github.com/repos/Jeija/minetest/issues{/number}","pulls_url":"https://api.github.com/repos/Jeija/minetest/pulls{/number}","milestones_url":"https://api.github.com/repos/Jeija/minetest/milestones{/number}","notifications_url":"https://api.github.com/repos/Jeija/minetest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Jeija/minetest/labels{/name}","releases_url":"https://api.github.com/repos/Jeija/minetest/releases{/id}","created_at":"2012-10-24T16:35:11Z","updated_at":"2014-01-11T16:54:13Z","pushed_at":"2013-05-23T05:49:40Z","git_url":"git://github.com/Jeija/minetest.git","ssh_url":"git@github.com:Jeija/minetest.git","clone_url":"https://github.com/Jeija/minetest.git","svn_url":"https://github.com/Jeija/minetest","homepage":"http://minetest.net/","size":18632,"stargazers_count":2,"watchers_count":2,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"minetest:master","ref":"master","sha":"5fefc4bbf6380960f11f0b125fc51b6efdc19e2e","user":{"login":"minetest","id":2624745,"avatar_url":"https://avatars.githubusercontent.com/u/2624745?","gravatar_id":"19a073a2ee67f8deda9da3460b736edc","url":"https://api.github.com/users/minetest","html_url":"https://github.com/minetest","followers_url":"https://api.github.com/users/minetest/followers","following_url":"https://api.github.com/users/minetest/following{/other_user}","gists_url":"https://api.github.com/users/minetest/gists{/gist_id}","starred_url":"https://api.github.com/users/minetest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minetest/subscriptions","organizations_url":"https://api.github.com/users/minetest/orgs","repos_url":"https://api.github.com/users/minetest/repos","events_url":"https://api.github.com/users/minetest/events{/privacy}","received_events_url":"https://api.github.com/users/minetest/received_events","type":"Organization","site_admin":false},"repo":{"id":2168780,"name":"minetest","full_name":"minetest/minetest","owner":{"login":"minetest","id":2624745,"avatar_url":"https://avatars.githubusercontent.com/u/2624745?","gravatar_id":"19a073a2ee67f8deda9da3460b736edc","url":"https://api.github.com/users/minetest","html_url":"https://github.com/minetest","followers_url":"https://api.github.com/users/minetest/followers","following_url":"https://api.github.com/users/minetest/following{/other_user}","gists_url":"https://api.github.com/users/minetest/gists{/gist_id}","starred_url":"https://api.github.com/users/minetest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minetest/subscriptions","organizations_url":"https://api.github.com/users/minetest/orgs","repos_url":"https://api.github.com/users/minetest/repos","events_url":"https://api.github.com/users/minetest/events{/privacy}","received_events_url":"https://api.github.com/users/minetest/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/minetest/minetest","description":"Minetest, an open source infinite-world block sandbox game with survival and crafting. [also https://github.com/minetest/minetest_game]","fork":false,"url":"https://api.github.com/repos/minetest/minetest","forks_url":"https://api.github.com/repos/minetest/minetest/forks","keys_url":"https://api.github.com/repos/minetest/minetest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/minetest/minetest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/minetest/minetest/teams","hooks_url":"https://api.github.com/repos/minetest/minetest/hooks","issue_events_url":"https://api.github.com/repos/minetest/minetest/issues/events{/number}","events_url":"https://api.github.com/repos/minetest/minetest/events","assignees_url":"https://api.github.com/repos/minetest/minetest/assignees{/user}","branches_url":"https://api.github.com/repos/minetest/minetest/branches{/branch}","tags_url":"https://api.github.com/repos/minetest/minetest/tags","blobs_url":"https://api.github.com/repos/minetest/minetest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/minetest/minetest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/minetest/minetest/git/refs{/sha}","trees_url":"https://api.github.com/repos/minetest/minetest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/minetest/minetest/statuses/{sha}","languages_url":"https://api.github.com/repos/minetest/minetest/languages","stargazers_url":"https://api.github.com/repos/minetest/minetest/stargazers","contributors_url":"https://api.github.com/repos/minetest/minetest/contributors","subscribers_url":"https://api.github.com/repos/minetest/minetest/subscribers","subscription_url":"https://api.github.com/repos/minetest/minetest/subscription","commits_url":"https://api.github.com/repos/minetest/minetest/commits{/sha}","git_commits_url":"https://api.github.com/repos/minetest/minetest/git/commits{/sha}","comments_url":"https://api.github.com/repos/minetest/minetest/comments{/number}","issue_comment_url":"https://api.github.com/repos/minetest/minetest/issues/comments/{number}","contents_url":"https://api.github.com/repos/minetest/minetest/contents/{+path}","compare_url":"https://api.github.com/repos/minetest/minetest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/minetest/minetest/merges","archive_url":"https://api.github.com/repos/minetest/minetest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/minetest/minetest/downloads","issues_url":"https://api.github.com/repos/minetest/minetest/issues{/number}","pulls_url":"https://api.github.com/repos/minetest/minetest/pulls{/number}","milestones_url":"https://api.github.com/repos/minetest/minetest/milestones{/number}","notifications_url":"https://api.github.com/repos/minetest/minetest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/minetest/minetest/labels{/name}","releases_url":"https://api.github.com/repos/minetest/minetest/releases{/id}","created_at":"2011-08-07T13:48:36Z","updated_at":"2014-06-08T15:22:12Z","pushed_at":"2014-06-08T09:33:31Z","git_url":"git://github.com/minetest/minetest.git","ssh_url":"git@github.com:minetest/minetest.git","clone_url":"https://github.com/minetest/minetest.git","svn_url":"https://github.com/minetest/minetest","homepage":"http://minetest.net/","size":54761,"stargazers_count":856,"watchers_count":856,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"forks_count":318,"mirror_url":null,"open_issues_count":239,"forks":318,"open_issues":239,"watchers":856,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/minetest/minetest/pulls/490"},"html":{"href":"https://github.com/minetest/minetest/pull/490"},"issue":{"href":"https://api.github.com/repos/minetest/minetest/issues/490"},"comments":{"href":"https://api.github.com/repos/minetest/minetest/issues/490/comments"},"review_comments":{"href":"https://api.github.com/repos/minetest/minetest/pulls/490/comments"},"review_comment":{"href":"https://api.github.com/repos/minetest/minetest/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/minetest/minetest/pulls/490/commits"},"statuses":{"href":"https://api.github.com/repos/minetest/minetest/statuses/983b2be7b68bfa7d9141bd0a5445c99d4bd96716"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":15,"review_comments":0,"commits":1,"additions":216,"deletions":10,"changed_files":6}}