Commit Graph

16 Commits

Author SHA1 Message Date
Brian Palmer 325d94955f strip_invalid_utf8 for error reports and incoming messages
If an incomplete utf-8 byte sequence comes at the end of an input
string, Iconv with //IGNORE will still include that incomplete sequence
in the output, causing psql errors among other problems. This new method
pads the string with spaces to work around the problem.

refs #10188

Change-Id: Idacae010462f2b98c02afbe4103974f39c0f24c1
Reviewed-on: https://gerrit.instructure.com/13258
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-08-28 15:06:45 -06:00
Brian Palmer 426fcd241c track request timing and error reports with statsd
Adds an infrastructure for using statsd (configured with
config/statsd.yml) and uses it to track a few basic stats. Stat names
are appended with the hostname.

test plan: without statsd enabled, make sure no errors are raised when
doing requests. add a statsd.yml configuration, restart the server, and
verify that stats are sent over UDP to the given host/port (this could
even be checked without statsd available, by monitoring UDP traffic)

Change-Id: Ie8c3ece7e08ff48616ffd968069bd760300e4fd2
Reviewed-on: https://gerrit.instructure.com/12673
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-08-07 08:50:49 -06:00
Simon Williams e3a6f5615a filter sensitive data from error reports
fixes #9700

filter sensitive information from the data that is saved for an error report.
also add a few extra fields to the view, such as request_context_id and form
parameters.

test plan:
- make an action with the api that will cause an error report to be generated
- go view that error report
- it should have your access token filtered out
- it should have a request context id field

Change-Id: I3c4d0d8002b6f502fdeb9e4dd40f3fd5d51dc04d
Reviewed-on: https://gerrit.instructure.com/12625
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-08-02 16:24:45 -06:00
Mark Ericksen 694095db18 Minor code refactor loosely related to #8521
Adds comments and changes how the custom callback
"on_send_to_external" gets code attached.
Previous callback version is deprecated in future
versions of Rails. This was changed as part of
work on canvas_zendesk_plugin which is
a separate project.

 Testing Plan:
 ---------------------
 Nothing to test. No change in behavior.
 Tests for "canvas_zendesk_plugin" cover this as well.

Change-Id: I21fd4e20985b4a79b19578611d05e32c3b4b564f
Reviewed-on: https://gerrit.instructure.com/11004
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
2012-06-25 15:10:48 -06:00
Jon Jensen 99b3da3856 more general (and slightly faster) fast distinct for postgres
test plan:
ensure error reports work (and still render quickly), and specs pass

Change-Id: I2e47171652cf429be312818070bf4a342689f1d3
Reviewed-on: https://gerrit.instructure.com/8300
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-02-01 14:02:22 -07:00
Cody Cutrer d58dfaa134 improve error reports categories query on postgres
postgres can't/won't use the index for a DISTINCT query, so be a
bit more explicit with it to get it to use the index

test plan:
 * go to /error_reports
 * it should load fast, there should be a categories dropdown,
   and it should have a few things in it besides all categories
   (assuming you have some error reports)

Change-Id: If7c71cd669e7eadc1792eefe1fb6e85a08c054ed
Reviewed-on: https://gerrit.instructure.com/8190
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-01-20 12:44:21 -07:00
Cody Cutrer a913470561 sanitize invalid UTF-8 before creating error reports
refs #5638

Change-Id: If469eea015536a8378538fb2fb91cf7725ebdf94
Reviewed-on: https://gerrit.instructure.com/5669
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-09-15 15:30:17 -06:00
Brian Palmer f0f9e2c160 use request.remote_ip to get the client address
This method has the proxy smarts to check x-forwarded-for and client-ip,
and some level of ip spoofing protection.

Change-Id: I19d7768cdbc1d25deceed4a157467d7eb83b4cc8
Reviewed-on: https://gerrit.instructure.com/4516
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-07-01 09:26:58 -06:00
Zach Wily 1d6cadf7a6 delete error reports based on creation date
We already have an index on creation date. These are mostly immutable, so I'm
not sure why we would want to purge based on updated date.

Change-Id: Ie52cee3d364dffbf644a73efa9322bf00e3bb362
Reviewed-on: https://gerrit.instructure.com/3942
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-05-31 14:40:17 -06:00
Cody Cutrer bdbebfaec8 check all models for protecting attributes refs #3847
Change-Id: I7cba6e26ad98e91723e2ccf0a28b8db79bb37b5c
Reviewed-on: https://gerrit.instructure.com/3631
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-05-25 17:38:50 -06:00
Brian Palmer 3bea05103c delete old error reports periodically, refs #4487
Change-Id: I94e75d61eaff56509dee8f00d955f0063caf5b68
Reviewed-on: https://gerrit.instructure.com/3597
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-05-11 13:32:47 -06:00
Brian Palmer b657f4e959 generate an error report for all errors, not just some of them
refs #4487

This consolidates our ErrorReport class with our ErrorLogging mechanism,
it's all in ErrorReport now and you call ErrorReport.log_error or
ErrorReport.log_exception to both create an ErrorReport object, and call
the hooks similar to what ErrorLogging did so that plugins for other
error handling mechanisms can be injected.

ErrorReport has a category field now, similar to how ErrorLogging used
to take a type. the /error_reports UI can filter by category.

The plugin interface was designed with Hoptoad integration in mind, but
it should be pretty general.

Change-Id: I59f7a0d44cf4b6215ad13ff92d30e1d1af607b74
Reviewed-on: https://gerrit.instructure.com/3577
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-05-11 10:36:56 -06:00
Brian Palmer 4465b1fc7b create error report locally on javascript errors, refs #4487
Change-Id: I2cb09c7f7d9a5ffe9d5286da36da9ddbc999ed86
Reviewed-on: https://gerrit.instructure.com/3575
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-05-11 08:47:49 -06:00
Brian Whitmer d20eede2df move default error reporting to a plugin
Accounts can specify a destination email address or URL
endpoint that will receive messages as error reports are
created if the feedback button is enabled.  This could
be configured before, but it wasn't straightforward
how to go about doing it.

fixes #3410

Change-Id: Ibd28ebf14c876fb216b14d3d56e622fc009aa2ba
Reviewed-on: https://gerrit.instructure.com/2739
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-03-24 13:21:31 -06:00
Brian Whitmer 89f5934bae quiz moderation
- added a moderation link on the quiz page
- moderators can see current quiz results for students
- moderators can add time to a current quiz attempt
- moderators can manually unlock a quiz for a student,
  which means the student can take the quiz even if
  it's locked for everyone else
- moderators can give a student extra time for every
  subsequent attempt of a quiz
- moderators can give a student extra attempts on a quiz
- moderators can also update these settings for multiple
  students at the same time

Change-Id: I31c34097fc6e19d8c6e377a6059568e591ffbab8
Reviewed-on: https://gerrit.instructure.com/2166
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-02-11 22:08:42 -07:00
Brian Whitmer 8b8173dcc9 Initial commit.
closes #6988138
2011-01-31 18:57:29 -07:00