Skip to content

Commit

Permalink
Merge branch 'develop' into chore/fix-local-atlassian-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Krusche authored Oct 3, 2023
2 parents 22379b4 + a55031a commit 0a83b62
Show file tree
Hide file tree
Showing 274 changed files with 3,529 additions and 9,588 deletions.
8 changes: 4 additions & 4 deletions docker/atlassian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
extra_hosts:
- "host.docker.internal:host-gateway"
image: ghcr.io/ls1intum/artemis-jira:9.4.3
pull_policy: always
pull_policy: if_not_present
volumes:
- artemis-jira-data:/var/atlassian/application-data/jira
ports:
Expand All @@ -25,7 +25,7 @@ services:
extra_hosts:
- "host.docker.internal:host-gateway"
image: ghcr.io/ls1intum/artemis-bitbucket:8.13.1
pull_policy: always
pull_policy: if_not_present
volumes:
- artemis-bitbucket-data:/var/atlassian/application-data/bitbucket
environment:
Expand All @@ -45,7 +45,7 @@ services:
extra_hosts:
- "host.docker.internal:host-gateway"
image: ghcr.io/ls1intum/artemis-bamboo:9.3.3
pull_policy: always
pull_policy: if_not_present
volumes:
- artemis-bamboo-data:/var/atlassian/application-data/bamboo
ports:
Expand All @@ -70,7 +70,7 @@ services:
extra_hosts:
- "host.docker.internal:host-gateway"
image: ghcr.io/ls1intum/artemis-bamboo-build-agent:9.3.3
pull_policy: always
pull_policy: if_not_present
volumes:
# The following path needs to be the same absolute path on the host because of the docker socket:
# https://confluence.atlassian.com/bamkb/bamboo-in-docker-build-fails-due-to-a-missing-working-directory-when-using-docker-runner-1027119339.html
Expand Down
4 changes: 2 additions & 2 deletions docker/broker-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ services:
jhipster-registry:
container_name: artemis-jhipster-registry
image: docker.io/jhipster/jhipster-registry:v6.1.2
pull_policy: always
pull_policy: if_not_present
volumes:
- ./registry:/central-config
# When run with the "dev" Spring profile, the JHipster Registry will
Expand All @@ -25,7 +25,7 @@ services:
activemq-broker:
container_name: artemis-activemq-broker
image: docker.io/vromero/activemq-artemis:latest
pull_policy: always
pull_policy: if_not_present
environment:
ARTEMIS_USERNAME: guest
ARTEMIS_PASSWORD: guest
Expand Down
2 changes: 2 additions & 0 deletions docker/cypress-E2E-tests-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ services:
CYPRESS_DB_TYPE: "MySQL"
SORRY_CYPRESS_PROJECT_ID: "artemis-mysql"
command: sh -c "cd /app/artemis/src/test/cypress && chmod 777 /root && npm ci && npm run cypress:setup && (npm run cypress:record:mysql & sleep 60 && npm run cypress:record:mysql & wait)"
# Old run method using plain cypress kept here as backup
# command: sh -c "cd /app/artemis/src/test/cypress && chmod 777 /root && npm ci && npm run cypress:run"

networks:
artemis:
Expand Down
2 changes: 2 additions & 0 deletions docker/cypress-E2E-tests-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ services:
CYPRESS_DB_TYPE: "Postgres"
SORRY_CYPRESS_PROJECT_ID: "artemis-postgres"
command: sh -c "cd /app/artemis/src/test/cypress && chmod 777 /root && npm ci && npm run cypress:setup && (npm run cypress:record:postgres & sleep 60 && npm run cypress:record:postgres & wait)"
# Old run method using plain cypress kept here as backup
# command: sh -c "cd /app/artemis/src/test/cypress && chmod 777 /root && npm ci && npm run cypress:run"

