This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
houseofkraft's profile picture

How to post issues to GitHub? [Lua]

Started by houseofkraft, 12 October 2016 - 01:26 PM
houseofkraft #1
Posted 12 October 2016 - 03:26 PM
Hi Guys!

I want to make it so when my OS crashes it will automatically report the error and version to GitHub.

Thanks!

- House
1lann #2
Posted 12 October 2016 - 03:56 PM
You'll need your own (real) server, and write software for the server to do this. Note that anyone can post an issue and abuse through the user you'll set up to post issues on the operating system's user's behalf. Here's a brief outline on what you need to do.

First, you need to authenticate the server. You can do this:
- via OAuth: https://developer.github.com/v3/oauth/
- or with a user token: https://github.com/settings/tokens/new
- or with a password: https://developer.github.com/v3/auth/#basic-authentication

Then you simply call the create issue endpoint:
https://developer.github.com/v3/issues/#create-an-issue
Sewbacca #3
Posted 12 October 2016 - 04:11 PM
I dunno if it would be a great idea, because if a users system crashes often (maybe if it often reboots), then you get hundred of issues.
Also, the user should know that it will be reported.
hbomb79 #4
Posted 12 October 2016 - 08:44 PM
I dunno if it would be a great idea, because if a users system crashes often (maybe if it often reboots), then you get hundred of issues.
Also, the user should know that it will be reported.

Well, you would simply not post the issue if an open issue exists with the same name/error. It is difficult, but effective against repeat automatic bug reports.
Sewbacca #5
Posted 12 October 2016 - 10:23 PM
I dunno if it would be a great idea, because if a users system crashes often (maybe if it often reboots), then you get hundred of issues.
Also, the user should know that it will be reported.

Well, you would simply not post the issue if an open issue exists with the same name/error. It is difficult, but effective against repeat automatic bug reports.

Okay, but what is, if someone edits the code and occur variable errors like error(tostring({}))?
KingofGamesYami #6
Posted 12 October 2016 - 11:09 PM
Okay, but what is, if someone edits the code and occur variable errors like error(tostring({}))?

That's simple. If the MD5 of the file doesn't match, don't post the issue because the user has modified it or are using an older version.
Sewbacca #7
Posted 13 October 2016 - 12:53 PM
Okay, but what is, if someone edits the code and occur variable errors like error(tostring({}))?

That's simple. If the MD5 of the file doesn't match, don't post the issue because the user has modified it or are using an older version.
but then you've to create MD5 hashes form all OS files, and comparing to all versions, existing (He wanted to get all errors from all versions). Reporting the error would take much time.
Admicos #8
Posted 13 October 2016 - 12:55 PM
but then you've to create MD5 hashes form all OS files, and comparing to all versions, existing (He wanted to get all errors from all versions). Reporting the error would take much time.

It would be a single command (under Linux) to md5 all files in a directory, let me check my zsh history for the command.

EDIT: The command is: find . -type f -exec md5sum {} \; > dir.md5
Edited on 13 October 2016 - 10:56 AM
Sewbacca #9
Posted 13 October 2016 - 12:56 PM
but then you've to create MD5 hashes form all OS files, and comparing to all versions, existing (He wanted to get all errors from all versions). Reporting the error would take much time.

It would be a single command (under Linux) to md5 all files in a directory, let me check my zsh history for the command.
A single command which takes some minutes.
Admicos #10
Posted 13 October 2016 - 01:02 PM
A single command which takes some minutes.

It will take minutes if you have gigantic files, but then a CC os probably doesn't have any files that is that large.
Edited on 13 October 2016 - 11:02 AM
Sewbacca #11
Posted 16 October 2016 - 04:55 PM
A single command which takes some minutes.

It will take minutes if you have gigantic files, but then a CC os probably doesn't have any files that is that large.
Also you can hash the native files, delete them (except the md5 hash) and post many bugs.
H4X0RZ #12
Posted 16 October 2016 - 08:19 PM
You don't have to hash anything at all. If someone really wants to mess this up they can claim to have the correct file by submitting the correct md5. They just have to bypass your Lua code and call the API on their own.
Edited on 16 October 2016 - 06:20 PM
KingofGamesYami #13
Posted 16 October 2016 - 09:18 PM
You don't have to hash anything at all. If someone really wants to mess this up they can claim to have the correct file by submitting the correct md5. They just have to bypass your Lua code and call the API on their own.

The idea here is to prevent someone's stupidity from auto-reporting errors they created, not to prevent against malicious intent. We've already established that the github account will be fully accessible by anyone who looks at the code.
H4X0RZ #14
Posted 16 October 2016 - 10:52 PM
You don't have to hash anything at all. If someone really wants to mess this up they can claim to have the correct file by submitting the correct md5. They just have to bypass your Lua code and call the API on their own.

The idea here is to prevent someone's stupidity from auto-reporting errors they created, not to prevent against malicious intent. We've already established that the github account will be fully accessible by anyone who looks at the code.

Oh, okay. I should read the whole post next time. Sorry :/