Skip to content

Commit

Permalink
Merge pull request #4799 from mishaschwartz/v1.10.0.rc
Browse files Browse the repository at this point in the history
v1.10.0.rc
  • Loading branch information
mishaschwartz authored Aug 10, 2020
2 parents 184fa1f + 291d9c6 commit b8bf9d4
Show file tree
Hide file tree
Showing 545 changed files with 16,052 additions and 9,468 deletions.
1 change: 0 additions & 1 deletion .dockerfiles/.psqlrc

This file was deleted.

32 changes: 32 additions & 0 deletions .dockerfiles/Dockerfile-ssh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
ARG UBUNTU_VERSION

FROM ubuntu:$UBUNTU_VERSION

ARG SSH_USER

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update -qq && \
apt-get -yq dist-upgrade && \
apt-get install -yq --no-install-recommends openssh-server git sudo vim tzdata && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
truncate -s 0 /var/log/*log

# Make temporary dir for ssh server (should not be necessary)
RUN mkdir -p -m0755 /var/run/sshd

# Set up git user
RUN useradd -m -s /bin/bash $SSH_USER

COPY ./entrypoint-ssh.sh entrypoint-ssh.sh

COPY ./markus-git-shell.sh /usr/local/bin/markus-git-shell.sh
RUN chown "$SSH_USER:$SSH_USER" /usr/local/bin/markus-git-shell.sh && \
chmod 700 /usr/local/bin/markus-git-shell.sh && \
echo "${SSH_USER} ALL=(root) NOPASSWD:/usr/bin/git-shell" | sudo EDITOR="tee -a" visudo

# Disable root login
RUN sed -i "s@#*PermitRootLogin.*@PermitRootLogin no@g" /etc/ssh/sshd_config

EXPOSE 22
16 changes: 16 additions & 0 deletions .dockerfiles/entrypoint-ssh.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

AUTHORIZED_KEY_FILES=$(echo "${RELATIVE_URL_ROOTS}" | sed -E "s@([^:]+):?@/home/${SSH_USER}/.ssh\1/authorized_keys @g")

if [[ -z "${AUTHORIZED_KEY_FILES}" ]]; then
>&2 echo 'RELATIVE_URL_ROOTS is not set'
exit 1
fi

if grep -q AuthorizedKeysFile /etc/ssh/sshd_config; then
sed -i "s@#*AuthorizedKeysFile.*@AuthorizedKeysFile ${AUTHORIZED_KEY_FILES}@g" /etc/ssh/sshd_config
else
echo "AuthorizedKeysFile ${AUTHORIZED_KEY_FILES}" >> /etc/ssh/sshd_config
fi

exec "$@"
31 changes: 31 additions & 0 deletions .dockerfiles/markus-git-shell.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

set -eE -o functrace

write_log() {
echo "$(date): ${1}" >> "${HOME}/log/ssh.log"
}

failure() {
write_log "UNEXPECTED ERROR: ${1}"
}

trap 'failure "$BASH_COMMAND"' ERR

[[ -z ${LOGIN_USER} ]] && write_log 'ERROR: LOGIN_USER not set' && exit 1

GIT_ACCESS_FILE="${HOME}/.ssh/${RELATIVE_URL_ROOT}/.access"

[[ ! -f ${GIT_ACCESS_FILE} ]] && write_log "ERROR: file does not exist: ${GIT_ACCESS_FILE}" && exit 1

AVAILABLE_REPOS=$(grep -P ",${LOGIN_USER}(?:,|\s*$)" "${GIT_ACCESS_FILE}" | cut -f1 -d,)
REQUESTED_REPO_PATH=$(basename "$(echo "${SSH_ORIGINAL_COMMAND}" | cut -f2 -d' ')")
REQUESTED_REPO="${REQUESTED_REPO_PATH%.*}"

if grep -qP "^${REQUESTED_REPO%.*}|\*$" <(echo "${AVAILABLE_REPOS}"); then
sudo /usr/bin/git-shell -c "${SSH_ORIGINAL_COMMAND}"
write_log "SUCCESS: LOGIN_USER=${LOGIN_USER} RELATIVE_URL_ROOT=${RELATIVE_URL_ROOT}, cmd=${SSH_ORIGINAL_COMMAND}"
else
write_log "PERMISSION DENIED: LOGIN_USER=${LOGIN_USER}, RELATIVE_URL_ROOT=${RELATIVE_URL_ROOT}, cmd=${SSH_ORIGINAL_COMMAND}"
exit 1
fi
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# git dir
.git/

tmp/
public/

config/database.yml
config/local_environment_override.rb

Expand Down
50 changes: 50 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!--- Provide a summary of your changes in the Pull Request Title above. -->
<!--- If this is a work in progress (not yet ready to be merged), make this a draft pull request. -->

## Motivation and Context
<!--- Why is this pull request required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->


## Your Changes
<!--- Describe your changes here. -->
<!--- Include how your changes may affect other areas of the application, if relevant. -->
**Description**:


**Type of change** (select all that apply):
<!--- Put an `x` in all the boxes that apply. -->
<!--- Remove any lines that do not apply. -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Refactoring (internal change to codebase, without changing functionality)
- [ ] Test update (change that modifies or updates tests only)
- [ ] Other (please specify):


## Testing
<!--- Please describe in detail how you tested this pull request. -->
<!--- This can include tests you added and manual testing through the web interface. -->


## Questions and Comments (if applicable)
<!-- Ask any questions you have for the maintainers of this project regarding this PR. -->
<!-- Please describe the steps you have already taken to find the answer to your question. -->
<!-- This will ensure that we can give you clear and relevant advice. -->
<!-- If you have additional comments add them here as well. -->


## Checklist

- [ ] I have performed a self-review of my own code.
- [ ] I have fixed any Hound bot comments. <!-- (check after opening pull request) -->
- [ ] I have verified that the TravisCI tests have passed. <!-- (check after opening pull request) -->
- [ ] I have reviewed the test coverage changes reported on Coveralls. <!-- (check after opening pull request) -->
- [ ] I have added tests for my changes. <!-- (delete this checklist item if not applicable) -->
- [ ] I have updated the Changelog.md file. <!-- (delete this checklist item if not applicable) -->
- [ ] I have described any required documentation changes below. <!-- (delete this checklist item if not applicable) -->


### Required documentation changes (if applicable)
2 changes: 1 addition & 1 deletion .rspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
--require rails_helper
--color
--format documentation
--format Fuubar
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
language: ruby
rvm:
- 2.5.3
dist: xenial
dist: bionic
addons:
postgresql: "10"
apt:
packages:
- postgresql-10
- postgresql-client-10

before_install:
Expand All @@ -24,6 +23,7 @@ install:
before_script:
- sudo rm -f /etc/localtime
- sudo ln -s /usr/share/zoneinfo/US/Eastern /etc/localtime
- sudo sed -ri 's/(rights=")none("\s+pattern="PDF")/\1read\2/' /etc/ImageMagick-6/policy.xml
- bundle exec rake i18n:js:export
- chmod u+x bin/webpack
- NODE_ENV=test RAILS_ENV=test bundle exec rake webpacker:compile
Expand All @@ -32,7 +32,7 @@ before_script:

script:
# - bundle exec rake test # shoulda (with rails 5) compatibility issues
- bundle exec rspec
- RSPEC_RENDER_VIEWS=true bundle exec rspec

services:
- postgresql
Expand Down
44 changes: 43 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,44 @@
# Changelog

## [v1.10.0]
- Issue #3670: Added API for adding and removing extra marks (#4499)
- Restrict confirmation dialog for annotation editing to annotations that belong to annotation categories (#4540)
- Fixed sorting in annotation table in results view (#4542)
- Enabled customization of rubric criterion level number and marks (#4535)
- Introduces automated email sending for submissions releases (#4432)
- Introduces automated email sending for spreadsheet releases (#4460)
- Introduces automated email sending for grouping invitations (#4470)
- Introduces student email settings (#4578)
- Assignment grader distribution graphs only show marks for assigned criteria when graders are assigned specific
criteria (#4656)
- Fixed bug preventing graders from creating new notes in results view (#4668)
- Fixed bug preventing new tags from being created from results view (#4669)
- Remove deprecated "detailed CSV" download link from submissions/browse (#4675)
- Introduces Deductive Annotations (#4693)
- Introduces annotation usage details panel to Annotations tab in admin settings (#4695)
- Fixed bug where bonuses and deductions were not displayed properly (#4699)
- Fixed bug where image annotations did not stay fixed relative to the image (#4706)
- Fixed bug where image annotations did not load properly (#4706)
- Fixed bug where downloading files in nested directories renamed the downloaded file (#4730)
- Introduces an option to unzip an uploaded zip file in place (#4731)
- Fixed bug where marking scheme weights were not displayed (#4735)
- Introduces timed assignments (#4665)
- Introduces uncategorized annotations grouping in Annotations settings tab (#4733)
- Introduces new grades summary chart, and makes student view of grades consistent with admin (#4740)
- Set SameSite=Lax on cookies (#4742)
- Introduces individual marks chart view for assessments (#4747)
- Fix annotation modal overflow issue (#4748)
- Introduce file viewer for student submission file manager and admin repo manager (#4754)
- Make skipping empty submissions the default behaviour when assigning graders (#4761)
- Introduce typing delay for entering flexible criterion mark (#4763)
- Fix UI overflow bug for large images in results file viewer (#4764)
- Add disabled delete button to submissions file manager when files unselected (#4765)
- Support syntax highlighting for html and css files (#4781)
- Add minutes field to non timed assessment extension modal (#4791)
- Add ability to check out git repositories over ssh using a public key uploaded in the new Key Pairs tab (#4598)
- Unify criterion tables using single table inheritance (refactoring change) (#4749)
- Add support for uploading multiple versions of starter files (#4751)

## [v1.9.3]
- Fixed inverse association bug with assignments (#4551)
- Fixed bug preventing graders from downloading submission files from multiple students (#4658)
Expand All @@ -16,6 +56,8 @@
- Fixed N+1 queries in Assignment repo list methods (#4543)
- Fixed submission download_repo_list file extension (#4543)
- Fixed bug preventing creation of assignments with submission rules (#4557)
- Fixed inverse association bug with assignments (#4551)
- Updated interface with the autotester so that files do not need to be copied when test are setup/enqueued (#4546)

## [v1.9.0]
- Added option to anonymize group membership when viewed by graders (#4331)
Expand All @@ -40,7 +82,7 @@
- Fixed annotation Markdown and MathJax rendering bug (#4506)
- Fixed bug where a grouping could be created even when the assignment subdirectory failed to be created (#4516)
- Progress messages for background jobs now are hidden once the job is completed (#4519)
- Fixed bug where a javascript submission/test/starter code file can't be downloaded (#4520)
- Fixed bug where a javascript submission/test/starter file can't be downloaded (#4520)
- Add ability to upload and download autotest settings as a json file/string through the UI and API (#4498)

## [v1.8.4]
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ source 'https://rubygems.org'

# Bundler requires these gems in all environments
gem 'puma'
gem 'rails', '~> 6.0.2'
gem 'rails', '~> 6.0.3'
gem 'sprockets'

# Models and database interactions
Expand Down Expand Up @@ -55,7 +55,6 @@ gem 'net-ssh'
gem 'redcarpet'
gem 'rubyzip', require: 'zip'
gem 'rugged'
gem 'ya2yaml'

# Rails miscellany
gem 'activerecord-session_store'
Expand Down Expand Up @@ -103,6 +102,7 @@ end
group :test do
gem 'coveralls', require: false
gem 'factory_bot_rails'
gem 'fuubar'
gem 'machinist', '< 3'
gem 'shoulda'
gem 'simplecov', require: false
Expand All @@ -116,7 +116,7 @@ end
group :development, :test do
gem 'byebug'
gem 'i18n-tasks'
gem 'rspec-rails', '~> 4.0.0'
gem 'rspec-rails', '~> 4.0.1'
end

# Gems needed (wanted) for development, test and production_test
Expand Down
Loading

0 comments on commit b8bf9d4

Please sign in to comment.