networks:
artemis:
Expand Down
2 changes: 1 addition & 1 deletion docker/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
artemis-cypress:
# Cypress image with node and chrome browser installed (Cypress installation needs to be done separately because we require additional dependencies)
image: docker.io/cypress/browsers:node-18.16.0-chrome-114.0.5735.133-1-ff-114.0.2-edge-114.0.1823.51-1
pull_policy: always
pull_policy: if_not_present
environment:
CYPRESS_baseUrl: "https://artemis-nginx"
CYPRESS_video: "${bamboo_cypress_video_enabled}"
Expand Down
2 changes: 1 addition & 1 deletion docker/gitlab-gitlabci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ services:
shm_size: "256m"
gitlab-runner:
image: docker.io/gitlab/gitlab-runner:latest
pull_policy: always
pull_policy: if_not_present
container_name: artemis-gitlab-runner
volumes:
- /var/run/docker.sock:/var/run/docker.sock
Expand Down
2 changes: 1 addition & 1 deletion docker/mailhog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
mailhog:
container_name: artemis-mailhog
image: docker.io/mailhog/mailhog
pull_policy: always
pull_policy: if_not_present
ports:
- "1025:1025"
- "8025:8025"
Expand Down
6 changes: 3 additions & 3 deletions docker/monitoring.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
# ----------------------------------------------------------------------------------------------------------------------
# This configuration is intended for development purpose, it's **your** responsibility to harden it for production
#
# Out of the box this setup just works with a non-containerized Artemis instancezs
# Out of the box this setup just works with a non-containerized Artemis instances
# ----------------------------------------------------------------------------------------------------------------------

services:
prometheus:
container_name: artemis-prometheus
image: docker.io/prom/prometheus:v2.34.0
pull_policy: always
pull_policy: if_not_present
volumes:
- ./monitoring/prometheus/:/etc/prometheus/
# If you want to expose these ports outside your dev PC,
Expand All @@ -26,7 +26,7 @@ services:
grafana:
container_name: artemis-grafana
image: docker.io/grafana/grafana:9.0.2
pull_policy: always
pull_policy: if_not_present
volumes:
- ./monitoring/grafana/provisioning/:/etc/grafana/provisioning/
environment:
Expand Down
2 changes: 1 addition & 1 deletion docker/mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
mysql:
container_name: artemis-mysql
image: docker.io/library/mysql:8.0.33
pull_policy: always
pull_policy: if_not_present
volumes:
- artemis-mysql-data:/var/lib/mysql
# DO NOT use this default file for production systems!
Expand Down
2 changes: 1 addition & 1 deletion docker/nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
# nginx setup based on artemis prod ansible repository
container_name: artemis-nginx
image: docker.io/library/nginx:1.23
pull_policy: always
pull_policy: if_not_present
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/timeouts.conf:/etc/nginx/conf.d/timeouts.conf:ro
Expand Down
2 changes: 1 addition & 1 deletion docker/postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
postgres:
container_name: artemis-postgres
image: docker.io/library/postgres:15.3-alpine
pull_policy: always
pull_policy: if_not_present
user: postgres
command: ["postgres", "-c", "max_connections=200"]
volumes:
Expand Down
2 changes: 1 addition & 1 deletion docker/saml-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
saml-test:
container_name: artemis-saml-test
image: docker.io/jamedjo/test-saml-idp
pull_policy: always
pull_policy: if_not_present
ports:
- "9980:8080"
# expose the port to make it reachable docker internally even if the external port mapping changes
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ All these exercises are supposed to be run either live in the lecture with insta
user/courses/customizable
user/scaling
user/markdown-support
user/exports
user/mobile-applications


Expand Down
91 changes: 91 additions & 0 deletions docs/user/exports.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
.. _exports:

.. |archive_course| image:: exports/archive_course.png
.. |archive_exam| image:: exports/archive_exam.png
.. |download_archive| image:: exports/download_archive.png
.. |export_quiz| image:: exports/export_quiz.png
.. |export_results| image:: exports/export_results.png
.. |export_submissions| image:: exports/export_submissions.png
.. |download_exercise| image:: exports/download_exercise.png
.. |download_repos| image:: exports/download_repos.png
.. |download_scores| image:: exports/scores.png
.. |export_scores| image:: exports/export_scores.png
.. |export| image:: exports/export.png
.. |scores_navigation_bar| image:: exports/scores_navigation_bar.png
.. |privacy_statement| image:: exports/privacy_statement.png
.. |data_export| image:: exports/data_export.png


Exports
=======

.. contents:: Table of Contents
:local:
:depth: 2

