/git-challenge

A challenge server that communicates with a gitea server using an admin account.

Primary LanguagePython

Overview

  • A server hosting a series of git challenges. Using a gitea instance and a fastapi backend, any number of users can go through the challenges in a dedicated git environment without polluting a production git server.
  • TODO add Instructions Screenshot
  • Once a challenge is complete, there is a verification tool that will tell the user whether they succeeded and what they did wrong if they did not succeed.
  • TODO add Verification Screenshot

Check out the demo

Getting Started

Running the docker containers

sudo apt install -y python3 nginx sed
  • Create a .env file, leave the GITEA_TOKEN as XXXX..etc for now
cp example.env .env
<some editor> .env
  • Start the docker containers
make docker
  • Add an api user, this will write a token into your .env file
make create_api_user

Hosting Option One: Test the server locally, http://git.challenge.local/ will be added to /etc/hosts so that you can reach it from a web browser.

  • Configure nginx
# To test the server locally
sudo make nginx

Hosting Option Two: To run the server in production, specify a real domain your server is reachable at.

  • Configure nginx
# Use sudo make nginx DOMAIN=<your_domain>
sudo make nginx DOMAIN=git.example.com
# Optionally: use certbot to switch your site from HTTP to HTTPS
sudo apt install python3-certbot-nginx
sudo certbot --nginx
  • Open your domain in a web browser to make sure it worked

Uninstalling

  • Remove the containers
docker-compose down
  • Delete the nginx site configurations
# Delete the site configurations
# If you ran "sudo make nginx", the domain is git.challenge.local
sudo rm /etc/nginx/sites-enabled/<your.domain>
sudo rm /etc/nginx/sites-available/<your.domain>
# Restart nginx
sudo service nginx restart
  • Delete the persistent git data
sudo rm -rf /var/gitea/