Commit Graph

2125 Commits

Author SHA1 Message Date
Sebastian Serth
91c2e14fe8 Fix error handling during Runner::Connection close
Closes CODEOCEAN-HQ
2023-02-16 10:47:28 +01:00
Sebastian Serth
596a04b9da Handle ReadTimeouts for LTI consumer properly 2023-02-16 10:12:05 +01:00
Sebastian Serth
99372464aa Lock "sudo" switch for shell with root environments 2023-02-11 00:44:47 +01:00
Karol
90d713a1d4 fix (potential) problems with empty file_extensions 2023-02-09 18:42:24 +01:00
Karol
637f872f34 add file_extension validation for file_type 2023-02-09 18:42:24 +01:00
Karol
454b34275c fix file_type selection for Makefile 2023-02-09 18:42:24 +01:00
Sebastian Serth
04504973ba Adjust Sentry's user context 2023-02-03 00:16:52 +01:00
Sebastian Serth
e8983a28d9 Fix generated URLs for native files in subdirectories
Our handling of uploaded files (see FilesController#show_protected_upload) checks for the full file name including the file path. However, URLs generated by CarrierWave didn't contain any path information resulting in invalid URLs. The wrong behavior was only visible when serving native files was disabled in Rails (or by using the x_sendfile_header).
2023-01-20 23:53:17 +01:00
Sebastian Serth
234a4fe02b Deny /implement without execution environment
Also, fix a smaller typo in the locales
2023-01-20 23:53:08 +01:00
Sebastian Serth
2679f5fa56 Allow random selection for ProxyExercise 2023-01-20 21:02:20 +01:00
Sebastian Serth
873fefdd9e Use relative import paths for SCSS node modules 2023-01-14 11:32:57 +01:00
Sebastian Serth
fcc6d69982 Fix percentage value display for remote score 2023-01-12 18:50:50 +01:00
Sebastian Serth
87771b905a Fix rubocop offenses 2023-01-11 23:57:29 +01:00
Sebastian Serth
5d02251cbb Replace BooleanPresenceValidator with InclusionValidator
The `BooleanPresenceValidator` is causing issues with Ruby 3.2+ YJIT irregularly.

Fixes CODEOCEAN-GQ, fixes CODEOCEAN-GR
2023-01-08 14:10:14 +01:00
Sebastian Serth
922ba5df4e Fix rubocop offenses 2023-01-02 10:06:00 +01:00
Sebastian Serth
6a942ccf50 Capture exception for Scoring
Previously, an exception was caused by the tubesock gem but not sent to Sentry. This caused errors not to bubble up correctly but rather kill the current thread, leaving the user with a generic "WebSocket connection not established" message.

Probably, this should be removed when updating the WebSocket implementation.
2022-12-23 13:04:34 +01:00
Sebastian Serth
7cd61acbce I18n: Automatically choose locale through HTTP header 2022-12-20 10:26:32 +01:00
Sebastian Serth
8a6e0a8366 Catch empty files_json during conversion 2022-12-19 16:11:35 +01:00
Sebastian Serth
17356c3045 Allow redirect to main CodeOcean host
When a file cannot be retrieved any longer, we send a redirect to the previous locations. As we usually enable a different render host, Rails sees this redirect as a redirect to another host (from the render host to the main CodeOcean host).
2022-12-19 16:06:47 +01:00
Sebastian Serth
735f37d1dd Fix import of lodash module 2022-12-19 15:17:32 +01:00
Sebastian Serth
7a2e442d91 Reject reference implementations only for Runs 2022-12-12 20:53:46 +01:00
Sebastian Serth
838019343e ProFormA: Hide 'delayed' files by default 2022-12-08 10:57:36 +01:00
Sebastian Serth
bec235c8d6 Fix XML parsing with invalid LTI response
An invalid XML response may be returned if the LTI provider is unavailable and cannot handle our request. We decided against logging in Sentry as this affects a third party functionality we cannot fix ourselves.
Fixes CODEOCEAN-G2
2022-12-07 23:00:21 +01:00
Sebastian Serth
bc5baed05e Use exec_query for custom SQL execution
Also align how we use query Postgres from controllers.

The change is mainly due to regular (but not reproducible) issues with the `intervalstyle` defaulting to `postgres` (instead of `iso8601`) and thereby causing issues. We're just experimenting to see whether this change resolves the issue.
2022-12-06 22:41:00 +01:00
Sebastian Serth
da9a9b3e76 Ensure all text is visible during page load
We introduce the font-display property. See
https://developer.chrome.com/docs/lighthouse/performance/font-display/
2022-12-06 18:36:45 +01:00
Sebastian Serth
75c6dfd20b Rename actioncable integration (deprecation warning) 2022-12-06 15:26:50 +01:00
Sebastian Serth
de0c1d368c Add source map for sprockets 2022-12-06 15:26:50 +01:00
Sebastian Serth
9977e1614b Allow external redirect for render host and LTI
We only use the `launch_presentation_return_url` provided to the @provider, in order to prevent using an open redirect.
2022-12-05 22:38:13 +01:00
Sebastian Serth
b7a3fd4586 Refactor exercise statistics to use convert times in Ruby 2022-12-05 21:59:34 +01:00
Sebastian Serth
1cfae6101a Introduce additional time helper for managing intervals and durations 2022-12-05 18:22:18 +01:00
Sebastian Serth
df666b4389 Fix missing whitespace for exercise feedback page 2022-12-05 18:21:44 +01:00
dependabot[bot]
90b30e2bf7 Upgrade to Rails 7.0 and apply new framework defaults
* Remove `send_stream` method pulled in before upgrading Rails
* Remove spring, it is no longer included by default for new apps
* Remove deprecated options from environments
* Remove old asset paths and workarounds no longer needed
* Remove unnecessary `OAUTH_10_SUPPORT` const, LTI still uses OAuth 1.0
* Dump schema with new defaults (and specify precision for timestamps where needed)
2022-12-04 15:21:59 +01:00
Sebastian Serth
ffe96d9223 Remove I18n.translation_present? monkey patch 2022-12-04 15:03:28 +01:00
Sebastian Serth
574e99eddd Fix rubocop offenses - Requires Ruby 3.1+ 2022-11-25 11:10:06 +01:00
Sebastian Serth
dfbf06274c Specify class for html_escape 2022-11-24 17:16:18 +01:00
Sebastian Serth
ab688e09c0 Execute SQL statement in ping controller 2022-11-21 14:52:11 +01:00
Sebastian Serth
25707478ea Require user for Community Solution
Fixes CODEOCEAN-F7
2022-11-21 10:48:08 +01:00
Sebastian Serth
b6cecf53aa Pundit: Skip authorization in case of errors
Fixes CODEOCEAN-F3
2022-11-17 21:37:45 +01:00
Sebastian Serth
b2af4e0663 Check submission and exercise files when filtering downloads 2022-11-17 20:47:33 +01:00
Sebastian Serth
9bd900bd86 Raise NotAuthorized Error if ID cannot be found
Fixes CODEOCEAN-F3
2022-11-17 20:47:33 +01:00
Sebastian Serth
15878f500c Switch order of unloading the autosave timer
Hypothesis: When unloadAutoSave was called, we first saved (causing this.autosaveTimer to become null) and then tried to clearTimeout on this variable (= on null). This probably never worked?

Hopefully closes CODEOCEAN-B5
2022-11-16 23:26:25 +01:00
Sebastian Serth
591f776f69 Close WebSocket connection normally
With Tubesock, we need to send a close frame ourselves. Otherwise, some browsers might display a warning.
2022-11-16 23:16:49 +01:00
Sebastian Serth
7aaeac03d6 Remove outdated error for used_defined_tests
Previously, a user-defined test (those run with "Test" instead of "Run") would cause a flash message and a Sentry error if anything was printed to StdErr. As this might happen during user code execution (and therefore is no error), we remove this warning. All existing errors are already caught (compare with enum status in testrun.rb), so it's fine for now.

Fixes CODEOCEAN-BT
2022-11-16 22:41:07 +01:00
Sebastian Serth
fb494dabbd Re-init Sorttable on turbolinks page load 2022-11-16 20:13:37 +01:00
Sebastian Serth
0950e626ba Convert message data to string before slicing
Fixes CODEOCEAN-F1
2022-11-16 19:53:19 +01:00
Sebastian Serth
f17718f69f CSP: Extract JavaScript from layout to assets
Fixes CODEOCEAN-CP
2022-11-16 19:47:58 +01:00
Sebastian Serth
a9c642a116 CSP: Extract RfC JS from view to assets
Relates to CODEOCEAN-CP
2022-11-16 19:47:58 +01:00
Sebastian Serth
b9f3126f21 CSP: Remove global this in webpack
Also refactor how we handle global namespace objects.

Fixes CODEOCEAN-DV
2022-11-16 19:47:58 +01:00
Sebastian Serth
55d7fb2f9a Download file: Return after rendering NotAuthorized Error
Fixes CODEOCEAN-ET
2022-11-14 18:21:35 +01:00
Sebastian Serth
d50e6d30e9 List Files: Catch more Runner::Errors 2022-11-14 13:51:04 +01:00