Overview
--------
Artemis offers several options to export or archive different data. The following table gives an overview of the available export options.

.. list-table:: Export options
:widths: 100
:header-rows: 1

* - Export/Archive option
* - Archive course/exam
* - Export programming exercise material
* - Export programming exercise student repositories
* - Export exercise results
* - Export quiz questions
* - Export exercise submissions
* - Export user data

Archive course/exam
-------------------
Export all course/exam data, including all exercises and student submissions.
To archive a course or an exam the end date of the entity needs to be in the past.
You can archive a course by clicking |archive_course| on the course management overview page or an exam by clicking |archive_exam| on the exam checklist page. This will create a zip file containing all exercises of the exam or course and all student submissions. For a course all exams are exported as well.
For each exercise the problem statement and a JSON file with exercise details such as points are exported. For programming exercises, the template, solution, test, and auxiliary (if existing) repository is exported as well.
The creation is done asynchronously. You will receive a notification once the archive is ready to download. You can then download the archive by clicking |download_archive| on the course management overview page or the exam checklist page.

Export programming exercise material
------------------------------------
Export the exercise material (template, solution, test, and auxiliary repositories as well as the problem statement and other general exercise information) of a programming exercise.
To export the material click the |download_exercise| button on the exercise details page.

Export quiz exercise
--------------------
Exports the questions and the sample solution of a quiz in JSON format.
You can export a a quiz exercise by clicking the |export_quiz| button on the exercises overview page.


Export programming exercise student repositories
------------------------------------------------
Export the student repositories (this can include the repositories for both graded and practice participations) of a programming exercise.
To export the repositories click the |export| button and then the |download_repos| button on the |download_scores| page.

Export exercise submissions
---------------------------
Export the submissions of all students that participated in a specific exercise. This is supported for text, modeling and file upload exercises.
Text submissions are exported as a zip file containing all submissions as text files.
Modeling submissions are exported as a zip file containing all submissions as json files.
File upload submissions are exported as a zip file containing all submitted files.
To export the submissions click the |export_scores| button and then the |export_submissions| button on the |download_scores| page.

Export exercise results
-----------------------------------
Export the results of students for a specific exercise as CSV file. This is supported for all exercise types.
To export the results click the |export| button and then the |export_results| button on the |download_scores| page.

Export course/exam scores
-------------------------
Export the scores of all students that participated in a specific course or exam. This is supported for all exercise types.
The scores are exported in CSV format.
To export the scores of a course click on the |scores_navigation_bar| tab in the course management navigation bar and then the |export_scores| button.
For exams you can export the scores by clicking the |download_scores| button on the exam checklist page and then |export_scores| button.

Export user data
----------------
Export all data Artemis stores about a specific user. This includes information such as name or email, exercise submissions, results, feedbacks the user received, messages they've sent.
You can request a data export by clicking |privacy_statement| and |data_export|. Once the export has been created you will receive an email with a download link.

Binary file added docs/user/exports/archive_course.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/exports/archive_exam.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/exports/data_export.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/exports/download_archive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/exports/download_exercise.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/exports/download_repos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/exports/export.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/exports/export_quiz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/exports/export_results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/exports/export_scores.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/exports/export_submissions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/exports/privacy_statement.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/exports/scores.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/exports/scores_navigation_bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@
"test-diff:ci": "git fetch origin develop && npm run prebuild && ng test --log-heap-usage -w=4 --ci --reporters=default --reporters=jest-junit --pass-with-no-tests --changed-since=origin/develop",
"test:leaks": "npm run prebuild && ng test --log-heap-usage --detect-leaks",
"test:open-handles": "npm run prebuild && ng test --detect-open-handles",
"test:server-api-tests": "`pwd`/src/test/k6/api_tests.sh",
"test:watch": "npm run prebuild && npm run test -- --watch",
"webapp:build": "npm run clean-www && npm run webapp:build:dev",
"webapp:build:dev": "npm run prebuild -- --develop && ng build --configuration development",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package de.tum.in.www1.artemis.config;

import static de.tum.in.www1.artemis.config.Constants.*;

import java.util.List;
import java.util.Optional;
import java.util.*;
import java.util.stream.Collectors;

