{"action":"created","issue":{"url":"https://api.github.com/repos/CodingTrain/CrowdSourceColorData/issues/1","repository_url":"https://api.github.com/repos/CodingTrain/CrowdSourceColorData","labels_url":"https://api.github.com/repos/CodingTrain/CrowdSourceColorData/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/CodingTrain/CrowdSourceColorData/issues/1/comments","events_url":"https://api.github.com/repos/CodingTrain/CrowdSourceColorData/issues/1/events","html_url":"https://github.com/CodingTrain/CrowdSourceColorData/issues/1","id":332115514,"node_id":"MDU6SXNzdWUzMzIxMTU1MTQ=","number":1,"title":"You should use Firebase Hosting instead of Github Pages for security","user":{"login":"K1ngjulien","id":16562333,"node_id":"MDQ6VXNlcjE2NTYyMzMz","avatar_url":"https://avatars0.githubusercontent.com/u/16562333?v=4","gravatar_id":"","url":"https://api.github.com/users/K1ngjulien","html_url":"https://github.com/K1ngjulien","followers_url":"https://api.github.com/users/K1ngjulien/followers","following_url":"https://api.github.com/users/K1ngjulien/following{/other_user}","gists_url":"https://api.github.com/users/K1ngjulien/gists{/gist_id}","starred_url":"https://api.github.com/users/K1ngjulien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/K1ngjulien/subscriptions","organizations_url":"https://api.github.com/users/K1ngjulien/orgs","repos_url":"https://api.github.com/users/K1ngjulien/repos","events_url":"https://api.github.com/users/K1ngjulien/events{/privacy}","received_events_url":"https://api.github.com/users/K1ngjulien/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-13T18:40:10Z","updated_at":"2018-06-13T19:21:38Z","closed_at":null,"author_association":"NONE","body":"Hi!\r\n\r\nThe way your project is setup now you are exposing all your credentials which is really bad!\r\n\r\nYou should use Firebase Hosting instead because it does not require that you put your credentials in the code!\r\nAlso it is really easy using the CLI:\r\nhttps://firebase.google.com/docs/hosting/quickstart\r\n"},"comment":{"url":"https://api.github.com/repos/CodingTrain/CrowdSourceColorData/issues/comments/397055174","html_url":"https://github.com/CodingTrain/CrowdSourceColorData/issues/1#issuecomment-397055174","issue_url":"https://api.github.com/repos/CodingTrain/CrowdSourceColorData/issues/1","id":397055174,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzA1NTE3NA==","user":{"login":"emielhman","id":33085492,"node_id":"MDQ6VXNlcjMzMDg1NDky","avatar_url":"https://avatars2.githubusercontent.com/u/33085492?v=4","gravatar_id":"","url":"https://api.github.com/users/emielhman","html_url":"https://github.com/emielhman","followers_url":"https://api.github.com/users/emielhman/followers","following_url":"https://api.github.com/users/emielhman/following{/other_user}","gists_url":"https://api.github.com/users/emielhman/gists{/gist_id}","starred_url":"https://api.github.com/users/emielhman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emielhman/subscriptions","organizations_url":"https://api.github.com/users/emielhman/orgs","repos_url":"https://api.github.com/users/emielhman/repos","events_url":"https://api.github.com/users/emielhman/events{/privacy}","received_events_url":"https://api.github.com/users/emielhman/received_events","type":"User","site_admin":false},"created_at":"2018-06-13T19:21:38Z","updated_at":"2018-06-13T19:21:38Z","author_association":"NONE","body":"Maybe add the ip address of the client to each row in the database?\r\n\r\nYou can easily retrieve the ip address of the client with this piece of code: \r\n\r\n```\r\n$.getJSON('https://json.geoiplookup.io/api?callback=?', function(data) {\r\n  console.log(data[\"ip\"]);\r\n});\r\n```\r\n\r\nThat way you can limit every client to a limited amount of entries, a 1000 entries for example.\r\n\r\nBecause right now you're able to simply spam the database with trash by simply copy pasting the code below, into the chrome console window. Which is probably not something we want.. \r\n(And I personally think learning how to securely retrieve data through a public form like this is a very vital part of the process! 👍 )\r\n\r\n```\r\nfunction foo() {\r\n    sendData();\r\n    setTimeout(foo, 1000);\r\n}\r\n\r\nfunction sendData() {\r\n  let colorDatabase = database.ref('colors');\r\n\t\r\n\tlet arr = [\"red-ish\", \"green-ish\", \"blue-ish\", \"orange-ish\", \"yellow-ish\", \"pink-ish\", \"purple-ish\", \"brown-ish\", \"grey-ish\"];\r\n  // Make an object with data in it\r\n  var data = {\r\n    r: r,\r\n    g: g,\r\n    b: b,\r\n    label: arr[Math.floor(Math.random() * arr.length)]\r\n  }\r\nfor(let i = 0; i < 100; i++){\r\n  let color = colorDatabase.push(data, finished);\r\n}\r\n  // Reload the data for the page\r\n  function finished(err) {\r\n    if (err) {\r\n      console.error(\"ooops, something went wrong.\");\r\n      console.error(err);\r\n    } else {\r\n      console.log('Data saved successfully');\r\n      pickColor();\r\n    }\r\n  }\r\n}\r\n\r\nfunction foo() {\r\n\r\n    // your function code here\r\n\tsendData();\r\n    setTimeout(foo, 1000);\r\n}\r\n\r\nfoo();\r\n```\r\n\r\nIn any case I really enjoyed the livestream!\r\nIt was fun to get a 'behind-the-scenes'-look of how the videos get made!\r\n"}}
{"actor":{"display_login":"emielhman"}}