{"id":25776238,"url":"https://github.com/CodeDefenders/CodeDefenders","last_synced_at":"2025-02-27T06:05:53.259Z","repository":{"id":39380534,"uuid":"48437673","full_name":"CodeDefenders/CodeDefenders","owner":"CodeDefenders","description":"Gamification of Mutation Testing","archived":false,"fork":false,"pushed_at":"2025-02-10T12:09:34.000Z","size":59740,"stargazers_count":41,"open_issues_count":12,"forks_count":20,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-02-10T12:37:45.006Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodeDefenders.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-12-22T14:53:12.000Z","updated_at":"2025-02-10T12:09:38.000Z","dependencies_parsed_at":"2023-02-16T07:31:10.048Z","dependency_job_id":"99c2cd7a-bd60-40ff-919d-2c97891e5b37","html_url":"https://github.com/CodeDefenders/CodeDefenders","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeDefenders%2FCodeDefenders","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeDefenders%2FCodeDefenders/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeDefenders%2FCodeDefenders/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeDefenders%2FCodeDefenders/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodeDefenders","download_url":"https://codeload.github.com/CodeDefenders/CodeDefenders/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240987435,"owners_count":19889333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-27T06:01:19.752Z","updated_at":"2025-02-27T06:05:53.254Z","avatar_url":"https://github.com/CodeDefenders.png","language":"Java","funding_links":[],"categories":["测试"],"sub_categories":[],"readme":"# Code Defenders\n\nThis is Code Defenders, a mutation testing game. Publicly available at [code-defenders.org](\u003chttp://code-defenders.org\u003e).\n\nFor information regarding running Code Defenders via docker see [the corresponding documentation](docker/README.md).\n\n## Vagrant\n\nThe repository contains a `Vagrantfile` for use with [Vagrant](https://www.vagrantup.com/) to quickly create a dev(!) environment.\n\nIf you have `vagrant` installed and configured, simply execute `vagrant up`. This will create a VM with all required software installed, but initially without the `codedefenders.war` file deployed.  \nBy default port forwarding for the tomcat server to port 8080, JVM remote debugging to port 8000 and for the database port to port 3306 are set up.\n\nThe database name, user and password are all `codedefenders`.  \nThe tomcat manager application (api and web) can be accessed with username and password `manager`.  \nAdmin access to codedefenders is possible with username and password `admin`.\n\nCodedefenders can be deployed to the VM e.g. via the [maven deployment steps](#automatic-deployment-via-maven) mentioned below and the `manager` credentials mentioned above. Everything required should already be setup.\n\n## Installation \u0026 Configuration\n\n### Software Requirements\n\n- Java (Version 1.8 or later)\n- Tomcat Server (Version 10)\n- Apache Maven\n- Apache Ant\n- MySQL (e.g. [MariaDB](https://mariadb.org/))\n\n### Setup\n\nThis guide assumes:\n - you are running Debian 12 as OS\n - you installed all the required software\n\n#### Modify the configuration\n\nCopy the `example.codedefenders.properties` file to `/var/lib/tomcat10/conf/codedefenders.properties` and set the values to match your environment.  \nThe only required value is `data.dir`, all other properties have sensible default values.\n\n#### Adapt the systemd service\n\nOn Debian 10 tomcat10 by default has only very limited write permissions.  \nTo allow the `data.dir` to be located outside of the `/var/lib/tomcat10/webapps/` folder hierarchy you have to `systemctl edit tomcat10` and add the following code:  \n```ini\n[Service]\nReadWritePaths=\"\u003cdata.dir path\u003e\"\n```\n\n#### Setup the database\n\nThe MySQL or MariaDB database and the user to access the database have to be created before the first run.\n\n#### Create the data.dir and run the installation script\n\nCreate the `data.dir` folder with the appropriate owner/group and permissions.  \nCodeDefenders (resp. the tomcat user) requires write permissions to the folder to create missing directories/files and to save the source code files.\n\nTo install Code Defenders automatically, execute the `setup.sh` script under the `installation` folder with the appropriate user and pass the `codedefenders.properties` file as input.\n\n```bash\ncd installation\n./setup.sh /var/lib/tomcat10/conf/codedefenders.properties\n```\n\nThe script performs a basic availability check of required software. The data directory folder structures created. All the required dependencies and files are automatically downloaded.\n\nIf any installation step fails, the installation process aborts and prints an error message.\n\n**Note:** Depending on the chosen data directory and Tomcat installation in place, root access may be necessary to create required folders. Similarly, additional configurations might be needed. For example, if Tomcat runs under a different user, data directory accesses and ownership might be need to be adjusted.\n\n**Note:** Code Defenders also requires that its MySQL user owns specific privileges to create databases and tables. Additionally, it requires INDEX privileges, otherwise the installation fails with an error message similar to:\n\n```ERROR 1142 (42000) at line 183: INDEX command denied to user```\n\n\n#### Set up Code Defenders admin users\n\nCode Defenders currently relies on the Tomcat authentication system for providing a `username`-`role` mapping that can be used to assign admin privileges.\n\nAssigning admin privileges to a Code Defenders users can be done by setting up a mapping between the username (`\u003cCODEDEFENDERS_USERNAME\u003e`) and the configured `auth.admin.role` (`codedefenders-admin` by default) in the `tomcat-users.xml` file.  \nThis file is per default located in `${CATALINA_HOME}/conf`.\n\n```xml\n  \u003crole rolename=\"codedefenders-admin\"/\u003e\n  \u003cuser username=\"\u003cCODEDEFENDERS_USERNAME\u003e\" roles=\"codedefenders-admin\"/\u003e\n```\n\nCare should be taken, so the chosen `CODEDEFENDERS_USERNAME` can not be simply registered by anyone.\n\nAll system configuration and privileged features are accessible for admin users under the `/admin` page. Configurations are organized in three groups:\n\n* Game management: Create bulk games for an entire class, distribute students among the games, and assign roles to students.\n* User management: Check and update users settings, and forcefully reset passwords.\n* System settings: Customize technical aspects of Code Defenders and include several advanced settings.\n\n\n### Build and Deployment\n\nFor successful deployment, both Tomcat and MySQL services must be running.\n\nTests can be skipped via `-DskipTests`  \nIf you want to run the tests be sure the library `libncurses.so.5` is present on your system as the database tests depend on it.\n\nFor additional information on the system- and integration-tests see the [Testing document](docs/Testing.md).\n\n#### Manual\n\nTo deploy you simply need to copy the `codedefenders.war` file to the tomcat `webapps` directory, with the context path as name.  \nE.g to deploy codedefenders at the tomcat root path (`http://localhost:8080/`) you can simply `cp target/codedefenders.war /var/lib/tomcat10/webapps/ROOT.war`\n\nYou can either download the `codedefenders.war` file from the latest [release](https://github.com/CodeDefenders/CodeDefenders/releases/) or build it yourself with `mvn clean package -DskipTests`.\n\n#### Automatic Deployment via Maven\n\nAlternatively you can automatically deploy with maven. For this, Tomcat requires a user with `manager-script` role, which can be configured in `$CATALINA_BASE/conf/tomcat-users.xml` (`CATALINA_BASE` is the Tomcat installation directory).\n\nThe maven deployment is configured via a `config.properties` file. Simply copy the `example.config.properties` file over and adjust the values to your needs.\n\n```xml\n\u003crole rolename=\"manager-script\"/\u003e\n\u003cuser username=\"\u003cMY_USER\u003e\" password=\"\u003cMY_USER_PASSWORD\u003e\" roles=\"manager-script\"/\u003e\n```\n\n**Note:** This requires the tomcat manager application to be installed, which on Debian is provided by the `tomcat10-admin` package.\n\nCode Defenders is built and deployed with Maven using the following commands.\n\n```bash\nmvn clean deploy -DskipTests\n```\n\n### Supporters\n\nThis project is supported [IMPRESS](https://impress-project.eu/).\nCheck the [official website](https://code-defenders.org/about) for a detailed\nlist of supporters.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCodeDefenders%2FCodeDefenders","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCodeDefenders%2FCodeDefenders","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCodeDefenders%2FCodeDefenders/lists"}