import javax.annotation.PostConstruct;
Expand All @@ -12,6 +9,7 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.core.env.Environment;
import org.springframework.http.HttpMethod;
import org.springframework.security.access.hierarchicalroles.RoleHierarchy;
import org.springframework.security.access.hierarchicalroles.RoleHierarchyImpl;
Expand Down Expand Up @@ -62,15 +60,19 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Value("#{'${spring.prometheus.monitoringIp:127.0.0.1}'.split(',')}")
private List<String> monitoringIpAddresses;

private final Environment env;

public SecurityConfiguration(AuthenticationManagerBuilder authenticationManagerBuilder, UserDetailsService userDetailsService, TokenProvider tokenProvider,
CorsFilter corsFilter, SecurityProblemSupport problemSupport, PasswordService passwordService, Optional<AuthenticationProvider> remoteUserAuthenticationProvider) {
CorsFilter corsFilter, SecurityProblemSupport problemSupport, PasswordService passwordService, Optional<AuthenticationProvider> remoteUserAuthenticationProvider,
Environment env) {
this.authenticationManagerBuilder = authenticationManagerBuilder;
this.userDetailsService = userDetailsService;
this.tokenProvider = tokenProvider;
this.corsFilter = corsFilter;
this.problemSupport = problemSupport;
this.passwordService = passwordService;
this.remoteUserAuthenticationProvider = remoteUserAuthenticationProvider;
this.env = env;
}

/**
Expand Down Expand Up @@ -170,15 +172,17 @@ protected void configure(HttpSecurity http) throws Exception {
.antMatchers(HttpMethod.POST, "/api/programming-exercises/new-result").permitAll()
.antMatchers(HttpMethod.POST, "/api/programming-submissions/*").permitAll()
.antMatchers(HttpMethod.POST, "/api/programming-exercises/test-cases-changed/*").permitAll()
.antMatchers(HttpMethod.POST, "/api/lti/launch/*").permitAll()
.antMatchers("/websocket/**").permitAll()
.antMatchers("/.well-known/jwks.json").permitAll()
.antMatchers("/management/prometheus/**").access(getMonitoringAccessDefinition())
.antMatchers("/api/**").authenticated()
.and()
.apply(securityConfigurerAdapter());

http.apply(new CustomLti13Configurer());
Collection<String> activeProfiles = Arrays.asList(env.getActiveProfiles());
if (activeProfiles.contains("lti")) {
http.apply(new CustomLti13Configurer());
}

// @formatter:on
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package de.tum.in.www1.artemis.config.lti;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Profile;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;
import org.springframework.security.oauth2.client.web.AuthorizationRequestRepository;
Expand All @@ -18,6 +19,7 @@
/**
* Configures and registers Security Filters to handle LTI 1.3 Resource Link Launches
*/
@Profile("lti")
public class CustomLti13Configurer extends Lti13Configurer {

private static final String LOGIN_PATH = "/auth-login";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package de.tum.in.www1.artemis.domain.plagiarism;

/**
* Stores configuration for plagiarism detection.
*/
public record PlagiarismDetectionConfig(float similarityThreshold, int minimumScore, int minimumSize) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,10 @@ public interface CompetencyRelationRepository extends JpaRepository<CompetencyRe
""")
Set<CompetencyRelation> findAllByCourseId(@Param("courseId") Long courseId);

@Query("""
SELECT count(cr)
FROM CompetencyRelation cr
WHERE cr.headCompetency.course.id = :courseId OR cr.tailCompetency.course.id = :courseId
""")
long countByCourseId(@Param("courseId") long courseId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import de.tum.in.www1.artemis.domain.Course;
import de.tum.in.www1.artemis.domain.competency.Competency;
import de.tum.in.www1.artemis.web.rest.errors.EntityNotFoundException;

Expand Down Expand Up @@ -180,4 +181,6 @@ default Competency findByIdWithExercisesAndLectureUnitsElseThrow(Long competency
default Competency findByIdWithExercisesElseThrow(Long competencyId) {
return findByIdWithExercises(competencyId).orElseThrow(() -> new EntityNotFoundException("Competency", competencyId));
}

long countByCourse(Course course);
}
Loading

0 comments on commit 0a83b62

Please sign in to comment.