Bug Reporting
#1
Posted 31 August 2014 - 03:37 AM
I have implemented a log file system which writes to a log file, But in the event of an error I would like the system to send the log file to an email or something similar, I thought maybe pastebin but I wont know what IDs they are, Is there a way of using githubs issue section here through a computer script???
-Thanks - Harry
#3
Posted 31 August 2014 - 04:35 AM
#4
Posted 31 August 2014 - 04:57 AM
#5
Posted 31 August 2014 - 05:41 AM
#6
Posted 31 August 2014 - 05:52 AM
natedogith1, on 31 August 2014 - 05:41 AM, said:
My problem is I have zero understanding of whats discussed in the links you gave me, Mainly because im a little stupid
#7
Posted 31 August 2014 - 06:05 PM
--local base64Credentials = "" -- TO_BASE_64(USERNAME .. ":" .. PASSWORD)
--local auth = "Basic " .. base64Credentials -- could also be "token " .. OAUTH_TOKEN
-- above probably shouldn't be used, rather insecure
local oauthToken = "" -- your oauth token
local auth = "token " .. oauthToken -- value for Authroization header
local headers={ -- headers sent with every http request to github api
Authorization=auth, -- for authorization
Accept="application/vnd.github.v3+json", -- make sure we get correct version
["User-Agent"]="" -- set to something unique, should probably include username (see https://developer.github.com/v3/#user-agent-required)
}
local owner = "" -- owner of repository
local repo = "" -- repository
local title = "" -- title of issue
title = title:gsub("\\", "\\\\"):gsub("\"", "\\\"") -- make JSON string
local body = "" -- body of issue
body = body:gsub("\\", "\\\\"):gsub("\"", "\\\"") -- make JSON string
local jsonObject=[[
{
"title" : "]] .. title .. [[",
"body" : "]] .. body .. [[",
}]]
http.post("https://api.github.com/repos/" .. owner .. "/" .. repo .. "/issues", jsonObject, headers)
--if headers aren't avaliable try this instead
--http.post("https://api.github.com/repos/" .. owner .. "/" .. repo .. "/issues?access_token=" .. oauthToken, jsonObject)
#8
Posted 31 August 2014 - 06:14 PM
natedogith1, on 31 August 2014 - 06:05 PM, said:
--#local base64Credentials = "" -- TO_BASE_64(USERNAME .. ":" .. PASSWORD)
--#local auth = "Basic " .. base64Credentials -- could also be "token " .. OAUTH_TOKEN
--#above probably shouldn't be used, rather insecure
local oauthToken = "" --#your oauth token
local auth = "token " .. oauthToken --#value for Authroization header
local headers={ --#headers sent with every http request to github api
Authorization=auth, --#for authorization
Accept="application/vnd.github.v3+json", --#make sure we get correct version
["User-Agent"]="" --#set to something unique, should probably include username (see https://developer.github.com/v3/#user-agent-required)
}
local owner = "" --#owner of repository
local repo = "" --#repository
local title = "" --#title of issue
title = title:gsub("\\", "\\\\"):gsub("\"", "\\\"") --#make JSON string
local body = "" --#body of issue
body = body:gsub("\\", "\\\\"):gsub("\"", "\\\"") --#make JSON string
local jsonObject=[[
{
"title" : "]] .. title .. [[",
"body" : "]] .. body .. [[",
}]]
http.post("https://api.github.com/repos/" .. owner .. "/" .. repo .. "/issues", jsonObject, headers)
--#if headers aren't avaliable try this instead
--#http.post("https://api.github.com/repos/" .. owner .. "/" .. repo .. "/issues?access_token=" .. oauthToken, jsonObject)
Tip: Use --# for comments, since the forum parses # as a comment, and lua interprets -- as a comment. It looks good when posting, and still works fine in game.
#9
Posted 31 August 2014 - 06:28 PM
KingofGamesYami, on 31 August 2014 - 06:14 PM, said:
Tip: Use --# for comments, since the forum parses # as a comment, and lua interprets -- as a comment. It looks good when posting, and still works fine in game.
#10
Posted 31 August 2014 - 08:43 PM
natedogith1, on 31 August 2014 - 06:05 PM, said:
--local base64Credentials = "" -- TO_BASE_64(USERNAME .. ":" .. PASSWORD)
--local auth = "Basic " .. base64Credentials -- could also be "token " .. OAUTH_TOKEN
-- above probably shouldn't be used, rather insecure
local oauthToken = "" -- your oauth token
local auth = "token " .. oauthToken -- value for Authroization header
local headers={ -- headers sent with every http request to github api
Authorization=auth, -- for authorization
Accept="application/vnd.github.v3+json", -- make sure we get correct version
["User-Agent"]="" -- set to something unique, should probably include username (see https://developer.github.com/v3/#user-agent-required)
}
local owner = "" -- owner of repository
local repo = "" -- repository
local title = "" -- title of issue
title = title:gsub("\\", "\\\\"):gsub("\"", "\\\"") -- make JSON string
local body = "" -- body of issue
body = body:gsub("\\", "\\\\"):gsub("\"", "\\\"") -- make JSON string
local jsonObject=[[
{
"title" : "]] .. title .. [[",
"body" : "]] .. body .. [[",
}]]
http.post("https://api.github.com/repos/" .. owner .. "/" .. repo .. "/issues", jsonObject, headers)
--if headers aren't avaliable try this instead
--http.post("https://api.github.com/repos/" .. owner .. "/" .. repo .. "/issues?access_token=" .. oauthToken, jsonObject)
Sorry, but when you say the above shouldn't be used, what else do I put there, or is it not necessary, as you can see I'm very much new to Internet Apis etc within computer craft, I've only ever done GitHub downloading, I hope I can get your code to work, just for classification, what is the auth and oauth etc...
Like you said, the first part is very insecure, I don't want people knowing my password to GitHub, whether it is a seperate account or not, it would still have push access etc...
#11
Posted 31 August 2014 - 08:49 PM
Hbomb_79, on 31 August 2014 - 08:43 PM, said:
Sorry, but when you say the above shouldn't be used, what else do I put there, or is it not necessary, as you can see I'm very much new to Internet Apis etc within computer craft, I've only ever done GitHub downloading, I hope I can get your code to work, just for classification, what is the auth and oauth etc...
Like you said, the first part is very insecure, I don't want people knowing my password to GitHub, whether it is a seperate account or not, it would still have push access etc...
You'd just leave that part blank, that's why it's commented out. Instead you'd just fill in the oauthToken part with the value of your token. Though according to the github api documentation, you don't actually need push access to make an issue, you only need pull access.
#12
Posted 31 August 2014 - 10:15 PM
If someone knows my auto token can they access my account?
So basically is this secure or insecure like the first section.
#13
Posted 31 August 2014 - 10:26 PM
#14
Posted 31 August 2014 - 10:38 PM
Is the client ID my oAuth token?
EDIT: I replied as you posted, I'm following your instruction now and I deleted what I did...
EDIT 2: None of the scopes seem to mention issue posting, I don't want the token granting access to any of my code... Just the issue section
-Harry
Edited by Hbomb_79, 31 August 2014 - 10:52 PM.
#15
Posted 31 August 2014 - 11:07 PM
#17
Posted 01 September 2014 - 12:25 AM
#18
Posted 01 September 2014 - 12:54 AM
#19
Posted 01 September 2014 - 02:06 AM
#20
Posted 01 September 2014 - 04:15 AM
P.S: You've been so helpful, Thank you so much for your help
Edited by Hbomb_79, 01 September 2014 - 04:23 AM.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











